/* ── Theme tokens (#581 white-label; #590 token overhaul) ─────────────────────
   ONE semantic token set drives every surface, line, text and accent colour.
   --brand* derive from the TENANT's primary colour (ThemeState.BrandStyleCss
   renders :root + .theme-dark overrides after this sheet); light/dark flips via
   .theme-dark on the app shell wrapper. RULES: chrome + kit + component classes
   use tokens ONLY — no raw surface/text/line hex anywhere below (the splash is
   the one exception: it paints before the tenant brand loads). Pages may keep
   Tailwind slate/semantic utilities — the bridge at the end of this block
   re-skins the ones in real use (see the census in #590). */
:root {
  --brand: #4f46e5;              /* tenant primary (overridden per tenant) */
  --brand-strong: #4338ca;       /* hover/pressed */
  --brand-soft: #eef2ff;         /* tinted fills (active nav, chips)       */
  --brand-line: #c7d2fe;         /* tinted borders (grid toolbars)         */
  --brand-text: #4f46e5;         /* brand-coloured TEXT (links, accents)   */
  --brand-ring: rgba(79, 70, 229, .14);
  --on-brand: #ffffff;           /* text on brand-filled surfaces          */
  --surface: #ffffff;            /* cards, popovers, table rows            */
  --surface-muted: #f8fafc;      /* inset panels, inputs, user card        */
  --surface-page: #f1f5f9;       /* the page behind everything             */
  --line: #e2e8f0;               /* standard border                        */
  --line-soft: #f1f5f9;          /* hairlines + hover fills                */
  --text: #1e293b;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --ok: #059669;      --ok-soft: #ecfdf5;
  --ok-strong: #047857;            /* badge text on --ok-soft: --ok is only ~3.6:1 there (axe #330b) */
  --warn: #b45309;    --warn-soft: #fffbeb;
  --danger: #dc2626;  --danger-soft: #fef2f2;
  --info: #1d4ed8;    --info-soft: #eff6ff;
  --accent: #7c3aed;  --accent-soft: #ede9fe;
}
.theme-dark {
  --brand-soft: #2a3355;         /* neutral dark tint (re-derived per tenant brand) */
  --brand-line: #3b4a7a;
  --brand-text: #a5b4fc;         /* lightened for dark surfaces (re-derived per tenant) */
  --brand-ring: rgba(129, 140, 248, .25);
  --surface: #1e293b;
  --surface-muted: #16202f;
  --surface-page: #0f172a;
  --line: #334155;
  --line-soft: #273449;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --ok: #34d399;      --ok-soft: rgba(52, 211, 153, .12);
  --ok-strong: #34d399;            /* light-on-dark already clears 4.5:1 */
  --warn: #fbbf24;    --warn-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;  --danger-soft: rgba(248, 113, 113, .12);
  --info: #93c5fd;    --info-soft: rgba(96, 165, 250, .14);
  --accent: #c4b5fd;  --accent-soft: rgba(167, 139, 250, .14);
}

/* ── Dark-theme bridge ────────────────────────────────────────────────────────
   Pages keep their Tailwind colour utilities; in dark the shell class re-skins
   every utility the pages actually use (grep census, #590) onto the tokens.
   Semantic (red/emerald/amber/indigo) text lightens so it stays readable. */
