:root {
    /* ── Brand ─────────────────────────────────────────── */
    --ui-brand:       #0f6bd7;
    --ui-brand-deep:  #0a4ea1;
    --ui-brand-soft:  rgba(15, 107, 215, 0.12);
    --ui-brand-hover: rgba(15, 107, 215, 0.08);

    /* ── Accent / State colours ─────────────────────────── */
    --ui-accent:      #f59e0b;
    --ui-accent-soft: rgba(245, 158, 11, 0.12);
    --ui-success:     #059669;
    --ui-success-soft:rgba(5, 150, 105, 0.11);
    --ui-danger:      #e11d48;
    --ui-danger-soft: rgba(225, 29, 72, 0.1);
    --ui-warn:        #d97706;
    --ui-warn-soft:   rgba(217, 119, 6, 0.1);

    /* ── Ink / Text ─────────────────────────────────────── */
    --ui-ink:         #0f172a;
    --ui-ink-2:       #1e293b;
    --ui-muted:       #475569;
    --ui-subtle:      #94a3b8;

    /* ── Surfaces ───────────────────────────────────────── */
    --ui-surface:        #ffffff;
    --ui-surface-2:      rgba(248, 250, 252, 0.95);
    --ui-surface-glass:  rgba(255, 255, 255, 0.82);
    --ui-panel:          rgba(255, 255, 255, 0.82);
    --ui-panel-strong:   rgba(255, 255, 255, 0.94);

    /* ── Borders ─────────────────────────────────────────── */
    --ui-line:        rgba(148, 163, 184, 0.22);
    --ui-line-solid:  #e2e8f0;
    --ui-line-brand:  rgba(15, 107, 215, 0.22);

    /* ── Elevation / Shadows ─────────────────────────────── */
    --ui-shadow:      0 18px 50px rgba(15, 23, 42, 0.08);
    --ui-shadow-sm:   0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 10px 32px rgba(15, 23, 42, 0.07);
    --ui-shadow-xs:   0 1px 3px rgba(15, 23, 42, 0.08);

    /* ── Radii ───────────────────────────────────────────── */
    --ui-radius-xl:   1.5rem;
    --ui-radius-lg:   1rem;
    --ui-radius-md:   0.75rem;
    --ui-radius-sm:   0.5rem;
    --ui-radius-pill: 999px;

    /* ── Typography ─────────────────────────────────────── */
    --ui-text-xs:     0.72rem;
    --ui-text-sm:     0.8125rem;
    --ui-text-base:   0.9375rem;
    --ui-text-lg:     1.125rem;
    --ui-text-xl:     1.375rem;
    --ui-text-2xl:    1.75rem;
    --ui-lh-tight:    1.25;
    --ui-lh-snug:     1.4;
    --ui-lh-normal:   1.625;

    /* ── Transitions ─────────────────────────────────────── */
    --ui-ease:        cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ui-dur-fast:    120ms;
    --ui-dur:         160ms;
    --ui-dur-slow:    280ms;
    --ui-transition:  var(--ui-dur) var(--ui-ease);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Accessible skip-link for keyboard navigation */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -4rem;
    z-index: 100;
    border-radius: 0.75rem;
    background: #0f172a;
    color: #fff;
    padding: 0.6rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    transition: top 140ms ease;
}

.skip-link:focus {
    top: 0.75rem;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(ellipse 90% 55% at 8% -8%, rgba(15, 107, 215, 0.2), transparent),
        radial-gradient(ellipse 55% 45% at 92% 6%,  rgba(99, 102, 241, 0.14), transparent),
        radial-gradient(ellipse 45% 55% at 78% 82%, rgba(245, 158, 11, 0.1), transparent),
        radial-gradient(ellipse 35% 30% at 20% 90%, rgba(16, 185, 129, 0.08), transparent),
        linear-gradient(180deg, #f4f8ff 0%, #f7f9fc 45%, #edf2f8 100%);
}

.app-shell {
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
}

.app-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(148, 163, 184, 0.22) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.4), transparent 62%);
}

.shell-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark__mark {
    display: block;
    height: 2.5rem;
    width: 2.5rem;
    flex: none;
}

.brand-mark__logo {
    display: block;
    height: 2rem;
    max-width: 8.25rem;
    width: auto;
}

.brand-mark__glyph {
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #0953a9 0%, var(--ui-brand) 55%, #4f9ef0 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(15, 107, 215, 0.4), inset 0 1px 0 rgba(255,255,255,0.18);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.surface-card {
    border: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--ui-shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-wrap: anywhere;
    transition: transform var(--ui-dur-slow) var(--ui-ease), box-shadow var(--ui-dur-slow) var(--ui-ease), border-color var(--ui-transition), background-color var(--ui-transition);
}

.surface-card-strong {
    border: 1px solid var(--ui-line);
    background: var(--ui-panel-strong);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.09);
    overflow-wrap: anywhere;
    transition: transform var(--ui-dur-slow) var(--ui-ease), box-shadow var(--ui-dur-slow) var(--ui-ease), border-color var(--ui-transition), background-color var(--ui-transition);
}

