/* Nest School design system, in the Nest family theme (Nest POS, Nest WhatsApp, Nest Mail):
   navy rail, indigo → violet brand, the Nest pink (paper plane) for the one thing that needs you now.
   One family (Plus Jakarta Sans), tabular figures for every number. A school can swap the brand colour for its own. */
@font-face { font-family: 'Jakarta'; src: url('fonts/jakarta.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --brand: #4F46E5;            /* Nest indigo: primary buttons, links */
  --brand-2: #7C3AED;          /* Nest violet */
  --brand-ink: #3730A3;
  --brand-bg: #EEF0FF;
  --rail-bg: #12142A;          /* Nest navy rail, same as every Nest product */
  --bus: #E8457F;              /* Nest pink (the paper plane): attention, the current item */
  --bus-ink: #A3124B;
  --bus-bg: #FFE6EF;
  --paper: #F4F5F8;            /* page */
  --surface: #FFFFFF;
  --sunk: #EEF0F4;
  --ink: #171A2E;
  --ink-2: #4B5068;
  --ink-3: #80859C;
  --line: #E3E5EC;
  --line-2: #D3D6E0;
  --present: #1F8A5B; --present-bg: #E3F4EA;
  --absent: #C8382E;  --absent-bg: #FBE7E4;
  --late: #B7791F;    --late-bg: #FBF0DB;
  --leave: #3A6FD8;   --leave-bg: #E5EDFB;
  --r-s: 6px; --r: 10px; --r-l: 16px;
  --shadow: 0 1px 2px rgba(20, 40, 33, .06), 0 6px 20px -12px rgba(20, 40, 33, .25);
  --rail: 248px;
  --f: 'Jakarta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-mode='dark'] {
  --brand-ink: #B4B0FF; --brand-bg: #1E1D45; --rail-bg: #0B0C1A;
  --bus-ink: #FF8FB6; --bus-bg: #3A1426;
  --paper: #0F1120; --surface: #171A2E; --sunk: #1E2238;
  --ink: #ECEEF8; --ink-2: #B3B7CC; --ink-3: #80859C;
  --line: #262A42; --line-2: #343956;
  --present: #4CC38A; --present-bg: #12301F; --absent: #F07167; --absent-bg: #3A1714;
  --late: #E3A43C; --late-bg: #33260C; --leave: #7FA6F2; --leave-bg: #142340;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.8);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 14.5px/1.5 var(--f); color: var(--ink); background: var(--paper); font-feature-settings: 'tnum' 1, 'cv11' 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.012em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--bus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: 12.5px; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack.s { gap: 6px; } .stack.l { gap: 24px; }
.grow { flex: 1; min-width: 0; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell: dark green rail, quiet topbar, paper canvas */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail { background: var(--rail-bg); color: #C9CCE4; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.rail .brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.rail .brand img { width: 36px; height: 36px; border-radius: 10px; background: #fff1; }
.rail .brand b { font-size: 15px; line-height: 1.15; display: block; }
.rail .brand span { font-size: 12px; opacity: .7; }
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail .grp { font-size: 12px; opacity: .55; padding: 14px 10px 4px; }
.rail a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 550; position: relative; }
.rail a svg { width: 19px; height: 19px; opacity: .8; flex: none; }
.rail a:hover { background: #ffffff12; }
.rail a.on { background: rgba(124, 58, 237, .28); color: #fff; }
.rail a.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--bus); }
.rail .badge { margin-left: auto; background: var(--bus); color: #fff; font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 19px; }
.rail .foot { margin-top: auto; padding: 14px 8px 0; font-size: 12px; opacity: .6; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.top .search { flex: 1; max-width: 420px; position: relative; }
.top .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--ink-3); }
.top .search input { padding-left: 36px; background: var(--sunk); border-color: transparent; }
.top .search .results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); max-height: 380px; overflow: auto; }
.top .search .results button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.top .search .results button:hover, .top .search .results button:focus { background: var(--sunk); }
.chip svg { width: 16px; height: 16px; }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--sunk); font-size: 12.5px; font-weight: 600; color: var(--ink-2); border: 0; }
.page { padding: 28px; max-width: 1320px; width: 100%; margin: 0 auto; }
.phead { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.phead .t { flex: 1; min-width: 240px; }
.phead p { color: var(--ink-2); margin-top: 6px; max-width: 64ch; }
.menu-btn { display: none; }

/* ---------- surfaces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.panel > .ph { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.panel > .pb { padding: 16px 20px 20px; }
.panel.flush > .pb { padding: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.split { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(0, var(--l, 300px)) minmax(0, 1fr); }

/* ---------- today strip: the dashboard's opening line, numbers set large and quiet */
.today { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 18px; }
.today > div { padding: 18px 22px; border-left: 1px solid var(--line); }
.today > div:first-child { border-left: 0; }
.today .v { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.today .l { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.today .s { font-size: 12.5px; margin-top: 8px; color: var(--ink-3); }
.bar { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--present); border-radius: 6px; }

/* ---------- buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); font-weight: 650; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--sunk); }
.btn svg { width: 17px; height: 17px; }
.btn.p { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn.p:hover { filter: brightness(1.08); }
.btn.bus { background: var(--bus); border-color: var(--bus); color: #fff; }
.btn.d { color: var(--absent); border-color: color-mix(in srgb, var(--absent) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--sunk); color: var(--ink); }
.iconbtn svg { width: 19px; height: 19px; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); outline: none; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 20%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field > small { color: var(--ink-3); font-size: 12px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.check { display: flex; gap: 9px; align-items: center; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.seg { display: inline-flex; background: var(--sunk); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* ---------- tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--sunk); }
.tbl .r { text-align: right; }
.tblwrap { overflow: auto; }
.person { display: flex; gap: 11px; align-items: center; min-width: 0; }
.person b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { color: var(--ink-3); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; background: #E0E3F5; color: var(--brand-ink); object-fit: cover; }
.av.f { background: #FBE7EF; color: #9C2D5A; } :root[data-mode='dark'] .av.f { background: #3A1A28; color: #F2A3C3; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--present-bg); color: var(--present); } .pill.bad { background: var(--absent-bg); color: var(--absent); }
.pill.warn { background: var(--late-bg); color: var(--late); } .pill.info { background: var(--leave-bg); color: var(--leave); } .pill.bus { background: var(--bus-bg); color: var(--bus-ink); }
.empty { padding: 48px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); }

/* ---------- roll call: the signature screen. Every child is a tile; one tap cycles present, absent, late. */
.roll { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kid { padding-right: 24px !important; position: relative; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; text-align: left; min-height: 64px; transition: border-color .12s, background .12s; }
.kid .no { font-size: 20px; font-weight: 750; width: 30px; color: var(--ink-3); flex: none; text-align: center; }
.kid b { font-size: 13.5px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kid .st { position: absolute; top: 8px; right: 10px; font-weight: 800; font-size: 12px; }
.kid[data-s='P'] .st { color: var(--present); }
.kid[data-s='A'] { border-color: var(--absent); background: var(--absent-bg); } .kid[data-s='A'] .no, .kid[data-s='A'] .st { color: var(--absent); }
.kid[data-s='L'] { border-color: var(--late); background: var(--late-bg); } .kid[data-s='L'] .no, .kid[data-s='L'] .st { color: var(--late); }
.kid[data-s='H'] { border-color: var(--late); border-style: dashed; } .kid[data-s='E'] { border-color: var(--leave); background: var(--leave-bg); } .kid[data-s='E'] .st { color: var(--leave); }
.rollbar { position: sticky; bottom: 0; margin-top: 18px; display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 12px 16px; box-shadow: var(--shadow); }
.tally { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.tally span { font-weight: 650; } .tally i { font-style: normal; font-size: 20px; font-weight: 750; margin-right: 4px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }

/* ---------- section picker: classes as rows, sections as buttons (fast with 80+ sections) */
.secpick { display: grid; gap: 6px; }
.secpick .cls { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; }
.secpick .cls > b { font-size: 13px; color: var(--ink-2); }
.secpick .secs { display: flex; gap: 6px; flex-wrap: wrap; }
.secbtn { min-width: 38px; height: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; cursor: pointer; }
.secbtn.done { background: var(--present-bg); border-color: transparent; color: var(--present); }
.secbtn.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- admissions board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--sunk); border-radius: var(--r-l); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 300px; }
.col > header { display: flex; justify-content: space-between; padding: 4px 6px 6px; font-weight: 700; }
.col > header span { color: var(--ink-3); font-weight: 600; }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.lead:hover { border-color: var(--line-2); }
.lead.due { box-shadow: inset 3px 0 0 var(--bus); }

/* ---------- timetable grid */
.tt { border-collapse: separate; border-spacing: 4px; width: 100%; }
.tt th { font-size: 12.5px; color: var(--ink-3); font-weight: 650; padding: 4px; }
.tt td { background: var(--sunk); border-radius: 9px; height: 56px; padding: 6px 8px; vertical-align: top; min-width: 110px; cursor: pointer; }
.tt td b { display: block; font-size: 13px; } .tt td small { color: var(--ink-3); font-size: 11.5px; }
.tt td.brk { background: transparent; text-align: center; color: var(--ink-3); font-size: 12px; cursor: default; vertical-align: middle; }
.tt td.empty-cell:hover { outline: 1.5px dashed var(--line-2); }

/* ---------- marks sheet */
.marks td input { width: 84px; text-align: right; height: 34px; }
.marks tr.fail input { color: var(--absent); font-weight: 700; }

/* ---------- report card (screen + print) */
.rc { background: #fff; color: #18221F; max-width: 800px; margin: 0 auto 24px; border: 1px solid #DCE3DF; border-radius: 12px; padding: 32px 36px; page-break-after: always; }
.rc header { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid #4F46E5; padding-bottom: 14px; margin-bottom: 16px; }
.rc header img { width: 54px; height: 54px; }
.rc h2 { font-size: 20px; } .rc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.rc th, .rc td { border: 1px solid #DCE3DF; padding: 7px 10px; font-size: 13px; text-align: left; } .rc th { background: #F2F5F3; }
.rc .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 18px; font-size: 13px; }
.rc .sign { display: flex; justify-content: space-between; margin-top: 44px; font-size: 12.5px; color: #4A5752; }
.rc .sign span { border-top: 1px solid #9AA6A1; padding-top: 6px; min-width: 150px; text-align: center; }

/* ---------- receipt (A5 / thermal-friendly) */
.receipt { background: #fff; color: #18221F; max-width: 420px; margin: 0 auto; padding: 22px; border: 1px dashed #C8D2CD; border-radius: 10px; }
.receipt .amt { font-size: 28px; font-weight: 800; margin: 10px 0; }

/* ---------- drawers, modals, toasts */
.scrim { position: fixed; inset: 0; background: rgba(10, 25, 20, .38); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
.scrim.center { justify-content: center; align-items: center; padding: 16px; }
.drawer { width: min(560px, 100%); height: 100%; background: var(--surface); overflow-y: auto; padding: 22px 24px 40px; animation: slide .2s ease-out; }
.drawer.wide { width: min(820px, 100%); }
.modal { width: min(520px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: var(--r-l); padding: 22px 24px; box-shadow: var(--shadow); }
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
@keyframes fade { from { opacity: 0; } } @keyframes slide { from { transform: translateX(30px); opacity: .4; } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--absent); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 650; color: var(--ink-2); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13.5px; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 550; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal div { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; font-size: 12.5px; font-weight: 650; background: var(--sunk); color: var(--ink-3); }
.cal .P { background: var(--present-bg); color: var(--present); } .cal .A { background: var(--absent); color: #fff; } .cal .L { background: var(--late-bg); color: var(--late); } .cal .E { background: var(--leave-bg); color: var(--leave); }
.alert { padding: 12px 14px; border-radius: var(--r); background: var(--bus-bg); color: var(--bus-ink); font-weight: 550; }
.alert.err { background: var(--absent-bg); color: var(--absent); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.chart > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart > div > i { width: 100%; max-width: 28px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.chart > div > i.low { background: var(--late); }
.chart small { font-size: 10.5px; color: var(--ink-3); }
.hbar { display: grid; grid-template-columns: 54px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.hbar > i { height: 10px; border-radius: 5px; background: var(--brand-bg); position: relative; overflow: hidden; }
.hbar > i > em { position: absolute; inset: 0 auto 0 0; background: var(--brand-2); border-radius: 5px; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 6px; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--sunk); padding: 2px 6px; border-radius: 5px; }
.copy { display: flex; gap: 8px; align-items: center; } .copy code { flex: 1; overflow: auto; padding: 9px 10px; }

/* ---------- sign-in: split, the left half shows the school's day in one quiet line of chalk */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth .art { background: radial-gradient(120% 90% at 100% 100%, #5B2DC9 0%, transparent 55%), var(--rail-bg); color: #E6E8F7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .art::after { content: ''; position: absolute; inset: auto -10% -30% auto; width: 520px; height: 520px; border-radius: 50%; border: 60px solid #ffffff0a; }
.auth .art h1 { font-size: 40px; line-height: 1.08; font-weight: 750; max-width: 13ch; letter-spacing: -.025em; }
.auth .art .day { display: flex; flex-direction: column; gap: 10px; max-width: 360px; position: relative; z-index: 1; }
.auth .art .day div { display: flex; gap: 12px; align-items: center; background: #ffffff10; padding: 11px 14px; border-radius: 12px; }
.auth .art .day b { font-size: 13.5px; } .auth .art .day span { font-size: 12.5px; opacity: .7; }
.auth .art .day i { width: 8px; height: 8px; border-radius: 50%; background: var(--bus); flex: none; }
.auth .form-side { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth .box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.otp { letter-spacing: .5em; font-size: 22px; text-align: center; font-weight: 700; height: 52px; }

/* ---------- parent app: phone-first */
.papp { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--paper); }
.papp .hero { background: radial-gradient(120% 120% at 100% 0%, var(--brand-2), transparent 60%), var(--rail-bg); color: #fff; padding: 22px 20px 54px; border-radius: 0 0 26px 26px; }
.papp .hero .row { justify-content: space-between; }
.papp .kidcard { margin: -38px 16px 0; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.papp .kidcard .av { width: 54px; height: 54px; font-size: 18px; }
.papp .body { padding: 18px 16px 90px; display: flex; flex-direction: column; gap: 14px; }
.papp .tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.papp .due { border: 1.5px solid var(--bus); background: var(--bus-bg); }
.papp .tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(560px, 100%); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.papp .tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 6px 0; cursor: pointer; }
.papp .tabbar button svg { width: 22px; height: 22px; }
.papp .tabbar button.on { color: var(--brand-ink); }

/* ---------- responsive */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .shell.open .rail { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: inline-grid; }
  .top { padding: 0 14px; } .page { padding: 18px 14px; }
  .today { grid-template-columns: 1fr 1fr; } .today > div:nth-child(3) { border-left: 0; } .today > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .g2, .g3, .split { grid-template-columns: minmax(0, 1fr); }
  .split.picked > :first-child { order: 2; } .form { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth .art { display: none; }
  .roll { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .hide-m { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff; } .rail, .top, .noprint, .toasts, .phead { display: none !important; }
  .shell { display: block; } .page { padding: 0; max-width: none; } .rc { border: 0; border-radius: 0; padding: 10mm; margin: 0; } .receipt { border: 0; }
}

/* ---------- parent & student sign-in: the school's own page, light and plain like a real school app */
.gate { min-height: 100vh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; background: var(--paper); }
.gate-top { padding: 22px 20px 54px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gate-top.has-photo { background-size: cover; background-position: center; min-height: 190px; display: flex; align-items: flex-end; border: 0; position: relative; }
.gate-top.has-photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,28,.05) 30%, rgba(10,12,28,.7)); }
.gate-school { display: flex; gap: 12px; align-items: center; position: relative; }
.gate-school img { width: 52px; height: 52px; border-radius: 14px; background: #fff; padding: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12); object-fit: contain; }
.gate-school b { display: block; font-size: 17px; line-height: 1.25; }
.gate-school span { font-size: 13px; color: var(--ink-2); }
.gate-top.has-photo .gate-school b, .gate-top.has-photo .gate-school span { color: #fff; }
.gate-card { margin: -34px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; position: relative; box-shadow: 0 6px 24px -16px rgba(20,22,40,.35); }
.gate-card h1 { font-size: 22px; }
.gate-sub { color: var(--ink-2); margin-top: -8px; }
.gate-foot { padding: 20px 24px 28px; text-align: center; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.gate-brand { color: var(--ink-3); font-size: 12px; margin-top: 8px; }
.phone-in { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.phone-in > span { display: grid; place-items: center; padding: 0 12px; background: var(--sunk); font-weight: 650; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.phone-in .input { border: 0; border-radius: 0; font-size: 18px; letter-spacing: .04em; height: 48px; }
.phone-in:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 20%, transparent); }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-boxes .input { height: 54px; padding: 0; text-align: center; font-size: 22px; font-weight: 700; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand-ink); font-weight: 650; cursor: pointer; text-decoration: underline; }
.wa-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.wa-note svg { width: 18px; height: 18px; color: #1FA855; flex: none; }
/* on a laptop the sign-in page is one framed card in the middle, not a strip floating on the page */
@media (min-width: 600px) {
  .gate { min-height: 0; margin: 6vh auto 40px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px -36px rgba(10, 12, 28, .55); }
  .gate-top { padding: 26px 26px 60px; }
  .gate-card { margin: -36px 20px 0; }
  .gate-foot { margin-top: 8px; }
}
.btn.p:disabled { background: var(--sunk); color: var(--ink-3); opacity: 1; filter: none; }
