/* ==========================================================================
   EXPERIENCE.CSS — Teacher Portal redesign layer
   ──────────────────────────────────────────────────────────────────────────
   Loaded AFTER style.css on every page. Pure overlay: it never removes
   behaviour, it re-skins the shell and adds micro-interaction primitives.
   The teacher identity is "indigo observatory": a deep-indigo night scene
   on the auth pages and sidebar, with a calm, cool-tinted light canvas for
   the high-repetition working surfaces.
     1. Extended design tokens
     2. Micro-interaction primitives (ripple, press)
     3. Auth experience  (immersive indigo scene + solid panel)
     4. App shell        (dark sidebar, light canvas)
     5. Dashboard        (welcome hero, stats, quick links, upcoming)
     6. Dynamic centre content polish
     7. Task pages       (body.eval-body.xp-task)
     8. Shared UX widgets (ux.js dialogs, toasts, empty states)
     9. Reduced motion
   ========================================================================== */

/* ==========================================================================
   1. EXTENDED TOKENS
   ========================================================================== */
:root {
    /* Indigo-night ink ramp (auth scene + sidebar) */
    --tink-950: #080b22;
    --tink-900: #0d1233;
    --tink-800: #161d4d;
    --tink-700: #212a66;

    /* Light surface ramp (app canvas) — tinted toward the brand hue */
    --tsurface-0: #f5f6fb;
    --tsurface-1: #ffffff;
    --tsurface-2: #edeffa;
    --tline-soft: #e1e4f3;
    --tline-mid:  #c9cee9;

    /* Accent ramp */
    --indigo-700: #4338ca;
    --indigo-300: #a5b4fc;
    --peri-200:   #c7d2fe;

    /* Ink (text) on light canvas */
    --tink-text:   #14183a;
    --tink-muted:  #4d5577;

    /* Elevation */
    --telev-1: 0 1px 2px rgba(20, 24, 58, .05), 0 2px 8px rgba(20, 24, 58, .05);
    --telev-2: 0 2px 6px rgba(20, 24, 58, .07), 0 10px 28px rgba(20, 24, 58, .10);
    --telev-3: 0 6px 16px rgba(8, 11, 34, .24), 0 28px 80px rgba(8, 11, 34, .36);

    /* Motion — exponential ease-outs only */
    --ease-out:   cubic-bezier(.22, 1, .36, 1);
    --ease-swift: cubic-bezier(.16, 1, .3, 1);
    --dur-fast:   .16s;
    --dur-mid:    .26s;

    /* Semantic z-scale */
    --z-nav: 50; --z-sticky: 100; --z-backdrop: 900; --z-modal: 1000; --z-toast: 20000;
}

/* ==========================================================================
   2. MICRO-INTERACTION PRIMITIVES
   ========================================================================== */

/* Ripple host + ink ripple (spawned by experience.js on pointerdown) */
.xp-ripple-host { position: relative; overflow: hidden; }
.xp-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: currentColor;
    opacity: .14;
    transform: scale(0);
    animation: xp-ripple .55s var(--ease-out) forwards;
}
@keyframes xp-ripple {
    to { transform: scale(1); opacity: 0; }
}

/* Tactile press for primary controls */
.btn, .btn--auth, .xp-row, .xp-fig {
    transition-property: transform, box-shadow, background, border-color, color, filter;
    transition-duration: var(--dur-fast);
    transition-timing-function: var(--ease-out);
}
.btn:active, .btn--auth:active { transform: scale(.985); }

/* ==========================================================================
   3. AUTH EXPERIENCE — indigo observatory
   ========================================================================== */