.hero-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(255,255,255,0.96) 0%, rgba(239,247,255,0.9) 100%);
    border: 1px solid rgba(15, 107, 215, 0.1);
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 24px 60px rgba(15, 107, 215, 0.09);
    transition: transform var(--ui-dur-slow) var(--ui-ease), box-shadow var(--ui-dur-slow) var(--ui-ease), border-color var(--ui-transition), background var(--ui-transition);
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(15, 107, 215, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-card::after {
    content: '';
    position: absolute;
    inset: auto -8rem -8rem auto;
    height: 18rem;
    width: 18rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 107, 215, 0.14), rgba(79, 70, 229, 0.06) 50%, transparent 68%);
    pointer-events: none;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.35rem;
    background: linear-gradient(180deg, var(--ui-brand), #7fc2ff);
}

.metric-card--amber::before {
    background: linear-gradient(180deg, var(--ui-accent), #fcd34d);
}

.metric-card--emerald::before {
    background: linear-gradient(180deg, #059669, #6ee7b7);
}

.metric-card--rose::before {
    background: linear-gradient(180deg, #e11d48, #fda4af);
}

.streak-summary-bar {
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: #fff6dd;
}

.nav-pill {
    border: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.72);
    transition: var(--ui-transition);
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
}

.nav-pill:hover {
    border-color: var(--ui-line-brand);
    background: var(--ui-brand-hover);
    color: var(--ui-brand-deep);
}

.nav-pill--active {
    border-color: var(--ui-line-brand);
    background: var(--ui-brand-soft);
    color: var(--ui-brand-deep);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 2.5rem;
    width: 2.5rem;
    min-width: 2.5rem;
    border-radius: 999px;
    border: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.74);
    color: var(--ui-muted);
    padding: 0;
    transition: background-color var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition), transform var(--ui-transition), box-shadow var(--ui-transition);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--ui-line-brand);
    background: var(--ui-brand-hover);
    color: var(--ui-brand-deep);
    box-shadow: var(--ui-shadow-xs);
}

.theme-toggle__icon {
    display: inline-flex;
    height: 1.1rem;
    width: 1.1rem;
    align-items: center;
    justify-content: center;
}

.theme-toggle__icon svg {
    height: 100%;
    width: 100%;
}

.theme-toggle__icon--moon {
    display: none;
}

.theme-toggle--mobile {
    align-self: flex-start;
}

.theme-toggle--sidebar {
    padding-inline: 0.75rem;
}

html[data-theme='dark'] .theme-toggle__icon--sun {
    display: none;
}

html[data-theme='dark'] .theme-toggle__icon--moon {
    display: inline-flex;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.8);
    padding: 0.45rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-muted);
}

.role-chip::before {
    content: '';
    height: 0.5rem;
    width: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ui-brand), #60a5fa);
}

.shell-sidebar {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(18px);
    transition: background-color var(--ui-transition), border-color var(--ui-transition), box-shadow var(--ui-dur-slow) var(--ui-ease), transform var(--ui-dur-slow) var(--ui-ease);
}

.app-two-column > * {
    min-width: 0;
}

.shell-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: var(--ui-radius-lg);
    padding: 0.8rem 1rem;
    font-weight: 700;
    color: var(--ui-muted);
    transition: var(--ui-transition);
    min-height: 2.75rem;
}

.shell-sidebar-link:focus-visible,
.action-tile:focus-visible,
.nav-pill:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(15, 107, 215, 0.45);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button:disabled,
input[type='submit']:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    filter: saturate(0.75);
}

[aria-busy='true'] {
    cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.shell-sidebar-link:hover {
    background: var(--ui-brand-hover);
    color: var(--ui-brand-deep);
}

.shell-sidebar-link--active {
    background: linear-gradient(135deg, rgba(15, 107, 215, 0.12), rgba(15, 107, 215, 0.2));
    color: var(--ui-brand-deep);
    box-shadow: inset 0 0 0 1px rgba(15, 107, 215, 0.1);
}

@media (hover: hover) {
    .surface-card:hover,
    .surface-card-strong:hover,
    .hero-card:hover,
    .shell-sidebar:hover {
        transform: translateY(-2px);
    }

    .surface-card:hover,
    .surface-card-strong:hover {
        box-shadow: 0 24px 58px rgba(15, 23, 42, 0.12);
    }

    .hero-card:hover {
        box-shadow: 0 10px 22px -2px rgba(15, 23, 42, 0.06), 0 28px 68px rgba(15, 107, 215, 0.12);
    }
}

.app-shell [data-ui-reveal='true'] {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
}

.app-shell.ui-ready [data-ui-reveal='true'] {
    opacity: 1;
    transform: none;
    transition: opacity 420ms var(--ui-ease), transform 420ms var(--ui-ease);
}

.app-shell.ui-ready [data-ui-reveal='true']:nth-child(2) {
    transition-delay: 60ms;
}

.app-shell.ui-ready [data-ui-reveal='true']:nth-child(3) {
    transition-delay: 110ms;
}

.app-shell.ui-ready [data-ui-reveal='true']:nth-child(4) {
    transition-delay: 150ms;
}

.shell-sidebar-link__badge {
    border-radius: 999px;
    background: rgba(15, 107, 215, 0.1);
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.form-shell {
    border: 1px solid var(--ui-line);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px);
}

.hero-split {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0b2440, #143e72 58%, #1d5eb0 100%);
    color: #e2e8f0;
}

.hero-split::after {
    content: '';
    position: absolute;
    inset: auto -3rem -4rem auto;
    height: 12rem;
    width: 12rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 65%);
}

