/*
 * Sarvella Academy — shared design tokens and student-area components.
 *
 * Why this file exists: every student page was styled in its own inline
 * <style> block, written in a different sprint with different numbers. The
 * dashboard alone used six border radii and three shadows; the payment page
 * used a fourth shadow and a 13px radius; the payment history page had no
 * styling at all and fell back to raw Bootstrap. Side by side they did not
 * look like one product.
 *
 * Values follow docs/DESIGN_SYSTEM.md. Pages should use these tokens and the
 * shared component classes rather than inventing their own.
 */

:root {
    /* Brand */
    --sv-primary: #0A5BFF;
    --sv-primary-dark: #0847CC;
    --sv-secondary: #1E88FF;
    --sv-navy: #081B4B;
    --sv-gradient: linear-gradient(90deg, #0A5BFF, #1E88FF);

    /* Semantic — kept distinct from the brand accent */
    --sv-success: #17A567;
    --sv-success-soft: #E7F7EF;
    --sv-warning: #B4790A;
    --sv-warning-soft: #FCF1DD;
    --sv-danger: #D64545;
    --sv-danger-soft: #FDECEC;
    --sv-info: #1E88FF;
    --sv-info-soft: #E9F3FF;

    /* Neutrals — slightly blue-biased so they sit with the brand rather than
       reading as an unconsidered grey */
    --sv-bg: #F7F9FC;
    --sv-surface: #FFFFFF;
    --sv-surface-2: #EEF2FA;
    --sv-line: #E1E7F2;
    --sv-ink: #081B4B;
    --sv-ink-soft: #55617A;
    --sv-ink-faint: #8892A6;

    /* Radii — DESIGN_SYSTEM.md: small 8, medium 16, large 24; cards 20 */
    --sv-r-sm: 8px;
    --sv-r-md: 16px;
    --sv-r-lg: 24px;
    --sv-r-card: 20px;
    --sv-r-pill: 999px;

    /* One shadow scale, not one per page */
    --sv-shadow-sm: 0 1px 2px rgba(8, 27, 75, .04), 0 4px 12px -6px rgba(8, 27, 75, .10);
    --sv-shadow: 0 1px 2px rgba(8, 27, 75, .04), 0 12px 32px -12px rgba(8, 27, 75, .12);
    --sv-shadow-lg: 0 2px 4px rgba(8, 27, 75, .04), 0 24px 48px -20px rgba(8, 27, 75, .18);

    /* Spacing */
    --sv-gap-xs: 6px;
    --sv-gap-sm: 10px;
    --sv-gap: 16px;
    --sv-gap-lg: 24px;

    --sv-font: "Cairo", "Tajawal", sans-serif;
}

/* ---------------------------------------------------------------- surfaces */

.sv-card {
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-card);
    box-shadow: var(--sv-shadow);
    padding: var(--sv-gap-lg);
}

.sv-card + .sv-card { margin-top: var(--sv-gap); }

.sv-card-title {
    color: var(--sv-ink);
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 var(--sv-gap);
}

.sv-panel {
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-card);
    box-shadow: var(--sv-shadow);
    padding: var(--sv-gap-lg);
    margin-bottom: var(--sv-gap);
}

/* --------------------------------------------------------------- page head */

.sv-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sv-gap);
    flex-wrap: wrap;
    margin-bottom: var(--sv-gap-lg);
}

.sv-page-head h1,
.sv-page-head h2 {
    color: var(--sv-ink);
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
    text-wrap: balance;
}

.sv-page-head p {
    color: var(--sv-ink-soft);
    font-size: 14px;
    margin: 0;
}

/* ------------------------------------------------------------------- stats */

.sv-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--sv-gap-sm);
    margin-bottom: var(--sv-gap);
}

.sv-stat {
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-md);
    box-shadow: var(--sv-shadow-sm);
    padding: var(--sv-gap);
    text-align: center;
}

.sv-stat .sv-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--sv-primary);
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.sv-stat .sv-stat-label {
    font-size: 12.5px;
    color: var(--sv-ink-soft);
    margin-top: 2px;
}

/* ------------------------------------------------------------------ badges */

.sv-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--sv-r-pill);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.sv-pill-success { background: var(--sv-success-soft); color: var(--sv-success); }
.sv-pill-warning { background: var(--sv-warning-soft); color: var(--sv-warning); }
.sv-pill-danger  { background: var(--sv-danger-soft);  color: var(--sv-danger); }
.sv-pill-info    { background: var(--sv-info-soft);    color: var(--sv-info); }
.sv-pill-muted   { background: var(--sv-surface-2);    color: var(--sv-ink-soft); }

