/* ============================================================
   Design System — 2026 premium dashboard theme
   Layered on top of Bootstrap 5 so every existing screen inherits
   it automatically via standard classes (.card, .btn, .table, ...).
   ============================================================ */

:root {
    /* Primary brand = teal/emerald, matching the reference UI's active-nav and
       hero-banner accent; --accent-500 stays blue for primary CTA buttons
       ("Give Feedback", "Create Survey") exactly as in the reference screens. */
    --brand-50:  #ecfdf5;
    --brand-100: #d1fae5;
    --brand-400: #34d399;
    --brand-500: #10b981;
    --brand-600: #0d9488;
    --brand-700: #0f766e;

    --accent-500: #2563eb;
    --accent-600: #1d4ed8;

    --success-500: #10b981;
    --danger-500:  #ef4444;
    --warning-500: #f59e0b;
    --info-500:    #3b82f6;

    /* Pastel icon-tint pairs used by .stat-icon-* — matches the soft
       purple/peach/green/blue circular icon chips in the reference cards. */
    --tint-purple-bg: #ede9fe; --tint-purple-fg: #7c3aed;
    --tint-peach-bg:  #ffedd5; --tint-peach-fg:  #f97316;
    --tint-green-bg:  #d1fae5; --tint-green-fg:  #059669;
    --tint-blue-bg:   #dbeafe; --tint-blue-fg:   #2563eb;
    --tint-amber-bg:  #fef3c7; --tint-amber-fg:  #d97706;

    --bg-canvas:   #f6f8fb;
    --bg-surface:  #ffffff;
    --bg-surface-2: #f8f9fe;
    --bg-sidebar:  #101a2e;
    --bg-sidebar-hover: rgba(255,255,255,0.07);

    --text-primary:   #14152b;
    --text-secondary: #5b5e78;
    --text-muted:     #8a8da8;
    --text-inverse:   #f4f5fb;

    --border-subtle: rgba(20, 21, 43, 0.08);
    --border-strong: rgba(20, 21, 43, 0.14);

    --shadow-sm: 0 1px 2px rgba(20, 21, 43, 0.06);
    --shadow-md: 0 6px 20px -4px rgba(20, 21, 43, 0.10), 0 2px 6px -2px rgba(20,21,43,0.06);
    --shadow-lg: 0 20px 40px -12px rgba(20, 21, 43, 0.18);
    --shadow-glow: 0 0 0 1px rgba(16,185,129,0.15), 0 8px 24px -6px rgba(16,185,129,0.30);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 150ms;
    --dur-base: 260ms;
    --dur-slow: 420ms;

    color-scheme: light;
}

[data-theme="dark"] {
    --bg-canvas:   #0c0d1a;
    --bg-surface:  #14152b;
    --bg-surface-2: #191a33;
    --bg-sidebar:  #0a0b16;
    --bg-sidebar-hover: rgba(255,255,255,0.06);

    --text-primary:   #eef0fb;
    --text-secondary: #b7bad6;
    --text-muted:     #7c7fa0;
    --text-inverse:   #14152b;

    --border-subtle: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.14);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
    --shadow-md: 0 10px 28px -6px rgba(0,0,0,0.55), 0 2px 8px -2px rgba(0,0,0,0.4);
    --shadow-lg: 0 24px 48px -12px rgba(0,0,0,0.65);

    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-canvas);
    color: var(--text-primary);
    transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; font-weight: 700; color: var(--text-primary); }
p, span, td, th, label, div { color: inherit; }
.text-muted { color: var(--text-muted) !important; }

a { color: var(--brand-600); }
[data-theme="dark"] a { color: var(--brand-400); }

/* ---------- Layout chrome ---------- */
.app-shell { min-height: 100vh; background: var(--bg-canvas); }