.hero-bullet {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.hero-bullet__dot {
    margin-top: 0.35rem;
    height: 0.65rem;
    width: 0.65rem;
    flex: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #fde68a);
}

.action-tile {
    display: block;
    border-radius: 1.25rem;
    border: 1px solid var(--ui-line);
    background: var(--ui-surface-2);
    padding: 1rem;
    transition: var(--ui-transition);
}

.action-tile:hover {
    transform: translateY(-2px);
    border-color: var(--ui-line-brand);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

.data-table thead th {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: var(--ui-text-xs);
    color: var(--ui-muted);
}

.data-table tbody tr {
    transition: background-color var(--ui-dur-fast) var(--ui-ease);
}

.data-table tbody tr:hover {
    background: var(--ui-surface-2);
}

.fade-in-up {
    animation: fade-in-up 420ms var(--ui-ease) both;
}

.fade-in-up:nth-child(2) { animation-delay: 60ms; }
.fade-in-up:nth-child(3) { animation-delay: 110ms; }
.fade-in-up:nth-child(4) { animation-delay: 160ms; }

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1023px) {
    .shell-nav {
        position: static;
    }

    .app-two-column > .shell-sidebar {
        order: 2;
    }

    .app-two-column > :not(.shell-sidebar) {
        order: 1;
    }

    .shell-sidebar {
        border-radius: 1.25rem;
        padding: 0.85rem;
    }

    .shell-sidebar .sidebar-workspace-card {
        margin-bottom: 0.35rem;
    }

    .shell-sidebar ul {
        display: flex;
        gap: 0.6rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .shell-sidebar ul::-webkit-scrollbar {
        display: none;
    }

    .shell-sidebar ul li {
        flex: none;
    }

    .shell-sidebar-link {
        min-height: 42px;
        white-space: nowrap;
        border: 1px solid rgba(148, 163, 184, 0.18);
        background: rgba(255, 255, 255, 0.9);
        padding: 0.7rem 0.9rem;
    }

    .shell-sidebar-link__badge,
    .shell-sidebar .section-divider {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .tap-target {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .shell-sidebar-link {
        min-height: 46px;
        padding: 0.9rem 0.95rem;
    }

    .mobile-sticky-actions {
        position: sticky;
        bottom: 0.5rem;
        z-index: 10;
        border: 1px solid rgba(148, 163, 184, 0.22);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 12px 25px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(8px);
    }

    .brand-mark__glyph {
        height: 2rem;
        width: 2rem;
        border-radius: 0.7rem;
        font-size: 0.72rem;
    }

    .hero-card::after {
        height: 10rem;
        width: 10rem;
        inset: auto -4rem -5rem auto;
    }

    .action-tile {
        padding: 0.85rem;
    }

    .shell-sidebar .sidebar-workspace-card {
        display: none;
    }

    .shell-sidebar > p {
        display: none;
    }
}

    /* ── Scrollbar hide utility ─────────────────────────── */
    .scrollbar-hide {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .scrollbar-hide::-webkit-scrollbar {
        display: none;
    }

    /* ── Mobile bottom nav ───────────────────────────────── */
    :root {
        --mobile-nav-height: 4rem;
        --mobile-nav-offset: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    @media (max-width: 1023px) {
        body {
            padding-bottom: calc(var(--mobile-nav-offset) + 1.25rem);
        }

        .footer-with-mobile-nav {
            margin-bottom: calc(var(--mobile-nav-offset) + 0.75rem);
            padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        }

        .mobile-bottom-nav {
            height: var(--mobile-nav-offset);
        }

        .back-to-top-fab {
            right: 0.9rem;
            bottom: calc(var(--mobile-nav-offset) + 0.9rem);
            top: auto;
            transform: none;
        }
    }

    @media (min-width: 1024px) {
        .back-to-top-fab {
            right: 1.2rem;
            top: 62%;
            bottom: auto;
            transform: translateY(-50%);
        }
    }

    .back-to-top-fab {
        position: fixed;
        z-index: 60;
    }

    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        display: flex;
        align-items: stretch;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(148, 163, 184, 0.2);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        height: var(--mobile-nav-offset);
    }

    .mobile-bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        color: #94a3b8;
        font-size: 0.625rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        text-decoration: none;
        transition: color 150ms ease;
        padding: 0.4rem 0;
    }

    .mobile-bottom-nav__item svg {
        flex-shrink: 0;
        width: 1.5rem;
        height: 1.5rem;
    }

    .mobile-bottom-nav__item:hover {
        color: #0f6bd7;
    }

    .mobile-bottom-nav__item--active {
        color: #0f6bd7;
    }

    .mobile-bottom-nav__item--active svg {
        stroke-width: 2.2;
    }

    /* ── App toasts ─────────────────────────────────────────── */
    .app-toast-root {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 70;
        display: grid;
        gap: 0.6rem;
        pointer-events: none;
        width: min(92vw, 24rem);
    }

    .app-toast {
        border-radius: 0.9rem;
        border: 1px solid rgba(148, 163, 184, 0.25);
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 0.75rem 0.95rem;
        font-size: 0.82rem;
        font-weight: 600;
        color: #334155;
        transform: translateY(-8px);
        opacity: 0;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .app-toast.is-visible {
        transform: translateY(0);
        opacity: 1;
    }

    .app-toast--success {
        border-color: rgba(16, 185, 129, 0.35);
        color: #065f46;
        background: rgba(240, 253, 250, 0.96);
    }

    .app-toast--info {
        border-color: rgba(15, 107, 215, 0.28);
        color: #1e3a8a;
        background: rgba(239, 246, 255, 0.96);
    }

    .app-toast--warning {
        border-color: rgba(245, 158, 11, 0.38);
        color: #92400e;
        background: rgba(255, 251, 235, 0.97);
    }

    .app-toast--error {
        border-color: rgba(239, 68, 68, 0.35);
        color: #991b1b;
        background: rgba(254, 242, 242, 0.97);
    }

    @media (max-width: 640px) {
        .app-toast-root {
            top: 0.75rem;
            right: 0.75rem;
            left: 0.75rem;
            width: auto;
        }
    }

/* ──────────────────────────────────────────────────────────
   MODERN ADDITIONS
   ────────────────────────────────────────────────────────── */

/* Gradient clip text for hero headings */
.gradient-text {
    background: linear-gradient(135deg, #0953a9 0%, var(--ui-brand) 50%, #4f9ef0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Primary gradient CTA button */
.btn-gradient {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 9999px;
    background: linear-gradient(130deg, var(--ui-brand-deep) 0%, var(--ui-brand) 55%, #5aa5f8 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(15, 107, 215, 0.36), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
    text-decoration: none;
}

.btn-gradient:hover {
    box-shadow: 0 10px 26px rgba(15, 107, 215, 0.48), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
    filter: brightness(1.06);
}

html[data-theme='dark'] {
    --ui-brand-soft: rgba(96, 165, 250, 0.2);
    --ui-brand-hover: rgba(96, 165, 250, 0.14);
    --ui-brand-deep: #93c5fd;
    --ui-ink: #e2e8f0;
    --ui-ink-2: #cbd5e1;
    --ui-muted: #94a3b8;
    --ui-subtle: #64748b;
    --ui-surface: #0f172a;
    --ui-surface-2: rgba(15, 23, 42, 0.88);
    --ui-surface-glass: rgba(15, 23, 42, 0.76);
    --ui-panel: rgba(15, 23, 42, 0.84);
    --ui-panel-strong: rgba(15, 23, 42, 0.92);
    --ui-line: rgba(148, 163, 184, 0.18);
    --ui-line-solid: rgba(71, 85, 105, 0.82);
    --ui-line-brand: rgba(96, 165, 250, 0.28);
    --ui-shadow: 0 24px 64px rgba(2, 6, 23, 0.45);
    --ui-shadow-sm: 0 16px 44px rgba(2, 6, 23, 0.34);
    --ui-shadow-xs: 0 8px 22px rgba(2, 6, 23, 0.22);
}

html[data-theme='dark'] body {
    background:
        radial-gradient(ellipse 90% 55% at 8% -8%, rgba(59, 130, 246, 0.2), transparent),
        radial-gradient(ellipse 55% 45% at 92% 6%, rgba(56, 189, 248, 0.12), transparent),
        radial-gradient(ellipse 45% 55% at 78% 82%, rgba(245, 158, 11, 0.09), transparent),
        radial-gradient(ellipse 35% 30% at 20% 90%, rgba(16, 185, 129, 0.08), transparent),
        linear-gradient(180deg, #020617 0%, #081225 44%, #0f172a 100%);
    color: #e2e8f0;
}

html[data-theme='dark'] .app-shell::before {
    background-image: radial-gradient(circle, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
}

html[data-theme='dark'] .surface-card,
html[data-theme='dark'] .surface-card-strong,
html[data-theme='dark'] .shell-sidebar,
html[data-theme='dark'] .app-toast,
html[data-theme='dark'] .action-tile,
html[data-theme='dark'] .mobile-sticky-actions,
html[data-theme='dark'] .form-shell,
html[data-theme='dark'] .mobile-bottom-nav,
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .nav-pill,
html[data-theme='dark'] .role-chip {
    border-color: var(--ui-line);
    background: rgba(15, 23, 42, 0.84);
    color: #e2e8f0;
}

html[data-theme='dark'] .shell-nav {
    border-color: var(--ui-line);
    background: rgba(2, 6, 23, 0.8);
}


html[data-theme='dark'] .hero-card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.94) 0%, rgba(12, 32, 58, 0.92) 100%);
    border-color: rgba(96, 165, 250, 0.16);
}

html[data-theme='dark'] .hero-card::before {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.12) 0%, transparent 50%);
}

html[data-theme='dark'] .hero-card::after {
    background: radial-gradient(circle, rgba(96, 165, 250, 0.18), rgba(79, 70, 229, 0.08) 50%, transparent 68%);
}

html[data-theme='dark'] .shell-sidebar-link--active {
    color: #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}

html[data-theme='dark'] .bg-white,
html[data-theme='dark'] .bg-white\/60,
html[data-theme='dark'] .bg-white\/75,
html[data-theme='dark'] .bg-white\/80,
html[data-theme='dark'] .bg-white\/90,
html[data-theme='dark'] .bg-white\/95,
html[data-theme='dark'] .bg-slate-50,
html[data-theme='dark'] .bg-slate-50\/40,
html[data-theme='dark'] .bg-slate-100 {
    background-color: rgba(15, 23, 42, 0.84) !important;
}

html[data-theme='dark'] .bg-brand-50 {
    background-color: rgba(30, 64, 175, 0.3) !important;
}

html[data-theme='dark'] .bg-emerald-50 {
    background-color: rgba(6, 78, 59, 0.34) !important;
}

html[data-theme='dark'] .bg-amber-50 {
    background-color: rgba(120, 53, 15, 0.34) !important;
}

html[data-theme='dark'] .bg-rose-50 {
    background-color: rgba(136, 19, 55, 0.32) !important;
}

html[data-theme='dark'] .bg-indigo-50,
html[data-theme='dark'] .bg-indigo-50\/50,
html[data-theme='dark'] .bg-sky-50 {
    background-color: rgba(30, 41, 59, 0.9) !important;
}

html[data-theme='dark'] .border-slate-100,
html[data-theme='dark'] .border-slate-200,
html[data-theme='dark'] .border-slate-300 {
    border-color: rgba(71, 85, 105, 0.78) !important;
}

html[data-theme='dark'] .border-brand-200,
html[data-theme='dark'] .border-brand-300,
html[data-theme='dark'] .border-brand-400,
html[data-theme='dark'] .border-brand-500 {
    border-color: rgba(96, 165, 250, 0.35) !important;
}

html[data-theme='dark'] .border-emerald-100,
html[data-theme='dark'] .border-emerald-200,
html[data-theme='dark'] .border-emerald-300 {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

html[data-theme='dark'] .border-amber-100,
html[data-theme='dark'] .border-amber-200,
html[data-theme='dark'] .border-amber-300 {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

html[data-theme='dark'] .border-rose-200,
html[data-theme='dark'] .border-rose-300 {
    border-color: rgba(244, 63, 94, 0.3) !important;
}

html[data-theme='dark'] .text-slate-900,
html[data-theme='dark'] .text-slate-800 {
    color: #f8fafc !important;
}

html[data-theme='dark'] .text-slate-700 {
    color: #cbd5e1 !important;
}

html[data-theme='dark'] .text-slate-600 {
    color: #94a3b8 !important;
}

html[data-theme='dark'] .text-slate-500,
html[data-theme='dark'] .text-slate-400 {
    color: #64748b !important;
}

html[data-theme='dark'] .text-brand-700,
html[data-theme='dark'] .text-brand-800 {
    color: #93c5fd !important;
}

html[data-theme='dark'] .text-emerald-700,
html[data-theme='dark'] .text-emerald-800 {
    color: #86efac !important;
}

html[data-theme='dark'] .text-amber-700,
html[data-theme='dark'] .text-amber-800 {
    color: #fcd34d !important;
}

html[data-theme='dark'] .text-rose-700,
html[data-theme='dark'] .text-rose-800 {
    color: #fda4af !important;
}

html[data-theme='dark'] input:not([type='checkbox']):not([type='radio']):not([type='file']),
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    border-color: rgba(71, 85, 105, 0.82);
}

html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
    color: #64748b;
}

html[data-theme='dark'] .app-toast--success {
    background: rgba(6, 78, 59, 0.94);
    color: #bbf7d0;
}

html[data-theme='dark'] .app-toast--info {
    background: rgba(30, 64, 175, 0.9);
    color: #dbeafe;
}

html[data-theme='dark'] .app-toast--warning {
    background: rgba(120, 53, 15, 0.92);
    color: #fde68a;
}

html[data-theme='dark'] .app-toast--error {
    background: rgba(136, 19, 55, 0.92);
    color: #fecdd3;
}

html[data-theme='dark'] .mobile-bottom-nav__item {
    color: #94a3b8;
}

html[data-theme='dark'] .mobile-bottom-nav__item:hover,
html[data-theme='dark'] .mobile-bottom-nav__item--active {
    color: #93c5fd;
}

html[data-theme='dark'] .files-library-page .library-search-shell {
    background: rgba(15, 23, 42, 0.76);
    border-color: rgba(96, 165, 250, 0.2);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

html[data-theme='dark'] .files-library-page .library-stat-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(10, 18, 34, 0.96));
}

html[data-theme='dark'] .files-library-page .library-context-banner,
html[data-theme='dark'] .files-library-page .library-access-banner {
    border-color: rgba(96, 165, 250, 0.24) !important;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.28), rgba(12, 74, 110, 0.2)) !important;
    color: #dbeafe !important;
}

html[data-theme='dark'] .files-library-page .library-file-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(9, 16, 30, 0.98));
}

html[data-theme='dark'] .files-library-page .library-file-card:hover {
    box-shadow: 0 22px 52px rgba(2, 6, 23, 0.42);
}

html[data-theme='dark'] .files-library-page .library-inline-action {
    background: rgba(15, 23, 42, 0.78);
}

html[data-theme='dark'] .student-dashboard-page .dashboard-panel,
html[data-theme='dark'] .student-dashboard-page .dashboard-stat-card,
html[data-theme='dark'] .student-dashboard-page .dashboard-table-panel,
html[data-theme='dark'] .student-dashboard-page .dashboard-modal-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 15, 28, 0.98));
}

