/* Hash International School — single stylesheet, no build step.
   l-* layout, c-* components, u-* utilities. Colour, type and spacing come only from the tokens below. */

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #C62828;
  --red-deep: #A61F24;
  --red-soft: #FBECEC;
  --yellow: #F4C430;
  --yellow-soft: #FDF5D8;
  --black: #171717;
  --black-2: #292929;
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --text: #171717;
  --text-2: #4A4744;
  --muted: #666666;
  --border: #E3E0D8;
  --border-2: #EFEDE7;
  --success: #287A45;
  --success-soft: #E6F2EA;
  --warning: #996500;
  --warning-soft: #FBF1DC;
  --danger: #B42318;
  --danger-soft: #FCEBE9;
  --info-soft: #F1EFE9;

  /* aliases used by components */
  --primary: var(--red);
  --primary-dark: var(--red-deep);
  --primary-soft: var(--red-soft);
  --accent: var(--success);
  --accent-soft: var(--success-soft);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: none;
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
  --bottomnav-h: 60px;
  --font: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 8px; }
img, svg { vertical-align: middle; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; box-shadow: 0 0 0 1px var(--black); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.u-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.l-app { min-height: 100vh; }
.l-main { min-width: 0; transition: margin-left .18s ease; }
.l-content { padding: 16px; padding-bottom: calc(var(--bottomnav-h) + 24px + env(safe-area-inset-bottom)); max-width: 1280px; margin: 0 auto; }
@media (min-width: 1024px) {
  .l-main { margin-left: var(--sidebar-w); }
  .is-collapsed .l-main { margin-left: var(--sidebar-w-collapsed); }
  .l-content { padding: 24px 28px 40px; }
}

/* ---------- Sidebar ---------- */
.c-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--black); color: #D9D6CF; display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .2s ease, width .18s ease; }
.is-open .c-sidebar { transform: none; }
@media (min-width: 1024px) {
  .c-sidebar { transform: none; }
  .is-collapsed .c-sidebar { width: var(--sidebar-w-collapsed); }
  .is-collapsed .c-sidebar__label, .is-collapsed .c-sidebar__section, .is-collapsed .c-sidebar__brand-text, .is-collapsed .c-portal-switch span { display: none; }
  .is-collapsed .c-sidebar__link, .is-collapsed .c-portal-switch { justify-content: center; padding-left: 0; padding-right: 0; }
}
.c-sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; height: var(--topbar-h); font-weight: 600; color: #fff; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.c-sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.c-sidebar__section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8C8880; padding: 12px 10px 2px; }
.c-sidebar__link { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 6px 10px; border-radius: var(--radius); color: #D9D6CF; font-size: 15px; }
.c-sidebar__link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.c-sidebar__link.is-active { background: var(--black-2); color: #fff; box-shadow: inset 3px 0 0 var(--yellow); }
.c-sidebar__link svg { flex: none; opacity: .9; }
.c-sidebar__foot { border-top: 1px solid rgba(255,255,255,.08); padding: 8px; }
.c-portal-switch { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border-radius: var(--radius); background: rgba(255,255,255,.06); color: #fff; font-size: 13px; margin: 8px; }
.c-portal-switch:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.c-scrim { position: fixed; inset: 0; background: rgba(23, 23, 23, .5); z-index: 35; display: none; }
.is-open .c-scrim { display: block; }
@media (min-width: 1024px) { .is-open .c-scrim { display: none; } }

/* ---------- Topbar ---------- */
.c-topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 4px; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.c-topbar__title { flex: 1; min-width: 0; padding: 0 4px; }
.c-topbar__title h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-crumbs { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-crumbs a { color: var(--muted); }
.c-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: var(--text-2); border-radius: var(--radius); cursor: pointer; flex: none; }
.c-iconbtn:hover { background: var(--border-2); color: var(--text); text-decoration: none; }
.c-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: var(--yellow-soft); color: var(--black); white-space: nowrap; }
@media (max-width: 480px) { .c-topbar .c-pill { padding: 3px 8px; font-size: 11px; } }

/* ---------- Bottom nav (mobile) ---------- */
.c-bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.c-bottomnav a, .c-bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--bottomnav-h); font-size: 11px; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; }
.c-bottomnav .is-active { color: var(--black); font-weight: 650; box-shadow: inset 0 3px 0 var(--red); }
.c-bottomnav a:hover { text-decoration: none; }
@media (min-width: 768px) { .c-bottomnav { display: none; } .l-content { padding-bottom: 32px; } }

