/* YS eGKB, server-rendered pages. Colours come from tokens.css (the same file the React app uses), so dark and light
   both work from data-theme on <html>. System fonts only: teachers open this on mobile data in the evening and the
   site makes no third-party requests. Layout is the old layout; the skin follows the approved mockup. */
:root { --step: 0.5rem; --radius: 10px; --card: 14px; }
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; font: 0.9375rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.4375rem; letter-spacing: -0.025em; } h2 { font-size: 1.0625rem; } h3 { font-size: 0.9375rem; font-weight: 650; }
p { margin: 0; max-width: 68ch; }
.muted { color: var(--muted); } .small { font-size: 0.8125rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header: the mockup's top bar. The demonstration notice is a quiet amber strip above it. */
.devbar { background: color-mix(in srgb, var(--amber) 11%, var(--bg)); color: var(--amber); text-align: center; font-size: 0.75rem; font-weight: 650;
  letter-spacing: 0.02em; padding: 0.3125rem 1rem; border-bottom: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 72rem; margin: 0 auto; padding: 0.625rem 1rem; min-height: 4rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6875rem; font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--text); text-decoration: none; }
.logo { width: 2.25rem; height: 2.25rem; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 0.8125rem;
  letter-spacing: 0.02em; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--brand-end)); }
.top a:not(.brand) { color: var(--muted); text-decoration: none; font-weight: 550; } .top a:not(.brand):hover { color: var(--text); }
.top .who { font-size: 0.8125rem; color: var(--muted); }
.top form { display: inline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer; }
.linklike:hover { color: var(--text); }
.iconbtn { width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { color: var(--text); border-color: var(--control); }
.iconbtn svg { width: 1.0625rem; height: 1.0625rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.themebtn { display: none; }                       /* needs JavaScript; hidden without it so it is never a dead control */
.js .themebtn { display: grid; }
.themebtn .ico-sun { display: none; } [data-theme="light"] .themebtn .ico-sun { display: block; } [data-theme="light"] .themebtn .ico-moon { display: none; }

.tabs { background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs ul { max-width: 72rem; margin: 0 auto; padding: 0.5rem 0.75rem; list-style: none; display: flex; gap: 0.25rem; overflow-x: auto; }
.tabs a { display: block; padding: 0.4375rem 0.875rem; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a:hover { background: var(--panel2); color: var(--text); }
.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.narrow { max-width: 36rem; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--card); box-shadow: var(--shadow); padding: 1.25rem 1.375rem; min-width: 0; }
.sheet + .sheet, .sheet + h2, .stack > * + * { margin-top: 1rem; }
.sheet > h2 { margin-bottom: 0.75rem; }
.row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.row .push { margin-left: auto; }

.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; border-left-width: 4px; color: var(--text); font-weight: 550; }
.flash.ok { background: var(--accent-soft); border-color: var(--accent); }
.flash.err { background: var(--red-soft); border-color: var(--red); }
.notice { padding: 0.75rem 1rem; border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); border-left: 4px solid var(--amber); background: var(--amber-soft); color: var(--text); border-radius: var(--radius); }
.notice.bad { border-color: color-mix(in srgb, var(--red) 40%, transparent); border-left-color: var(--red); background: var(--red-soft); }

/* The month's money: the one large thing on the teacher's screen. */
.sum { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.monthnav { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.monthnav h1 { margin-right: auto; }
.monthnav a, .monthnav span { min-width: 2.25rem; text-align: center; padding: 0.375rem 0.625rem; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.monthnav a:hover { color: var(--text); border-color: var(--control); }
.monthnav span { color: var(--dim); opacity: 0.6; }

/* The claim's path. A real sequence, so it is drawn as one: a line the claim travels along. */
.rail { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.rail li { position: relative; padding-top: 1.5rem; font-size: 0.8125rem; text-align: center; color: var(--muted); line-height: 1.25; padding-inline: 0.125rem; }
.rail li::before { content: ""; position: absolute; top: 0.3125rem; left: calc(50% - 0.4375rem); width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--panel); border: 2px solid var(--control); z-index: 1; }
.rail li::after { content: ""; position: absolute; top: 0.6875rem; left: -50%; width: 100%; height: 2px; background: var(--line2); }
.rail li:first-child::after { display: none; }
.rail .done { color: var(--text); } .rail .done::before { background: var(--accent); border-color: var(--accent); } .rail .done::after { background: var(--accent); }
.rail .now { color: var(--text); font-weight: 700; } .rail .now::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); } .rail .now::after { background: var(--accent); }
.rail .failed { color: var(--red); font-weight: 700; } .rail .failed::before { background: var(--red); border-color: var(--red); } .rail .failed::after { background: var(--accent); }
@media (max-width: 30rem) {
  .rail { grid-template-columns: 1fr; gap: 0; }
  .rail li { text-align: left; padding: 0 0 0.875rem 1.75rem; font-size: 0.9375rem; }
  .rail li::before { top: 0.25rem; left: 0; }
  .rail li::after { top: -0.875rem; left: 0.375rem; width: 2px; height: 1.25rem; }
}

/* Status labels: the mockup's tags. The words carry the meaning; colour only supports them. */
.pill { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 6px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.pill.wait { background: var(--amber-soft); color: var(--amber); }
.pill.good { background: var(--accent-soft); color: var(--accent); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.plain { background: var(--panel2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }

label { display: block; font-weight: 650; font-size: 0.8125rem; margin-bottom: 0.4375rem; }
input, select, textarea { font: inherit; color: var(--text); width: 100%; padding: 0.625rem 0.875rem; border: 1px solid var(--control); border-radius: var(--radius); background: var(--bg); min-height: 2.75rem; }
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
input[type="checkbox"] { width: 1.25rem; min-height: 1.25rem; height: 1.25rem; vertical-align: -0.2em; margin-right: 0.375rem; accent-color: var(--accent); }
input[type="file"] { padding: 0.4375rem; font-size: 0.875rem; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 650; margin-right: 0.75rem; padding: 0.3125rem 0.75rem; border-radius: 8px; border: 1px solid var(--control); background: var(--panel2); color: var(--text); cursor: pointer; }
textarea { min-height: 4.5rem; resize: vertical; }
.fields { display: grid; gap: 0.875rem; grid-template-columns: 1fr 1fr; }
.fields .wide { grid-column: 1 / -1; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 0.25rem 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.5rem 1.125rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); color: var(--accent-ink); text-decoration: none; }
.btn:active { filter: brightness(0.95); }
.btn.quiet { background: var(--panel); color: var(--text); border-color: var(--control); }
.btn.quiet:hover { background: var(--panel2); border-color: var(--muted); color: var(--text); filter: none; }
.btn.danger { background: var(--panel); color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); color: var(--red); filter: none; }
.btn.small { min-height: 2.25rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 0.75rem 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list .grow { flex: 1 1 12rem; min-width: 0; }
.flaglist { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.flaglist li { padding: 0.5rem 0 0.5rem 0.875rem; border-left: 3px solid var(--amber); margin-top: 0.5rem; }
.flaglist li.block { border-color: var(--red); } .flaglist li.info { border-color: var(--dim); } .flaglist li.cleared { border-color: var(--accent); }
.flaglist form { margin-top: 0.5rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.flaglist form input { flex: 1 1 14rem; width: auto; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th { text-align: left; font-weight: 700; color: var(--dim); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.5625rem 0.75rem 0.5625rem 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 0.75rem 0.75rem 0.75rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--panel2); }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
th, td { padding-left: 0.75rem; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line2); }
tfoot tr:hover td { background: none; }
.bar { height: 0.5rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 5rem; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.over i { background: var(--red); }
.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
.cols > .sheet { margin-top: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.big { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.brand .module { font-weight: 400; opacity: 0.75; margin-left: 0.35rem; font-size: 0.875em; }
.foot { color: var(--dim); font-size: 0.8125rem; text-align: center; padding: 2rem 1rem 1.5rem; }
@media (max-width: 40rem) {
  .fields { grid-template-columns: 1fr 1fr; }
  .sheet { padding: 1rem; border-left: 0; border-right: 0; border-radius: 0; margin-inline: -1rem; box-shadow: none; }
  .sum { font-size: 2.125rem; }
  .top-in { gap: 0.5rem 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tabs a, .iconbtn, input, select, textarea { transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, filter 0.15s; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Inbox count, search results, forms in a grid */
.count { display: inline-block; min-width: 1.25rem; padding: 0 0.375rem; border-radius: 0.625rem; background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--control); font-size: 0.6875rem; font-weight: 700; text-align: center; line-height: 1.25rem; }
.chips { margin-top: 0.375rem; font-size: 0.875rem; line-height: 1.9; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem 1rem; }
.warn { color: var(--amber); font-weight: 600; }

/* The passcode page: the mockup's sign-in layout. Works without JavaScript; the theme switch appears only with it. */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-left { padding: 3.5rem 3.75rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; border-right: 1px solid var(--line);
  background: radial-gradient(900px 500px at 10% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--panel); }
.auth-brand { display: flex; align-items: center; gap: 0.6875rem; }
.auth-brand b { display: block; font-size: 0.96875rem; letter-spacing: -0.01em; }
.auth-brand small { display: block; color: var(--muted); font-size: 0.71875rem; }
.auth-left h2 { font-size: 2.375rem; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 0.875rem; max-width: 30rem; font-weight: 700; }
.auth-left p { color: var(--muted); font-size: 0.96875rem; max-width: 27.5rem; }
.stats { display: flex; flex-wrap: wrap; gap: 0.75rem 2.125rem; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.stats dt { color: var(--muted); font-size: 0.78125rem; }
.auth-right { display: grid; place-items: center; padding: 2.5rem 1.5rem; max-width: none; margin: 0; background: var(--bg); position: relative; }
.auth-form { width: 100%; max-width: 23.25rem; }
.auth-tools { position: absolute; top: 1rem; right: 1rem; }
.auth-form h1 { font-size: 1.375rem; letter-spacing: -0.02em; margin-bottom: 0.375rem; }
.auth-form .lead { color: var(--muted); margin-bottom: 1.375rem; }
.auth-form input { height: 2.75rem; }
.auth-form .btn { margin-top: 0.875rem; }
.auth-note { margin-top: 1.25rem; font-size: 0.75rem; color: var(--dim); text-align: center; }
.auth-note a[aria-current] { color: var(--text); font-weight: 650; text-decoration: none; }
@media (max-width: 56rem) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-left { padding: 1.5rem 1.25rem 1.75rem; gap: 1.25rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-left h2 { font-size: 1.625rem; letter-spacing: -0.02em; }
  .auth-right { padding: 1.5rem 1.25rem 2.5rem; align-items: start; }
  .auth-tools { top: 0.75rem; }
}

/* Printable forms: a sheet of paper on screen, and only the sheet on paper. They are forms, so they stay paper
   in both themes: the tokens are pinned to light values here and the page never follows the theme switch. */
body.printable { --bg: #dfe5ec; --panel: #fff; --panel2: #f7f9fc; --line: #d3dae3; --line2: #c5cdd9; --text: #15233b; --muted: #55637a; --dim: #55637a;
  --control: #7a869b; --accent: #07755a; --amber: #8a560c; --amber-soft: rgba(138, 86, 12, .13); --brand-end: #0a8366; --red: #a1241c; --red-soft: #fdecea; --accent-soft: #e3f1ef;
  --accent-ink: #fff; --shadow: none; --font: "Segoe UI", system-ui, -apple-system, "Noto Sans", Roboto, sans-serif; color-scheme: light; }
body.printable { background: var(--bg); }
.printbar { max-width: 50rem; margin: 1rem auto 0; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; }
.paper { max-width: 50rem; margin: 1rem auto 3rem; background: #fff; padding: 2.5rem; border: 1px solid var(--line); color: #000; }
.paper-head { border-bottom: 2px solid #000; padding-bottom: 0.75rem; margin-bottom: 1.25rem; }
.paper h2 { margin: 1.5rem 0 0.5rem; font-size: 1rem; }
.paper table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.paper th, .paper td { padding: 0.3rem 0.5rem; border-bottom: 1px solid #c9c9c9; text-align: left; vertical-align: top; }
.paper th.r, .paper td.r { text-align: right; }
.paper th { font-size: 0.8125rem; color: var(--muted); font-weight: 600; letter-spacing: normal; text-transform: none; }
.paper tbody tr:hover td { background: none; }
.paper thead th { border-bottom: 1px solid #000; font-weight: 650; }
.paper tfoot td { border-top: 1px solid #000; border-bottom: 0; font-weight: 700; }
.paper table.tight { width: auto; min-width: 60%; }
.paper tr.group th { padding-top: 0.9rem; border-bottom: 1px solid #000; }
.paper tr.sub td { font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.25rem 2rem; margin: 0; font-size: 0.9375rem; }
.facts div { display: flex; gap: 0.75rem; border-bottom: 1px solid #e3e3e3; padding: 0.25rem 0; }
.facts dt { flex: 0 0 9.5rem; color: #444; } .facts dd { margin: 0; }
.paper-foot { margin-top: 2rem; padding-top: 0.75rem; border-top: 1px solid #000; font-size: 0.8125rem; color: #333; }
.paper-foot p { max-width: none; }
@media (max-width: 40rem) { .paper { padding: 1.25rem; } .facts { grid-template-columns: 1fr; } }
@media print {
  @page { size: A4; margin: 15mm; }
  body.printable { background: #fff; }
  .printbar { display: none; }
  .devbar { background: #fff !important; color: #000 !important; border-bottom: 1px solid #000; }
  .paper { border: 0; margin: 0; padding: 0; max-width: none; }
  .paper tr { break-inside: avoid; }
  .paper h2 { break-after: avoid; }
}
.facts + table { margin-top: 1.25rem; }