html[data-theme='dark'] .student-dashboard-page .dashboard-streak-panel {
    border-color: rgba(245, 158, 11, 0.22);
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.32), rgba(51, 65, 85, 0.88));
}

html[data-theme='dark'] .student-dashboard-page .dashboard-mini-panel,
html[data-theme='dark'] .student-dashboard-page .dashboard-soft-card,
html[data-theme='dark'] .student-dashboard-page .dashboard-progress-card {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(71, 85, 105, 0.74) !important;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-soft-card:hover {
    background: rgba(12, 32, 58, 0.82) !important;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-feature-panel {
    border-color: rgba(129, 140, 248, 0.28) !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(30, 27, 75, 0.88)) !important;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-progress-card--emerald {
    background: rgba(6, 78, 59, 0.34) !important;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-progress-card--amber {
    background: rgba(120, 53, 15, 0.34) !important;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-progress-card--sky {
    background: rgba(12, 74, 110, 0.34) !important;
    border-color: rgba(56, 189, 248, 0.28) !important;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-data-table thead,
html[data-theme='dark'] .student-dashboard-page .dashboard-data-table tbody {
    background: transparent;
}

html[data-theme='dark'] .student-dashboard-page .dashboard-data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.46);
}

html[data-theme='dark'] .study-packs-page .study-packs-hero {
    border-color: rgba(129, 140, 248, 0.26) !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(30, 27, 75, 0.88)) !important;
}

html[data-theme='dark'] .study-packs-page .study-packs-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 15, 28, 0.98));
}