.theme-dark { background: var(--surface-page); color: var(--text); color-scheme: dark; }
.theme-dark .bg-white { background-color: var(--surface) !important; }
.theme-dark .bg-slate-50, .theme-dark .bg-slate-100 { background-color: var(--surface-muted) !important; }
.theme-dark .bg-slate-200 { background-color: var(--line) !important; }
.theme-dark .hover\:bg-slate-50:hover, .theme-dark .hover\:bg-slate-100:hover,
.theme-dark .hover\:bg-white:hover { background-color: var(--line-soft) !important; }
.theme-dark .text-slate-800, .theme-dark .text-slate-900, .theme-dark .text-slate-700 { color: var(--text) !important; }
.theme-dark .text-slate-600, .theme-dark .text-slate-500 { color: var(--text-muted) !important; }
.theme-dark .text-slate-400, .theme-dark .text-slate-300, .theme-dark .text-slate-200 { color: var(--text-faint) !important; }
.theme-dark .hover\:text-slate-700:hover, .theme-dark .hover\:text-slate-600:hover { color: var(--text) !important; }
.theme-dark .border-slate-100, .theme-dark .border-slate-200, .theme-dark .border-slate-300 { border-color: var(--line) !important; }
.theme-dark .hover\:border-slate-300:hover { border-color: var(--text-faint) !important; }
.theme-dark .divide-slate-100 > * + *, .theme-dark .divide-slate-200 > * + * { border-color: var(--line) !important; }
.theme-dark .shadow-sm, .theme-dark .shadow-lg { box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
/* Brand-coloured text/fills follow the tenant colour in BOTH themes. */
.text-indigo-600, .text-indigo-700, .hover\:text-indigo-600:hover, .hover\:text-indigo-700:hover { color: var(--brand-text) !important; }
.bg-indigo-50 { background-color: var(--brand-soft) !important; }
.bg-indigo-500, .bg-indigo-600, .hover\:bg-indigo-600:hover { background-color: var(--brand) !important; }
.hover\:bg-indigo-50:hover { background-color: var(--brand-soft) !important; }
.hover\:border-indigo-300:hover, .border-indigo-300 { border-color: var(--brand-line) !important; }
/* Semantic text stays readable on dark; soft chips flip to deep tints. */
.theme-dark .text-red-600, .theme-dark .text-red-700, .theme-dark .hover\:text-red-500:hover { color: var(--danger) !important; }
.theme-dark .text-emerald-600, .theme-dark .text-emerald-700 { color: var(--ok) !important; }
.theme-dark .text-amber-600, .theme-dark .text-amber-700, .theme-dark .hover\:text-amber-700:hover { color: var(--warn) !important; }
.theme-dark .bg-red-50, .theme-dark .hover\:bg-red-50:hover { background-color: var(--danger-soft) !important; }
.theme-dark .border-red-100, .theme-dark .border-red-200 { border-color: rgba(248, 113, 113, .35) !important; }
.theme-dark .bg-emerald-50 { background-color: var(--ok-soft) !important; }
.theme-dark .bg-amber-50 { background-color: var(--warn-soft) !important; }
.theme-dark .bg-indigo-50\/40 { background-color: var(--brand-soft) !important; }
/* Skeletons + zebra stripes need their own dark ramp (gradients can't token-swap). */
.theme-dark .dg-skel { background: linear-gradient(90deg, #273449 25%, #2f3d55 50%, #273449 75%); background-size: 200% 100%; }
.theme-dark .kpi-skel-line { background: linear-gradient(90deg, #273449 25%, #2f3d55 50%, #273449 75%); background-size: 200% 100%; }
.theme-dark #grid-card .tr.dg-stripe:not(.selected):not(:hover) .td { background: var(--surface-muted); }
.theme-dark aside { scrollbar-color: rgba(255, 255, 255, .12) transparent; }
/* Tailwind preflight defaults border-color to gray-200 on EVERY element — flip it with the theme so a bare
   `border-b` never paints a bright hairline on dark. Specific border-colour utilities still override. */
.theme-dark *, .theme-dark ::before, .theme-dark ::after { border-color: var(--line); }
/* Native controls follow the brand in both themes. */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--brand); }



/* ═══════════════════════════════════════════════════════════════════
   Tera Hub — Custom component styles
   Layout classes supplement Tailwind utility classes.
   Data Grid styles live in the second half of this file.
═══════════════════════════════════════════════════════════════════ */

/* ============================================================
   Loading splash — full-screen overlay shown during the auth
   check and workspace load (LoadingSplash.razor). Restored here
   after the BFF/render-mode conversion (ADR-0024) replaced
   index.html, where these styles used to live. Fixes bug #46.
   ============================================================ */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(120% 120% at 50% 0%, #6366f1 0%, #4f46e5 45%, #4338ca 100%);
    color: #fff;
    /* NO entrance fade here: .splash mounts up to 3× (boot copy → <Authorizing> → workspace load),
       and replaying splash-in on each mount caused the ~1s blink (#47). The fade lives on the
       #app-splash boot wrapper only; every live instance renders already-opaque, so the handoff is
       a straight swap with nothing to flash. */
}
.splash__panel { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 340px; }
.splash__logo {
    width: 64px; height: 64px; margin-bottom: 20px;
    filter: drop-shadow(0 8px 20px rgba(15, 23, 42, .35));
    animation: splash-float 2.8s ease-in-out infinite;
}
.splash__logo svg { width: 100%; height: 100%; display: block; }
.splash__wordmark { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.splash__wordmark b { font-weight: 800; }
.splash__product { font-weight: 600; opacity: .8; margin-left: 4px; }
.splash__tagline { margin-top: 8px; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .8); }
.splash__bar {
    position: relative; width: 180px; height: 4px; margin-top: 28px;
    border-radius: 9999px; background: rgba(255, 255, 255, .22); overflow: hidden;
}
.splash__bar::after {
    content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
    border-radius: 9999px; background: #fff; animation: splash-slide 1.15s ease-in-out infinite;
}
.splash__hint { margin-top: 14px; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
@keyframes splash-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
@keyframes splash-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }
/* Boot-splash wrapper (App.razor): fade IN on first paint (the only entrance fade in play — see
   .splash above) and fade OUT when LoadingSplash removes it (app.js). The live .splash renders opaque
   underneath, so the wrapper fading out reveals an identical screen — a seamless handoff, no dip. */
#app-splash { animation: splash-in .25s ease-out; transition: opacity .25s ease; }
#app-splash.is-hiding { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    .splash__logo, .splash__bar::after { animation: none; }
    #app-splash { animation: none; transition: none; }
}

/* ── Sidebar navigation — exact values from mocks/app.css ───────── */

/* Hide native disclosure triangle on all summary elements */
details > summary { list-style: none; cursor: pointer; user-select: none; }
details > summary::-webkit-details-marker,
details > summary::marker { display: none; }

/* Submenu entrance animation */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar scrollbar */
aside { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.08) transparent; }
aside::-webkit-scrollbar { width: 3px; }
aside::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }
@keyframes dg-expand { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── Loading skeleton ────────────────────────────────────────────── */
@keyframes dg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty state ─────────────────────────────────────────────────── */
.dg-empty { padding: 64px 20px; text-align: center; }
.dg-empty svg { width: 40px; height: 40px; color: var(--text-faint); margin-bottom: 12px; }
.dg-empty h4 { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.dg-empty p  { font-size: 13px; color: var(--text-muted); }

/* ── Filter panel ────────────────────────────────────────────────── */
.col-filter-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 200; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 8px rgba(15,23,42,.06), 0 12px 28px rgba(15,23,42,.1); min-width: 236px; display: none; animation: dg-pop .12s ease; overflow: hidden; font-family: inherit; font-size: 13px; color: var(--text); text-transform: none; letter-spacing: normal; font-weight: 400; white-space: normal; }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes dg-pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Responsive ──────────────────────────────────────────────────── */

/* ── Mobile card layout ──────────────────────────────────────────── */

/* ── Students DataGrid — grid-specific styles ── */
.th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; background: var(--surface-muted); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; user-select: none; }
/* overflow:hidden clips content to the fixed colgroup widths (virtualized table) */
.td { padding: 12px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--text); background: var(--surface); }
.tr:hover .td { background: var(--brand-soft); }
.tr.selected .td { background: #f5f3ff; }
.tr.selected:hover .td { background: var(--accent-soft); }
/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
/* Fullscreen */
#grid-card:fullscreen { border-radius: 0 !important; }
#grid-card:-webkit-full-screen { border-radius: 0 !important; }
/* Ghost scrollbar */
.grid-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 0.3s; }
.grid-scroll:hover { scrollbar-color: rgba(0,0,0,0.12) transparent; }
.grid-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.grid-scroll::-webkit-scrollbar-track { background: transparent; }
.grid-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 9999px; }
.grid-scroll:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
.grid-scroll::-webkit-scrollbar-corner { background: transparent; }
/* Toggle switch */
.tog { position: relative; display: inline-flex; flex-shrink: 0; }
.tog input { position: absolute; opacity: 0; width: 0; height: 0; }
.date-inp { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: #374151; outline: none; font-family: inherit; box-sizing: border-box; }
.date-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
/* Spinning animation */
@keyframes spin { to { transform: rotate(360deg); } }
/* Bulk bar */
#bulk-bar { display: none; }
#bulk-bar.visible { display: flex; }

/* ═══════════════════════════════════════════════════════════════════
   ENROLMENT WIZARD  (/students/enroll)
   Multi-step form. Layout via Tailwind utilities in markup; the bespoke
   widgets (stepper, pill pickers, swatches, live preview, success) live
   here. Tokens match the Tera Hub palette: indigo #6366f1 · slate scale.
═══════════════════════════════════════════════════════════════════ */

/* ── Stepper ─────────────────────────────────────────────────────── */
.enr-stepper { display: flex; align-items: flex-start; gap: 0; }
.enr-step { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 0 0 auto; position: relative; background: none; border: none; padding: 0; font-family: inherit; cursor: default; min-width: 0; }
.enr-step.is-nav { cursor: pointer; }
.enr-step-dot {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0; position: relative; z-index: 1;
    background: var(--surface); color: var(--text-muted); border: 2px solid var(--line);
    transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .15s;
}
.enr-step.is-nav:hover .enr-step-dot { border-color: var(--brand-line); color: var(--brand); }
.enr-step.is-active .enr-step-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.enr-step.is-done .enr-step-dot { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.enr-step.is-done.is-nav:hover .enr-step-dot { background: #e0e7ff; }
.enr-step-dot svg { width: 15px; height: 15px; }
.enr-step-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; transition: color .25s; text-align: center; }
.enr-step.is-active .enr-step-label { color: var(--brand); }
.enr-step.is-done .enr-step-label { color: var(--text-muted); }
.enr-step-line { flex: 1 1 auto; height: 2px; background: var(--line); margin-top: 16px; border-radius: 2px; position: relative; overflow: hidden; min-width: 12px; }
.enr-step-line::after { content: ""; position: absolute; inset: 0; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.enr-step-line.is-filled::after { transform: scaleX(1); }

/* compact stepper (mobile): hide labels + lines, show dots only */
@media (max-width: 640px) {
    .enr-step-label { display: none; }
    .enr-step-dot { width: 30px; height: 30px; font-size: 12px; }
}

/* ── Step panel transition ───────────────────────────────────────── */
.enr-panel { animation: enr-slide .28s cubic-bezier(.22,.61,.36,1); }
@keyframes enr-slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.enr-section-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.enr-section-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Fields ──────────────────────────────────────────────────────── */
.enr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.enr-label { font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.enr-req { color: var(--danger); font-weight: 700; }
.enr-optional { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.enr-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }

.enr-input, .enr-select, .enr-textarea {
    width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13.5px; color: var(--text);
    background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.enr-input::placeholder, .enr-textarea::placeholder { color: var(--text-muted); }
.enr-input:focus, .enr-select:focus, .enr-textarea:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.enr-input:hover:not(:focus), .enr-select:hover:not(:focus), .enr-textarea:hover:not(:focus) { border-color: var(--text-faint); }
.enr-textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.enr-select { appearance: none; cursor: pointer; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* input with a leading icon and/or trailing adornment */
.enr-input-wrap { position: relative; display: flex; align-items: center; }
.enr-input-wrap .enr-lead-icon { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.enr-input-wrap.has-lead .enr-input { padding-left: 36px; }
.enr-input-suffix { position: absolute; right: 10px; font-size: 12px; color: var(--text-muted); font-weight: 500; pointer-events: none; }

/* validation states */
.enr-field.has-error .enr-input,
.enr-field.has-error .enr-select,
.enr-field.has-error .enr-textarea { border-color: #fca5a5; background: var(--danger-soft); }
.enr-field.has-error .enr-input:focus,
.enr-field.has-error .enr-select:focus,
.enr-field.has-error .enr-textarea:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.14); }
.enr-error { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--danger); animation: enr-shake .3s; }
.enr-error::before { content: ""; display: inline-block; width: 12px; height: 12px; flex-shrink: 0; background: currentColor;
    -webkit-mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath stroke-linecap='round' d='M12 7.5v5M12 16h.01'/%3E%3C/svg%3E");
    mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath stroke-linecap='round' d='M12 7.5v5M12 16h.01'/%3E%3C/svg%3E"); }
@keyframes enr-shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-3px); } 40%,80% { transform: translateX(3px); } }
.enr-valid-tick { color: #10b981; width: 14px; height: 14px; }

/* suggestion chip (e.g. suggested email) */
.enr-suggest { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 500; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line); cursor: pointer; transition: background .12s, border-color .12s; font-family: inherit; }
.enr-suggest:hover { background: #e0e7ff; border-color: #a5b4fc; }
.enr-suggest svg { width: 12px; height: 12px; }

/* ── Pill selector (radio-as-pills) ──────────────────────────────── */
.enr-pillset { display: flex; flex-wrap: wrap; gap: 8px; }
.enr-pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
    font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text);
    background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s, transform .12s;
}
.enr-pill:hover { border-color: var(--brand-line); background: var(--surface-muted); color: var(--text); }
.enr-pill:active { transform: scale(.97); }
.enr-pill.is-selected { border-color: var(--brand); background: var(--brand-soft); color: #4338ca; font-weight: 600; box-shadow: 0 0 0 1px #6366f1; }
.enr-pill .enr-pill-check { width: 14px; height: 14px; color: var(--brand); }
.enr-pill .enr-pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* grade picker — fixed-width cells in a tidy grid */
.enr-grade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .enr-grade-grid { grid-template-columns: repeat(6, 1fr); } }
.enr-grade-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 11px 4px; border-radius: 11px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-family: inherit; transition: border-color .15s, background .15s, box-shadow .15s, transform .12s; }
.enr-grade-cell:hover { border-color: var(--brand-line); background: var(--surface-muted); }
.enr-grade-cell:active { transform: scale(.96); }
.enr-grade-cell.is-selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px #6366f1; }
.enr-grade-num { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.5px; line-height: 1; }
.enr-grade-cell.is-selected .enr-grade-num { color: #4338ca; }
.enr-grade-cap { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }

/* ── Avatar swatches ─────────────────────────────────────────────── */
.enr-swatch-row { display: flex; flex-wrap: wrap; gap: 9px; }
.enr-swatch { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: none; padding: 0; position: relative; transition: transform .14s, box-shadow .14s; }
.enr-swatch:hover { transform: scale(1.12); }
.enr-swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor; }
.enr-swatch.is-selected::after { content: ""; position: absolute; inset: 0; display: flex; background: center/14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 12.75l6 6 9-13.5'/%3E%3C/svg%3E"); }

/* ── Toggle switch ───────────────────────────────────────────────── */
.enr-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.enr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.enr-switch-track { width: 40px; height: 23px; border-radius: 999px; background: var(--line); padding: 2px; transition: background .2s; flex-shrink: 0; }
.enr-switch input:checked ~ .enr-switch-track { background: var(--brand); }
.enr-switch input:focus-visible ~ .enr-switch-track { box-shadow: 0 0 0 3px rgba(99,102,241,.25); }
.enr-switch-thumb { width: 19px; height: 19px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.4,0,.2,1); }
.enr-switch input:checked ~ .enr-switch-track .enr-switch-thumb { transform: translateX(17px); }
.enr-switch-label { font-size: 13px; color: var(--text); font-weight: 500; }

/* ── Live preview card ───────────────────────────────────────────── */
.enr-preview { position: sticky; top: 0; }
.enr-preview-banner { height: 64px; background: linear-gradient(135deg,#6366f1,#8b5cf6); position: relative; }
.enr-preview-av { position: relative; z-index: 1; width: 76px; height: 76px; border-radius: 18px; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(99,102,241,.28); margin: -38px auto 0; display: block; background: var(--brand-soft); transition: box-shadow .2s; }
.enr-preview-name { font-size: 16px; font-weight: 700; color: var(--text); text-align: center; margin-top: 10px; letter-spacing: -.2px; }
.enr-preview-id { font-size: 11.5px; color: var(--text-muted); text-align: center; margin-top: 2px; font-variant-numeric: tabular-nums; }
.enr-preview-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.enr-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--line-soft); color: var(--text); }
.enr-tag.indigo { background: var(--brand-soft); color: #4338ca; }
/* Intake-origin tone modifiers (#122): metro=indigo, regional=emerald, interstate=amber, overseas=sky. */
.enr-tag.emerald { background: var(--ok-soft); color: var(--ok); }
.enr-tag.amber { background: var(--warn-soft); color: var(--warn); }
.enr-preview-rows { margin-top: 16px; display: flex; flex-direction: column; }
.enr-prow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.enr-prow svg { width: 14px; height: 14px; color: var(--brand-line); flex-shrink: 0; }
.enr-prow-k { color: var(--text-muted); flex-shrink: 0; }
.enr-prow-v { color: var(--text); font-weight: 500; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* completion ring */
.enr-ring-wrap { display: flex; align-items: center; gap: 11px; }
.enr-ring { --pct: 0; width: 44px; height: 44px; flex-shrink: 0; position: relative; }
.enr-ring svg { transform: rotate(-90deg); }
.enr-ring-track { stroke: #eef2ff; }
.enr-ring-fill { stroke: #6366f1; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
.enr-ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--brand); }

/* ── Status badges (preview + review, reuse grid palette) ────────── */
.enr-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.enr-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.enr-badge.active { background: var(--ok-soft); color: var(--ok); } .enr-badge.active .dot { background: #22c55e; }
.enr-badge.pending { background: var(--warn-soft); color: var(--warn); } .enr-badge.pending .dot { background: #f59e0b; }

/* ── Review step ─────────────────────────────────────────────────── */
.enr-review-group { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.enr-review-head { display: flex; align-items: center; gap: 9px; padding: 11px 16px; background: var(--surface-muted); border-bottom: 1px solid var(--line); }
.enr-review-head h4 { font-size: 13px; font-weight: 700; color: var(--text); }
.enr-review-edit { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--brand); background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 7px; font-family: inherit; transition: background .12s; }
.enr-review-edit:hover { background: var(--brand-soft); }
.enr-review-edit svg { width: 11px; height: 11px; }
.enr-review-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px 20px; padding: 15px 16px; }
@media (max-width: 520px) { .enr-review-body { grid-template-columns: 1fr; } }
.enr-rv-k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 3px; }
.enr-rv-v { font-size: 13.5px; color: var(--text); font-weight: 500; }
.enr-rv-full { grid-column: 1 / -1; }

/* consent box */
.enr-consent { display: flex; gap: 11px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-muted); cursor: pointer; transition: border-color .15s, background .15s; }
.enr-consent:hover { border-color: var(--brand-line); }
.enr-consent.has-error { border-color: #fca5a5; background: var(--danger-soft); }
.enr-consent input { width: 17px; height: 17px; accent-color: var(--brand); margin-top: 1px; flex-shrink: 0; cursor: pointer; }
.enr-consent-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }

/* ── Footer nav ──────────────────────────────────────────────────── */
.enr-nav { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.enr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 20px; border-radius: 11px; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .14s, border-color .14s, color .14s, box-shadow .14s, transform .1s; white-space: nowrap; }
.enr-btn:active { transform: translateY(1px); }
.enr-btn svg { width: 15px; height: 15px; }
.enr-btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.enr-btn-ghost:hover { border-color: var(--text-faint); background: var(--surface-muted); color: var(--text); }
.enr-btn-primary { background: var(--brand); border: 1px solid var(--brand); color: #fff; box-shadow: 0 2px 8px var(--brand-ring); }
.enr-btn-primary:hover { background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 14px var(--brand-ring); }
.enr-btn-success { background: #10b981; border: 1px solid #10b981; color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,.32); }
.enr-btn-success:hover { background: #059669; border-color: #059669; }
.enr-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.enr-btn-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .65s linear infinite; }

/* ── Draft-resume banner ─────────────────────────────────────────── */
.enr-draft { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid #fde68a; font-size: 12.5px; color: var(--warn); }
.enr-draft svg { width: 15px; height: 15px; color: #d97706; flex-shrink: 0; }
.enr-draft-btn { font-weight: 700; color: var(--warn); background: none; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; padding: 3px 8px; border-radius: 6px; transition: background .12s; }
.enr-draft-btn:hover { background: #fef3c7; }
.enr-draft-x { margin-left: auto; }

/* ── Success screen ──────────────────────────────────────────────── */
.enr-success { text-align: center; padding: 14px 0 8px; position: relative; overflow: hidden; }
.enr-check { width: 84px; height: 84px; margin: 0 auto 18px; }
.enr-check circle { stroke: #10b981; stroke-width: 3; fill: #f0fdf4; stroke-dasharray: 251; stroke-dashoffset: 251; animation: enr-draw-c .5s ease forwards; }
.enr-check path { stroke: #10b981; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: enr-draw-t .35s .45s ease forwards; }
@keyframes enr-draw-c { to { stroke-dashoffset: 0; } }
@keyframes enr-draw-t { to { stroke-dashoffset: 0; } }
.enr-success h2 { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.enr-success p { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }

/* pure-CSS confetti burst */
.enr-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.enr-confetti i { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; opacity: 0; animation: enr-fall 2.4s ease-in forwards; }
@keyframes enr-fall { 0% { opacity: 0; transform: translateY(-10px) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }
.enr-confetti i:nth-child(1)  { left: 8%;  background: var(--brand); animation-delay: 0s;    }
.enr-confetti i:nth-child(2)  { left: 18%; background: #f59e0b; animation-delay: .12s;  }
.enr-confetti i:nth-child(3)  { left: 28%; background: #10b981; animation-delay: .05s;  }
.enr-confetti i:nth-child(4)  { left: 38%; background: #ec4899; animation-delay: .22s;  }
.enr-confetti i:nth-child(5)  { left: 48%; background: #8b5cf6; animation-delay: .08s;  }
.enr-confetti i:nth-child(6)  { left: 58%; background: #06b6d4; animation-delay: .3s;   }
.enr-confetti i:nth-child(7)  { left: 68%; background: #f97316; animation-delay: .15s;  }
.enr-confetti i:nth-child(8)  { left: 78%; background: #22c55e; animation-delay: .26s;  }
.enr-confetti i:nth-child(9)  { left: 88%; background: #a855f7; animation-delay: .1s;   }
.enr-confetti i:nth-child(10) { left: 14%; background: #0ea5e9; animation-delay: .34s;  }
.enr-confetti i:nth-child(11) { left: 63%; background: #ef4444; animation-delay: .4s;   }
.enr-confetti i:nth-child(12) { left: 33%; background: #14b8a6; animation-delay: .18s;  }

/* ── "What happens next" list (success) ──────────────────────────── */
.enr-next { display: flex; flex-direction: column; }
.enr-next li { display: flex; gap: 11px; padding: 10px 0; align-items: flex-start; border-top: 1px solid var(--line-soft); }
.enr-next li:first-child { border-top: none; }
.enr-next-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.enr-next-ic svg { width: 15px; height: 15px; }
.enr-next-t { font-size: 12.5px; font-weight: 600; color: var(--text); }
.enr-next-d { font-size: 11px; color: var(--text-muted); margin-top: 1px; line-height: 1.4; word-break: break-word; }

/* ── University wizard extras (reuse the .enr-* palette; preview crest, course rows) ── */
/* Preview crest — the avatar analogue: a gradient tile lifted over the banner, like .enr-preview-av */
.enr-uni-crest {
    position: relative; z-index: 1; width: 64px; height: 64px; margin: -32px auto 0;
    border-radius: 16px; border: 3px solid #fff; background: linear-gradient(135deg,#6366f1,#8b5cf6);
    box-shadow: 0 6px 18px rgba(99,102,241,.28); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.5px;
}

/* Empty-courses placeholder inside the step */
.enr-uni-courses-empty { text-align: center; padding: 26px 16px; color: var(--text-muted); }
.enr-uni-courses-empty svg { width: 32px; height: 32px; color: var(--text-faint); margin: 0 auto 8px; }
.enr-uni-courses-empty p { font-size: 13px; }

/* A saved course row — level chip + name/meta + remove */
.enr-uni-course-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-muted); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.enr-uni-course-row:hover { border-color: var(--brand-line); background: #fafbff; }
.enr-uni-course-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enr-uni-course-meta { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enr-uni-course-lvl { flex-shrink: 0; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; }

/* Add-course sub-form panel */
.enr-uni-addcourse { background: #fafbff; border: 1px solid #eef2ff; border-radius: 14px; padding: 16px; }
.enr-uni-addcourse-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; }

/* ── Grade colour-coding (#135) ──────────────────────────────────────
   A compact grade chip used in the result-set list, the subject rows and the live preview. The tone tracks
   the outcome: HD/D green, C/P blue, F-family red, Other neutral (reuses the enr-tag tone palette). */
.res-grade { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: .02em; line-height: 1.4; background: var(--line-soft); color: var(--text-muted); }                          /* Other — neutral */

@media (prefers-reduced-motion: reduce) {
    .enr-panel, .enr-error, .enr-check circle, .enr-check path, .enr-confetti i { animation: none; }
    .enr-check circle, .enr-check path { stroke-dashoffset: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   REUSABLE UI KIT  (Shared/Ui/* — PageHeader, Card, AppButton, Badge,
   EmptyState, FormField, TextInput, SelectInput, ModalDialog)
   Tokens match the Tera Hub palette: indigo #6366f1 · slate scale ·
   success #10b981 · amber #f59e0b · red #ef4444. FormField/TextInput/
   SelectInput reuse the existing .enr-* form styles above.
═══════════════════════════════════════════════════════════════════ */

/* ── AppButton ───────────────────────────────────────────────────── */
.ui-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 16px; border-radius: 10px; font-family: inherit;
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
    border: 1px solid transparent;
    transition: background .14s, border-color .14s, color .14s, box-shadow .14s, transform .1s;
}
.ui-btn:active:not(:disabled) { transform: translateY(1px); }
.ui-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.ui-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.ui-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px var(--brand-ring); }
.ui-btn-primary:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 14px var(--brand-ring); }

.ui-btn-secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.ui-btn-secondary:hover:not(:disabled) { border-color: var(--text-faint); background: var(--surface-muted); color: var(--text); }

.ui-btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.ui-btn-ghost:hover:not(:disabled) { background: var(--line-soft); color: var(--text); }

.ui-btn-danger { background: #ef4444; border-color: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,.28); }
.ui-btn-danger:hover:not(:disabled) { background: #dc2626; border-color: var(--danger); }

/* inline spinner (uses the global @keyframes spin) — no JS */
.ui-btn-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
    animation: spin .65s linear infinite; flex-shrink: 0;
}
.ui-btn-secondary .ui-btn-spinner,
.ui-btn-ghost .ui-btn-spinner { border-color: var(--brand-ring); border-top-color: var(--brand); }

/* ── Badge (pill) ────────────────────────────────────────────────── */
.ui-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ui-badge-neutral { background: var(--line-soft); color: var(--text); }
.ui-badge-success { background: var(--ok-soft); color: var(--ok-strong); }
.ui-badge-warning { background: var(--warn-soft); color: var(--warn); }
.ui-badge-danger  { background: var(--danger-soft); color: var(--danger); }
.ui-badge-info    { background: var(--brand-soft); color: #4338ca; }

/* ── EmptyState ──────────────────────────────────────────────────── */
.ui-empty { padding: 56px 20px; text-align: center; }
.ui-empty-icon { display: inline-flex; }
.ui-empty-icon svg { width: 40px; height: 40px; color: var(--text-faint); margin-bottom: 12px; }
.ui-empty-title { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.ui-empty-msg { font-size: 13px; color: var(--text-muted); }
@keyframes kpi-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ── ModalDialog ─────────────────────────────────────────────────── */
.ui-modal-overlay {
    position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(15,23,42,.45); animation: ui-modal-fade .15s ease;
}
@keyframes ui-modal-fade { from { opacity: 0; } to { opacity: 1; } }
.ui-modal {
    width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: var(--surface); border-radius: 18px; border: 1px solid var(--line);
    box-shadow: 0 20px 60px rgba(15,23,42,.22), 0 4px 16px rgba(15,23,42,.08);
    overflow: hidden; animation: ui-modal-pop .16s ease;
}
@keyframes ui-modal-pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.ui-modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.ui-modal-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.ui-modal-close { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .12s, color .12s; }
.ui-modal-close:hover { background: var(--line-soft); color: var(--text); }
.ui-modal-close svg { width: 16px; height: 16px; }
.ui-modal-body { padding: 20px; overflow-y: auto; scrollbar-width: thin; }
.ui-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); background: #fafbff; flex-shrink: 0; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
    .ui-modal-overlay, .ui-modal, .ui-btn-spinner { animation: none; }
}

/* ── Portal home tiles + entry doors (ADR-0042) ── */
.prt-tile { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-muted); font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none; text-align: center; transition: border-color .12s, background .12s, color .12s; }
.prt-tile:hover { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }
.prt-door { display: block; padding: 14px; border-radius: 14px; border: 1px dashed #cbd5e1; background: var(--surface); text-decoration: none; transition: border-color .12s, background .12s; }
.prt-door:hover { border-color: #a5b4fc; background: #f5f7ff; }

/* Skeleton shimmer (shared kit — SkeletonRows) */
.dg-skel { height: 11px; border-radius: 5px; background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: dg-shimmer 1.6s infinite linear; }
@keyframes dg-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.dg-skel { height: 11px; border-radius: 5px; background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 50%, var(--line-soft) 75%); background-size: 200% 100%; animation: dg-shimmer 1.6s infinite linear; }

/* ── Empty state ─────────────────────────────────────────────────── */
.dg-empty { padding: 64px 20px; text-align: center; }
.dg-empty svg { width: 40px; height: 40px; color: var(--text-faint); margin-bottom: 12px; }
.dg-empty h4 { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.dg-empty p  { font-size: 13px; color: var(--text-muted); }

/* ── Pagination ──────────────────────────────────────────────────── */
.dg-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; gap: 10px; background: var(--surface); }
.dg-foot-info { font-size: 12.5px; color: var(--text-muted); }
.dg-foot-info strong { color: var(--text); font-weight: 600; }
.dg-foot-sep { margin: 0 7px; color: var(--text-faint); }
.dg-foot-clear { font-size: 12px; font-weight: 600; color: var(--brand); background: none; border: none; cursor: pointer; padding: 4px 9px; border-radius: 7px; font-family: inherit; transition: background 0.12s; }
.dg-foot-clear:hover { background: var(--brand-soft); }

.cfp-head { padding: 10px 14px 9px; border-bottom: 1px solid var(--line-soft); }
.cfp-foot { display: flex; gap: 6px; padding: 9px 12px; border-top: 1px solid var(--line-soft); background: #fafafa; }
.cfp-apply { flex: 1; padding: 6px 12px; border-radius: 6px; background: var(--brand); color: #fff; border: none; font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .12s; }
.cfp-apply:hover { background: var(--brand); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px)  { .dg-foot { flex-wrap: wrap; row-gap: 8px; } .dg-foot-info { order: 3; width: 100%; text-align: center; } .dg-table-wrap { -webkit-overflow-scrolling: touch; } }

/* ── Students DataGrid — grid-specific styles ── */
.th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; background: var(--surface-muted); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4; user-select: none; }
.th.sortable { cursor: pointer; }
.th.sortable:hover { background: var(--line-soft); color: var(--text); }
.th.sort-active { color: var(--brand); }
/* overflow:hidden clips content to the fixed colgroup widths (virtualized table) */
.td { padding: 12px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--text); background: var(--surface); }
.tr:hover .td { background: var(--brand-soft); }
.tr.selected .td { background: #f5f3ff; }
.tr.selected:hover .td { background: var(--accent-soft); }
/* Zebra striping (always on) keyed off the data-row index — virtualized rows
   aren't contiguous nth-children; yields to hover + selection so those win. */
#grid-card .tr.dg-stripe:not(.selected):not(:hover) .td { background: var(--surface-muted); }
/* Sort icons */
.sort-icon { display: inline-flex; flex-direction: column; gap: 1px; margin-left: 5px; opacity: 0.3; vertical-align: middle; }
.sort-icon.asc, .sort-icon.desc { opacity: 1; }
/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-suspended { background: var(--danger-soft); color: var(--danger); }
.badge-graduated { background: var(--info-soft); color: var(--info); }
/* GPA */
.gpa-high { color: var(--ok); font-weight: 700; }
.gpa-mid  { color: #d97706; font-weight: 700; }
.gpa-low  { color: var(--danger); font-weight: 700; }
/* Attendance bar */
.att-wrap { display: flex; flex-direction: column; gap: 3px; }
.att-bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.att-fill { height: 100%; border-radius: 2px; }
/* th inner */
.th-inner { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.th-label { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; overflow: hidden; }
/* Sort button (#576 X2) — a real, keyboard-operable button that inherits the header's typography so
   the header looks unchanged; the focus ring is the only visible addition. */
.th-sort-btn { display: flex; align-items: center; gap: 3px; min-width: 0; overflow: hidden; border: none; background: transparent; padding: 0; margin: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.th-sort-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
/* Drag handle — revealed on header hover so it doesn't crowd the label */
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 0; height: 22px; overflow: hidden; opacity: 0; border-radius: 6px; color: var(--text-muted); cursor: grab; transition: width 0.15s, opacity 0.15s, background 0.15s, color 0.15s; flex-shrink: 0; }
.th:hover .drag-handle { width: 22px; opacity: 1; }
.drag-handle:hover { background: var(--line); color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.th.is-dragging { opacity: 0.4; background: var(--brand-soft); }
.th.drop-left  { box-shadow: inset  3px 0 0 #6366f1; background: #f5f3ff; }
.th.drop-right { box-shadow: inset -3px 0 0 #6366f1; background: #f5f3ff; }
/* Filter btn — overlaid at the header's right edge, revealed on hover or when a
   filter is active, so it doesn't eat label width in narrow columns. */
.filter-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent; cursor: pointer; color: var(--text-muted); opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.th:hover .filter-btn, .filter-btn.is-filtered { opacity: 1; }
.filter-btn:hover { background: var(--line); color: var(--text); }
.filter-btn.is-filtered { color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-line); }
.filter-dot { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; background: var(--brand); border-radius: 9999px; border: 1.5px solid #fff; }
/* Filter chips */
.filter-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 500; color: #4338ca; background: var(--brand-soft); border: 1px solid var(--brand-line); white-space: nowrap; }
.chip-x { display: flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 3px; color: #818cf8; cursor: pointer; transition: all 0.1s; border: none; background: transparent; padding: 0; font: inherit; }
.chip-x:hover { background: var(--brand-line); color: #4338ca; }
/* Density */
.density-group { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-muted); }
.density-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s; position: relative; }
.density-btn:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 20%; height: 60%; width: 1px; background: var(--line); }
.density-btn:hover:not(.active) { color: var(--text); background: rgba(0,0,0,0.03); }
.density-btn.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
/* Row density */
#grid-card.density-compact .td { padding-top: 5px; padding-bottom: 5px; }
#grid-card.density-compact .td img { width: 24px !important; height: 24px !important; border-radius: 6px !important; }
#grid-card.density-comfortable .td { padding-top: 18px; padding-bottom: 18px; }
#grid-card.density-comfortable .td img { width: 38px !important; height: 38px !important; border-radius: 10px !important; }
/* Fullscreen */
#grid-card:fullscreen { border-radius: 0 !important; }
#grid-card:-webkit-full-screen { border-radius: 0 !important; }
/* Ghost scrollbar */
.grid-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 0.3s; }
.grid-scroll:hover { scrollbar-color: rgba(0,0,0,0.12) transparent; }
.grid-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.grid-scroll::-webkit-scrollbar-track { background: transparent; }
.grid-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 9999px; }
.grid-scroll:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
.grid-scroll::-webkit-scrollbar-corner { background: transparent; }
/* Custom select dropdowns */
.csel { position: relative; display: inline-block; }
.csel-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; border: none; background: none; text-align: left; transition: background 0.1s; font-family: inherit; }
.csel-opt:hover { background: var(--surface-muted); color: var(--text); }
.csel-opt.sel { color: var(--brand); font-weight: 600; }
.csel-sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.sdot { width: 7px; height: 7px; border-radius: 9999px; flex-shrink: 0; display: inline-block; }
/* Column picker panel */
.cp { position: fixed; z-index: 9999; width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.06); display: none; overflow: hidden; flex-direction: column; }
.cp.open { display: flex; animation: slideDown 0.15s ease-out; }
.cp-search-inp { width: 100%; padding: 7px 10px 7px 32px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: #374151; outline: none; background: var(--surface-muted); transition: all 0.15s; font-family: inherit; box-sizing: border-box; }
.cp-search-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(165,180,252,0.2); background: var(--surface); }
.cp-body { overflow-y: auto; max-height: 420px; padding: 8px; scrollbar-width: thin; }
.cp-body::-webkit-scrollbar { width: 3px; }
.cp-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }
.cp-group { margin-bottom: 6px; }
.cp-group-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 4px; }
.cp-group-name { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.cp-group-count { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.cp-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background 0.1s; }
.cp-card:hover { background: var(--surface-muted); }
.cp-card.cp-fixed { opacity: 0.5; cursor: not-allowed; }
.cp-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-info { flex: 1; min-width: 0; }
.cp-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cp-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
/* Toggle switch */
.tog { position: relative; display: inline-flex; flex-shrink: 0; }
.tog input { position: absolute; opacity: 0; width: 0; height: 0; }
.tog-track { width: 34px; height: 19px; border-radius: 999px; background: var(--line); transition: background 0.2s; cursor: pointer; display: flex; align-items: center; padding: 2px; }
.tog input:checked ~ .tog-track { background: var(--brand); }
.tog-thumb { width: 15px; height: 15px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s cubic-bezier(0.4,0,0.2,1); flex-shrink: 0; }
.tog input:checked ~ .tog-track .tog-thumb { transform: translateX(15px); }
.cp-card.cp-fixed .tog-track { cursor: not-allowed; }
/* Column filter panel */
.cfp { position: fixed; z-index: 9999; min-width: 230px; max-width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; display: none; }
.cfp.open { display: block; animation: slideDown 0.13s ease-out; }
.cfp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; border-bottom: 1px solid var(--line-soft); }
.cfp-title { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; }
.cfp-body { padding: 8px; max-height: 280px; overflow-y: auto; scrollbar-width: thin; }
.cfp-body::-webkit-scrollbar { width: 3px; }
.cfp-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }
.cfp-foot { padding: 8px 10px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background 0.1s; }
.ms-opt:hover { background: var(--surface-muted); }
.ms-opt input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.ms-opt label { font-size: 13px; color: #374151; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.ms-sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.range-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.range-inp { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: #374151; outline: none; transition: border-color 0.15s; font-family: inherit; }
.range-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
.tf-op { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: #374151; outline: none; margin-bottom: 6px; font-family: inherit; box-sizing: border-box; }
.tf-inp { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: #374151; outline: none; font-family: inherit; box-sizing: border-box; }
.tf-inp:focus, .tf-op:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
.date-inp { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: #374151; outline: none; font-family: inherit; box-sizing: border-box; }
.date-inp:focus { border-color: #a5b4fc; box-shadow: 0 0 0 2px rgba(165,180,252,0.2); }
/* Spinning animation */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 0.6s linear infinite; }
/* Bulk bar */
#bulk-bar { display: none; }
#bulk-bar.visible { display: flex; }

/* ═══════════════════════════════════════════════════════════════════
   ENROLMENT WIZARD  (/students/enroll)
   Multi-step form. Layout via Tailwind utilities in markup; the bespoke
   widgets (stepper, pill pickers, swatches, live preview, success) live
   here. Tokens match the Tera Hub palette: indigo #6366f1 · slate scale.
═══════════════════════════════════════════════════════════════════ */

/* ── Stepper ─────────────────────────────────────────────────────── */
.enr-stepper { display: flex; align-items: flex-start; gap: 0; }
.enr-step { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 0 0 auto; position: relative; background: none; border: none; padding: 0; font-family: inherit; cursor: default; min-width: 0; }
.enr-step.is-nav { cursor: pointer; }
.enr-step-dot {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0; position: relative; z-index: 1;
    background: var(--surface); color: var(--text-muted); border: 2px solid var(--line);
    transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .15s;
}