body.auth-page {
    background: radial-gradient(120% 90% at 76% 14%, #232b6e 0%, var(--tink-900) 48%, var(--tink-950) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* three.js canvas sits behind everything */
.xp-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

/* Large soft glows — cheap depth without GPU cost */
.xp-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}
.xp-glow--a { width: 46vw; height: 46vw; left: -12vw; bottom: -18vw; background: rgba(79, 70, 229, .22); }
.xp-glow--b { width: 34vw; height: 34vw; right: -10vw; top: -12vw;  background: rgba(165, 180, 252, .10); }

/* ── Stage layout (rebuilt login page) ─────────────────────────────────── */
.xp-stage {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    width: min(1120px, 100% - 48px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: clamp(32px, 6vw, 88px);
    padding-block: 48px;
}

/* ── Hero (left) ───────────────────────────────────────────────────────── */
.xp-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 9px;
    border: 1px solid rgba(199, 210, 254, .24);
    border-radius: var(--radius-pill);
    background: rgba(13, 18, 51, .5);
    margin-bottom: 28px;
}
.xp-hero-badge img { width: 30px; height: 30px; object-fit: contain; }
.xp-hero-badge span {
    color: var(--peri-200);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
}
.xp-hero-title {
    font-size: clamp(2.6rem, 5.4vw, 4.25rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #f4f5ff;
    margin-bottom: 18px;
    max-width: 12ch;
}
.xp-hero-title .xp-char { display: inline-block; will-change: transform; }
.xp-hero-sub {
    color: rgba(199, 210, 254, .85);
    font-size: 1.05rem;
    line-height: var(--leading-normal);
    margin-bottom: 30px;
    max-width: 44ch;
}
.xp-hero-points {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    padding: 0;
}
.xp-hero-points li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(199, 210, 254, .75);
    font-size: .88rem;
    font-weight: 500;
}
.xp-hero-points li::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--indigo-300);
    box-shadow: 0 0 10px rgba(165, 180, 252, .85);
}

/* ── Form panel (right) — solid, credible, elevated ────────────────────── */
.xp-form-card {
    position: relative;
    z-index: 1;
    background: var(--tsurface-1);
    border-radius: 24px;
    padding: clamp(28px, 3.4vw, 42px);
    box-shadow: var(--telev-3);
    will-change: transform;
}
.xp-form-card h2 {
    color: var(--tink-text);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 4px;
    text-transform: none;
    text-align: left;
}
.xp-form-hint {
    color: var(--tink-muted);
    font-size: .9rem;
    margin-bottom: 26px;
}