html[data-theme='dark'] .study-packs-page .study-packs-soft-panel,
html[data-theme='dark'] .study-packs-page .study-pack-card {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(71, 85, 105, 0.74) !important;
}

html[data-theme='dark'] .study-packs-page .study-pack-card:hover {
    background: rgba(23, 37, 84, 0.82) !important;
}

html[data-theme='dark'] .study-packs-page .study-packs-selected-panel {
    border-color: rgba(129, 140, 248, 0.28) !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(30, 27, 75, 0.84)) !important;
}

html[data-theme='dark'] .study-packs-page input[type='file'] {
    background: rgba(15, 23, 42, 0.92);
    color: #cbd5e1;
    border-color: rgba(71, 85, 105, 0.82);
}

html[data-theme='dark'] .exams-page .exam-hero-card,
html[data-theme='dark'] .question-bank-page .question-bank-hero {
    border-color: rgba(129, 140, 248, 0.26) !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(30, 27, 75, 0.88)) !important;
}

html[data-theme='dark'] .exams-page .exam-stat-card,
html[data-theme='dark'] .question-bank-page .question-bank-stat-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(8, 15, 28, 0.98));
}

html[data-theme='dark'] .exams-page .exam-panel,
html[data-theme='dark'] .exams-page .exam-table-panel,
html[data-theme='dark'] .question-bank-page .question-bank-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 15, 28, 0.98));
}