/* ---------- Page header ---------- */
.c-pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.c-pagehead__sub { color: var(--text-2); font-size: 14px; }
.c-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.c-actions form { margin: 0; }

/* ---------- Cards / panels ---------- */
.c-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.c-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); }
.c-card__body { padding: 16px; }
.c-card__body--flush { padding: 0; }
.c-grid { display: grid; gap: 16px; }
@media (min-width: 768px) { .c-grid--2 { grid-template-columns: repeat(2, 1fr); } .c-grid--3 { grid-template-columns: repeat(3, 1fr); } .c-grid--main { grid-template-columns: 2fr 1fr; } }
@media (min-width: 1024px) { .c-grid--4 { grid-template-columns: repeat(4, 1fr); } }
.c-grid--stats { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1024px) { .c-grid--stats { grid-template-columns: repeat(4, 1fr); } }

.c-stat { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: inherit; box-shadow: var(--shadow); }
a.c-stat:hover { border-color: var(--primary); text-decoration: none; }
.c-stat__label { font-size: 14px; color: var(--text-2); }
.c-stat__value { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 639px) { .c-stat { padding: 12px; } .c-stat__value { font-size: 16px; } .c-stat__label { font-size: 11px; } }
.c-stat__hint { font-size: 12px; color: var(--muted); }
.c-stat--danger .c-stat__value { color: var(--danger); }
.c-stat--accent .c-stat__value { color: var(--accent); }

/* Definition list for show pages */
.c-dl { display: grid; grid-template-columns: 1fr; gap: 10px 16px; margin: 0; }
@media (min-width: 640px) { .c-dl { grid-template-columns: repeat(2, 1fr); } }
.c-dl div { min-width: 0; }
.c-dl dt { font-size: 12px; color: var(--muted); }
.c-dl dd { margin: 0; word-break: break-word; }

/* ---------- Buttons ---------- */
.c-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 15px/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.c-btn:hover { border-color: #C9C4B8; text-decoration: none; background: #FBFAF7; }
.c-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.c-btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.c-btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.c-btn--accent:hover { background: #1F6237; color: #fff; }
.c-btn--dark { background: var(--black); border-color: var(--black); color: #fff; }
.c-btn--dark:hover { background: var(--black-2); color: #fff; }
.c-btn--danger { color: var(--danger); }
.c-btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.c-btn--ghost { border-color: transparent; background: none; }
.c-btn--sm { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.c-btn--block { width: 100%; }
.c-btn[disabled], .c-btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------- Forms ---------- */
.c-form { display: grid; gap: 14px; }
.c-form__row { display: grid; gap: 14px; }
@media (min-width: 640px) { .c-form__row--2, .c-form__row--4 { grid-template-columns: repeat(2, 1fr); } .c-form__row--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .c-form__row--4 { grid-template-columns: repeat(4, 1fr); } }
.c-field label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.c-field .req { color: var(--danger); }
.c-input, .c-field input:not([type=checkbox]):not([type=radio]), .c-field select, .c-field textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); font: 15px/1.4 var(--font); }
.c-field textarea { min-height: 88px; resize: vertical; }
.c-field input:focus, .c-field select:focus, .c-field textarea:focus, .c-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--yellow-soft); }
.c-field.has-error input, .c-field.has-error select, .c-field.has-error textarea { border-color: var(--danger); }
.c-field__error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.c-field__hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.c-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.c-check input { width: 20px; height: 20px; accent-color: var(--primary); }
.c-form__foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding-top: 4px; }

/* Filters bar */
.c-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.c-filters > * { flex: 1 1 140px; }
.c-filters .c-input { min-height: 40px; padding: 7px 10px; font-size: 14px; }
.c-filters .c-btn { flex: 0 0 auto; min-height: 40px; }