/* ---------------------------------------------------------------- progress */

.sv-progress {
    display: flex;
    align-items: center;
    gap: var(--sv-gap-sm);
}

.sv-progress-track {
    flex: 1;
    height: 8px;
    background: var(--sv-surface-2);
    border-radius: var(--sv-r-pill);
    overflow: hidden;
}

.sv-progress-track span {
    display: block;
    height: 100%;
    border-radius: var(--sv-r-pill);
    background: var(--sv-gradient);
    transition: width .4s ease;
}

.sv-progress-value {
    font-weight: 800;
    color: var(--sv-primary);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

/* ----------------------------------------------------------------- buttons */

.sv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sv-gap-xs);
    border: 1px solid transparent;
    border-radius: var(--sv-r-md);
    padding: 10px 22px;
    font-family: var(--sv-font);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}

.sv-btn:focus-visible {
    outline: 2px solid var(--sv-primary);
    outline-offset: 2px;
}

.sv-btn-primary { background: var(--sv-gradient); color: #fff; }
.sv-btn-primary:hover { color: #fff; opacity: .92; }

.sv-btn-secondary {
    background: var(--sv-surface);
    border-color: var(--sv-line);
    color: var(--sv-ink-soft);
}
.sv-btn-secondary:hover { color: var(--sv-primary); border-color: var(--sv-primary); }

.sv-btn-block { width: 100%; }

/* ------------------------------------------------------------------- forms */

.sv-field { margin-bottom: var(--sv-gap); }

.sv-label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--sv-ink);
    margin-bottom: 6px;
}

.sv-input,
.sv-textarea,
.sv-select {
    width: 100%;
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-md);
    padding: 11px 14px;
    font-family: var(--sv-font);
    font-size: 14px;
    color: var(--sv-ink);
}

.sv-input:focus,
.sv-textarea:focus,
.sv-select:focus {
    outline: none;
    border-color: var(--sv-primary);
    box-shadow: 0 0 0 3px rgba(10, 91, 255, .12);
}

.sv-hint { font-size: 12px; color: var(--sv-ink-faint); margin-top: 4px; }
.sv-error { font-size: 12.5px; color: var(--sv-danger); margin-top: 4px; }

/* ------------------------------------------------------------------ tables */

.sv-table-wrap { overflow-x: auto; }

.sv-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
}

.sv-table th {
    text-align: start;
    color: var(--sv-ink-soft);
    font-size: 12.5px;
    font-weight: 700;
    padding: 0 8px 10px;
    border-bottom: 1px solid var(--sv-line);
    white-space: nowrap;
}

.sv-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--sv-surface-2);
    vertical-align: middle;
    color: var(--sv-ink);
}

.sv-table tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------- empty state */

.sv-empty {
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-card);
    box-shadow: var(--sv-shadow-sm);
    padding: 48px 24px;
    text-align: center;
}

.sv-empty h3 {
    color: var(--sv-ink);
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 6px;
}

.sv-empty p { color: var(--sv-ink-soft); margin: 0; font-size: 14px; }

/* ------------------------------------------------------------------ alerts */

.sv-alert {
    border-radius: var(--sv-r-md);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--sv-gap);
    border: 1px solid transparent;
}

.sv-alert-success { background: var(--sv-success-soft); color: var(--sv-success); border-color: rgba(23,165,103,.25); }
.sv-alert-warning { background: var(--sv-warning-soft); color: var(--sv-warning); border-color: rgba(180,121,10,.25); }
.sv-alert-danger  { background: var(--sv-danger-soft);  color: var(--sv-danger);  border-color: rgba(214,69,69,.25); }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 575.98px) {
    .sv-card,
    .sv-panel { padding: var(--sv-gap); }

    .sv-page-head h1,
    .sv-page-head h2 { font-size: 19px; }

    .sv-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
    .sv-stat .sv-stat-value { font-size: 20px; }

    /* Stacked actions read better than cramped side-by-side buttons */
    .sv-btn { padding: 10px 16px; }
    .sv-actions-stack-sm { display: flex; flex-direction: column; gap: var(--sv-gap-sm); }
    .sv-actions-stack-sm .sv-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .sv-progress-track span,
    .sv-btn { transition: none; }
}