html[data-theme='dark'] .exams-page .exam-soft-panel,
html[data-theme='dark'] .exams-page .exam-review-card,
html[data-theme='dark'] .exams-page .exam-student-card,
html[data-theme='dark'] .question-bank-page .question-bank-soft-panel,
html[data-theme='dark'] .question-bank-page .question-bank-mobile-card {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(71, 85, 105, 0.74) !important;
}

html[data-theme='dark'] .exams-page .exam-review-card:hover,
html[data-theme='dark'] .exams-page .exam-student-card:hover,
html[data-theme='dark'] .question-bank-page .question-bank-mobile-card:hover {
    background: rgba(12, 32, 58, 0.82) !important;
}

html[data-theme='dark'] .exams-page .exam-data-table thead,
html[data-theme='dark'] .exams-page .exam-data-table tbody,
html[data-theme='dark'] .question-bank-page .question-bank-table thead,
html[data-theme='dark'] .question-bank-page .question-bank-table tbody {
    background: transparent;
}

html[data-theme='dark'] .exams-page .exam-data-table tbody tr:hover,
html[data-theme='dark'] .question-bank-page .question-bank-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.46);
}

html[data-theme='dark'] .exams-page button:hover,
html[data-theme='dark'] .exams-page a:hover,
html[data-theme='dark'] .question-bank-page button:hover,
html[data-theme='dark'] .question-bank-page a:hover {
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
}