.app-sidebar {
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #17182f 100%);
    color: var(--text-inverse);
    position: relative;
    transition: width var(--dur-base) var(--ease-out);
}
.app-sidebar::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(600px 200px at 0% 0%, rgba(99,102,241,0.25), transparent 60%);
    pointer-events: none;
}
.app-sidebar .brand {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px;
}
.app-sidebar .brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-glow);
    font-weight: 800; color: #fff; flex-shrink: 0;
    overflow: hidden; object-fit: cover;
}
.app-sidebar .nav-section-title {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.38);
    margin: 1.1rem 0 0.35rem;
    padding: 0 0.6rem;
}
.app-sidebar .nav-link-item {
    display: flex; align-items: center; gap: 10px;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.87rem;
    margin-bottom: 2px;
    position: relative;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.app-sidebar .nav-link-item:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
    transform: translateX(2px);
}
.app-sidebar .nav-link-item.is-active {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.app-sidebar .nav-link-item .icon { width: 18px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.app-sidebar .nav-link-item.is-disabled {
    color: rgba(255,255,255,0.32);
    cursor: default;
}
.app-sidebar .badge-soon {
    font-size: 0.6rem;
    padding: 0.2em 0.5em;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    border-radius: 999px;
    margin-left: auto;
}

.app-topbar {
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky; top: 0; z-index: 20;
    padding-right: 1rem !important;
}

.theme-toggle {
    width: 38px; height: 38px; border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-2);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
    color: var(--text-secondary);
}
.theme-toggle:hover { transform: translateY(-1px) rotate(-8deg); box-shadow: var(--shadow-md); }

.app-main { animation: page-in var(--dur-slow) var(--ease-out); }
@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card.glass {
    background: color-mix(in srgb, var(--bg-surface) 70%, transparent) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}
.stat-card {
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.stat-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: #fff; box-shadow: var(--shadow-glow);
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; }

/* Flat pastel icon chips — matches the soft purple/peach/green/blue circular
   icons in the reference dashboard cards, used instead of the default gradient
   chip when a card wants that specific look (e.g. dashboard stat rows). */
.stat-icon-flat {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon-flat.tint-purple { background: var(--tint-purple-bg); color: var(--tint-purple-fg); }
.stat-icon-flat.tint-peach  { background: var(--tint-peach-bg);  color: var(--tint-peach-fg); }
.stat-icon-flat.tint-green  { background: var(--tint-green-bg);  color: var(--tint-green-fg); }
.stat-icon-flat.tint-blue   { background: var(--tint-blue-bg);   color: var(--tint-blue-fg); }
.stat-icon-flat.tint-amber  { background: var(--tint-amber-bg);  color: var(--tint-amber-fg); }

/* Tinted card variants — light background wash instead of a plain white card,
   used for the dashboard stat row (Active Assessments / Pending / Completed). */
.tint-card {
    border-radius: var(--radius-md); padding: 1.1rem 1.25rem; position: relative; overflow: hidden;
    border: 1px solid rgba(20,21,43,0.06);
    box-shadow: 0 1px 3px rgba(20,21,43,0.04);
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.tint-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -6px rgba(20,21,43,0.10); }
.tint-card.tint-purple { background: var(--tint-purple-bg); }
.tint-card.tint-peach  { background: var(--tint-peach-bg); }
.tint-card.tint-green  { background: var(--tint-green-bg); }
.tint-card.tint-blue   { background: var(--tint-blue-bg); }
.tint-card .tint-value { font-size: 1.9rem; font-weight: 800; color: var(--text-primary); }
.tint-card .tint-label { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); }
.tint-card .tint-meta { font-size: 0.78rem; color: var(--text-secondary); }

/* Hero greeting banner (dashboard top) — soft tinted panel with a rounded
   illustration slot, matching the "Good Afternoon, {name}" banner pattern. */
.hero-banner {
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, var(--tint-green-bg) 0%, var(--bg-surface) 75%);
    border: 1px solid var(--border-subtle);
    padding: 1.75rem 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.hero-banner .hero-illustration {
    width: 96px; height: 96px; border-radius: 24px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2.4rem;
    box-shadow: var(--shadow-glow);
}
.hero-banner h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.hero-banner .hero-eyebrow { color: var(--text-secondary); font-size: 0.95rem; margin: 0 0 2px; }
.hero-banner .hero-sub { color: var(--text-secondary); font-size: 0.9rem; margin: 4px 0 0; }
.hero-banner .hero-chip {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); padding: 0.7rem 1.1rem;
    display: flex; align-items: center; gap: 0.6rem; margin-left: auto;
    box-shadow: var(--shadow-sm);
    min-width: 0; /* let its own text ellipsize/wrap instead of forcing the row wider */
}
.hero-chip > div { min-width: 0; }
.hero-chip > div > div { overflow-wrap: anywhere; }
@media (max-width: 576px) {
    .hero-banner { padding: 1.25rem; gap: 1rem; }
    .hero-banner .hero-illustration { width: 64px; height: 64px; font-size: 1.6rem; border-radius: 16px; }
    .hero-banner h1 { font-size: 1.2rem; }
    .hero-banner .hero-chip { margin-left: 0; width: 100%; }
}

