/* =====================================================================
   Design tokens – light (default) and dark
   ===================================================================== */
:root {
  --bg: #efeeec; --surface: #ffffff; --surface-2: #f5f4f2; --line: #ebe9e6; --line-2: #dedbd6;
  --ink: #151515; --ink-2: #4a4a4a; --ink-3: #8e8c88;
  --brand: #e8603c; --brand-2: #f08a63; --brand-soft: #fdebe4; --brand-ink: #c2471f;
  --grad: linear-gradient(135deg, #f27c53 0%, #e8603c 55%, #dc4f2b 100%);
  --grad-soft: linear-gradient(135deg, rgba(232,96,60,.12), rgba(242,124,83,.08));
  --tile: #f6f5f3; --dark: #151515; --dark-ink: #ffffff;
  --good: #15803d; --good-soft: #e8f5ec; --good-fill: #22a35a;
  --bad: #c2381c; --bad-soft: #fdebe4; --bad-fill: #e8603c;
  --warn: #a15c07; --warn-soft: #fdf3e2; --warn-fill: #f2b552;
  --info: #44546a; --info-soft: #eef0f3; --info-fill: #9aa5b4;
  --violet-fill: #f3a383;
  --shadow: 0 1px 2px rgba(20,20,20,.03), 0 6px 20px rgba(20,20,20,.04);
  --shadow-lg: 0 18px 48px rgba(20,20,20,.14);
  --radius: 26px; --radius-sm: 14px;
  --side: 252px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0e0e0e; --surface: #1a1a1a; --surface-2: #222120; --line: #2a2927; --line-2: #353330;
  --ink: #f4f3f1; --ink-2: #c4c1bc; --ink-3: #8e8a84;
  --brand: #ff7a50; --brand-2: #ff9a76; --brand-soft: rgba(255,122,80,.15); --brand-ink: #ffa184;
  --grad-soft: linear-gradient(135deg, rgba(255,122,80,.18), rgba(255,154,118,.10));
  --tile: #141414; --dark: #f4f3f1; --dark-ink: #151515;
  --good: #4ade80; --good-soft: rgba(34,163,90,.16);
  --bad: #ff8a66; --bad-soft: rgba(255,122,80,.16);
  --warn: #fbbf5a; --warn-soft: rgba(242,181,82,.15);
  --info: #b8c2d0; --info-soft: rgba(154,165,180,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 "Plus Jakarta Sans", "Segoe UI", Roboto, Arial, sans-serif;
       -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; } svg.i.lg { width: 22px; height: 22px; }

/* =====================================================================
   Boot / loading
   ===================================================================== */
#topbar-progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--grad); z-index: 200; border-radius: 0 3px 3px 0; box-shadow: 0 0 10px rgba(232,96,60,.5); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 150; }
.boot .mark { width: 64px; height: 64px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 26px; box-shadow: 0 12px 30px rgba(232,96,60,.30); }
.boot .dots { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.boot .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: .3; }
.sk { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 37%, var(--line) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* =====================================================================
   Login
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth .art { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .art .blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .35; background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,0) 70%); }
.auth .art h2 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; max-width: 440px; }
.auth .art p { opacity: .85; max-width: 420px; margin: 0; }
.auth .art .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.auth .art .pills span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: 6px 12px; border-radius: 99px; font-size: 13px; backdrop-filter: blur(6px); }
.auth .art .mini { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 18px; padding: 16px; backdrop-filter: blur(8px); max-width: 360px; }
.auth .art .mini b { font-size: 28px; display: block; }
.auth .form { display: grid; place-items: center; padding: 32px 20px; }
.auth .box { width: 100%; max-width: 380px; }
.auth .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; box-shadow: 0 10px 24px rgba(232,96,60,.28); }
.auth h1 { font-size: 26px; margin: 22px 0 6px; letter-spacing: -.02em; }
.auth .lead { color: var(--ink-3); margin: 0 0 26px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 44px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 0 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { height: 84px; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw button { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.formmsg { min-height: 20px; font-size: 13px; margin-top: 10px; color: var(--ink-3); }
.formmsg.err { color: var(--bad); } .formmsg.ok { color: var(--good); }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid transparent;
       font-weight: 650; font-size: 14px; cursor: pointer; background: var(--surface-2); color: var(--ink); transition: transform .15s, box-shadow .2s, background .2s, opacity .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(232,96,60,.30); }
.btn.primary:hover { box-shadow: 0 10px 26px rgba(232,96,60,.40); }
.btn.outline { background: var(--surface); border-color: var(--line-2); }
.btn.outline:hover { border-color: var(--brand); color: var(--brand); }
.btn.ghost { background: transparent; }
.btn.dark { background: var(--dark); color: var(--dark-ink); }
.btn.dark:hover { box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.btn.light { background: var(--surface-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.success { background: #25d366; color: #fff; box-shadow: 0 6px 18px rgba(37,211,102,.3); }
.btn.lg { height: 48px; font-size: 15px; border-radius: 99px; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; border-radius: 99px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   App shell: sidebar + main
   ===================================================================== */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; z-index: 40; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side .brand .logo { width: 38px; height: 38px; border-radius: 50%; background: var(--dark); color: var(--dark-ink) !important; color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 6px 16px rgba(232,96,60,.28); flex: none; }
.side .brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.side .brand span { font-size: 12px; color: var(--ink-3); }
.side .group { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: 99px; color: var(--ink-2); font-weight: 600; cursor: pointer; position: relative; transition: background .2s, color .2s; user-select: none; }
.nav:hover { background: var(--surface-2); color: var(--ink); }
.nav.on { background: var(--dark); color: var(--dark-ink); }
.nav.on::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--brand); }
.nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side .grow { flex: 1; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.soft { background: var(--brand-soft); color: var(--brand-ink); }
.side .me b { display: block; font-size: 13.5px; line-height: 1.2; }
.side .me span { font-size: 12px; color: var(--ink-3); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .titles h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; line-height: 1.2; }
.top .titles p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.top .back { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: transform .15s, border-color .2s; }
.top .back:hover { border-color: var(--brand); color: var(--brand); transform: translateX(-2px); }
.top .menu-btn { display: none; }
.pill-date { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }
.upd { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.upd i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: updPulse 1s ease-in-out infinite; }
@keyframes updPulse { 50% { opacity: .25; transform: scale(.7); } }
.content { padding: 8px 28px 40px; flex: 1; }
.view { max-width: 1320px; margin: 0 auto; }
.scrim { position: fixed; inset: 0; background: rgba(13,15,28,.45); z-index: 35; backdrop-filter: blur(2px); }

/* =====================================================================
   Cards, KPIs, grids
   ===================================================================== */
.card { background: var(--surface); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .25s, transform .25s, border-color .25s; }
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; }
.card-b { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-a { grid-template-columns: 2fr 1fr; }
.dash-b { grid-template-columns: 1.35fr 1fr; }

.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; background: var(--grad); color: #fff; box-shadow: 0 14px 36px rgba(232,96,60,.26); }
.hero h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hero p { margin: 4px 0 0; opacity: .86; }
.hero .orb { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); pointer-events: none; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; }
.hero .chips span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }

.kpi { padding: 16px 18px; }
.kpi .t { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.kpi .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .ic.good { background: var(--good-soft); color: var(--good); } .kpi .ic.bad { background: var(--bad-soft); color: var(--bad); }
.kpi .ic.warn { background: var(--warn-soft); color: var(--warn); } .kpi .ic.info { background: var(--info-soft); color: var(--info); }
.kpi .v { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.kpi .v b { font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .s { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.delta.up { background: var(--good-soft); color: var(--good); } .delta.down { background: var(--bad-soft); color: var(--bad); } .delta.flat { background: var(--surface-2); color: var(--ink-3); }

/* badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); } .badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); transition: all .2s; }
.chip.on { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.chip em { font-style: normal; opacity: .65; margin-left: 4px; }
.tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; }
.tab { border: 0; background: transparent; border-radius: 99px; padding: 7px 14px; font-weight: 650; font-size: 13.5px; color: var(--ink-3); cursor: pointer; transition: all .2s; }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* tables & lists */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--dark); }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .name { font-weight: 650; }
.empty { padding: 34px 18px; text-align: center; color: var(--ink-3); }
.empty .ill { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 10px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; }

/* donut legend */
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.donut-wrap { position: relative; height: 230px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { display: block; font-size: 30px; letter-spacing: -.03em; }
.donut-center span { color: var(--ink-3); font-size: 12.5px; }
.chart-box { position: relative; height: 260px; }

/* heatmap */
.heat { display: grid; gap: 5px; align-items: center; }
.heat .lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.heat .cell { aspect-ratio: 1.6 / 1; min-height: 18px; border-radius: 6px; background: var(--line); position: relative; cursor: default; transition: transform .15s; }
.heat .cell:hover { transform: scale(1.12); z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.heat-scale { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.heat-scale i { width: 18px; height: 12px; border-radius: 4px; display: inline-block; }
.tip { position: fixed; z-index: 120; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); }

/* class grid */
.class-card { padding: 16px; cursor: pointer; position: relative; overflow: hidden; }
.class-card .cls { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.class-card .ring { width: 54px; height: 54px; }
.class-card .meta { color: var(--ink-3); font-size: 12.5px; }

/* attendance roster */
.roster .rrow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); transition: background .2s; }
.roster .rrow:first-child { border-top: 0; }
.roster .rrow.locked { background: var(--surface-2); }
.roster .rrow .nm { flex: 1; min-width: 0; }
.roster .rrow .nm b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roster .rrow .nm span { font-size: 12px; color: var(--ink-3); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; gap: 3px; flex: none; }
.seg button { width: 42px; height: 34px; border: 0; border-radius: 9px; background: transparent; font-weight: 800; font-size: 13px; color: var(--ink-3); cursor: pointer; transition: all .18s; }
.seg button:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.seg button.on.P { background: var(--good-fill); color: #fff; box-shadow: 0 4px 10px rgba(18,183,106,.35); }
.seg button.on.A { background: var(--bad-fill); color: #fff; box-shadow: 0 4px 10px rgba(240,68,56,.35); }
.seg button.on.L { background: var(--warn-fill); color: #422006; box-shadow: 0 4px 10px rgba(253,176,34,.35); }
.seg button:disabled { cursor: not-allowed; }
.savebar { position: sticky; bottom: 0; z-index: 20; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
           border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.banner.info { background: var(--info-soft); color: var(--info); } .banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.brand { background: var(--brand-soft); color: var(--brand-ink); } .banner.bad { background: var(--bad-soft); color: var(--bad); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--ink-3); }
.search .input { padding-left: 38px; height: 42px; min-width: 220px; }

/* menus, modals, toasts */
.menu { position: fixed; z-index: 90; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; text-align: left; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.menu button:hover { background: var(--surface-2); color: var(--ink); }
.menu button.danger { color: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(13,15,28,.5); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 760px; }
.modal .mh { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal .mh h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; flex: 1; }
.modal .mb { padding: 12px 22px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 22px 20px; flex-wrap: wrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 130; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px; }
.toast.err { background: var(--bad-fill); color: #fff; } .toast.ok { background: #0f9f62; color: #fff; }
.pick-list { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.pick-list .li { cursor: pointer; padding: 9px 14px; }
.pick-list .li:hover, .pick-list .li.on { background: var(--brand-soft); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: .12em; font-weight: 700; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 16px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; }
.cal div { height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }


/* =====================================================================
   Dashboard (reference style: warm grey, white board, coral + black)
   ===================================================================== */
.dz-hero { display: flex; align-items: center; gap: 18px; padding: 6px 2px 24px; flex-wrap: wrap; }
.dz-date { width: 86px; height: 86px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 30px; font-weight: 600; letter-spacing: -.03em; flex: none; }
.dz-day { font-weight: 600; line-height: 1.25; font-size: 15.5px; }
.dz-sep { width: 1px; height: 42px; background: var(--line-2); }
.dz-round { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); position: relative; flex: none; transition: border-color .2s, transform .2s; }
.dz-round:hover { border-color: var(--ink); transform: translateY(-1px); }
.dz-round .pip { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.dz-round input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-cta { height: 50px; padding: 0 22px 0 24px; gap: 18px; background: var(--brand); color: #fff; box-shadow: 0 10px 24px rgba(232,96,60,.28); }
.dz-greet { margin-left: auto; text-align: left; min-width: 0; flex: 1 1 320px; display: flex; flex-direction: column; align-items: flex-end; }
.dz-greet > * { max-width: 100%; }
.dz-greet h2 { margin: 0; font-size: 36px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.dz-greet p { margin: 4px 0 0; font-size: 30px; letter-spacing: -.03em; color: var(--ink-3); line-height: 1.15; }
.dz-greet p::before { content: ""; display: inline-block; width: 2px; height: .9em; background: var(--ink); vertical-align: -3px; margin-right: 4px; animation: dzBlink 1.1s steps(1) infinite; }
@keyframes dzBlink { 50% { opacity: 0; } }
.dz-mic { width: 86px; height: 86px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); flex: none; color: var(--ink); }

.dz-board { background: var(--surface); border-radius: 34px; padding: 16px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.dz-tile { background: var(--tile); border-radius: 26px; padding: 18px; min-width: 0; position: relative; }
.dz-in { background: var(--surface); border-radius: 22px; padding: 16px 18px; min-width: 0; }
.dz-a { grid-column: span 4; } .dz-b { grid-column: span 3; } .dz-c { grid-column: span 2; } .dz-d { grid-column: span 3; }
.dz-e { grid-column: span 5; } .dz-f { grid-column: span 7; } .dz-g { grid-column: span 12; }
.dz-plain { background: transparent; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.dz-t { font-size: 12.5px; color: var(--ink-3); }
.dz-h { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.dz-v { font-size: 26px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dz-v small { font-size: 15px; color: var(--brand); font-weight: 650; margin-right: 2px; }
.dz-v .u { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.dz-sel { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.dz-sel select { border: 0; background: transparent; font: inherit; color: inherit; outline: none; cursor: pointer; appearance: none; padding-right: 12px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 4px center, right 0 center; background-size: 4px 4px; background-repeat: no-repeat; }
.dz-ico { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; background: var(--surface); flex: none; }
.dz-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--brand); line-height: 1.15; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.dz-link i { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-style: normal; }
.dz-link i svg { width: 12px; height: 12px; }
.dz-split { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.dz-split > .dz-in { border-radius: 22px; flex: 1; }
.dz-split > .dz-foot { padding: 14px 18px 4px; display: flex; align-items: center; gap: 10px; }

.dz-lock { width: 100%; aspect-ratio: 1; max-width: 104px; margin: 0 auto; border-radius: 50%; background: var(--tile); display: grid; place-items: center; text-align: center; font-size: 12px; font-weight: 650; line-height: 1.3; }
.dz-gauge { position: relative; width: 100%; max-width: 104px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: #151515; color: #fff; display: grid; place-items: center; box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.dz-gauge svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.dz-gauge b { display: block; font-size: 19px; letter-spacing: -.02em; text-align: center; position: relative; }
.dz-gauge > div > span { display: block; font-size: 10px; opacity: .65; text-align: center; position: relative; }

.dz-dots { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-top: 12px; max-width: 150px; }
.dz-dots i { aspect-ratio: 1; border-radius: 50%; background: var(--line-2); display: block; }
.dz-dots i.on { background: var(--brand); } .dz-dots i.mid { background: #f3a383; }
.dz-grid { position: relative; height: 112px; margin-top: 6px; background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px); background-size: 18px 18px; border-radius: 10px; }
.dz-pin { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.dz-pin span { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.dz-pin.hot span { background: var(--brand); color: #fff; }
.dz-pin em { width: 2px; background: var(--line-2); display: block; }
.dz-pin.hot em { background: var(--brand); }
.dz-trend { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 700; color: var(--brand); }
.dz-trend.down { color: var(--ink-2); }
.dz-wave { width: 100%; height: 70px; display: block; margin: 6px 0; }

.dz-conc { position: relative; width: 100%; aspect-ratio: 2 / 1.08; margin-top: 18px; overflow: hidden; }
.dz-e { display: flex; flex-direction: column; } .dz-e .dz-conc { margin-top: auto; }
.dz-conc .ring { position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 50%); border-radius: 50%; display: flex; justify-content: center; aspect-ratio: 1; }
.dz-conc .ring span { position: absolute; top: 9%; font-size: 13px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.dz-conc .ring span em { font-style: normal; color: var(--brand); margin-right: 2px; }
.dz-conc .ring.core span { color: #fff; } .dz-conc .ring.core span em { color: #fff; }
.dz-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.dz-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }

.dz-search { position: relative; flex: 1; min-width: 150px; }
.dz-search svg { position: absolute; left: 12px; top: 11px; color: var(--ink-3); }
.dz-search input { width: 100%; height: 38px; border-radius: 99px; border: 0; background: transparent; padding: 0 12px 0 36px; outline: none; font-size: 13px; }
.dz-search::before { content: ""; position: absolute; left: 3px; top: 3px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); }
.dz-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.dz-chip .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.dz-chip.on { border-color: var(--ink); color: var(--ink); }
.dz-trio { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 12px; margin-top: 14px; }
.dz-bars { display: flex; align-items: center; gap: 4px; height: 82px; margin-top: 10px; }
.dz-bars i { flex: 1; border-radius: 3px; background: var(--line-2); min-height: 6px; display: block; }
.dz-bars i.hot { background: var(--brand); }
.dz-pager { display: flex; gap: 4px; justify-content: center; margin-top: 10px; }
.dz-pager i { width: 4px; height: 4px; border-radius: 99px; background: var(--line-2); display: block; }
.dz-pager i.on { width: 14px; background: var(--brand); }
.dz-list { margin-top: 8px; position: relative; }
.dz-list::before { content: ""; position: absolute; left: 10px; top: 14px; bottom: 14px; width: 1px; background: var(--line-2); }
.dz-list .it { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; font-weight: 600; position: relative; cursor: pointer; }
.dz-list .it b { width: 21px; height: 21px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 10px; flex: none; }
.dz-list .it.done b { background: var(--dark); color: var(--dark-ink); }
.dz-list .it span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-list .it em { font-style: normal; color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.dz-segs { display: flex; gap: 4px; }
.dz-segs i { flex: 1; height: 26px; border-radius: 99px; background: var(--line); display: block; }
.dz-segs i.done { background: var(--dark); } .dz-segs i.part { background: var(--brand); }
.dz-sun { width: 46px; height: 46px; color: var(--brand); }
.dz-faces { display: flex; gap: 8px; margin-top: 16px; }
.dz-faces div { flex: 1; text-align: center; }
.dz-faces b { width: 100%; aspect-ratio: 1; max-width: 54px; margin: 0 auto 6px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; background: var(--surface); font-size: 15px; }
.dz-faces span { font-size: 11px; color: var(--ink-3); }
.dz-rep { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); }
.dz-rep:first-child { border-top: 0; }
.dz-rep .nm { flex: 1; min-width: 0; }
.dz-rep .nm b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-rep .nm span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.dz-gbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.dz-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; border: 0; cursor: pointer; color: var(--ink-2); }
.dz-below { margin-top: 16px; }

@media (max-width: 1500px) {
  .dz-greet h2 { font-size: 30px; } .dz-greet p { font-size: 23px; } .dz-mic { width: 64px; height: 64px; }
}
@media (max-width: 1240px) {
  .dz-a { grid-column: span 7; } .dz-b { grid-column: span 5; }
  .dz-c { grid-column: span 4; } .dz-d { grid-column: span 8; }
}
@media (max-width: 860px) { .dz-gbody { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .dz-board { grid-template-columns: 1fr; padding: 10px; border-radius: 26px; }
  .dz-a, .dz-b, .dz-c, .dz-d, .dz-e, .dz-f, .dz-g { grid-column: auto; }
  .dz-c.dz-plain { flex-direction: row; } .dz-c .dz-tile { flex: 1; }
  .dz-greet { margin-left: 0; width: 100%; order: 5; } .dz-mic { display: none; }
  .dz-trio { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dz-hero { gap: 12px; padding-bottom: 16px; } .dz-date { width: 64px; height: 64px; font-size: 24px; }
  .dz-cta { height: 44px; padding: 0 16px; gap: 10px; } .dz-sep { display: none; }
  .dz-greet h2 { font-size: 25px; } .dz-greet p { font-size: 19px; }
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-a, .dash-b { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; } .auth .art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 276px; transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  .side.open { transform: translateX(0); }
  .top .menu-btn { display: grid; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .top { padding: 10px 14px; gap: 8px; } .top .titles h1 { font-size: 17px; } .top .titles p { display: none; }
  .pill-date span.txt { display: none; }
  .content { padding: 6px 14px 32px; }
  .g4, .g2, .g3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px 14px; } .kpi .v b { font-size: 24px; } .kpi .t { font-size: 12.5px; } .kpi .ic { width: 28px; height: 28px; }
  .hero { padding: 18px; } .hero h2 { font-size: 18px; }
  .cls-grid { grid-template-columns: 1fr; }
  .roster .rrow { padding: 10px 12px; gap: 8px; } .roster .avatar { display: none; } .seg button { width: 38px; }
  .search .input { min-width: 0; width: 100%; } .search { flex: 1; }
  table.t.stack thead { display: none; }
  table.t.stack tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.t.stack td { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border: 0; }
  table.t.stack td::before { content: attr(data-l); color: var(--ink-3); font-size: 12px; font-weight: 600; }
  table.t.stack td.first::before { content: none; }
  .toasts { left: 14px; right: 14px; } .toast { min-width: 0; max-width: none; }
  .modal .mf .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   Phase 3: homework, study material, parent portal
   ===================================================================== */
.hw-card .hw-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-card .hw-text { white-space: pre-wrap; word-break: break-word; margin-top: 10px; color: var(--ink); line-height: 1.6; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.thumbs a, .thumbs .th { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .th button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumbs .th.off img { opacity: .25; } .thumbs .th.off::after { content: 'Will be removed'; position: absolute; inset: auto 0 6px; text-align: center; font-size: 11px; font-weight: 700; color: var(--bad); }
.thumbs .add { display: grid; place-items: center; border: 1.5px dashed var(--line-2); border-radius: 12px; aspect-ratio: 1; cursor: pointer; color: var(--ink-3); font-size: 12px; text-align: center; gap: 2px; background: transparent; }
.thumbs .add:hover { border-color: var(--brand); color: var(--brand); }
.hw-class .cls { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.day-h { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 20px 4px 10px; }
.mat { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.mat:first-child { border-top: 0; }
.mat .mic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.mat .mic.pdf { background: var(--bad-soft); color: var(--bad); } .mat .mic.youtube { background: #ffe4e4; color: #d4161b; } .mat .mic.image { background: var(--info-soft); color: var(--info); }
.pick-classes { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; padding: 2px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 99px; font-weight: 650; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.meter { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.meter.warn i { background: linear-gradient(90deg, #f2b552, #c2381c); }
.portal-url { font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: var(--surface-2); padding: 10px 14px; border-radius: 12px; word-break: break-all; }
.upbar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.upbar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }

/* Printable notice (shown over the app, printed on A4) */
#printSheet { position: fixed; inset: 0; z-index: 300; background: #e9e7e4; overflow: auto; color: #111; }
#printSheet .pbar { position: sticky; top: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; background: #151515; color: #fff; z-index: 2; }
#printSheet .pbar b { font-size: 15px; } #printSheet .pbar .grow { min-width: 200px; }
#printSheet .pwarn { background: #fdf3e2; color: #7a4504; padding: 10px 18px; font-size: 13px; font-weight: 600; }
.poster { width: 210mm; min-height: 297mm; margin: 16px auto; background: #fff; padding: 18mm; text-align: center; font-family: "Plus Jakarta Sans", Arial, sans-serif; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.poster h1 { font-size: 26pt; margin: 0 0 4mm; } .poster h2 { font-size: 16pt; margin: 0 0 10mm; color: #444; font-weight: 600; }
.poster svg { width: 120mm; height: 120mm; } .poster .addr { font-family: ui-monospace, Consolas, monospace; font-size: 14pt; margin: 6mm 0; word-break: break-all; }
.poster .en { font-size: 13pt; } .poster .ur { direction: rtl; font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif; font-size: 15pt; line-height: 2.2; margin-top: 6mm; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(#printSheet) { display: none !important; }
  body.printing { background: #fff; }
  #printSheet { position: static; background: #fff; overflow: visible; }
  #printSheet .pbar, #printSheet .pwarn { display: none; }
  .poster { margin: 0; box-shadow: none; page-break-after: always; }
}

/* The Principal has no access to parent messages */
body.no-messages [onclick*="go('messages')"], body.no-messages [onclick*="replyMenu"] { display: none !important; }

/* ---------- Phase 4: tests and marks ---------- */
.marks-roster .mrow { flex-wrap: wrap; }
.marks-roster .mk-in { display: flex; align-items: center; gap: 6px; flex: none; }
.marks-roster .mk-in .input { width: 74px; height: 40px; text-align: center; font-weight: 700; font-size: 16px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.marks-roster .mk-in .input:disabled { background: var(--surface-2); color: var(--ink-3); }
.marks-roster .mk-res { width: 104px; flex: none; text-align: right; }
.marks-roster .mk-ab { width: 36px; padding: 0; justify-content: center; font-weight: 800; }
.marks-roster .mk-ab.warn-on { background: var(--warn-fill); color: #422006; border-color: transparent; }
.marks-roster .mk-rm { flex-basis: 100%; padding-left: 52px; }
.marks-roster .mk-rm .input { height: 38px; font-size: 13.5px; }
.st-list .row { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.st-list .row:first-child { border-top: 0; padding-top: 0; }
.st-edit .row { padding: 6px 0; border-top: 1px solid var(--line); }
.st-edit .row:first-child { border-top: 0; }
.st-edit label { font-weight: 600; }
.bad-ink { color: var(--bad); }
@media (max-width: 640px) {
  .marks-roster .mrow { gap: 8px 10px; padding: 10px 12px; }
  .marks-roster .mrow .nm { flex-basis: calc(100% - 52px); }
  .marks-roster .mk-in { margin-left: 52px; }
  .marks-roster .mk-res { width: auto; flex: 1; }
  .marks-roster .mk-rm { padding-left: 0; }
  .st-edit .row { flex-wrap: wrap; } .st-edit select.input { max-width: none !important; }
}
@media (max-width: 640px) {
  .tm-head .grow { flex-basis: calc(100% - 60px); }
  .tm-tip { display: none; }
}

/* ---------- Phase 5: report cards and usage ---------- */
.rc-table td { vertical-align: middle; }
.rc-table textarea.input { font-size: 13.5px; line-height: 1.45; padding: 8px 10px; }
.meter.bad i { background: var(--bad-fill, #c2381c); }
.su-item .hint { margin-top: 6px; }
.su-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 110px; align-items: end; margin-top: 10px; }
.su-day { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.su-day i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--brand); opacity: .85; }
.su-day i.warn { background: #c2381c; }
.su-day span { font-size: 11px; color: var(--ink-3); }