html[data-theme='dark'] .exams-page button:focus-visible,
html[data-theme='dark'] .exams-page a:focus-visible,
html[data-theme='dark'] .exams-page input:focus-visible,
html[data-theme='dark'] .exams-page select:focus-visible,
html[data-theme='dark'] .exams-page textarea:focus-visible,
html[data-theme='dark'] .question-bank-page button:focus-visible,
html[data-theme='dark'] .question-bank-page a:focus-visible,
html[data-theme='dark'] .question-bank-page input:focus-visible,
html[data-theme='dark'] .question-bank-page select:focus-visible,
html[data-theme='dark'] .question-bank-page textarea:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* ─── Exam Attempts page ──────────────────────────────────────────────────── */
html[data-theme='dark'] .exam-attempts-page .attempts-hero {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-attempts-page .attempts-hero h1,
html[data-theme='dark'] .exam-attempts-page .attempts-hero p {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page .attempts-hero .font-display {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-stat-card {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-stat-card p.text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page .attempts-stat-card p.text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-chart-card {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-attempts-page .attempts-chart-card h2 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel h2 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel .text-slate-600,
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel .bg-slate-100 {
    background: rgba(30, 41, 59, 0.5);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel .bg-slate-50 {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel .text-slate-500.text-xs {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page .attempts-data-panel .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-mobile-card {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-attempts-page .attempts-mobile-card:hover {
    background: rgba(30, 41, 59, 0.6);
}
html[data-theme='dark'] .exam-attempts-page .attempts-mobile-card .text-slate-800,
html[data-theme='dark'] .exam-attempts-page .attempts-mobile-card .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-mobile-card .text-slate-500,
html[data-theme='dark'] .exam-attempts-page .attempts-mobile-card .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page .attempts-table thead {
    border-color: var(--ui-border);
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page .attempts-table tbody tr {
    border-color: rgba(51, 65, 85, 0.5);
}
html[data-theme='dark'] .exam-attempts-page .attempts-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.46);
}
html[data-theme='dark'] .exam-attempts-page .attempts-table .text-slate-800 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-attempts-page .attempts-table .text-slate-600,
html[data-theme='dark'] .exam-attempts-page .attempts-table .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-attempts-page button:focus-visible,
html[data-theme='dark'] .exam-attempts-page a:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* ─── Exam Result page ────────────────────────────────────────────────────── */
html[data-theme='dark'] .exam-result-page .result-hero {
    background: var(--ui-surface-card-strong, var(--ui-surface-card));
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-result-page .result-hero .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-result-page .result-hero .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-result-page .result-question-card {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-result-page .result-question-card .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-result-page .result-question-card .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-result-page .result-question-card .bg-slate-50 {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-result-page button:focus-visible,
html[data-theme='dark'] .exam-result-page a:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* ─── Exam Take page ──────────────────────────────────────────────────────── */
html[data-theme='dark'] .exam-take-page .take-hero {
    background: var(--ui-surface-card-strong, var(--ui-surface-card));
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-take-page .take-hero .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-take-page .take-hero .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-take-page .take-hero .bg-slate-50 {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-take-page .take-hero .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-take-page .take-question-card {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-take-page .take-question-card .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-take-page .take-question-card .text-slate-500,
html[data-theme='dark'] .exam-take-page .take-question-card .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-take-page .take-question-card label {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-take-page .take-question-card label:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(59, 130, 246, 0.45);
}
html[data-theme='dark'] .exam-take-page .take-question-card label span.bg-white {
    background: var(--ui-surface-card);
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-take-page .take-submit-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-take-page .take-submit-panel .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-take-page .take-submit-panel .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-take-page .take-navigator {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-take-page .take-navigator .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-take-page .take-navigator .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-take-page .take-navigator .bg-slate-50 {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-take-page button:focus-visible,
html[data-theme='dark'] .exam-take-page a:focus-visible,
html[data-theme='dark'] .exam-take-page input:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* ─── Student Analytics page ─────────────────────────────────────────────── */
html[data-theme='dark'] .student-analytics-page .analytics-header-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .student-analytics-page .analytics-header-panel .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-header-panel .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page .analytics-header-panel form {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .student-analytics-page .analytics-header-panel input[type='date'],
html[data-theme='dark'] .student-analytics-page .analytics-header-panel select {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-stat-card {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .student-analytics-page .analytics-stat-card p.text-slate-500,
html[data-theme='dark'] .student-analytics-page .analytics-stat-card p.text-xs {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page .analytics-stat-card p.text-slate-900,
html[data-theme='dark'] .student-analytics-page .analytics-stat-card p.text-3xl,
html[data-theme='dark'] .student-analytics-page .analytics-stat-card p.text-2xl {
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-chart-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .student-analytics-page .analytics-chart-panel h2,
html[data-theme='dark'] .student-analytics-page .analytics-chart-panel .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-chart-panel .text-slate-600,
html[data-theme='dark'] .student-analytics-page .analytics-chart-panel .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page .analytics-data-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .student-analytics-page .analytics-data-panel h2 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-data-panel .text-slate-600,
html[data-theme='dark'] .student-analytics-page .analytics-data-panel .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page .analytics-data-panel .bg-slate-100 {
    background: rgba(30, 41, 59, 0.5);
}
html[data-theme='dark'] .student-analytics-page .analytics-mobile-card {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .student-analytics-page .analytics-mobile-card:hover {
    background: rgba(30, 41, 59, 0.6);
}
html[data-theme='dark'] .student-analytics-page .analytics-mobile-card .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-mobile-card .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page .analytics-table thead {
    border-color: var(--ui-border);
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page .analytics-table tbody tr {
    border-color: rgba(51, 65, 85, 0.5);
}
html[data-theme='dark'] .student-analytics-page .analytics-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.46);
}
html[data-theme='dark'] .student-analytics-page .analytics-table .text-slate-800 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .student-analytics-page .analytics-table .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .student-analytics-page button:focus-visible,
html[data-theme='dark'] .student-analytics-page a:focus-visible,
html[data-theme='dark'] .student-analytics-page input:focus-visible,
html[data-theme='dark'] .student-analytics-page select:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* ─── Teacher Analytics page ─────────────────────────────────────────────── */
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-panel .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-panel .text-slate-600,
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-panel .text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-panel .bg-slate-100 {
    background: rgba(30, 41, 59, 0.5);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-stat-card {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-stat-card p.text-slate-500 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-stat-card p.text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-table thead {
    border-color: var(--ui-border);
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-table tbody tr {
    border-color: rgba(51, 65, 85, 0.5);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.46);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-table .text-slate-800 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .teacher-analytics-page .teacher-analytics-table .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .teacher-analytics-page button:focus-visible,
html[data-theme='dark'] .teacher-analytics-page a:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* ─── Exam Edit page ─────────────────────────────────────────────────────── */
html[data-theme='dark'] .exam-edit-page .exam-edit-hero {
    background: rgba(49, 46, 129, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-hero .text-indigo-700 {
    color: rgba(165, 180, 252, 0.9);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-hero .text-slate-900 {
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-hero .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel {
    background: var(--ui-surface-card);
    border-color: var(--ui-border);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel label {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel input,
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel select,
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel textarea {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--ui-border);
    color: var(--ui-ink);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel input:focus,
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel select:focus,
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel textarea:focus {
    border-color: rgba(96, 165, 250, 0.6);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel .bg-slate-50 {
    background: rgba(30, 41, 59, 0.4);
    border-color: var(--ui-border);
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-edit-page .exam-edit-form-panel .text-slate-600 {
    color: var(--ui-ink-muted);
}
html[data-theme='dark'] .exam-edit-page button:focus-visible,
html[data-theme='dark'] .exam-edit-page a:focus-visible,
html[data-theme='dark'] .exam-edit-page input:focus-visible,
html[data-theme='dark'] .exam-edit-page select:focus-visible,
html[data-theme='dark'] .exam-edit-page textarea:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.78);
    outline-offset: 2px;
}

/* Stat icon orb */
.stat-orb {
    display: inline-flex;
    height: 2.75rem;
    width: 2.75rem;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    margin-bottom: 0.65rem;
}

/* Feature icon orb - used in 3-col feature section */
.feature-orb {
    display: flex;
    height: 3.5rem;
    width: 3.5rem;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 1.1rem;
    margin-bottom: 1rem;
}

/* File type icon orb */
.file-type-orb {
    display: flex;
    height: 2.75rem;
    width: 2.75rem;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
}

/* Nav icons inside sidebar links */
.shell-sidebar-link .nav-icon {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    opacity: 0.55;
    transition: opacity 160ms ease;
}

.shell-sidebar-link:hover .nav-icon,
.shell-sidebar-link--active .nav-icon {
    opacity: 1;
}

/* Pill filter tabs */
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.72);
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 150ms ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 2.5rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.subject-filter-tab {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: min(100%, 16rem);
    text-align: center;
    line-height: 1.2;
}

.filter-tab:hover {
    border-color: rgba(15, 107, 215, 0.32);
    background: rgba(15, 107, 215, 0.06);
    color: var(--ui-brand-deep);
}

.filter-tab--active {
    border-color: rgba(15, 107, 215, 0.38);
    background: rgba(15, 107, 215, 0.1);
    color: var(--ui-brand-deep);
    box-shadow: inset 0 0 0 1px rgba(15, 107, 215, 0.1);
}

.filter-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-toolbar__status {
    display: none;
    align-items: center;
    gap: 0.45rem;
    border-radius: 9999px;
    border: 1px solid rgba(15, 107, 215, 0.18);
    background: rgba(239, 246, 255, 0.9);
    color: #1d4ed8;
    padding: 0.45rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.filter-toolbar__status::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: currentColor;
    opacity: 0.8;
}

.loading-surface {
    position: relative;
    overflow: hidden;
}

.loading-surface::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    animation: ui-shimmer 1.35s infinite;
    pointer-events: none;
}

@keyframes ui-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 640px) {
    .horizontal-chip-strip {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .horizontal-chip-strip::-webkit-scrollbar {
        display: none;
    }

    .horizontal-chip-strip > * {
        scroll-snap-align: start;
        flex: none;
    }

    .mobile-card-scroller {
        display: grid !important;
        grid-auto-flow: column;
        grid-auto-columns: minmax(16rem, 84%);
        overflow-x: auto;
        scroll-snap-type: x proximity;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }

    .mobile-card-scroller::-webkit-scrollbar {
        display: none;
    }

    .mobile-card-scroller > * {
        scroll-snap-align: start;
    }
}

/* On phones in landscape, switch the horizontal carousel to a 2-column grid */
@media (max-width: 640px) and (orientation: landscape) {
    .mobile-card-scroller {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(2, 1fr);
        overflow-x: visible;
        padding-bottom: 0;
        scroll-snap-type: none;
    }

    .mobile-card-scroller > * {
        scroll-snap-align: none;
    }
}

/* Pagination pills */
.page-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    transition: all 150ms ease;
    padding: 0 0.65rem;
    text-decoration: none;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.page-pill:hover {
    border-color: rgba(15, 107, 215, 0.36);
    background: rgba(15, 107, 215, 0.07);
    color: var(--ui-brand-deep);
}

.page-pill--active {
    background: linear-gradient(135deg, var(--ui-brand-deep), var(--ui-brand));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(15, 107, 215, 0.36);
}

.page-pill--disabled {
    pointer-events: none;
    opacity: 0.38;
}

/* Subtle divider with gradient fade */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3) 30%, rgba(148, 163, 184, 0.3) 70%, transparent);
    margin: 0.5rem 0;
}

/* Glow badge - replaces plain rounded-full tags in featured areas */
.glow-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Sidebar workspace card upgraded */
.sidebar-workspace-card {
    background: linear-gradient(145deg, #0b2440 0%, #143e72 60%, #1a56a8 100%);
    border-radius: 1.25rem;
    padding: 1.1rem 1.1rem 1rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.sidebar-workspace-card::after {
    content: '';
    position: absolute;
    inset: auto -3rem -3rem auto;
    width: 9rem;
    height: 9rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 65%);
    pointer-events: none;
}

/* Input and select modern style */
.form-input-modern {
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    color: #0f172a;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    outline: none;
    width: 100%;
}

.form-input-modern:focus {
    border-color: rgba(15, 107, 215, 0.5);
    box-shadow: 0 0 0 3px rgba(15, 107, 215, 0.1);
}

@media (max-width: 640px) {
    .brand-mark__logo {
        height: 1.75rem;
        max-width: 7.25rem;
    }

    .brand-mark__glyph {
        height: 2rem;
        width: 2rem;
        border-radius: 0.7rem;
        font-size: 0.72rem;
    }

    .hero-card::after {
        height: 10rem;
        width: 10rem;
        inset: auto -4rem -5rem auto;
    }

    .action-tile {
        padding: 0.85rem;
    }
}