/* ESDS — one stylesheet, no build step. Layout is fluid with a fixed maximum width,
   so pages look the same in a maximized or a smaller window; below 900px the side menu
   folds into a top bar. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --ink: #1d2a26;
  --ink-2: #55635e;
  --line: #dfe5e2;
  --brand: #0f6b4f;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #0f6b4f;
  --ok-soft: #e3f1ec;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --radius: 10px;
  --side: 248px;
  --font: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Tamil", "Nirmala UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0; line-height: 1.3; }
h2 { font-size: 17px; margin: 0 0 12px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side); flex: 0 0 var(--side); background: #10261f; color: #dbe7e2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: #9fb7ae; }
.nav { padding: 6px 10px 16px; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #7f9a90; padding: 14px 10px 6px; }
.nav a, .nav span.soon {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 8px; color: #dbe7e2; text-decoration: none; font-size: 14.5px;
}
.nav a:hover { background: #1b3a30; }
.nav a.active { background: var(--brand); color: #fff; }
.nav span.soon { color: #7f9a90; cursor: default; }
.tag-soon { font-size: 10.5px; border: 1px solid #3a5a4f; border-radius: 999px; padding: 0 7px; }
.side-foot { padding: 14px 18px; border-top: 1px solid #23423a; font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .roles { color: #9fb7ae; font-size: 12px; margin-bottom: 8px; }
.side-foot a, .side-foot button { color: #cfe0d9; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }

.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.content { max-width: 1180px; margin: 0 auto; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* ---------- Pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: block; }
.stat .n { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--ink-2); font-size: 13.5px; }
a.stat:hover { border-color: var(--brand); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  padding: 8px 14px; border-radius: 8px; font: inherit; font-size: 14.5px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.sm { padding: 4px 10px; font-size: 13px; font-weight: 600; }

.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14.5px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe0d4; }
.alert.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c2bd; }
.alert ul { margin: 4px 0 0 18px; padding: 0; }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin: 1px 2px 1px 0; white-space: nowrap; }
.badge.grey { background: #eef1f0; color: var(--ink-2); }
.badge.off { background: var(--danger-soft); color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-2); background: #fafbfb; font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
tr.is-off td { color: var(--ink-2); }
.empty { padding: 28px; text-align: center; color: var(--ink-2); }

/* ---------- Forms ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; }
.form { max-width: 720px; }
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field .hint { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.field .error { font-size: 13px; color: var(--danger); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #c9d2ce; border-radius: 8px; background: #fff; color: var(--ink);
}
.filters input, .filters select { width: auto; min-width: 160px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fd3c0; border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; cursor: pointer; background: #fff; }
.check input { margin-top: 4px; }
.check strong { display: block; font-size: 14px; }
.check span { font-size: 12.5px; color: var(--ink-2); }
.check:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.switch { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { color: var(--ink); padding: 0 0 18px; justify-content: center; }
.login-card .brand-mark { color: #fff; }
.login-card .brand-sub { color: var(--ink-2); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 14px; }
.pagination a, .pagination span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: 13.5px; background: #fff; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Narrow windows and phones ---------- */
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 0 100vmax rgba(0,0,0,0); }
  #nav-toggle:checked ~ .shell .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: #10261f; color: #fff; padding: 10px 16px; }
  .topbar label { cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 6px; }
  .topbar .brand-name { font-size: 15px; }
  .content { padding: 20px 16px 40px; }
  .row2 { grid-template-columns: 1fr; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
}
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .side { box-shadow: none !important; }
  #nav-toggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.35); }
}
/* labels inside a .field must keep their own layout */
.field label.check { display: flex; margin-bottom: 0; font-weight: 400; }
.field label.switch { display: inline-flex; margin-bottom: 0; }
@media (min-width: 901px) {
  .shell { background: linear-gradient(to right, #10261f var(--side), var(--bg) var(--side)); }
}
/* attendance grid */
.att th.att-col, .att td.att-col { text-align: center; padding-left: 6px; padding-right: 6px; width: 1%; white-space: nowrap; }
.att th.att-col a { color: var(--ink-2); text-decoration: none; }
.mk { font-weight: 700; }
.mk.ok { color: var(--ok); }
.mk.no { color: var(--danger); }
.pct { font-weight: 700; }
.pct.low { color: var(--danger); }
details.card > summary { cursor: pointer; }
/* attendance taking */
.roll { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.roll .check { align-items: center; }
.roll .check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
.roll .check:not(:has(input:checked)) { border-color: #f5c2bd; background: var(--danger-soft); }
.roll-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.roll-count { font-weight: 600; margin-left: auto; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
@media (max-width: 900px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }
.row3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0 16px; max-width: 720px; }
input[type=date], input[type=time] { width: 100%; font: inherit; font-size: 15px; padding: 7px 10px; border: 1px solid #c9d2ce; border-radius: 8px; background: #fff; color: var(--ink); }
.filters input[type=date] { width: auto; }
@media (max-width: 900px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 .field:first-child { grid-column: 1 / -1; } }
.att td:first-child { min-width: 170px; }
tr.row-bad td { background: #fff7f6; }
code { font-family: Consolas, "Courier New", monospace; font-size: 14px; background: #eef1f0; padding: 1px 6px; border-radius: 5px; }
input[type=file] { font: inherit; font-size: 14.5px; max-width: 100%; }
.tag-count { font-size: 11px; font-weight: 700; background: #f5b83d; color: #10261f; border-radius: 999px; padding: 0 7px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; position: relative; top: -1px; }
.stat .dot { width: 12px; height: 12px; top: -4px; }
.dot.online { background: #12a150; box-shadow: 0 0 0 3px #d6f3e2; }
.dot.away { background: #e0a100; }
.dot.offline { background: #b8c2be; }
.dot.never { background: transparent; border: 2px solid #b8c2be; }
@media (max-width: 600px) { .hide-sm { display: none; } }
/* WhatsApp */
.wa { width: 16px; height: 16px; flex: 0 0 auto; }
.btn.wa-btn { background: #1fa855; border-color: #1fa855; }
.wa-sent { display: inline-flex; align-items: center; gap: 5px; color: #1fa855; font-weight: 700; font-size: 14px; }
.wa-sent .wa { width: 18px; height: 18px; }
.n.money { font-size: 20px; white-space: nowrap; }
.n.warn { color: var(--warn); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two-col > .card { margin-bottom: 18px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 0; } }
.bar-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 14px; }
.bar { background: #eef1f0; border-radius: 6px; height: 14px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar-val { font-weight: 600; white-space: nowrap; }
.n.ok { color: var(--ok); }
td.warn-t { color: var(--warn); font-weight: 600; }
/* One-click class start / end */
.btn.big { font-size: 17px; padding: 12px 22px; }
.btn.stop { background: var(--danger); border-color: var(--danger); }
.start-box, .running-box { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--brand-soft); margin: 6px 0 4px; }
.running-box { background: var(--warn-soft); border-color: #f0dcae; margin-bottom: 16px; }
.running-banner { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border-radius: 10px; background: var(--warn-soft); border: 1px solid #f0dcae; }
.running-banner form { margin-left: auto; }
details.manual { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.manual summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-bottom: 12px; }
.status-running { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.live { font-variant-numeric: tabular-nums; }
/* Approve classes */
.approve-card { padding-bottom: 12px; }
.approve-head { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.approve-body { display: flex; gap: 14px 24px; flex-wrap: wrap; align-items: stretch; }
.approve-form { display: flex; gap: 10px; align-items: flex-end; flex: 1 1 260px; }
.approve-form .field { flex: 1 1 auto; max-width: 220px; }
.ref-box { flex: 1 1 240px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; background: #fbfcfb; }
.ref-box .btn { margin-top: 6px; }
details.reject { margin-top: 12px; }
details.reject summary { cursor: pointer; color: var(--ink-2); font-size: 14px; margin-bottom: 8px; }
.status-approved { background: var(--brand-soft); color: var(--brand); }
.status-paid { background: #e7f0ff; color: #1d4f9c; }
/* Cash book */
.book td, .book th { white-space: nowrap; }
.book td.desc { white-space: normal; min-width: 160px; }
.book tr.in td { background: #f3faf5; }
.book td.neg { color: var(--danger); }
.book tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #f7f9f8; }
.split-row { display: flex; gap: 10px; flex-wrap: wrap; }
.split-row .field { flex: 1 1 150px; max-width: 220px; }
.pay-group { margin-bottom: 16px; }
.pay-group h2 { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
/* Late comers */
.badge.late, .mk.late { background: var(--warn-soft); color: var(--warn); }
.mk.late { font-weight: 700; padding: 0 6px; border-radius: 6px; }
.late-form { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.late-form input[type=time] { width: 120px; padding: 4px 8px; font-size: 14px; }
.absent-list { border-top: 1px solid var(--line); }
.absent-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.absent-row:last-child { border-bottom: 0; }
.absent-row .who { flex: 1 1 200px; min-width: 0; }
.absent-row .wa-cell { margin-left: auto; }
/* ---------- Progress: tabs, charts, grades, tips ---------- */
.ctabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 18px; overflow-x: auto; }
.ctabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; border-bottom: 3px solid transparent; white-space: nowrap; }
.ctabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.ctabs a:hover { color: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e7ecea; stroke-width: 1; }
.chart .ax { font-size: 12px; fill: #6b7773; font-family: var(--font); }
.chart .band { font-weight: 700; fill: #9aa5a1; }
.chart .lbl { font-size: 12px; fill: var(--ink-2); font-weight: 600; font-family: var(--font); }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.grade { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px; font-weight: 800; font-size: 17px; background: #eef1f0; color: var(--ink); }
.grade.sm { min-width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
.grade.g-A { background: #dff3e8; color: #0b6b3f; }
.grade.g-B { background: #e3eefc; color: #1f57a8; }
.grade.g-C { background: #fff2d6; color: #8a5a00; }
.grade.g-S { background: #fde7dc; color: #a2441b; }
.grade.g-F { background: var(--danger-soft); color: var(--danger); }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.st.good { background: #dff3e8; color: #0b6b3f; }
.st.warn { background: var(--warn-soft); color: var(--warn); }
.st.bad { background: var(--danger-soft); color: var(--danger); }
.st.none { background: #eef1f0; color: var(--ink-2); }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #f7f9f8; border: 1px solid var(--line); font-size: 14.5px; }
.tips li .ic { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; margin-top: 1px; }
.tips li.good .ic { background: #12a150; }
.tips li.warn .ic { background: #d48a00; }
.tips li.bad .ic { background: var(--danger); }
.tips li.info .ic { background: #2a78d6; }
.tips li strong { font-weight: 700; }
.subj-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 18px; }
.subj { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; }
a.subj:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(15,107,79,.08); }
.subj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.subj-head h3 { margin: 0; font-size: 17px; }
.subj-head .small { margin-top: 2px; }
.pred { display: flex; align-items: center; gap: 10px; }
.pred .arrow { color: var(--ink-2); font-size: 13px; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meter .k { font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 6px; }
.meter .k b { color: var(--ink); }
.meter .bar { height: 8px; margin-top: 4px; }
.bar span.plan { background: transparent; border-right: 2px solid #8a918e; border-radius: 0; height: 100%; position: relative; top: -8px; }
.bar.two { position: relative; }
.bar.two .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #55635e; }
.bar span.warn { background: #d48a00; }
.bar span.bad { background: var(--danger); }
.next-pill { display: flex; align-items: center; gap: 8px; font-size: 13.5px; background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 6px 10px; }
.hero { background: linear-gradient(120deg, #0f6b4f, #16815f 60%, #1f9a72); color: #fff; border-radius: 14px; padding: 20px 22px; margin-bottom: 18px; display: flex; gap: 14px 24px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.hero h1 { color: #fff; font-size: 23px; }
.hero p { margin: 4px 0 0; color: #d6efe5; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stat { background: rgba(255,255,255,.13); border-radius: 10px; padding: 8px 14px; min-width: 96px; }
.hero-stat .n { font-size: 22px; font-weight: 800; line-height: 1.15; }
.hero-stat .l { font-size: 12px; color: #d6efe5; }
.units { list-style: none; margin: 0; padding: 0; }
.units li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.units li:last-child { border-bottom: 0; }
.units .u-dot { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 2px solid #c9d2ce; color: #fff; }
.units .done .u-dot { background: #12a150; border-color: #12a150; }
.units .started .u-dot { border-color: #2a78d6; background: #fff; color: #2a78d6; }
.units .overdue .u-dot { border-color: var(--danger); background: #fff; color: var(--danger); }
.units .u-name { flex: 1; min-width: 0; }
.units .u-when { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.dist { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.dist span { display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; min-width: 0; }
.dist .g-A { background: #12a150; } .dist .g-B { background: #2a78d6; } .dist .g-C { background: #d48a00; } .dist .g-S { background: #e06b33; } .dist .g-F { background: var(--danger); }
.mini-form { display: inline-flex; gap: 6px; align-items: center; }
.mini-form select { width: auto; padding: 3px 8px; font-size: 14px; }
.marks-table input[type=number] { width: 96px; padding: 5px 8px; }
.marks-table td.abs label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; }
.marks-table tr.is-abs td { background: #fff7f6; }
.unit-table td.u-actions { white-space: nowrap; text-align: right; }
.unit-table td.u-actions form { display: inline; }
.unit-table input[type=month] { width: 150px; font: inherit; font-size: 14px; padding: 4px 8px; border: 1px solid #c9d2ce; border-radius: 8px; }
tr.u-overdue td { background: #fff7f6; }
tr.u-done td { color: var(--ink-2); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.days label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.countdown { font-variant-numeric: tabular-nums; }
/* Student pages: top bar instead of the side menu */
.s-top { background: #10261f; color: #fff; }
.s-top-in { max-width: 1100px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.s-top .brand { padding: 0; }
.s-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.s-nav a { color: #dbe7e2; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 14.5px; }
.s-nav a.active, .s-nav a:hover { background: #1b3a30; color: #fff; }
.s-who { font-size: 13px; color: #9fb7ae; display: flex; gap: 10px; align-items: center; }
.s-who button { color: #cfe0d9; }
.s-main { max-width: 1100px; margin: 0 auto; padding: 24px 24px 48px; }
@media (max-width: 700px) {
  .s-top-in { padding: 10px 16px; }
  .s-main { padding: 16px 16px 40px; }
  .meters { grid-template-columns: 1fr; }
  .subj-grid { grid-template-columns: 1fr; }
  .hero { padding: 16px; }
}
.chart.narrow { display: none; }
@media (max-width: 600px) { .chart.wide { display: none; } .chart.narrow { display: block; } }
.two-col > * { min-width: 0; }
.next-pill { display: block; }
.units .u-name { overflow-wrap: anywhere; }
.units .u-when { white-space: normal; text-align: right; max-width: 40%; }
.stat .mini-form, .stat .mini-form select { max-width: 100%; }
.term-row { display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.term-row:last-child { border-bottom: 0; }
.term-row .who { flex: 0 1 190px; min-width: 150px; }
.term-subjects { list-style: none; margin: 0; padding: 0; flex: 1 1 280px; display: grid; gap: 4px; font-size: 14px; }
.term-subjects li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.term-subjects .sub { min-width: 150px; color: var(--ink-2); }
.term-row .act { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 600px) { .term-row .act { margin-left: 0; } .term-subjects .sub { min-width: 120px; } }
.chart { max-width: 820px; }
.show-sm { display: none; }
@media (max-width: 600px) {
  .show-sm { display: block; }
  td.actions.stack-sm { white-space: normal; }
  td.actions.stack-sm .btn { margin: 2px 0; }
}
/* Outstanding by member */
.out-head { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.out-head > div:first-child { flex: 1 1 220px; }
.out-total { text-align: right; }
.out-total .n { font-size: 20px; font-weight: 700; }
.out-group tfoot td { background: #f7f9f8; border-top: 2px solid var(--line); }
.phone-form { display: inline-flex; gap: 6px; align-items: center; }
.phone-form input[type=text] { width: 190px; padding: 4px 8px; font-size: 14px; }
@media (max-width: 600px) { .phone-form input[type=text] { width: 150px; } }
/* Buttons keep readable text wherever they are placed */
a.btn, button.btn { color: var(--brand-ink); }
a.btn.ghost, button.btn.ghost { color: var(--ink); }
.year-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0c4bf; }
.btn.danger:hover { background: var(--danger-soft); filter: none; }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