/* ------------------------------------------------- student sidebar (shared)
 *
 * frontend/default/student/left_sidebar.blade.php is included by 20 pages but
 * these rules previously lived inside the <style> block of just two of them
 * (my_courses and vodafone_cash_payments/create). On the other 18 the sidebar
 * rendered with no card, no padding and no active state — which is the main
 * reason the student area did not look like one product.
 */

.sarvella-student-sidebar {
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-card);
    box-shadow: var(--sv-shadow);
    padding: 20px;
    position: sticky;
    top: 24px;
    align-self: start;
    margin-bottom: var(--sv-gap);
}

.sarvella-profile-mini {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--sv-line);
}

.sarvella-avatar-wrap { position: relative; flex: 0 0 56px; }

.sarvella-avatar-wrap img {
    width: 56px;
    height: 56px;
    border-radius: var(--sv-r-md);
    object-fit: cover;
}

.sarvella-avatar-action {
    position: absolute;
    inset-inline-end: -5px;
    bottom: -5px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--sv-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
}

.sarvella-profile-mini h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: var(--sv-ink);
}

.sarvella-profile-mini p {
    margin: 0;
    font-size: 12px;
    color: var(--sv-ink-soft);
    word-break: break-word;
}

.sarvella-student-nav {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.sarvella-student-nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--sv-r-md);
    color: var(--sv-ink-soft);
    font-weight: 700;
    transition: background .18s ease, color .18s ease;
}

.sarvella-student-nav a:hover,
.sarvella-student-nav a.active {
    background: rgba(10, 91, 255, .09);
    color: var(--sv-primary);
}

.sarvella-student-nav a:focus-visible {
    outline: 2px solid var(--sv-primary);
    outline-offset: 2px;
}

/* Below the two-column breakpoint the sidebar becomes a scrollable row of
   chips rather than a tall stack that pushes the content off-screen. */