/* ---------- Responsive root-cause fix: flex children must be allowed to shrink ----------
   Bootstrap's .flex-grow-1 (and any flex item) defaults to min-width:auto, which means it
   refuses to shrink below its own content's natural width. A flex row holding a fixed-size
   icon/badge next to a text block (question cards, list rows, profile headers, etc.) will
   force the WHOLE PAGE wider than the viewport on mobile once the text is long enough —
   this is the actual cause of most "not responsive on phones" symptoms in this app, not a
   missing media query. Fixing it here, once, fixes it everywhere the pattern is used. */
html, body { overflow-x: hidden; max-width: 100%; }
.d-flex > * { min-width: 0; }
.d-flex { min-width: 0; }


.topbar-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 480px;
    align-items: center;
}
.topbar-search i { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.topbar-search .form-control {
    padding-left: 2.4rem;
    border-radius: 999px !important;
    background: var(--bg-surface-2) !important;
}
.btn-icon-flat {
    width: 38px; height: 38px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-subtle); background: var(--bg-surface);
    color: var(--text-secondary);
}
.btn-icon-flat:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.avatar-circle {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: #fff; font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topbar-account-btn {
    border: 1px solid var(--border-subtle) !important;
    border-radius: 999px !important;
    background: var(--bg-surface) !important;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem !important;
    color: var(--text-primary) !important;
}
.topbar-account-btn:hover { background: var(--bg-surface-2) !important; }


.btn { border-radius: var(--radius-sm) !important; font-weight: 600; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out); }
.btn:active { transform: scale(0.97); }
.btn-primary {
    /* Reference UI uses blue for primary actions (Give Feedback / Create Survey) while
       teal is reserved for the active nav pill and status accents — accent-500 is that blue. */
    background: linear-gradient(135deg, var(--accent-600), var(--accent-500)) !important;
    border: none !important;
    box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent-500) 45%, transparent);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline-secondary, .btn-outline-primary {
    border-color: var(--border-strong) !important;
    color: var(--text-secondary) !important;
}
.btn-outline-secondary:hover { background: var(--bg-surface-2) !important; color: var(--text-primary) !important; }

/* ---------- Forms ---------- */
.form-control, .form-select {
    background: var(--bg-surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-500) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent) !important;
    background: var(--bg-surface) !important;
}
.form-label { color: var(--text-secondary); }

/* ---------- Tables ---------- */
.table { color: var(--text-primary); }
.table thead.table-light th, .table > :not(caption) > * > th {
    background: var(--bg-surface-2) !important;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-subtle) !important;
}
.table-hover > tbody > tr:hover > * { background: var(--bg-surface-2) !important; }
.table > :not(caption) > * > * { border-bottom-color: var(--border-subtle) !important; }

/* ---------- Badges / alerts ---------- */
.badge { border-radius: 999px; font-weight: 600; }
.alert { border: none !important; border-radius: var(--radius-sm) !important; }

/* ---------- Toasts (form submission feedback) ---------- */
#toast-stack {
    position: fixed;
    top: 1rem; right: 1rem;
    z-index: 1080;
    display: flex; flex-direction: column; gap: 0.6rem;
    width: min(360px, calc(100vw - 2rem));
}
.app-toast {
    display: flex; align-items: flex-start; gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
    animation: toast-in var(--dur-base) var(--ease-out);
}
.app-toast.is-leaving { animation: toast-out var(--dur-base) var(--ease-out) forwards; }
.app-toast .toast-icon {
    width: 26px; height: 26px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.8rem; flex-shrink: 0; margin-top: 1px;
}
.app-toast.success .toast-icon { background: var(--success-500); }
.app-toast.error .toast-icon   { background: var(--danger-500); }
.app-toast.warning .toast-icon { background: var(--warning-500); }
.app-toast.info .toast-icon    { background: var(--info-500); }
.app-toast .toast-body { font-size: 0.86rem; color: var(--text-primary); line-height: 1.35; }
.app-toast .toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; line-height: 1; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

