/* Schoolhouse — XTX "calm cards" style. One accent hue re-tints everything; dark mode redefines surface and ink tokens. */
@font-face { font-family:'Plus Jakarta Sans'; src:url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2'); font-weight:400 700; font-display:swap; }

:root {
  color-scheme:light;
  --accent-h:152; --accent-s:58%;
  --a-900:hsl(var(--accent-h) var(--accent-s) 14%);
  --a-700:hsl(var(--accent-h) var(--accent-s) 24%);
  --a-600:hsl(var(--accent-h) var(--accent-s) 30%);
  --a-500:hsl(var(--accent-h) var(--accent-s) 38%);
  --a-300:hsl(var(--accent-h) calc(var(--accent-s) - 8%) 62%);
  --a-100:hsl(var(--accent-h) 40% 93%);
  --a-ink:var(--a-600);
  --canvas:#EEF1EF; --shell:#F7F8F7; --card:#FFFFFF; --sunk:#F2F4F3; --hover:#F5F7F6;
  --line:#E4E8E6; --line-strong:#CDD3D0;
  --ink:#141917; --ink-2:#4F5A55; --ink-3:#67716C;
  --crit:#C2362B; --crit-bg:#FCEBE9; --warn:#926400; --warn-bg:#FBF1DC; --good:#1E7A45; --good-bg:#E5F4EA; --info-bg:#EAF1F6; --info:#3C5A70;
  --hatch:repeating-linear-gradient(135deg,var(--line-strong) 0 2px,transparent 2px 7px);
  --r-xl:22px; --r-lg:16px; --r-md:12px; --r-sm:9px; --r-pill:999px; --tap:44px;
  --sh:0 1px 2px rgba(20,25,23,.04),0 8px 24px -16px rgba(20,25,23,.18);
  --sh-lift:0 2px 4px rgba(20,25,23,.05),0 18px 40px -20px rgba(20,25,23,.28);
  --sh-accent:0 8px 20px -10px hsl(var(--accent-h) var(--accent-s) 24% / .55);
  --ease:cubic-bezier(.2,.8,.2,1);
  --focus:hsl(var(--accent-h) 60% 45%);
  font-family:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif; font-size:16px; color:var(--ink); background:var(--canvas);
  font-synthesis:none; text-rendering:optimizeLegibility; -webkit-font-smoothing:antialiased;
}
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) {
  color-scheme:dark;
  --a-100:hsl(var(--accent-h) 30% 18%); --a-ink:var(--a-300);
  --canvas:#0C0F0E; --shell:#121715; --card:#181D1B; --sunk:#1F2522; --hover:#202724;
  --line:#2A312E; --line-strong:#3B4440;
  --ink:#EEF2F0; --ink-2:#B9C2BE; --ink-3:#97A29D;
  --crit:#F08A80; --crit-bg:#3A1D1A; --warn:#E8BE62; --warn-bg:#352A12; --good:#74D19B; --good-bg:#16301F; --info-bg:#1B2A35; --info:#A9C6DB;
  --sh:0 1px 2px rgba(0,0,0,.3),0 8px 24px -16px rgba(0,0,0,.6); --sh-lift:0 18px 40px -20px rgba(0,0,0,.7);
  --focus:hsl(var(--accent-h) 55% 60%);
} }
:root[data-theme="dark"] {
  color-scheme:dark;
  --a-100:hsl(var(--accent-h) 30% 18%); --a-ink:var(--a-300);
  --canvas:#0C0F0E; --shell:#121715; --card:#181D1B; --sunk:#1F2522; --hover:#202724;
  --line:#2A312E; --line-strong:#3B4440;
  --ink:#EEF2F0; --ink-2:#B9C2BE; --ink-3:#97A29D;
  --crit:#F08A80; --crit-bg:#3A1D1A; --warn:#E8BE62; --warn-bg:#352A12; --good:#74D19B; --good-bg:#16301F; --info-bg:#1B2A35; --info:#A9C6DB;
  --sh:0 1px 2px rgba(0,0,0,.3),0 8px 24px -16px rgba(0,0,0,.6); --sh-lift:0 18px 40px -20px rgba(0,0,0,.7);
  --focus:hsl(var(--accent-h) 55% 60%);
}

/* Base */
* { box-sizing:border-box; }
body { margin:0; background:var(--canvas); color:var(--ink); }
button,input,select,textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.55; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
#main:focus,#main:focus-visible { outline:none; }
a { color:var(--a-ink); }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:clamp(1.65rem,2.6vw,1.9rem); letter-spacing:-.03em; font-weight:700; line-height:1.15; margin-bottom:8px; }
h2 { font-size:1.08rem; letter-spacing:-.015em; font-weight:700; margin-bottom:6px; }
h3 { font-size:1rem; font-weight:650; margin-bottom:6px; }
p { line-height:1.6; }
small,.text-small { font-size:.8125rem; }
.muted { color:var(--ink-3); }
.eyebrow { text-transform:uppercase; letter-spacing:.12em; font-size:.6875rem; font-weight:700; color:var(--a-ink); margin-bottom:10px; display:block; }
.icon { width:20px; height:20px; flex:none; display:block; }
.number,.stat-value,.data-table td { font-variant-numeric:tabular-nums; }
[hidden] { display:none!important; }
.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; }
.full { grid-column:1/-1; }
.skip-link { position:fixed; top:8px; left:8px; transform:translateY(-150%); z-index:100; background:var(--card); color:var(--ink); padding:12px 16px; border:2px solid var(--a-500); border-radius:var(--r-md); }
.skip-link:focus { transform:none; }