@media (max-width: 991.98px) {
    .sarvella-student-sidebar {
        position: static;
        margin-bottom: var(--sv-gap);
    }

    .sarvella-student-nav {
        display: flex;
        overflow-x: auto;
        gap: var(--sv-gap-xs);
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .sarvella-student-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sarvella-student-nav a { transition: none; }
}

/* =============================================================================
 * APPROVED MOCKUP COMPONENTS
 *
 * Source: `ui screens/*/code.html` + screenshots.
 *
 * The mockups are authored with Tailwind. These pages cannot use it: they render
 * on layouts/default, which is the Bootstrap theme, and Tailwind's preflight
 * would flatten it. (Tailwind stays scoped to layouts/sarvella — the homepage —
 * where no Bootstrap is loaded.) So the mockups' form is reproduced here as
 * plain CSS on the existing tokens, which already carry the same brand values
 * the mockups use: #0A5BFF primary, #081B4B navy, #F7F9FC canvas.
 * ========================================================================== */

/* ------------------------------------------------------- numbered step flow */

/* The checkout mockup walks the student through three numbered sections rather
   than presenting one undifferentiated form. */

.sv-steps {
    display: grid;
    gap: 40px;
}

.sv-step-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.sv-step-num {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sv-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.sv-step-title {
    margin: 0;
    color: var(--sv-ink);
    font-size: 19px;
    font-weight: 800;
}

/* ------------------------------------------------------------- copy-a-value */

/* The wallet number is the one value the student must transcribe exactly, so
   the mockup gives it its own panel, tracks the digits out, and offers a copy
   button rather than relying on selection. */

.sv-copy-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 22px;
    border-radius: var(--sv-r-lg);
    border: 1px solid var(--sv-line);
    background: var(--sv-surface-2);
}

.sv-copy-label {
    display: block;
    margin-bottom: 6px;
    color: var(--sv-ink-faint);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
}

/* Latin digits inside an RTL page: force LTR so the number never reorders. */
.sv-copy-value {
    display: block;
    direction: ltr;
    text-align: start;
    color: var(--sv-primary);
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 800;
    letter-spacing: .12em;
    font-variant-numeric: tabular-nums;
}

.sv-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--sv-r-md);
    border: 1px solid var(--sv-line);
    background: var(--sv-surface);
    color: var(--sv-primary);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .12s ease;
}

.sv-copy-btn:hover {
    border-color: var(--sv-primary);
    background: #F2F6FF;
}

.sv-copy-btn:active { transform: scale(.97); }

.sv-copy-btn.is-copied {
    border-color: var(--sv-success);
    color: var(--sv-success);
    background: var(--sv-success-soft);
}

/* -------------------------------------------------------------- inline note */

.sv-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--sv-r-md);
    border: 1px solid rgba(30, 136, 255, .18);
    background: var(--sv-info-soft);
    color: var(--sv-ink);
    font-size: 14px;
    line-height: 1.8;
}

.sv-note > i {
    flex: 0 0 auto;
    color: var(--sv-info);
    font-size: 18px;
    line-height: 1.5;
}

.sv-note p { margin: 0; }

/* ------------------------------------------------------------ trust badges */

.sv-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.sv-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--sv-r-pill);
    border: 1px solid var(--sv-line);
    background: var(--sv-surface);
    color: var(--sv-ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.sv-trust i { color: var(--sv-primary); }

/* --------------------------------------------------------- catalogue header */

/* The mockup opens the catalogue with a display-size title and a lede instead
   of the theme's bare breadcrumb row. */

.sv-catalog-head {
    margin-bottom: 26px;
}

.sv-catalog-head h1 {
    margin: 0 0 8px;
    color: var(--sv-ink);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    line-height: 1.35;
    text-wrap: balance;
}

.sv-catalog-head p {
    margin: 0;
    max-width: 640px;
    color: var(--sv-ink-soft);
    font-size: 15px;
    line-height: 1.9;
}

/* ------------------------------------------------------------- course cards */

/* Restyles the theme's existing .Ecard markup rather than replacing it, so the
   wishlist toggle, price badge and layout switcher all keep working. */

.eNtery-item .Ecard {
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-card);
    box-shadow: var(--sv-shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.eNtery-item .Ecard:hover {
    transform: translateY(-4px);
    border-color: rgba(10, 91, 255, .28);
    box-shadow: var(--sv-shadow-lg);
}

.eNtery-item .Ecard .courses-img img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.eNtery-item .Ecard .entry-title h3 {
    color: var(--sv-ink);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.6;
}

/* Metric strip — the mockup pairs each figure with a small label under it. */
.sv-course-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--sv-line);
}

.sv-course-stat {
    text-align: center;
}

.sv-course-stat strong {
    display: block;
    color: var(--sv-ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.sv-course-stat span {
    display: block;
    color: var(--sv-ink-faint);
    font-size: 11.5px;
    font-weight: 700;
}

/* The middle column carries hairlines on both inline edges, which mirrors
   correctly without needing a [dir] override. */
.sv-course-stat + .sv-course-stat {
    border-inline-start: 1px solid var(--sv-line);
}

/* CTA foot */
.eNtery-item .Ecard .learn-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 13px 16px;
    border-top: 1px solid var(--sv-line);
    background: var(--sv-surface-2);
    color: var(--sv-primary);
    font-size: 14px;
    font-weight: 800;
    transition: background .2s ease, color .2s ease;
}

.eNtery-item .Ecard:hover .learn-more {
    background: var(--sv-primary);
    color: #fff;
}

/* Arrows point along the reading direction. */
[dir="rtl"] .eNtery-item .Ecard .learn-more i {
    transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
    .eNtery-item .Ecard,
    .eNtery-item .Ecard .learn-more { transition: none; }
    .eNtery-item .Ecard:hover { transform: none; }
}

/* ------------------------------------------------------ course detail hero */

/* The mockup fronts the course with four labelled figures — duration, lessons,
   quizzes, rating — rather than burying them in the body copy. */

.sv-course-hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 22px 0 6px;
}

.sv-course-hero-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--sv-r-md);
    border: 1px solid var(--sv-line);
    background: var(--sv-surface);
}

.sv-course-hero-stat > i {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: var(--sv-r-sm);
    background: rgba(10, 91, 255, .10);
    color: var(--sv-primary);
    font-size: 16px;
    line-height: 1 !important;   /* theme sets line-height on <i> with !important */
}

.sv-course-hero-stat span {
    display: block;
    color: var(--sv-ink-faint);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.5;
}

.sv-course-hero-stat strong {
    display: block;
    color: var(--sv-ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ progress map */

/* The student-dashboard mockup shows the journey as a row of milestone nodes
   joined by a rail, each either complete, current, or locked. Here the states
   are derived from real lesson-completion progress rather than a hand-authored
   curriculum, so the map cannot drift out of sync with the data. */

.sv-map {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

/* The rail sits behind the nodes and stops half a cell short at each end so it
   never protrudes past the first and last node. */
.sv-map::before {
    content: "";
    position: absolute;
    inset-inline: 12.5%;
    top: 26px;
    height: 3px;
    border-radius: var(--sv-r-pill);
    background: var(--sv-line);
    z-index: 0;
}

.sv-map-node {
    position: relative;
    z-index: 1;
    text-align: center;
}

.sv-map-dot {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border-radius: 50%;
    border: 3px solid var(--sv-line);
    background: var(--sv-surface);
    color: var(--sv-ink-faint);
    font-size: 18px;
}

.sv-map-dot > i { line-height: 1 !important; }

.sv-map-label {
    display: block;
    color: var(--sv-ink);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.5;
}

.sv-map-state {
    display: block;
    color: var(--sv-ink-faint);
    font-size: 11.5px;
    font-weight: 700;
}

.sv-map-node.is-done .sv-map-dot {
    border-color: var(--sv-success);
    background: var(--sv-success-soft);
    color: var(--sv-success);
}

.sv-map-node.is-current .sv-map-dot {
    border-color: var(--sv-primary);
    background: var(--sv-primary);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(10, 91, 255, .14);
}

.sv-map-node.is-current .sv-map-state { color: var(--sv-primary); }

.sv-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--sv-line);
}

.sv-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--sv-ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.sv-map-legend b {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sv-line);
}

.sv-map-legend .is-done b { background: var(--sv-success); }
.sv-map-legend .is-current b { background: var(--sv-primary); }

@media (max-width: 575px) {
    .sv-map { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
    .sv-map::before { display: none; }   /* a rail across a wrapped grid reads as noise */
}

/* ------------------------------------------ student sidebar column reset */

/* `left_sidebar.blade.php` wraps itself in a Bootstrap `.col-lg-3`. That is
 * correct for the pages that include it inside a real `.row`, but our dashboard
 * and payment shells are CSS grids, not flex rows — and Bootstrap's
 * `.col-lg-3 { flex: 0 0 auto; width: 25% }` then resolves against the 280px
 * grid track instead of a 12-column row. 25% of 280px is 70px, which is what
 * crushed every nav label onto two lines and broke the email mid-word.
 *
 * Neutralising the column here rather than editing the partial keeps the ~10
 * other pages that DO include it inside a `.row` working unchanged. */
.sarvella-dashboard-shell > [class*="col-"],
.sarvella-payment-shell > [class*="col-"] {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
}

/* Long words with no break opportunity — an email address, mostly — must wrap
   at an arbitrary point rather than overflow the panel. */
.sarvella-student-sidebar {
    min-width: 0;
}

.sarvella-profile-mini h3,
.sarvella-profile-mini p,
.sarvella-profile-mini span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Nav labels stay on one line at the sidebar's real width. No `overflow:hidden`
   here — the anchor is a flex container, so text-overflow would not apply
   anyway, and clipping would cut the focus ring. */
.sarvella-student-nav a {
    white-space: nowrap;
}

/* Progress-map card. Kept off .sarvella-widget on purpose — see the note in
   my_courses/index.blade.php. */
.sv-map-card {
    background: var(--sv-surface);
    border: 1px solid var(--sv-line);
    border-radius: var(--sv-r-card);
    box-shadow: var(--sv-shadow);
    padding: var(--sv-gap-lg);
    margin-bottom: var(--sv-gap);
}

.sv-map-card-title {
    margin: 0;
    color: var(--sv-ink);
    font-size: 17px;
    font-weight: 800;
}

.sv-map-card-sub {
    margin: 4px 0 0;
    color: var(--sv-ink-soft);
    font-size: 14px;
}

/* Defensive: if this card is ever nested somewhere that styles bare spans as
   icon badges, the map's own spans must still win. */
.sv-map .sv-map-dot,
.sv-map .sv-map-label,
.sv-map .sv-map-state,
.sv-map-legend span {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
}

.sv-map .sv-map-dot {
    display: grid;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--sv-surface);
}

.sv-map-node.is-done .sv-map-dot { background: var(--sv-success-soft); }
.sv-map-node.is-current .sv-map-dot { background: var(--sv-primary); }

.sv-map-legend span {
    display: inline-flex;
}

.sv-map-legend b {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