/* ---------- Tables (become cards on phones) ---------- */
.c-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.c-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.c-table th { text-align: left; font-weight: 650; font-size: 13px; color: var(--text-2); background: var(--info-soft); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.c-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.c-table tr:last-child td { border-bottom: 0; }
.c-table tbody tr:hover { background: #FBFAF6; }
.c-table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-table tfoot td { font-weight: 600; background: var(--info-soft); border-top: 1px solid var(--border); }
.c-table a.row-link { font-weight: 500; }
@media (max-width: 639px) {
  .c-table--stack thead { display: none; }
  .c-table--stack, .c-table--stack tbody, .c-table--stack tr, .c-table--stack td { display: block; width: 100%; }
  .c-table--stack tr { padding: 10px 14px; border-bottom: 1px solid var(--border-2); }
  .c-table--stack td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .c-table--stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .c-table--stack td:first-child { font-size: 15px; justify-content: flex-start; text-align: left; padding-bottom: 4px; }
  .c-table--stack td:first-child::before { display: none; }
  .c-table--stack tfoot tr { background: var(--info-soft); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  .c-table--stack tfoot td { width: auto; padding: 0; }
  .c-table--stack tfoot td:empty { display: none; }
}

/* ---------- Badges ---------- */
.c-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: var(--info-soft); color: var(--text-2); white-space: nowrap; }
.c-badge--blue { background: var(--info-soft); color: var(--black); }
.c-badge--yellow { background: var(--yellow-soft); color: var(--black); }
.c-badge--green { background: var(--success-soft); color: var(--success); }
.c-badge--amber { background: var(--warning-soft); color: var(--warning); }
.c-badge--red { background: var(--danger-soft); color: var(--danger); }

/* ---------- Alerts / flash ---------- */
.c-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.c-alert--success { background: var(--success-soft); color: #1E5E35; border-color: #C3DDCB; }
.c-alert--error { background: var(--danger-soft); color: #8A1C12; border-color: #F1C7C1; }
.c-alert--warning { background: var(--warning-soft); color: #6E4900; border-color: #EBD7A8; }
.c-alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Empty state ---------- */
.c-empty { text-align: center; padding: 36px 16px; color: var(--text-2); }
.c-empty svg { color: var(--muted); margin-bottom: 8px; }
.c-empty h3 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.c-empty p { font-size: 14px; margin-bottom: 14px; }

/* ---------- Lists (timeline, simple rows) ---------- */
.c-list { list-style: none; margin: 0; padding: 0; }
.c-list li { padding: 12px 16px; border-bottom: 1px solid var(--border-2); display: flex; justify-content: space-between; gap: 12px; }
.c-list li:last-child { border-bottom: 0; }
.c-list__main { min-width: 0; }
.c-list__meta { font-size: 12px; color: var(--muted); }

/* Tabs */
.c-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.c-tabs a { padding: 10px 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.c-tabs a.is-active { color: var(--black); border-color: var(--red); font-weight: 650; }
.c-tabs a:hover { text-decoration: none; color: var(--text); }

/* Auth */
.l-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px 72px; background: var(--bg); }
.c-authcard { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--red); border-radius: var(--radius); padding: 28px 24px; }
.c-authcard__title { font-size: 20px; margin-bottom: 8px; }
.c-authcard__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

/* Utilities */
.u-muted { color: var(--muted); } .u-small { font-size: 13px; } .u-danger { color: var(--danger); } .u-success { color: #17734A; } .u-warning { color: var(--warning); }
.u-mt { margin-top: 16px; } .u-mb0 { margin-bottom: 0; } .u-right { text-align: right; } .u-nowrap { white-space: nowrap; }
.u-pre { white-space: pre-line; } .u-hide-sm { } @media (max-width: 639px) { .u-hide-sm { display: none !important; } }
.u-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.u-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Pagination */
.c-pager { display: flex; gap: 6px; justify-content: center; padding: 12px; flex-wrap: wrap; }
.c-pager a, .c-pager span { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font-size: 14px; }
.c-pager .is-current { background: var(--primary); color: #fff; border-color: var(--primary); }
.c-pager .is-disabled { color: var(--muted); }

/* Print */
@media print {
  .c-sidebar, .c-topbar, .c-bottomnav, .c-actions, .c-filters, .c-pager, .no-print { display: none !important; }
  .l-main { margin: 0 !important; } .l-content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; } .c-card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ---------- Brand mark ---------- */
.c-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; background: var(--red); color: #fff; font: 700 13px/1 var(--font); border-radius: var(--radius); box-shadow: inset 0 -4px 0 var(--yellow); }
.c-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; border-radius: var(--radius); }
.c-brandname { font-weight: 700; font-size: 17px; line-height: 1.15; }
.c-brandname small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

/* ---------- Standalone (home-screen) safe areas: iOS notch / Android status bar ---------- */
.c-topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.c-sidebar__brand { padding-top: calc(14px + env(safe-area-inset-top)); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.l-content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* ---------- Demo data banner ---------- */
.c-demo { background: var(--yellow); color: var(--black); font-size: 14px; font-weight: 600; padding: 6px 16px; text-align: center; }

/* ---------- Footer credit ---------- */
.c-footer { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 0 8px; }
.c-footer a { color: var(--text-2); font-weight: 600; }
.c-footer--auth { position: fixed; left: 0; right: 0; bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* ---------- Save to home screen prompt ---------- */
.c-install { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: 44px 1fr; gap: 10px 12px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: 0 10px 30px -10px rgba(23,23,23,.35); }
.c-install[hidden], .c-install-ios[hidden] { display: none; }
.c-install img { border-radius: 10px; border: 1px solid var(--border-2); }
.c-install__text strong { display: block; font-size: 15px; } .c-install__text span { font-size: 13px; color: var(--text-2); }
.c-install__actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.c-install__actions .c-btn--primary { flex: 1; }
.c-install__done { grid-column: 1 / -1; background: none; border: 0; color: var(--muted); font: 12px var(--font); text-decoration: underline; cursor: pointer; padding: 0; justify-self: center; }
@media (min-width: 768px) { .c-install { bottom: 20px; left: auto; right: 20px; } }
.l-auth ~ .c-install, body.is-auth .c-install { bottom: calc(52px + env(safe-area-inset-bottom)); }
.c-install-ios { position: fixed; inset: 0; z-index: 70; background: rgba(23,23,23,.5); display: grid; align-items: end; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.c-install-ios__card { background: #fff; border-radius: 14px; padding: 20px; max-width: 420px; margin: 0 auto; width: 100%; }
.c-install-ios__card ol { padding-left: 20px; margin: 10px 0 16px; line-height: 1.8; }
.c-install-ios__card svg { vertical-align: -3px; color: var(--red); }
@media print { .c-demo, .c-install, .c-footer { display: none !important; } }

/* ---------- Password show / hide ---------- */
.c-pass { position: relative; }
.c-pass input { padding-right: 48px !important; }
.c-pass__eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.c-pass__eye:hover { color: var(--text); }

/* ---------- Four-column board (dashboards / overviews only) ----------
   Items span 1–4 columns; dense flow lets short panels fill gaps, masonry-style, with CSS only. */
.c-board { display: grid; gap: var(--s4); grid-template-columns: 1fr; grid-auto-flow: row dense; align-items: start; }
.c-board > * { margin-bottom: 0; min-width: 0; }
@media (min-width: 640px) { .c-board { grid-template-columns: repeat(2, 1fr); } .c-board .span-2, .c-board .span-3, .c-board .span-4 { grid-column: span 2; } }
@media (min-width: 1024px) { .c-board { grid-template-columns: repeat(4, 1fr); } .c-board .span-3 { grid-column: span 3; } .c-board .span-4 { grid-column: span 4; } }
.c-board .tall { grid-row: span 2; }

/* Figures strip: compact numbers in one bordered row, not a wall of cards */
.c-figures { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--s4); }
.c-figures > * { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border-2); color: inherit; min-width: 0; }
.c-figures > *:nth-child(odd) { border-right: 1px solid var(--border-2); }
@media (min-width: 1024px) {
  .c-figures { grid-template-columns: repeat(4, 1fr); }
  .c-figures > * { border-bottom: 0; border-right: 1px solid var(--border-2); }
  .c-figures > *:last-child { border-right: 0; }
}
a.c-figure:hover { background: #FBFAF6; text-decoration: none; }
.c-figure__label { font-size: 14px; color: var(--text-2); }
.c-figure__value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-figure__hint { font-size: 13px; color: var(--muted); }
.c-figure--alert .c-figure__value { color: var(--danger); }
.c-figure--key { box-shadow: inset 0 3px 0 var(--red); }

.c-card__head h2 { font-size: 16px; }
.c-card__head a { font-size: 14px; }
.c-card--accent { border-top: 3px solid var(--yellow); }

/* ---------- Attendance marking ---------- */
.c-mark-row { display: grid; grid-template-columns: 1fr; gap: var(--s2); padding: 10px 16px; border-bottom: 1px solid var(--border-2); align-items: center; }
@media (min-width: 768px) { .c-mark-row { grid-template-columns: 56px 1fr auto; } }
.c-mark-row:last-child { border-bottom: 0; }
.c-mark-row__roll { color: var(--muted); font-variant-numeric: tabular-nums; }
.c-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.c-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.c-seg label { min-width: 44px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.c-seg input:focus-visible + label { outline: 3px solid var(--yellow); outline-offset: 1px; }
.c-seg input:checked + label { color: #fff; }
.c-seg input[value=present]:checked + label { background: var(--success); border-color: var(--success); }
.c-seg input[value=absent]:checked + label { background: var(--danger); border-color: var(--danger); }
.c-seg input[value=late]:checked + label, .c-seg input[value=half_day]:checked + label { background: var(--warning); border-color: var(--warning); }
.c-seg input[value=leave]:checked + label { background: var(--black-2); border-color: var(--black-2); }
.c-sticky-save { position: sticky; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); padding: var(--s3) var(--s4); display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between; z-index: 5; }
@media (min-width: 768px) { .c-sticky-save { bottom: 0; } }

/* Marks entry */
.c-marks input[type=number] { width: 96px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font: 15px var(--font); text-align: right; }

/* Timetable grid */
.c-tt { width: 100%; border-collapse: collapse; font-size: 14px; }
.c-tt th, .c-tt td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; }
.c-tt th { background: var(--info-soft); font-weight: 650; text-align: left; }
.c-tt td small { display: block; color: var(--muted); }

/* Student header */
.c-person { display: flex; gap: var(--s4); align-items: center; }
.c-person__photo { width: 64px; height: 64px; border-radius: var(--radius); object-fit: cover; background: var(--info-soft); flex: none; display: grid; place-items: center; font-weight: 700; font-size: 22px; color: var(--text-2); }
.c-person h2 { font-size: 20px; }

/* ---------- Printable documents (receipt, report card) ---------- */
.c-doc { background: var(--surface); border: 1px solid var(--border); max-width: 800px; margin: 0 auto var(--s4); padding: var(--s5); }
.c-doc__head { display: flex; justify-content: space-between; gap: var(--s4); border-bottom: 2px solid var(--black); padding-bottom: var(--s3); margin-bottom: var(--s4); }
.c-doc__school { font-size: 20px; font-weight: 700; }
.c-doc__title { text-align: right; font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.c-doc .c-table td, .c-doc .c-table th { padding: 6px 8px; }
.c-doc__sign { display: flex; justify-content: space-between; margin-top: 48px; font-size: 14px; }
.c-doc__sign span { border-top: 1px solid var(--black); padding-top: 4px; min-width: 160px; text-align: center; }
.c-stamp { display: inline-block; border: 2px solid var(--danger); color: var(--danger); font-weight: 700; padding: 4px 10px; transform: rotate(-4deg); }
@media print {
  .c-doc { border: 0; padding: 0; max-width: none; }
  .c-alert, .c-demo { display: none !important; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 12mm; }
}

/* Public demo: role buttons on the sign-in card */
.c-demo-roles { display: grid; gap: var(--s2); }
.c-demo-roles form { margin: 0; }
.c-demo-role { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 14px; min-height: 52px; border: 1px solid var(--border); border-left: 3px solid var(--red); border-radius: var(--radius); background: var(--surface); color: var(--text); font: 15px/1.3 var(--font); cursor: pointer; }
.c-demo-role:hover { background: var(--yellow-soft); }
.c-demo-role span { font-size: 13px; color: var(--muted); }