/* Shell: three floating panels on a soft canvas */
.shell { min-height:100vh; display:grid; grid-template-columns:248px minmax(0,1fr); gap:14px; padding:14px; }
.sidebar { background:var(--card); border-radius:var(--r-xl); box-shadow:var(--sh); padding:22px 14px 16px; display:flex; flex-direction:column; position:sticky; top:14px; height:calc(100vh - 28px); overflow-y:auto; }
.brand { display:flex; align-items:center; gap:11px; font-weight:700; font-size:1.12rem; letter-spacing:-.02em; text-decoration:none; color:var(--ink); margin:0 8px 22px; }
.brand .logo { width:38px; height:38px; flex:none; }
.brand .muted { display:block; font-size:.7rem; font-weight:500; letter-spacing:0; margin-top:2px; }
.school-switch { display:flex; gap:10px; align-items:center; font-size:.8125rem; padding:10px; margin:0 0 18px; background:var(--sunk); border-radius:var(--r-md); }
.school-switch strong { display:block; font-weight:650; }
.school-switch small { display:block; margin-top:2px; color:var(--ink-3); }
.nav-label { color:var(--ink-3); font-size:.6875rem; font-weight:700; text-transform:uppercase; letter-spacing:.12em; margin:14px 12px 6px; }
.sidebar nav { display:flex; flex-direction:column; gap:2px; }
.nav-button { position:relative; display:flex; align-items:center; gap:12px; width:100%; min-height:var(--tap); background:transparent; border:0; text-align:left; padding:10px 12px; border-radius:var(--r-md); color:var(--ink-2); font-size:.9rem; font-weight:550; transition:background-color 180ms var(--ease),color 180ms var(--ease); }
.nav-button .icon { width:19px; height:19px; }
.nav-button.active,.nav-button[aria-current=page] { color:var(--ink); font-weight:700; background:var(--a-100); }
.nav-button.active::before { content:''; position:absolute; left:-14px; top:10px; bottom:10px; width:4px; border-radius:0 4px 4px 0; background:var(--a-500); }
.nav-button.active .icon { color:var(--a-ink); }
.sidebar-footer { margin-top:auto; padding-top:16px; font-size:.8125rem; line-height:1.55; color:var(--ink-3); }
.term-card { position:relative; overflow:hidden; padding:16px; border-radius:var(--r-lg); color:#fff; background:radial-gradient(120% 120% at 100% 0%,var(--a-600) 0%,var(--a-900) 70%); }
.term-card::after { content:''; position:absolute; right:-40px; top:-40px; width:140px; height:140px; border-radius:50%; border:1px solid rgba(255,255,255,.14); box-shadow:0 0 0 18px rgba(255,255,255,.04),0 0 0 36px rgba(255,255,255,.03); pointer-events:none; }
.term-card > span,.term-card > strong { display:block; position:relative; }
.term-card .eyebrow { color:hsl(var(--accent-h) 60% 80%); margin-bottom:6px; }
.term-card strong { font-size:1.05rem; color:#fff; }
.term-card span:last-child { color:rgba(255,255,255,.78); }
.demo-caption { font-size:.75rem; line-height:1.6; color:var(--ink-3); margin:12px 4px 0; }

.workspace,.main-content { min-width:0; display:flex; flex-direction:column; gap:14px; }
.topbar { background:var(--card); border-radius:var(--r-xl); box-shadow:var(--sh); min-height:72px; display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 14px 12px 24px; position:sticky; top:14px; z-index:5; }
.breadcrumb { margin:0; font-size:.875rem; color:var(--ink-3); display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.breadcrumb strong { color:var(--ink); font-weight:650; }
.topbar-actions,.user-info { display:flex; align-items:center; gap:8px; }
.icon-button { width:var(--tap); height:var(--tap); border-radius:50%; border:1px solid var(--line); background:var(--card); color:var(--ink-2); display:grid; place-items:center; transition:background-color 180ms var(--ease),transform 150ms var(--ease); }
.icon-button:active { transform:scale(.95); }
.profile { display:flex; align-items:center; gap:10px; font-size:.875rem; text-align:right; background:transparent; border:0; padding:4px 4px 4px 12px; border-radius:var(--r-pill); min-height:var(--tap); color:var(--ink); }
.profile strong { display:block; font-weight:650; }
.profile small { display:block; color:var(--ink-3); margin-top:1px; }
.avatar { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:var(--a-100); color:var(--a-ink); font-size:.8125rem; font-weight:700; flex:none; }
.page { width:100%; max-width:1440px; margin:0 auto; padding:26px 26px 40px; background:var(--shell); border-radius:var(--r-xl); flex:1; }
.page-footer { padding:0 12px 4px; color:var(--ink-3); font-size:.75rem; }

/* Page heading */
.page-heading { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:24px; }
.page-heading h1 { font-size:clamp(1.7rem,2.6vw,1.9rem); }
.page-heading p { margin:0; color:var(--ink-2); font-size:.9375rem; max-width:68ch; }
.workspace-banner { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; margin:-8px 0 18px; color:var(--ink-3); font-size:.8125rem; }
.workspace-banner span { display:inline-flex; align-items:center; gap:8px; }
.workspace-banner span:first-child::before { content:''; width:8px; height:8px; border-radius:50%; background:var(--a-500); box-shadow:0 0 0 4px var(--a-100); }

/* Buttons: pill, 44px */
.button { border:1.5px solid var(--line-strong); background:var(--card); color:var(--ink); min-height:var(--tap); padding:9px 18px; border-radius:var(--r-pill); font-size:.875rem; font-weight:650; display:inline-flex; gap:8px; align-items:center; justify-content:center; text-decoration:none; line-height:1.25; transition:background-color 180ms var(--ease),border-color 180ms var(--ease),box-shadow 180ms var(--ease),transform 150ms var(--ease); white-space:nowrap; }
.button .icon { width:17px; height:17px; }
.button:active:not(:disabled) { transform:scale(.97); }
.button.primary { background:linear-gradient(160deg,var(--a-500),var(--a-700)); border-color:transparent; color:#fff; box-shadow:var(--sh-accent); }
.button.secondary { background:var(--card); }
.button.danger { background:var(--crit); border-color:transparent; color:#fff; }
.button.danger-outline { color:var(--crit); border-color:color-mix(in srgb,var(--crit) 45%,transparent); background:var(--card); }
.button.ghost { border-color:transparent; background:transparent; }
.button.small { min-height:36px; padding:6px 13px; font-size:.8125rem; }
.row-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.quick-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }

/* Cards */
.panel { background:var(--card); border-radius:var(--r-lg); box-shadow:var(--sh); overflow:hidden; margin-bottom:18px; }
.panel-header { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 22px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.panel-header h2,.panel-header h3 { margin:0; }
.panel-header p { margin:4px 0 0; font-size:.8125rem; color:var(--ink-3); }
.panel-body { padding:18px 22px; }
.dashboard-body { padding:16px 22px 22px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(280px,1fr); gap:18px; align-items:start; }
.dashboard-grid > .panel { margin:0; }
.dashboard-grid + .panel { margin-top:18px; }
.dashboard-list { display:grid; margin-bottom:16px; }
.dashboard-list > div { display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:var(--tap); padding:10px 0; border-bottom:1px solid var(--line); font-size:.875rem; color:var(--ink-2); }
.dashboard-list strong { text-align:right; flex-shrink:0; color:var(--ink); font-variant-numeric:tabular-nums; }
.dashboard-body > p.muted { font-size:.8125rem; margin:14px 0 0; }

/* KPI tiles: one hero per row */
.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.dashboard-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.stat-card { position:relative; overflow:hidden; background:var(--card); border-radius:var(--r-lg); box-shadow:var(--sh); padding:18px 20px; min-width:0; display:flex; flex-direction:column; }
.stat-card > span { font-size:.875rem; color:var(--ink-2); font-weight:550; }
.stat-card > small { color:var(--ink-3); }
.stat-value { display:block; font-size:2.1rem; line-height:1.15; font-weight:700; letter-spacing:-.03em; overflow-wrap:anywhere; margin:10px 0 6px; color:var(--ink); }
.stat-grid > .stat-card:first-child { background:linear-gradient(160deg,var(--a-600),var(--a-900)); color:#fff; box-shadow:var(--sh-accent); }
.stat-grid > .stat-card:first-child > span,.stat-grid > .stat-card:first-child > small { color:rgba(255,255,255,.8); }
.stat-grid > .stat-card:first-child .stat-value { color:#fff; }
.stat-grid > .stat-card:first-child::after { content:''; position:absolute; right:-50px; bottom:-60px; width:170px; height:170px; border-radius:50%; border:1px solid rgba(255,255,255,.12); box-shadow:0 0 0 20px rgba(255,255,255,.035),0 0 0 40px rgba(255,255,255,.025); pointer-events:none; }

/* Hero card (active term) */
.hero-card { position:relative; overflow:hidden; display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,340px); gap:24px; align-items:center; padding:24px 26px; margin-bottom:18px; border-radius:var(--r-lg); color:#fff; background:radial-gradient(130% 140% at 100% 0%,var(--a-600) 0%,var(--a-900) 72%); box-shadow:var(--sh-accent); }
.hero-card::after { content:''; position:absolute; right:-70px; top:-90px; width:260px; height:260px; border-radius:50%; border:1px solid rgba(255,255,255,.12); box-shadow:0 0 0 26px rgba(255,255,255,.035),0 0 0 52px rgba(255,255,255,.025); pointer-events:none; }
.hero-card > * { position:relative; }
.hero-card .eyebrow { color:hsl(var(--accent-h) 60% 80%); }
.hero-card h2 { font-size:1.5rem; letter-spacing:-.02em; margin:0 0 4px; }
.hero-card p { margin:0; color:rgba(255,255,255,.8); }
.hero-card .stat-value { color:#fff; font-size:1.7rem; margin:0 0 10px; }
.hero-card small { color:rgba(255,255,255,.78); }
.hero-card .progress-track { background:rgba(255,255,255,.18); }
.hero-card .progress-bar { background:#fff; }
.hero-card.quiet { display:block; color:var(--ink); background:var(--card); box-shadow:var(--sh); border:1.5px dashed var(--line-strong); }
.hero-card.quiet::after { display:none; }
.hero-card.quiet .eyebrow { color:var(--a-ink); }
.hero-card.quiet p { color:var(--ink-2); }
.progress-track { height:8px; background:var(--sunk); border-radius:var(--r-pill); overflow:hidden; margin:10px 0; }
.progress-bar { height:100%; background:var(--a-500); border-radius:var(--r-pill); transform-origin:left; }

/* Tables */
.table-wrap { overflow-x:auto; }
.data-table { border-collapse:collapse; width:100%; font-size:.875rem; text-align:left; }
.data-table th { position:sticky; top:0; padding:11px 22px; background:var(--sunk); color:var(--ink-3); font-size:.75rem; font-weight:650; text-transform:uppercase; letter-spacing:.06em; white-space:nowrap; border-bottom:1px solid var(--line); }
.data-table td { padding:12px 22px; height:60px; border-bottom:1px solid var(--line); vertical-align:middle; color:var(--ink); }
.data-table tr:last-child td { border-bottom:0; }
.data-table td small { display:block; margin-top:3px; color:var(--ink-3); }
.data-table td strong { font-weight:650; }
.data-table .number { white-space:nowrap; }
.data-table select { min-height:40px; }
.stale { opacity:.5; transition:opacity 200ms var(--ease); pointer-events:none; }
.student-cell { display:flex; gap:12px; align-items:center; min-width:170px; }
.student-cell strong { display:block; font-weight:650; }
.student-avatar { width:38px; height:38px; flex:none; border-radius:50%; background:var(--a-100); color:var(--a-ink); display:grid; place-items:center; font-size:.75rem; font-weight:700; }

/* Status pills: always a word, never colour alone */
.badge { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; padding:4px 10px; border-radius:var(--r-pill); font-size:.75rem; font-weight:650; background:var(--sunk); color:var(--ink-2); border:1px solid var(--line); }
.badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.8; }
.badge.success { background:var(--good-bg); color:var(--good); border-color:transparent; }
.badge.warning { background:var(--warn-bg); color:var(--warn); border-color:transparent; }
.badge.danger { background:var(--crit-bg); color:var(--crit); border-color:transparent; }
.badge.neutral { background:var(--info-bg); color:var(--info); border-color:transparent; }
.badge.muted { background:transparent; color:var(--ink-3); }

/* Forms */
.toolbar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:14px; margin-bottom:6px; }
.toolbar .field { margin:0; min-width:170px; flex:0 1 auto; }
.toolbar input[type=search] { min-width:min(300px,100%); }
.panel > .toolbar { padding:16px 22px; margin:0; border-bottom:1px solid var(--line); }
.panel > .toolbar > .muted { margin-left:auto; padding-bottom:12px; font-size:.8125rem; }
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; font-size:.875rem; font-weight:600; color:var(--ink); }
.field small { font-weight:500; }
input,select,textarea { border:1.5px solid var(--line-strong); background:var(--card); color:var(--ink); min-height:var(--tap); padding:10px 13px; border-radius:var(--r-md); min-width:0; max-width:100%; font-size:.9375rem; font-weight:500; transition:border-color 160ms var(--ease),box-shadow 160ms var(--ease); }
input:hover,select:hover,textarea:hover { border-color:var(--ink-3); }
input:focus-visible,select:focus-visible,textarea:focus-visible { outline:none; border-color:var(--a-500); box-shadow:0 0 0 4px var(--a-100); }
input[aria-invalid=true],select[aria-invalid=true] { border-color:var(--crit); }
input::placeholder,textarea::placeholder { color:var(--ink-3); opacity:.85; }
input[type=number] { max-width:180px; }
input[type=file] { min-height:auto; border-style:dashed; }
input:autofill,input:-webkit-autofill,textarea:-webkit-autofill { box-shadow:inset 4px 0 0 var(--a-500),inset 0 0 0 40px var(--card)!important; -webkit-text-fill-color:var(--ink)!important; caret-color:var(--ink); }
textarea { resize:vertical; min-height:110px; }
.field input,.field select,.field textarea { width:100%; max-width:none; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.form-grid > p { grid-column:1/-1; font-size:.875rem; }
.access-fieldset,fieldset { border:1px solid var(--line); border-radius:var(--r-md); margin:0 0 16px; padding:12px 14px; min-width:0; }
legend { font-size:.875rem; font-weight:650; padding:0 6px; }
.access-check { display:flex; align-items:center; gap:10px; min-height:40px; padding:4px 2px; font-size:.875rem; font-weight:500; cursor:pointer; }
.access-check input { width:20px; height:20px; min-height:0; flex:none; accent-color:var(--a-500); }
.error-message,.form-error { display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap; color:var(--crit); background:var(--crit-bg); border-radius:var(--r-md); padding:12px 14px; font-size:.875rem; font-weight:550; margin:12px 0; }
.error-message::before { content:'!'; flex:none; width:20px; height:20px; border-radius:50%; display:grid; place-items:center; background:var(--crit); color:var(--card); font-size:.75rem; font-weight:800; }
.registry-note { background:var(--a-100); color:var(--ink-2); padding:14px 18px; border-radius:var(--r-md); font-size:.875rem; line-height:1.6; margin-bottom:18px; }
.form-help { margin:0 0 16px; font-size:.8125rem; color:var(--ink-3); }

/* Inline field errors (F2) and filter chips (L2) */
.field-error { display:flex; gap:6px; align-items:flex-start; color:var(--crit); font-size:.8125rem; font-weight:600; line-height:1.4; }
.field-error::before { content:'!'; flex:none; width:16px; height:16px; margin-top:1px; border-radius:50%; display:grid; place-items:center; background:var(--crit); color:var(--card); font-size:.625rem; font-weight:800; }
.filter-chips { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px 22px; border-bottom:1px solid var(--line); }
.chip { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:6px 10px 6px 14px; border-radius:var(--r-pill); border:1px solid transparent; background:var(--a-100); color:var(--ink); font-size:.8125rem; font-weight:600; }
.chip .icon { width:15px; height:15px; color:var(--ink-2); }
@media (hover:hover) { .chip:hover { border-color:var(--a-300); } }
.stage-chips { padding:0 0 14px; border:0; } .chip.active { background:var(--a-600); color:#fff; } .chip span { font-variant-numeric:tabular-nums; opacity:.8; } .chip[data-zero]:not(.active) { background:var(--sunk); color:var(--ink-3); }
.application-detail fieldset { margin:14px 0; }

/* Segmented tabs */
.tabs { display:inline-flex; gap:4px; padding:4px; margin:0 0 18px; background:var(--sunk); border-radius:var(--r-pill); max-width:100%; overflow-x:auto; scrollbar-width:none; }
.tab { border:0; background:transparent; min-height:40px; padding:8px 16px; border-radius:var(--r-pill); font-size:.875rem; font-weight:650; color:var(--ink-2); white-space:nowrap; transition:background-color 180ms var(--ease),color 180ms var(--ease); }
.tab.active { background:var(--card); color:var(--ink); box-shadow:var(--sh); }
.inline-flow { display:inline-flex; align-items:center; gap:6px; } .inline-flow .icon { width:16px; height:16px; color:var(--ink-3); }
.promotion-group h3 { display:flex; align-items:center; gap:8px; padding:14px 22px 6px; margin:0; } .promotion-group h3 .icon { width:16px; height:16px; color:var(--ink-3); }
.compact-stats { margin:0; } .compact-stats .stat-card:first-child { background:var(--card); color:var(--ink); box-shadow:var(--sh); } .compact-stats .stat-card:first-child::after { display:none; } .compact-stats .stat-card:first-child > span { color:var(--ink-2); } .compact-stats .stat-card:first-child > small { color:var(--ink-3); } .compact-stats .stat-card:first-child .stat-value { color:var(--ink); }

/* Finance */
.panel.attention { box-shadow:var(--sh),inset 4px 0 0 var(--warn); }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--crit); margin-left:6px; vertical-align:middle; }
.statement-balance { text-align:right; } .statement-balance span { display:block; font-size:.75rem; color:var(--ink-3); text-transform:uppercase; letter-spacing:.06em; font-weight:650; } .statement-balance strong { font-size:1.4rem; font-variant-numeric:tabular-nums; }
.statement-invoice { padding:16px 22px; border-bottom:1px solid var(--line); } .statement-invoice .dashboard-list { margin:10px 0 0; }
.statement-row { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:var(--tap); padding:6px 0; } .statement-row small { display:block; color:var(--ink-3); }
.receipt { border:1.5px dashed var(--line-strong); border-radius:var(--r-md); padding:6px 0; } .receipt-head { display:flex; justify-content:space-between; align-items:center; padding:12px 22px 0; } .receipt-head span { font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--a-ink); }
.receipt-amount { font-size:1.6rem; font-weight:700; font-variant-numeric:tabular-nums; }
.naira-echo { font-weight:600; color:var(--a-ink); }

/* Report cards */
.report-card { background:var(--card); border-radius:var(--r-lg); box-shadow:var(--sh); overflow:hidden; }
.report-card section { border-top:1px solid var(--line); } .report-card section > h2 { padding:16px 22px 4px; margin:0; }
.report-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-end; padding:24px 22px; background:linear-gradient(160deg,var(--a-100),transparent); }
.report-head h1 { margin:0 0 4px; } .report-head p { margin:0; color:var(--ink-2); }
.report-average { text-align:right; } .report-average span { display:block; font-size:.75rem; font-weight:650; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); } .report-average strong { font-size:2.2rem; font-variant-numeric:tabular-nums; }
.report-split { display:grid; grid-template-columns:1fr 1.4fr; } .report-split > div { padding:0 22px 20px; } .report-split h2 { margin:16px 0 6px; }
.comment { padding:10px 0; border-bottom:1px solid var(--line); } .comment > span { font-size:.75rem; font-weight:650; color:var(--ink-3); text-transform:uppercase; letter-spacing:.06em; } .comment p { margin:4px 0 0; }
.grade-key { padding:0 22px 14px; margin:8px 0 0; }
.card-actions { margin-bottom:14px; }
.band-row { display:grid; grid-template-columns:110px 130px 1fr; gap:12px; }
@media (max-width:820px) { .report-split { grid-template-columns:1fr; } .report-head { flex-direction:column; align-items:flex-start; } .report-average { text-align:left; } .band-row { grid-template-columns:1fr 1fr; } .band-row .field:last-child { grid-column:1/-1; } }

/* Mark sheets */
.mark-grid input.mark { width:88px; min-height:40px; text-align:right; font-variant-numeric:tabular-nums; padding:8px 10px; }
.mark-grid select { min-height:40px; } .mark-grid td { height:56px; }
.mark-grid input[aria-invalid=true] { border-color:var(--crit); background:var(--crit-bg); }
.cell-error { display:block; color:var(--crit); font-weight:600; font-size:.75rem; min-height:0; }
.cell-error:empty { display:none; }
.sheet-actions { justify-content:flex-end; }

/* Row "More" menu: rare actions stay one tap away without crowding the row */
.row-menu { position:relative; } .row-menu summary { list-style:none; cursor:pointer; } .row-menu summary::-webkit-details-marker { display:none; }
.row-menu[open] .row-menu-list { position:absolute; right:0; top:calc(100% + 6px); z-index:6; min-width:200px; display:flex; flex-direction:column; align-items:stretch; padding:6px; background:var(--card); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--sh-lift); }
.row-menu-list .button { justify-content:flex-start; width:100%; } .danger-text { color:var(--crit); }

/* School profile and logo */
.school-logo { width:38px; height:38px; object-fit:contain; border-radius:var(--r-sm); background:#fff; flex:none; }
.school-logo.large { width:96px; height:96px; } .school-logo.placeholder { display:grid; place-items:center; color:var(--ink-3); background:var(--sunk); border:1.5px dashed var(--line-strong); font-size:.8rem; }
.logo-row { display:flex; gap:18px; align-items:center; flex-wrap:wrap; margin-bottom:12px; }
.report-school { display:flex; gap:12px; align-items:center; } .report-school small { display:block; } .report-head { flex-wrap:wrap; }
/* Long admin menus: tighter rows so the term card stays visible */
.sidebar .nav-button { min-height:40px; padding:8px 12px; } .sidebar .nav-label { margin:10px 12px 4px; }

.offline-banner { position:sticky; top:0; z-index:40; padding:10px 16px; text-align:center; background:var(--warn-bg); color:var(--warn); font-weight:650; font-size:.875rem; }

/* Help and onboarding */
.help-panel h3 { margin:14px 0 6px; } .help-panel ul { padding-left:1.2em; margin:0; } .help-panel li { margin-bottom:6px; line-height:1.55; } .help-panel details { margin-top:12px; } .help-panel summary { cursor:pointer; font-weight:650; min-height:var(--tap); display:flex; align-items:center; }
.onboarding .progress-track { margin:0 22px; } .onboarding-steps { list-style:none; margin:0; padding:10px 22px 18px; display:grid; gap:4px; }
.onboarding-steps li { display:flex; align-items:center; gap:12px; min-height:var(--tap); } .onboarding-steps li > span:nth-of-type(1),.onboarding-steps li > span:nth-child(2) { flex:1; }
.onboarding-steps li.done { color:var(--ink-3); } .onboarding-steps li.done .icon { color:var(--good); } .step-dot { width:18px; height:18px; border-radius:50%; border:2px solid var(--line-strong); flex:none; }

/* Messages */
.nav-count { margin-left:auto; min-width:22px; height:22px; padding:0 6px; border-radius:var(--r-pill); background:var(--a-600); color:#fff; font-size:.75rem; font-weight:700; display:grid; place-items:center; }
.thread-list { list-style:none; margin:0; padding:0; } .thread-row { display:flex; gap:12px; align-items:center; width:100%; padding:12px 22px; min-height:64px; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; color:var(--ink); }
.thread-row.unread strong { font-weight:800; } .thread-main { flex:1; min-width:0; } .thread-main strong,.thread-main small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .thread-main small,.thread-meta small { color:var(--ink-3); } .thread-meta { text-align:right; display:flex; flex-direction:column; gap:4px; align-items:flex-end; }
@media (hover:hover) { .thread-row:hover { background:var(--hover); } }
.message-list { list-style:none; margin:0; padding:16px 22px; display:grid; gap:14px; } .message-list li { max-width:min(640px,88%); } .message-list li.mine { justify-self:end; text-align:right; }
.bubble { display:inline-block; padding:10px 14px; border-radius:16px 16px 16px 4px; background:var(--sunk); text-align:left; } .mine .bubble { border-radius:16px 16px 4px 16px; background:var(--a-100); } .bubble p { margin:0; white-space:pre-line; } .message-list small { display:block; margin-top:4px; color:var(--ink-3); }
.reply-form { border-top:1px solid var(--line); } .reply-form .field { margin-bottom:10px; }

/* Timetable */
.week-grid th[scope=row] { white-space:nowrap; } .week-grid th small { display:block; font-weight:500; text-transform:none; letter-spacing:0; }
.week-grid td { padding:6px; height:auto; min-width:110px; vertical-align:top; } .week-grid td small { display:block; color:var(--ink-3); }
.week-grid td.clash { background:var(--crit-bg); box-shadow:inset 3px 0 0 var(--crit); } .break-row td,.break-row th { background:var(--sunk); color:var(--ink-3); text-align:center; font-size:.8125rem; }
.cell-button { width:100%; min-height:56px; padding:8px; border:1px dashed var(--line-strong); border-radius:var(--r-sm); background:transparent; text-align:left; color:var(--ink); }
.cell-button:has(strong) { border-style:solid; border-color:var(--line); background:var(--card); } .cover-note { color:var(--warn)!important; font-weight:650; }
@media (hover:hover) { .cell-button:hover { border-color:var(--a-300); background:var(--hover); } }
.period-row { display:grid; grid-template-columns:1.2fr 1fr 1fr auto; gap:10px; align-items:end; } @media (max-width:820px) { .period-row { grid-template-columns:1fr 1fr; } }

.link-button { border:0; background:none; padding:0; color:var(--a-ink); font-weight:650; text-align:left; text-decoration:underline; text-underline-offset:3px; cursor:pointer; min-height:32px; }
.pre { white-space:pre-line; } .clamp { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; max-width:320px; }
.submission-block { border-top:1px solid var(--line); } .submission-preview { max-height:220px; overflow:auto; padding:12px; background:var(--sunk); border-radius:var(--r-md); }

/* Reports & exports */
.report-layout { display:grid; grid-template-columns:260px minmax(0,1fr); gap:18px; align-items:start; } .report-layout > .panel { margin:0; } .report-layout.single { grid-template-columns:1fr; }
.report-menu { display:flex; flex-direction:column; padding:6px; } .report-option { display:block; width:100%; text-align:left; padding:10px 12px; border:0; border-radius:var(--r-md); background:transparent; color:var(--ink); min-height:var(--tap); }
.report-option small { display:block; color:var(--ink-3); margin-top:2px; } .report-option.active { background:var(--a-100); } @media (hover:hover) { .report-option:not(.active):hover { background:var(--hover); } }
.result-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; border-top:1px solid var(--line); }
.report-chart { margin:0; padding:6px 22px 14px; } .report-chart figcaption { font-size:.8125rem; font-weight:650; color:var(--ink-2); margin-bottom:6px; } .report-chart svg { width:100%; max-width:640px; height:auto; display:block; }
.chart-bar { fill:var(--a-500); } .chart-label,.chart-value { fill:var(--ink-2); font-size:13px; font-family:inherit; } .chart-value { fill:var(--ink); font-weight:650; }
@media (max-width:1180px) { .report-layout { grid-template-columns:1fr; } .report-menu { flex-direction:row; overflow-x:auto; } .report-option { min-width:200px; } }

/* Action queue */
.attention-list { display:grid; gap:8px; }
.attention-item { display:flex; align-items:center; gap:14px; width:100%; min-height:52px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--r-md); background:var(--card); text-align:left; color:var(--ink); transition:background-color 180ms var(--ease),border-color 180ms var(--ease); }
.attention-item strong { min-width:36px; height:36px; display:grid; place-items:center; border-radius:var(--r-sm); background:var(--warn-bg); color:var(--warn); font-variant-numeric:tabular-nums; }
.attention-item span { flex:1; } .attention-item em { font-style:normal; color:var(--crit); font-weight:650; } .attention-item .icon { width:16px; height:16px; color:var(--ink-3); }
@media (hover:hover) { .attention-item:hover { background:var(--hover); border-color:var(--line-strong); } }

/* Security */
.recovery-codes { columns:2; padding-left:1.4em; } .recovery-codes code,.setup-key,.api-key { word-break:break-all; font-size:1rem!important; }
.code-display code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:1rem; letter-spacing:.05em; }
.setup-key { display:inline-block; margin-top:6px; padding:6px 10px; border-radius:var(--r-sm); background:var(--sunk); }
.code-display { text-align:center; } .code-display code { display:inline-block; font-size:1.5rem; padding:12px 18px; border-radius:var(--r-md); background:var(--a-100); color:var(--ink); }
.steps li { margin-bottom:10px; line-height:1.55; }
.login-panel .button.ghost { margin-top:10px; align-self:flex-start; }
.registry-note .icon { display:inline-block; vertical-align:-4px; width:18px; height:18px; }

/* Empty states teach (U5) */
.empty-state { padding:44px 24px; text-align:center; color:var(--ink-3); line-height:1.6; display:flex; flex-direction:column; align-items:center; }
.empty-state > span { width:52px; height:52px; border-radius:var(--r-lg); display:grid; place-items:center; background:var(--a-100); color:var(--a-ink); font-size:1.4rem; margin-bottom:14px; }
.empty-state > span .icon { width:26px; height:26px; }
.empty-state h3,.empty-state h2 { color:var(--ink); margin-bottom:4px; }
.empty-state p { max-width:52ch; margin:0 auto 14px; }
.empty-state.compact { padding:28px 22px; }

/* Notices */
.notice-card { padding:18px 22px; border-bottom:1px solid var(--line); }
.notice-card:last-child { border-bottom:0; }
.notice-card > div { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.notice-card time { font-size:.75rem; color:var(--ink-3); }
.notice-card h3 { margin:10px 0 4px; }
.notice-card p { margin:0; color:var(--ink-2); font-size:.875rem; white-space:pre-line; }

/* Class cards */
.class-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:14px; }
.class-cards > article { padding:18px; border-radius:var(--r-md); background:var(--sunk); }
.class-cards > article .eyebrow { margin-bottom:6px; }
.class-cards p { color:var(--ink-3); font-size:.8125rem; }
.class-cards > .panel { margin:0; }

/* Dialogs scale in over a fading scrim */
dialog { border:0; border-radius:var(--r-xl); padding:26px; width:540px; max-width:calc(100vw - 24px); max-height:calc(100vh - 32px); overflow-y:auto; background:var(--card); color:var(--ink); box-shadow:0 30px 80px -20px rgba(0,0,0,.45); }
dialog[open] { animation:dialog-in 260ms var(--ease); }
dialog::backdrop { background:rgba(10,20,16,.45); backdrop-filter:blur(4px); animation:fade-in 220ms var(--ease); }
dialog h2 { font-size:1.3rem; margin:0; }
dialog > p,dialog form > p { color:var(--ink-2); font-size:.875rem; }
dialog .panel-header { padding:0 0 16px; margin-bottom:18px; }
dialog .panel-header .button { width:var(--tap); padding:0; border-color:var(--line); }
.dialog-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.dialog-footer { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:10px; padding-top:16px; border-top:1px solid var(--line); margin-top:8px; }
.panel > form > .dialog-footer { padding:16px 22px; justify-content:space-between; }
.confirm-copy p { color:var(--ink-2); font-size:.9375rem; }
.confirm-copy p:first-child { padding:14px 16px; background:var(--sunk); border-radius:var(--r-md); color:var(--ink); }

/* Toast: confirm close to where the eye is */
.toast { position:fixed; bottom:24px; right:24px; display:flex; align-items:center; gap:10px; background:var(--a-900); color:#fff; padding:13px 18px; border-radius:var(--r-md); box-shadow:var(--sh-lift); z-index:30; max-width:min(440px,calc(100vw - 32px)); font-size:.875rem; font-weight:550; animation:toast-in 280ms var(--ease); }
.toast::before { content:''; flex:none; width:8px; height:8px; border-radius:50%; background:var(--a-300); }
.toast.error { background:var(--crit); }

/* Student registry, profiles and parents (registry.js) */
.registry-layout { display:grid; grid-template-columns:minmax(0,1fr) 250px; gap:22px; align-items:start; }
.registration-form { min-width:0; }
.form-section { background:var(--card); border-radius:var(--r-lg); box-shadow:var(--sh); padding:24px; margin-bottom:18px; }
.section-heading { display:block; margin-bottom:20px; }
.section-heading h2 { margin:0 0 4px; }
.section-heading p { color:var(--ink-3); font-size:.875rem; margin:0; }
.section-number { width:30px; height:30px; display:grid; place-items:center; flex:none; background:var(--a-100); color:var(--a-ink); border-radius:var(--r-sm); font-size:.8125rem; font-weight:700; }
.registration-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:12px; padding:18px 0 10px; }
.photo-uploader { display:flex; gap:24px; align-items:center; text-align:left; margin:0 0 22px; padding:20px; background:var(--sunk); border-radius:var(--r-lg); }
.photo-uploader input[type=file] { display:block; width:100%; padding:10px; font-size:.8125rem; }
.photo-uploader p { color:var(--ink-3); font-size:.8125rem; margin:10px 0; }
.photo-uploader .button { margin-top:8px; }
.photo-uploader .passport-photo { margin:0; }
.passport-photo { width:38px; height:46px; object-fit:cover; object-position:center; border-radius:var(--r-sm); background:var(--sunk); display:block; flex:none; }
.passport-photo.large { width:150px; height:190px; border-radius:var(--r-md); margin:0 auto 16px; }
span.passport-photo { display:grid; place-items:center; color:var(--a-ink); background:var(--a-100); font-size:2rem; font-weight:700; }
.passport-placeholder { display:flex; align-items:center; justify-content:center; width:150px; height:190px; margin:0 auto 16px; background:var(--sunk); color:var(--ink-3); border:1.5px dashed var(--line-strong); border-radius:var(--r-md); font-size:2.25rem; font-weight:600; }
.student-avatar img,.student-photo { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.profile-hero { display:flex; align-items:center; gap:26px; background:var(--card); padding:24px; border-radius:var(--r-lg); box-shadow:var(--sh); margin-bottom:18px; }
.profile-hero > .button { margin-left:auto; }
.profile-hero .passport-photo,.profile-hero .passport-placeholder { margin:0; width:115px; height:145px; flex:none; }
.profile-hero h1 { margin:0 0 10px; }
.profile-hero p { margin:6px 0; color:var(--ink-2); font-size:.9375rem; }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.profile-grid .panel { margin:0; }
.profile-grid .parent-chip { display:block; overflow-wrap:anywhere; }
.profile-actions { display:flex; gap:10px; flex-wrap:wrap; }
.detail-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; margin:0; padding:22px; }
.detail-list dt { font-size:.75rem; font-weight:600; color:var(--ink-3); margin-bottom:4px; text-transform:uppercase; letter-spacing:.05em; }
.detail-list dd { margin:0; font-size:.9375rem; overflow-wrap:anywhere; white-space:pre-line; }
.detail-list .full { grid-column:1/-1; }
.directory-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.directory-cards .panel-header { padding:0; align-items:flex-start; gap:12px; flex-wrap:wrap; border:0; }
.directory-cards .detail-list { grid-template-columns:1fr; padding:18px 0; }
.directory-cards .form-section { margin:0; min-width:0; }
.directory-cards h2 { overflow-wrap:anywhere; }
.parent-card { background:var(--card); border-radius:var(--r-lg); box-shadow:var(--sh); padding:20px; min-width:0; }
.parent-card h2 { margin:10px 0 4px; }
.parent-card p { color:var(--ink-3); font-size:.875rem; margin:6px 0; overflow-wrap:anywhere; }
.parent-card .quick-actions { margin-top:14px; }
.parent-children { display:flex; flex-wrap:wrap; gap:6px; }
.parent-chip { display:inline-flex; align-items:center; min-height:36px; padding:6px 12px; border:0; border-radius:var(--r-pill); background:var(--a-100); color:var(--a-ink); font-size:.8125rem; font-weight:600; margin:2px 4px 2px 0; }
.account-panel { max-width:640px; }

/* Sign-in */
.login-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; padding:14px; }
.login-brand { position:relative; overflow:hidden; border-radius:var(--r-xl); color:#fff; padding:48px; display:flex; flex-direction:column; justify-content:space-between; gap:40px; background:radial-gradient(120% 90% at 100% 0%,var(--a-600) 0%,var(--a-900) 65%); }
.login-brand::after { content:''; position:absolute; right:-160px; bottom:-200px; width:520px; height:520px; border-radius:50%; border:1px solid rgba(255,255,255,.12); box-shadow:0 0 0 46px rgba(255,255,255,.035),0 0 0 92px rgba(255,255,255,.025),0 0 0 138px rgba(255,255,255,.02); pointer-events:none; }
.login-brand > * { position:relative; }
.login-brand .brand { color:#fff; margin:0; }
.login-brand .brand .muted { color:rgba(255,255,255,.7); }
.login-brand h1 { font-size:clamp(2.4rem,4vw,3.6rem); line-height:1.05; letter-spacing:-.04em; font-weight:700; max-width:520px; margin:0 0 18px; }
.login-brand p { color:rgba(255,255,255,.82); max-width:420px; font-size:1.02rem; }
.login-brand .eyebrow { color:hsl(var(--accent-h) 60% 80%); }
.login-brand .muted { color:rgba(255,255,255,.7); }
.login-points { list-style:none; padding:0; margin:22px 0 0; display:grid; gap:12px; max-width:420px; }
.login-points li { display:flex; gap:12px; align-items:center; color:rgba(255,255,255,.9); font-size:.9375rem; }
.login-points .icon { width:32px; height:32px; padding:7px; border-radius:50%; background:rgba(255,255,255,.12); }
.login-panel { display:flex; flex-direction:column; justify-content:center; padding:56px clamp(24px,6vw,96px); background:var(--card); border-radius:var(--r-xl); box-shadow:var(--sh); }
main.login-panel { min-height:100vh; border-radius:0; }
.login-panel h2 { font-size:1.9rem; letter-spacing:-.03em; margin-bottom:6px; }
.login-panel > p { color:var(--ink-2); font-size:.9375rem; max-width:460px; }
.login-panel #sign-in-form { max-width:440px; width:100%; margin:22px 0 10px; }
.login-panel #sign-in-form > .button { width:100%; min-height:50px; font-size:.95rem; }
.login-panel .demo-caption { max-width:440px; margin-left:0; }

/* Motion: cards rise in once per page view */
@keyframes rise { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes dialog-in { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:none; } }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes grow { from { transform:scaleX(0); } to { transform:scaleX(1); } }
.page.enter > * { animation:rise 600ms var(--ease) both; }
.page.enter > :nth-child(2) { animation-delay:60ms; } .page.enter > :nth-child(3) { animation-delay:120ms; } .page.enter > :nth-child(4) { animation-delay:180ms; } .page.enter > :nth-child(5) { animation-delay:240ms; } .page.enter > :nth-child(n+6) { animation-delay:300ms; }
.page.enter .stat-grid > .stat-card { animation:rise 600ms var(--ease) both; }
.page.enter .stat-grid > :nth-child(2) { animation-delay:120ms; } .page.enter .stat-grid > :nth-child(3) { animation-delay:180ms; } .page.enter .stat-grid > :nth-child(4) { animation-delay:240ms; }
.page.enter .progress-bar { animation:grow 900ms 300ms var(--ease) both; }

@media (hover:hover) {
  .button.primary:hover { box-shadow:0 10px 24px -10px hsl(var(--accent-h) var(--accent-s) 24% / .75); filter:brightness(1.06); }
  .button.secondary:hover,.icon-button:hover { background:var(--hover); border-color:var(--ink-3); }
  .button.danger-outline:hover { background:var(--crit-bg); }
  .nav-button:not(.active):hover { background:var(--hover); color:var(--ink); }
  .profile:hover { background:var(--hover); }
  .data-table tbody tr:hover td { background:var(--hover); }
}

/* Responsive: 2 columns under 1180px, 1 under 820px; sidebar becomes a scrolling tab row on phones */
@media (max-width:1180px) {
  .shell { grid-template-columns:216px minmax(0,1fr); }
  .stat-grid,.dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns:1fr; }
  .registry-layout { grid-template-columns:minmax(0,1fr) 210px; gap:18px; }
  .directory-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .profile-grid { grid-template-columns:1fr; }
  .login-brand { padding:36px; }
}
@media (max-width:820px) {
  .shell { display:block; padding:0; }
  .sidebar { position:sticky; top:0; z-index:10; height:auto; border-radius:0 0 var(--r-lg) var(--r-lg); padding:12px 12px 8px; overflow:visible; }
  .brand { margin:0 4px 8px; font-size:1rem; } .brand .logo { width:32px; height:32px; } .brand .muted { display:none; }
  .school-switch,.sidebar-footer,.nav-label { display:none; }
  .sidebar nav { flex-direction:row; gap:4px; overflow-x:auto; scrollbar-width:none; margin:0 -12px; padding:0 12px 4px; scroll-snap-type:x proximity; }
  .sidebar nav::-webkit-scrollbar { display:none; }
  .nav-group { display:contents; }
  .nav-button { width:auto; flex:none; white-space:nowrap; padding:8px 14px; min-height:40px; font-size:.84rem; border-radius:var(--r-pill); scroll-snap-align:start; }
  .nav-button.active::before { display:none; }
  .workspace,.main-content { gap:0; }
  .topbar { position:static; border-radius:0; box-shadow:none; background:transparent; min-height:60px; padding:12px 16px 4px; }
  .profile > div { display:none; } .profile { padding:0; }
  .page { border-radius:0; padding:18px 16px 32px; background:transparent; }
  .page-footer { padding:0 16px 20px; }
  .page-heading { flex-direction:column; align-items:stretch; gap:14px; }
  .page-heading .button { align-self:flex-start; }
  .stat-grid { gap:10px; } .stat-card { padding:15px 16px; } .stat-value { font-size:1.6rem; }
  .hero-card { grid-template-columns:1fr; padding:20px; gap:14px; }
  .panel-header { padding:16px; } .panel-body,.dashboard-body { padding:14px 16px 16px; }
  .data-table td,.data-table th { padding:11px 14px; }
  .toolbar { align-items:stretch; } .toolbar .field { flex:1 1 100%; } .toolbar input[type=search] { min-width:0; width:100%; }
  .panel > .toolbar > .muted { margin-left:0; padding:0; }
  .form-grid { grid-template-columns:1fr; }
  input,select,textarea { font-size:16px; }
  .toast { left:16px; right:16px; bottom:16px; max-width:none; }
  .login-shell { display:block; padding:0; }
  .login-brand { border-radius:0 0 var(--r-xl) var(--r-xl); padding:24px; gap:20px; }
  .login-brand h1 { font-size:2.1rem; margin:8px 0 10px; } .login-points { display:none; } .login-brand footer { display:none; }
  .login-panel { border-radius:0; box-shadow:none; padding:28px 20px 40px; background:transparent; }
  .registry-layout { display:flex; flex-direction:column; } .registry-layout > * { width:100%; }
  .form-section { padding:18px 16px; }
  .photo-uploader { display:block; }
  .profile-hero { padding:18px; gap:16px; align-items:flex-start; } .profile-hero .passport-photo,.profile-hero .passport-placeholder { width:80px; height:105px; } .profile-hero h1 { font-size:1.4rem; }
  .detail-list { padding:18px; gap:16px; } .directory-cards { grid-template-columns:1fr; } .class-cards { grid-template-columns:1fr; }
  dialog { padding:20px; border-radius:var(--r-lg); }
  .dialog-footer .button { flex:1 1 auto; }
}
@media (max-width:420px) {
  .dashboard-stats { grid-template-columns:1fr 1fr; }
  .dashboard-stats .stat-card:first-child,.dashboard-stats .stat-card:last-child:nth-child(even) { grid-column:1/-1; }
  .stat-value { font-size:1.45rem; }
  .profile-hero { flex-wrap:wrap; } .detail-list { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; } }
@media print { .no-print { display:none!important; } .report-card { box-shadow:none; } body:has(dialog[open]) .shell,body:has(dialog[open]) .skip-link { display:none!important; } dialog[open] { position:static; box-shadow:none; max-height:none; width:auto; max-width:none; padding:0; animation:none; } dialog::backdrop { display:none; } dialog .panel-header,dialog .dialog-footer,dialog #form-error { display:none!important; } .sidebar,.topbar,.button,.toolbar,.toast,.page-footer { display:none!important; } .shell { display:block; padding:0; } .page { padding:0; background:#fff; } .panel,.stat-card { break-inside:avoid; box-shadow:none; border:1px solid #ddd; } }