/* ---------- Skeleton loaders ---------- */
.skeleton {
    position: relative; overflow: hidden;
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
}
.skeleton::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-muted) 22%, transparent), transparent);
    animation: skeleton-sheen 1.4s infinite;
}
@keyframes skeleton-sheen {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ---------- Button submit / loading state ---------- */
.btn.is-loading { pointer-events: none; opacity: 0.85; position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: "";
    position: absolute; left: 50%; top: 50%;
    width: 16px; height: 16px; margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    animation: btn-spin 0.6s linear infinite;
}
.btn-outline-secondary.is-loading::after, .btn-outline-primary.is-loading::after {
    border-color: color-mix(in srgb, var(--text-primary) 30%, transparent);
    border-top-color: var(--text-primary);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Star rating (kept from original, restyled) ---------- */
.star-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-rating .star-input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-rating .star-label {
    font-size: 2rem; line-height: 1; color: var(--border-strong);
    cursor: pointer; user-select: none; padding: 4px;
    transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.star-rating .star-input:checked ~ .star-label,
.star-rating .star-label:hover,
.star-rating .star-label:hover ~ .star-label {
    color: var(--warning-500);
    transform: scale(1.08);
}

/* ---------- Page header component ---------- */
.page-header { display: flex; align-items: center; gap: 12px; }
.page-header-icon {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
    color: #fff; font-size: 1rem;
    box-shadow: var(--shadow-glow);
}
.page-header h1 i, h1 > i.bi, .page-header-icon-inline { color: var(--brand-600); }
[data-theme="dark"] .page-header h1 i, [data-theme="dark"] h1 > i.bi, [data-theme="dark"] .page-header-icon-inline { color: var(--brand-400); }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2rem; opacity: 0.5; display: block; margin-bottom: 0.5rem; }


/* ---------- Student dashboard: assessment sidebar + detail panel ---------- */
.student-dash { display: flex; gap: 1.25rem; align-items: flex-start; }
.student-dash-sidebar {
    width: 260px; flex-shrink: 0;
    background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    padding: 0.6rem; box-shadow: var(--shadow-sm);
    position: sticky; top: 76px;
}
.student-dash-sidebar .item {
    display: block; width: 100%; text-align: left; border: none; background: transparent;
    padding: 0.65rem 0.75rem; border-radius: var(--radius-sm); cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
    margin-bottom: 3px;
}
.student-dash-sidebar .item:hover { background: var(--bg-surface-2); }
.student-dash-sidebar .item.is-active {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); color: #fff;
    box-shadow: var(--shadow-glow);
}
.student-dash-sidebar .item .item-name { font-weight: 600; font-size: 0.88rem; display: block; }
.student-dash-sidebar .item .item-meta { font-size: 0.74rem; opacity: 0.8; }
.student-dash-sidebar .item.is-active .item-meta { color: rgba(255,255,255,0.85); }
.student-dash-content { flex: 1; min-width: 0; }
.student-dash-panel { display: none; }
.student-dash-panel.is-active { display: block; animation: fade-up var(--dur-base) var(--ease-out) both; }

@media (max-width: 767.98px) {
    .student-dash { flex-direction: column; }
    .student-dash-sidebar {
        width: 100%; position: static;
        display: flex; overflow-x: auto; gap: 6px; padding: 0.5rem;
    }
    .student-dash-sidebar .item { flex-shrink: 0; width: auto; white-space: nowrap; margin-bottom: 0; }
}

/* Sequential question numbering on the feedback form */
.question-sno {
    width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0;
    background: var(--bg-surface-2); border: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; color: var(--text-secondary);
}

/* A required question the student skipped — visible until they answer it, never clears their other answers */
.question-card.is-missing {
    border: 1.5px solid var(--danger-500) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-500) 15%, transparent);
    animation: shake-once 320ms ease-in-out;
}
@keyframes shake-once {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---------- Print styles (shared by any page with a Print Report button) ---------- */
@media print {
    .app-sidebar, .app-topbar, .no-print, .offcanvas, #toast-stack { display: none !important; }
    .app-main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
    .app-shell { display: block !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    .report-chart-canvas-wrap { break-inside: avoid; }
    a[href]::after { content: none !important; }
}

.fade-up { animation: fade-up var(--dur-slow) var(--ease-out) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Scrollbar (webkit) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 991.98px) {
    .stat-card .stat-value { font-size: 1.35rem; }
}