/* Light-panel field overrides (auth fields are glass/white by default) */
.xp-form-card .field { margin-bottom: 18px; }
.xp-form-card .field__label {
    color: #3c4470;
    font-size: .72rem;
    letter-spacing: .09em;
    font-weight: 600;
}
.xp-form-card .field__input {
    height: 48px;
    background: var(--tsurface-0);
    border: 1.5px solid var(--tline-mid);
    border-radius: 12px;
    color: var(--tink-text);
    font-size: .95rem;
    transition: border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.xp-form-card .field__input::placeholder { color: #5a628c; }
.xp-form-card .field__input:hover { border-color: #a9b1dd; }
.xp-form-card .field__input:focus,
.xp-form-card .field__input:focus:not(:focus-visible) {
    outline: none;
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .14);
}
.xp-form-card .field__input:user-invalid {
    border-color: #dc2626;
    background-color: #fef2f2;
}
.xp-form-card .field__input:user-valid { border-color: #34d399; }

/* Password reveal toggle on the light panel */
.xp-form-card .pw-wrap { position: relative; }
.xp-form-card .pw-toggle {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    color: #5a628c;
}
.xp-form-card .pw-toggle:hover { background: var(--tsurface-2); }

.xp-form-card .remember-me { margin: 4px 0 18px; }
.xp-form-card .remember-me input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--color-primary);
}
.xp-form-card .remember-me label { color: #3c4470; font-size: .85rem; }

.xp-form-card .message-error,
.xp-form-card .message-success { min-height: 0; margin-top: 0; }
.xp-form-card .message-error   { color: #b91c1c; font-size: .85rem; font-weight: 500; }
.xp-form-card .message-success { color: #047857; font-size: .85rem; font-weight: 500; }
.xp-form-card .message-error:not(:empty),
.xp-form-card .message-success:not(:empty) { margin-bottom: 12px; }

.xp-form-card .btn--auth {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--indigo-700) 100%);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .08em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .38);
    will-change: transform;
}
.xp-form-card .btn--auth:hover {
    background: linear-gradient(180deg, var(--indigo-700) 0%, #3730a3 100%);
    box-shadow: 0 8px 24px rgba(79, 70, 229, .48);
    transform: none;
}
.xp-form-card .btn--auth:disabled {
    opacity: .65;
    cursor: progress;
    transform: none;
}

.xp-form-card .auth-links { margin-top: 22px; }
.xp-form-card .forgot-link { text-align: center; margin-bottom: 10px; }
.xp-form-card .forgot-link a,
.xp-form-card .signup-text a {
    color: var(--indigo-700);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-fast) var(--ease-out);
}
.xp-form-card .forgot-link a:hover,
.xp-form-card .signup-text a:hover { opacity: 1; border-bottom-color: var(--indigo-700); }
.xp-form-card .forgot-link a { font-size: .85rem; font-weight: 500; }
.xp-form-card .signup-text {
    text-align: center;
    color: var(--tink-muted);
    font-size: .88rem;
}

/* ── Legacy auth pages (regis / recovery) on the new dark scene ──────────
   Near-solid panel: same identity as the login form card, but text sits on
   a stable surface (no backdrop blur, no glow bleeding through). */
body.auth-page .login-card { box-shadow: var(--telev-3); }
body.auth-page .login-card__glass {
    background: rgba(16, 22, 60, .96);
    border-color: rgba(199, 210, 254, .18);
}
body.auth-page .login-card__brand { background: rgba(255, 255, 255, .98); }
body.auth-page .login-card__glass .forgot-link a,
body.auth-page .login-card__glass .signup-text a { color: var(--indigo-300); }
body.auth-page .login-card__glass .btn--auth {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--indigo-700) 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .38);
}
body.auth-page .login-card__glass .btn--auth:hover {
    background: linear-gradient(180deg, var(--indigo-700) 0%, #3730a3 100%);
}
body.auth-page .field__input:focus,
body.auth-page .field__input:focus:not(:focus-visible) {
    border-color: var(--indigo-300);
}

/* ── Auth responsive ───────────────────────────────────────────────────── */
@media (max-width: 880px) {
    .xp-stage {
        grid-template-columns: 1fr;
        gap: 34px;
        padding-block: 40px 32px;
        width: min(480px, 100% - 40px);
    }
    .xp-hero { text-align: center; }
    .xp-hero-badge { margin-bottom: 20px; }
    .xp-hero-title { margin-inline: auto; font-size: clamp(2.2rem, 9vw, 2.9rem); }
    .xp-hero-sub { margin-inline: auto; margin-bottom: 20px; font-size: .95rem; }
    .xp-hero-points { justify-content: center; }
}

/* ==========================================================================
   4. APP SHELL — dark indigo sidebar + light canvas
   (Structural selectors out-rank the Tailwind utilities in the markup,
    so the shell re-skins without touching any class the JS toggles.)
   ========================================================================== */

body.layout-body { background: var(--tsurface-0); }
.layout-body .main-content { background: var(--tsurface-0); }

.layout-body .sidebar {
    background: linear-gradient(178deg, var(--tink-900) 0%, var(--tink-800) 62%, #1b2358 100%);
    border-right: none;
    box-shadow: inset -1px 0 0 rgba(199, 210, 254, .08);
}

/* Brand header */
.layout-body .sidebar__header { padding: 22px 22px 16px; }
.layout-body .sidebar__header span  { color: #eef0ff; }
.layout-body .sidebar__header p     { color: var(--indigo-300); }
.layout-body .sidebar__header img   { filter: drop-shadow(0 2px 8px rgba(8, 11, 34, .6)); }
.layout-body .sidebar__menu-icon    { color: var(--peri-200); }

/* Group toggles & direct links (top-level rows) */
.layout-body .sidebar .sidebar-group > button,
.layout-body .sidebar .sidebar-group > a {
    color: rgba(226, 230, 255, .88);
    border-radius: 11px;
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}
.layout-body .sidebar .sidebar-group > button:hover,
.layout-body .sidebar .sidebar-group > a:hover {
    background: rgba(199, 210, 254, .10);
    color: #fff;
    transform: translateX(2px);
}
.layout-body .sidebar .sidebar-group > button svg,
.layout-body .sidebar .sidebar-group > a svg { opacity: .8; }

/* Sub-group headers (uppercase year labels) */
.layout-body .sidebar .sidebar-group-content button {
    color: rgba(165, 180, 252, .65);
    transition: color var(--dur-fast) var(--ease-out);
}
.layout-body .sidebar .sidebar-group-content button:hover { color: var(--peri-200); }

/* "Coming soon" rows */
.layout-body .sidebar .sidebar-group-content span { color: rgba(165, 180, 252, .35); }
.layout-body .sidebar .sidebar-group-content span em { color: rgba(165, 180, 252, .35); }

/* Leaf links */
.layout-body .sidebar .sidebar-group-content a,
.layout-body .sidebar a[data-nav-key] {
    color: rgba(226, 230, 255, .88);
    border-radius: 9px;
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}
.layout-body .sidebar .sidebar-group-content a:hover {
    background: rgba(199, 210, 254, .10);
    color: #fff;
    transform: translateX(2px);
}
.layout-body .sidebar .sidebar-group-content a.active {
    background: rgba(199, 210, 254, .14);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(199, 210, 254, .16);
}

/* Footer (settings / logout) */
.layout-body .sidebar__footer { border-top-color: rgba(199, 210, 254, .10); }
.layout-body .sidebar__footer a {
    color: rgba(214, 219, 250, .78);
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.layout-body .sidebar__footer a:hover { background: rgba(199, 210, 254, .10); color: #fff; }
.layout-body .sidebar__footer button#logoutBtn {
    color: #fda4af;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.layout-body .sidebar__footer button#logoutBtn:hover { background: rgba(244, 63, 94, .14); color: #fecdd3; }

/* Sidebar scrollbar quieted to match the dark rail */
.layout-body .sidebar__nav { scrollbar-width: thin; scrollbar-color: rgba(199, 210, 254, .25) transparent; }

/* Mobile collapse keeps its slide; just keep the dark rail edge tidy */
@media (max-width: 768px) {
    .layout-body .sidebar { box-shadow: 0 1px 0 rgba(199, 210, 254, .08); }
    /* The floating notification bell would sit on top of the hamburger in
       the collapsed mobile header — slide it left of the toggle instead.
       Vertically centre it in the 88px sidebar header (88-38)/2 ≈ 25px.
       (!important: notif.js sets its fallback position as inline styles.) */
    body.layout-body #notif-bell-btn { top: 25px !important; right: 68px !important; }
    /* The dropdown is hardcoded to top:60px in notif.js — on mobile that
       puts it inside the 88px sidebar header. Push it below the header. */
    body.layout-body #notif-dropdown {
        top: 96px !important;
        right: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: 360px !important;
    }
}

/* ==========================================================================
   5. DASHBOARD (rebuilt home.html static region)
   ========================================================================== */

/* Shared dashboard column width */
.xp-dash-wrap { max-width: 880px; }

/* The central home module is an editorial "day desk", not a card dashboard:
   a masthead with a live time-of-day sky, a hairline figure ledger, and a
   table-of-contents list of where to go next. */
.xp-home { max-width: 880px; }

/* ── Masthead ──────────────────────────────────────────────────────────── */
.xp-home-masthead {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 28px;
    padding: 6px 2px 26px;
    border-bottom: 1px solid var(--tline-soft);
    margin-bottom: 28px;
}
.xp-home-date {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tink-muted);
    margin-bottom: 13px;
}
.xp-home-greeting {
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--tink-text);
    text-wrap: balance;
}
.xp-home-greeting #time-of-day { text-transform: lowercase; }
.xp-home-name { color: var(--color-primary); font-size: 0.82em; font-weight: 600; }
.xp-home-wave { display: inline-block; font-size: 0.82em; }
.xp-home-lead {
    margin-top: 15px;
    font-size: .96rem;
    color: var(--tink-muted);
    max-width: 46ch;
    line-height: 1.6;
}

/* ── Live sky glyph (sun tracks the hour; moon by night) ───────────────── */
.xp-home-sky { width: 138px; height: 88px; flex-shrink: 0; }
.xp-sky-arc {
    fill: none;
    stroke: var(--tline-mid);
    stroke-width: 1.4;
    stroke-dasharray: 1.5 6;
    stroke-linecap: round;
}
.xp-sky-core { fill: #fbbf24; filter: drop-shadow(0 0 6px rgba(251, 191, 36, .7)); }
.xp-sky-rays { transform-box: fill-box; transform-origin: center; animation: xp-sun-spin 26s linear infinite; }
.xp-sky-rays line { stroke: #fbbf24; stroke-width: 2; stroke-linecap: round; opacity: .9; }
.xp-sky-moon { fill: #cbd5f5; display: none; filter: drop-shadow(0 0 5px rgba(199, 210, 254, .6)); }
.xp-sky-stars circle { fill: var(--peri-200); opacity: 0; }
.xp-home-sky.is-night .xp-sky-core,
.xp-home-sky.is-night .xp-sky-rays { display: none; }
.xp-home-sky.is-night .xp-sky-moon { display: block; }
.xp-home-sky.is-night .xp-sky-arc { stroke: rgba(165, 180, 252, .45); }
.xp-home-sky.is-night .xp-sky-stars circle { opacity: .85; animation: xp-twinkle 3.2s ease-in-out infinite; }
.xp-home-sky.is-night .xp-sky-stars circle:nth-child(2) { animation-delay: .6s; }
.xp-home-sky.is-night .xp-sky-stars circle:nth-child(3) { animation-delay: 1.4s; }
.xp-home-sky.is-night .xp-sky-stars circle:nth-child(4) { animation-delay: 2.1s; }
@keyframes xp-sun-spin { to { transform: rotate(360deg); } }
@keyframes xp-twinkle  { 50% { opacity: .22; } }

/* ── Figure ledger ─────────────────────────────────────────────────────── */
.xp-home-figures {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 36px;
}
.xp-fig {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 20px;
    text-decoration: none;
    flex: 1 1 0;
    min-width: 104px;
    transition: color var(--dur-fast) var(--ease-out);
}
.xp-fig:first-child { padding-left: 2px; }
.xp-fig .sc-val {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--tink-text);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
a.xp-fig:hover .sc-val { color: var(--color-primary); }
a.xp-fig:hover .xp-fig-lbl { color: var(--indigo-700); }
.xp-fig-lbl {
    font-size: .73rem;
    font-weight: 600;
    color: var(--tink-muted);
    line-height: 1.35;
    max-width: 15ch;
}
.xp-fig-div { width: 1px; align-self: stretch; background: var(--tline-soft); margin: 2px 0; }

/* ── Continue: editorial list ──────────────────────────────────────────── */
.xp-home-eyebrow {
    font-size: .95rem;
    font-weight: 600;
    color: var(--tink-text);
    margin-bottom: 13px;
}
.xp-rows {
    background: var(--tsurface-1);
    border: 1px solid var(--tline-soft);
    border-radius: 16px;
    box-shadow: var(--telev-1);
    overflow: hidden;
}
.xp-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    text-decoration: none;
    border-bottom: 1px solid var(--tline-soft);
    transition: background var(--dur-fast) var(--ease-out);
}
.xp-row:last-child { border-bottom: none; }
.xp-row:hover { background: var(--tsurface-2); }
.xp-row-glyph {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--tsurface-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    transition: transform var(--dur-mid) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.xp-row:hover .xp-row-glyph { transform: scale(1.08) rotate(-4deg); background: #e0e7ff; }
.xp-row-main { flex: 1; min-width: 0; }
.xp-row-title { display: block; font-weight: 700; font-size: .95rem; color: var(--tink-text); }
.xp-row-sub { display: block; font-size: .8rem; color: var(--tink-muted); margin-top: 2px; }
.xp-row-arrow {
    color: var(--indigo-700);
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: transform var(--dur-mid) var(--ease-out);
}
.xp-row:hover .xp-row-arrow { transform: translateX(5px); }

/* ── Home responsive ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .xp-home-masthead { grid-template-columns: 1fr; gap: 14px; }
    .xp-home-sky { order: -1; width: 112px; height: 72px; }
    .xp-home-figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
    .xp-fig, .xp-fig:first-child { padding: 0; }
    .xp-fig-div { display: none; }
}

/* ── Section label (still used by the Upcoming-sessions block) ──────────── */
.xp-dash-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .72rem;
    font-weight: 700;
    color: #565e8c;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
}
.xp-dash-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tline-soft);
}

/* ── Upcoming sessions (cards injected by the home loader) ─────────────── */
#upcoming-cards { display: flex; flex-direction: column; gap: 9px; }
.upcoming-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tsurface-1);
    border: 1px solid var(--tline-soft);
    border-radius: 14px;
    padding: 13px 16px;
    box-shadow: var(--telev-1);
    transition: transform var(--dur-mid) var(--ease-out),
                box-shadow var(--dur-mid) var(--ease-out),
                border-color var(--dur-mid) var(--ease-out);
}
.upcoming-card:hover { transform: translateY(-1px); border-color: var(--tline-mid); box-shadow: var(--telev-2); }
.upcoming-icon { font-size: 22px; flex-shrink: 0; }
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-type {
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6770a3;
    margin-bottom: 2px;
}
.upcoming-topic {
    font-size: .88rem;
    font-weight: 700;
    color: var(--tink-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upcoming-detail { font-size: .75rem; color: var(--tink-muted); margin-top: 2px; }
.upcoming-countdown {
    flex-shrink: 0;
    text-align: center;
    background: #e0e7ff;
    border-radius: 10px;
    padding: 7px 13px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--indigo-700);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.upcoming-countdown small {
    display: block;
    font-size: .58rem;
    font-weight: 600;
    color: #818cf8;
    text-transform: uppercase;
    margin-top: 2px;
}
.upcoming-countdown.today { background: #d1fae5; color: #047857; }
.upcoming-countdown.today small { color: #34d399; }

/* ==========================================================================
   6. DYNAMIC CENTRE CONTENT — module launcher (Class Evaluation / Course
   Management / Advisor panels injected by home.js → buildCardGrid).
   ========================================================================== */
.xp-home { /* shared wrapper also used by #dynamic-content via .xp-dash-wrap */ }

/* ── Header ─────────────────────────────────────────────────────────────── */
.xp-mod-head { margin-bottom: 22px; }
.xp-mod-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--tink-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.xp-mod-desc { color: var(--tink-muted); font-size: .92rem; margin-top: 5px; }

/* ── Tab bar (segmented pills) ─────────────────────────────────────────── */
.xp-tabbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.xp-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--tline-mid);
    background: var(--tsurface-1);
    color: var(--tink-muted);
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.xp-tab:hover { border-color: var(--indigo-300); color: var(--indigo-700); background: #eef0fb; }
.xp-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .3);
}
.xp-tab-soon {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 6px;
    border-radius: 5px;
    background: #fef3c7;
    color: #b45309;
}
.xp-tab.active .xp-tab-soon { background: rgba(255, 255, 255, .22); color: #fff; }

/* ── Module cards ──────────────────────────────────────────────────────── */
.xp-modgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
    gap: 12px;
}
.xp-modcard {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: var(--tsurface-1);
    border: 1px solid var(--tline-soft);
    box-shadow: var(--telev-1);
    text-decoration: none;
    transition: transform var(--dur-mid) var(--ease-out),
                box-shadow var(--dur-mid) var(--ease-out),
                border-color var(--dur-mid) var(--ease-out);
    will-change: transform;
}
.xp-modcard:hover {
    transform: translateY(-3px);
    border-color: var(--tline-mid);
    box-shadow: var(--telev-2);
}
.xp-modcard-icon {
    width: 46px; height: 46px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform var(--dur-mid) var(--ease-out);
}
.xp-modcard-icon svg { width: 22px; height: 22px; }
.xp-modcard:hover .xp-modcard-icon { transform: scale(1.08) rotate(-4deg); }
.xp-modcard-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.xp-modcard-title { font-weight: 700; font-size: .92rem; color: var(--tink-text); line-height: 1.3; }
.xp-modcard-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--indigo-700);
}
.xp-modcard-open svg { width: 14px; height: 14px; transition: transform var(--dur-mid) var(--ease-out); }
.xp-modcard:hover .xp-modcard-open svg { transform: translateX(4px); }

/* Per-card icon hue (cycles every 6) */
.xp-modgrid .xp-modcard:nth-child(6n+1) .xp-modcard-icon { background: #e0e7ff; color: #4338ca; }
.xp-modgrid .xp-modcard:nth-child(6n+2) .xp-modcard-icon { background: #e0f2fe; color: #0369a1; }
.xp-modgrid .xp-modcard:nth-child(6n+3) .xp-modcard-icon { background: #dcfce7; color: #15803d; }
.xp-modgrid .xp-modcard:nth-child(6n+4) .xp-modcard-icon { background: #fce7f3; color: #be185d; }
.xp-modgrid .xp-modcard:nth-child(6n+5) .xp-modcard-icon { background: #fef3c7; color: #b45309; }
.xp-modgrid .xp-modcard:nth-child(6n+6) .xp-modcard-icon { background: #f3e8ff; color: #7c3aed; }

/* Disabled / coming-soon module card */
.xp-modcard.is-soon {
    background: var(--tsurface-2);
    border-style: dashed;
    border-color: var(--tline-mid);
    box-shadow: none;
    cursor: not-allowed;
}
.xp-modcard.is-soon:hover { transform: none; box-shadow: none; border-color: var(--tline-mid); }
.xp-modcard.is-soon .xp-modcard-icon { background: #e6e9f5; color: #8a92bd; }
.xp-modcard.is-soon:hover .xp-modcard-icon { transform: none; }
.xp-modcard.is-soon .xp-modcard-title { color: var(--tink-muted); }
.xp-modcard-soon { font-size: .73rem; font-weight: 600; color: #8a92bd; }

.xp-mod-empty {
    color: var(--tink-muted);
    font-size: .88rem;
    font-style: italic;
    padding: 22px 4px;
}

/* ── Whole-panel "coming soon" state ───────────────────────────────────── */
.xp-mod-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 54px 20px;
    background: var(--tsurface-1);
    border: 1px dashed var(--tline-mid);
    border-radius: 18px;
    box-shadow: var(--telev-1);
}
.xp-mod-soon-badge {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}
.xp-mod-soon-title { font-size: 1rem; font-weight: 700; color: var(--tink-text); }
.xp-mod-soon-sub { font-size: .85rem; color: var(--tink-muted); margin-top: 4px; }

/* Legacy fallback for any Tailwind-markup panel still rendered here */
#dynamic-content header h2 { color: var(--tink-text); }
#dynamic-content header p  { color: var(--tink-muted); }

/* ==========================================================================
   7. TASK PAGES — every body.eval-body.xp-task surface
   ========================================================================== */

body.eval-body.xp-task {
    background:
        radial-gradient(90% 40% at 50% 0%, #eef0fb 0%, var(--tsurface-0) 100%);
    padding: 34px 20px 70px;
}

/* The container becomes a calm elevated sheet */
.xp-task .eval-container {
    background: var(--tsurface-1);
    border: 1px solid var(--tline-soft);
    border-radius: 20px;
    box-shadow: var(--telev-1);
    padding: clamp(24px, 4vw, 42px);
}

/* Back-to-home: quiet pill */
.xp-task .eval-container > .btn--secondary {
    border: 1px solid var(--tline-mid);
    color: var(--indigo-700);
    background: var(--tsurface-0);
    border-radius: var(--radius-pill);
    padding: 7px 16px;
    font-weight: 600;
}
.xp-task .eval-container > .btn--secondary:hover {
    background: #e0e7ff;
    border-color: var(--indigo-300);
    color: var(--indigo-700);
}

/* Page header: title case, ink, short accent rule */
.xp-task .eval-header {
    text-transform: none;
    color: var(--tink-text);
    font-size: 1.45rem;
    letter-spacing: -0.015em;
    border-bottom: 1px solid var(--tline-soft);
    padding-bottom: 16px;
    margin-bottom: 26px;
    position: relative;
}
.xp-task .eval-header::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 64px; height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--indigo-300));
}

/* Sections become soft cards */
.xp-task .eval-section {
    background: var(--tsurface-1);
    border: 1px solid var(--tline-soft);
    border-radius: 16px;
    box-shadow: var(--telev-1);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.xp-task .eval-section h3,
.xp-task .section-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--tink-text);
    letter-spacing: -0.01em;
}
.xp-task .eval-container > h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--tink-text);
    letter-spacing: -0.01em;
}

/* Inputs & selects: calm field treatment + indigo focus */
.xp-task .eval-section select,
.xp-task .eval-section input[type="text"],
.xp-task .eval-section input[type="number"],
.xp-task .eval-input,
.xp-task .clean-input,
.xp-task .presenter-select,
.xp-task .absent-select,
.xp-task .score-input {
    border: 1.5px solid var(--tline-mid);
    border-radius: 11px;
    background: var(--tsurface-0);
    transition: border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.xp-task .eval-section select:hover,
.xp-task .eval-input:hover,
.xp-task .presenter-select:hover,
.xp-task .absent-select:hover,
.xp-task .score-input:hover { border-color: #a9b1dd; }
.xp-task .eval-section select:focus,
.xp-task .eval-section input:focus,
.xp-task .eval-input:focus,
.xp-task .clean-input:focus,
.xp-task .presenter-select:focus,
.xp-task .absent-select:focus,
.xp-task .score-input:focus,
.xp-task .eval-section select:focus:not(:focus-visible),
.xp-task .eval-section input:focus:not(:focus-visible),
.xp-task .presenter-select:focus:not(:focus-visible),
.xp-task .absent-select:focus:not(:focus-visible),
.xp-task .score-input:focus:not(:focus-visible) {
    outline: none;
    background: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.xp-task .eval-section input[readonly],
.xp-task .eval-input[readonly] {
    background-color: var(--tsurface-2);
    border-color: var(--tline-soft);
    color: var(--tink-muted);
}

/* Tables: calm headers, soft grid, row hover */
.xp-task .eval-table { border-radius: 12px; }
.xp-task .eval-table th {
    background: var(--tsurface-2);
    font-size: .72rem;
    letter-spacing: .05em;
    color: #3c4470;
    border-color: var(--tline-soft);
}
.xp-task .eval-table td { border-color: var(--tline-soft); }
.xp-task .eval-table tbody tr:hover > td { background: #f6f7fd; }
.xp-task .eval-table__group-row td,
.xp-task .group-row td {
    background: #e0e7ff;
    color: var(--tink-text);
    border-top-color: var(--tline-mid);
    border-bottom-color: var(--tline-mid);
}
.xp-task .cell-input:focus { background-color: #eef2ff; }

/* Buttons: confident radius + shadows, tactile press */
.xp-task .btn--primary {
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .28);
}
.xp-task .btn--primary:hover { box-shadow: 0 6px 18px rgba(79, 70, 229, .38); filter: none; background: var(--indigo-700); }
.xp-task .btn--success {
    border-radius: 12px;
    height: 48px;
    font-size: .95rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, .28);
}
.xp-task .btn--success:hover { box-shadow: 0 6px 18px rgba(16, 185, 129, .38); }
.xp-task .btn--danger { border-radius: 11px; }
.xp-task .btn:disabled { opacity: .65; cursor: progress; transform: none; }

/* Absent chips */
.xp-task .absent-tag {
    background: #e0e7ff;
    color: var(--indigo-700);
    border: 1px solid var(--peri-200);
    border-radius: var(--radius-pill);
    font-weight: 600;
}

/* Notes & status lines */
.xp-task .note--muted { color: var(--tink-muted); }
.xp-task .blinking-text { color: var(--color-primary); }

/* Summary pages: keep their print discipline, soften the shell only */
.xp-task.summary-body .eval-container { box-shadow: var(--telev-1); }

/* ==========================================================================
   8. SHARED UX WIDGETS — ux.js dialogs, toasts, empty states
   (Element+class selectors out-rank ux.js's runtime-injected sheet.)
   ========================================================================== */
dialog.ux-dialog {
    border-radius: 20px;
    box-shadow: var(--telev-3);
}
dialog.ux-dialog::backdrop {
    background: rgba(8, 11, 34, .5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
dialog.ux-dialog .ux-btn-confirm.safe  { background: var(--color-primary); }
dialog.ux-dialog .ux-btn-confirm.safe:hover { background: var(--indigo-700); }
div.ux-toast { border-radius: 12px; box-shadow: var(--telev-2); }
div.ux-empty .ux-empty-cta { background: var(--color-primary); border-radius: 10px; }
div.ux-empty .ux-empty-cta:hover { background: var(--indigo-700); }

/* ==========================================================================
   9. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .xp-ripple { animation: none; opacity: 0; }
    .xp-sky-rays, .xp-home-sky.is-night .xp-sky-stars circle { animation: none; }
    .btn, .btn--auth, .xp-row, .xp-row-glyph, .xp-row-arrow, .xp-fig,
    .xp-modcard, .xp-modcard-icon, .xp-modcard-open svg, .xp-tab, .upcoming-card,
    .layout-body .sidebar .sidebar-group > button,
    .layout-body .sidebar .sidebar-group > a,
    .layout-body .sidebar .sidebar-group-content a {
        transition: none !important;
    }
    .xp-row:hover, .xp-modcard:hover, .upcoming-card:hover,
    .layout-body .sidebar .sidebar-group > button:hover,
    .layout-body .sidebar .sidebar-group > a:hover,
    .layout-body .sidebar .sidebar-group-content a:hover { transform: none; }
    .xp-row:hover .xp-row-glyph, .xp-row:hover .xp-row-arrow,
    .xp-modcard:hover .xp-modcard-icon, .xp-modcard:hover .xp-modcard-open svg { transform: none; }
}
