/* Nest Construction design system, in the Nest family theme (Nest POS, Nest WhatsApp, Nest Mail, Nest School):
   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 company 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: #B0124F;
  --bus-bg: #FFE9F1;
  --paper: #F4F5F9;            /* page */
  --surface: #FFFFFF;
  --sunk: #F0F1F6;
  --raise: #FAFAFD;            /* a step up inside a panel (rows on hover, inner tiles) */
  --ink: #14172B;
  --ink-2: #474C66;
  --ink-3: #6B7089;
  --line: #E6E8F0;
  --line-2: #D4D7E2;
  --present: #157A4E; --present-bg: #E2F3EA;
  --absent: #C2352B;  --absent-bg: #FCE8E5;
  --late: #A86A0F;    --late-bg: #FCF1DC;
  --leave: #2F63CC;   --leave-bg: #E6EEFC;
  /* charts: categorical in a fixed order (indigo, pink, amber, teal; checked for colour-blind separation), ordinal ramp, grid, axis */
  --c1: #4F46E5; --c2: #E8457F; --c3: #E39B0B; --c4: #0E9F8E;
  --o1: #B9B5F8; --o2: #8C85F1; --o3: #5B52E6; --o4: #2E2795;
  --grid: #ECEDF3; --axis: #C9CCD8; --track: #ECEDF4;
  --hero-bg: #12142A; --hero-ink: #F2F3FB; --hero-ink-2: #A9AECB; --hero-accent: #A5A0FF; --hero-track: rgba(255,255,255,.12); --hero-line: rgba(255,255,255,.09);
  --r-s: 6px; --r: 10px; --r-l: 14px; --r-xl: 20px;
  --shadow: 0 1px 2px rgba(18, 20, 42, .06), 0 10px 28px -14px rgba(18, 20, 42, .28);   /* only for things that float: menus, dialogs, toasts */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --rail: 248px;
  --f: 'Jakarta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-mode='dark'] {
  --brand-ink: #B9B5FF; --brand-bg: #1F1E47; --rail-bg: #0A0B17;
  --bus-ink: #FF93BA; --bus-bg: #3A1528;
  --paper: #0C0E1B; --surface: #151829; --sunk: #1C2035; --raise: #191C30;
  --ink: #ECEEF8; --ink-2: #B1B6CD; --ink-3: #8C91AA;
  --line: #242942; --line-2: #313752;
  --present: #4CC38A; --present-bg: #10301F; --absent: #F27A70; --absent-bg: #3A1714;
  --late: #E6A94A; --late-bg: #33260C; --leave: #86ACF4; --leave-bg: #142340;
  --c1: #6F68F0; --c2: #E0508A; --c3: #BA7E05; --c4: #12998B;
  --o1: #3B3794; --o2: #5650C8; --o3: #8A84F4; --o4: #C3C0FB;
  --grid: #20243A; --axis: #343A55; --track: #232741;
  --hero-bg: #171A33; --hero-accent: #ABA6FF; --hero-track: rgba(255,255,255,.10); --hero-line: rgba(255,255,255,.08);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -14px rgba(0,0,0,.85);
  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; }
.rail-scrim { display: none; }
/* phones: the top bar fits 390 px (project picker shrinks, the account chip shows only its icon) */
@media (max-width: 560px) {
  .top { gap: 6px; }
  .top .grow { display: none; }
  .top select.input { flex: 1 1 0; min-width: 0; width: 0 !important; max-width: none !important; }
  .top .chip { font-size: 0; gap: 0; padding: 7px; }
  .top .chip svg { width: 18px; height: 18px; }
}
/* rail sub-items:a module with pages expands under itself (chevron), thin guide line, 13px items; the open page is marked */
.rail .mrow { position: relative; }
.rail .mrow > a.has-sub { padding-right: 36px; }
.rail .ml { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail .mod.open > .mrow > a.on { background: #ffffff10; }
.rail .chev { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; opacity: .55; }
.rail .chev:hover { background: #ffffff18; opacity: 1; }
.rail .chev svg { width: 15px; height: 15px; transition: transform .15s ease; }
.rail .chev[aria-expanded='true'] svg { transform: rotate(90deg); }
.rail .subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 19px; padding-left: 9px; border-left: 1px solid #ffffff1f; }
.rail .subnav a { font-size: 13px; font-weight: 500; line-height: 1.35; padding: 5px 10px; color: #A9AECB; }
.rail .subnav a:hover { color: #fff; background: #ffffff0f; }
.rail .subnav a.on { color: #fff; font-weight: 650; background: rgba(124, 58, 237, .30); }
.rail .subnav a.on::before { left: -10px; top: 5px; bottom: 5px; width: 2px; border-radius: 2px; background: #C4B5FD; }
.rail a:focus-visible, .rail .chev:focus-visible { outline: 2px solid #C4B5FD; outline-offset: -2px; }
.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: var(--brand); 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; max-width: 100%; overflow-x: auto; }
.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: 24px; background: var(--c1); border-radius: 4px 4px 0 0; 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; }
  .shell.open .rail-scrim { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,.4); }
  .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; }
.gate-demo { margin: 0 0 16px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bus) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bus) 30%, transparent); font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* ---------- Nest Construction additions: site app and portal, tiles, progress bars, Gantt, KPI cards */
.papp { padding: 0 14px; }
.ptop { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 20; }
.ptop img { border-radius: 9px; background: #fff; padding: 3px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; color: var(--ink); min-height: 104px; }
.tile svg { width: 26px; height: 26px; color: var(--brand-ink); }
.tile b { font-size: 15px; } .tile small { color: var(--ink-3); font-size: 12.5px; }
.tile:active { transform: scale(.98); }
.fieldmode .btn.lg, .fieldmode .input { min-height: 44px; }
.alert.warn { background: var(--late-bg); color: var(--late); } .alert.ok { background: var(--present-bg); color: var(--present); } .alert.info { background: var(--leave-bg); color: var(--leave); }
.prog { height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; min-width: 60px; }
.prog > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.prog.warn > i { background: var(--late); } .prog.bad > i { background: var(--absent); } .prog.ok > i { background: var(--present); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 750; letter-spacing: -.02em; } .kpi .l { color: var(--ink-2); font-size: 13px; } .kpi .s { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.kpi.bad .v { color: var(--absent); } .kpi.warn .v { color: var(--late); } .kpi.ok .v { color: var(--present); }
.gantt { position: relative; overflow-x: auto; }
.gantt .grow-row { display: grid; grid-template-columns: 260px 1fr; align-items: center; border-bottom: 1px solid var(--line); min-height: 30px; }
.gantt .bar-track { position: relative; height: 30px; }
.gantt .gbar { position: absolute; top: 8px; height: 14px; border-radius: 4px; background: var(--brand-bg); border: 1px solid var(--brand); overflow: hidden; }
.gantt .gbar > i { display: block; height: 100%; background: var(--brand); opacity: .75; }
.gantt .gbar.base { top: 23px; height: 4px; background: var(--ink-3); border: 0; opacity: .5; }
.gantt .gbar.late { border-color: var(--absent); } .gantt .gbar.late > i { background: var(--absent); }
.gantt .today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bus); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.grp td { background: var(--sunk); font-weight: 700; }
.tbl tr.sub td { color: var(--ink-2); font-size: 13px; }
.tbl tfoot td { font-weight: 750; border-top: 2px solid var(--line-2); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--sunk); }
.doc { background: #fff; color: #171A2E; padding: 28px; border-radius: 6px; font-size: 13px; }
.doc table { width: 100%; border-collapse: collapse; } .doc th, .doc td { border: 1px solid #C9CCD8; padding: 5px 7px; text-align: left; } .doc td.r, .doc th.r { text-align: right; }
.doc h2 { font-size: 17px; } .doc .muted { color: #4B5068; }
@media print { .noprint { display: none !important; } .doc { padding: 0; } }

/* ---------- Arabic and right-to-left (i18n.mjs sets <html lang="ar" dir="rtl">). System Arabic fonts only, nothing loaded from outside. */
:root[lang="ar"] { --f: 'Noto Sans Arabic', 'Segoe UI', Tahoma, 'Geeza Pro', 'Jakarta', system-ui, sans-serif; }
.ar { font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, 'Geeza Pro', sans-serif; }
[dir="rtl"] .rail a.on::before { left: auto; right: -12px; border-radius: 4px 0 0 4px; }
[dir="rtl"] .rail .badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .top .search > svg { left: auto; right: 11px; }
[dir="rtl"] .top .search input { padding-left: 12px; padding-right: 36px; }
[dir="rtl"] .top .search .results button, [dir="rtl"] .lead, [dir="rtl"] .tile { text-align: right; }
[dir="rtl"] .tbl th, [dir="rtl"] .rc th, [dir="rtl"] .rc td, [dir="rtl"] .doc th, [dir="rtl"] .doc td { text-align: right; }
[dir="rtl"] .tbl .r, [dir="rtl"] .tbl td.r, [dir="rtl"] .tbl th.r, [dir="rtl"] .doc td.r, [dir="rtl"] .doc th.r, [dir="rtl"] .right, [dir="rtl"] .marks td input { text-align: left; }
[dir="rtl"] .today > div { border-left: 0; border-right: 1px solid var(--line); } [dir="rtl"] .today > div:first-child { border-right: 0; }
[dir="rtl"] .kid { padding-right: 12px !important; padding-left: 24px !important; } [dir="rtl"] .kid .st { right: auto; left: 10px; }
[dir="rtl"] .tally i { margin-right: 0; margin-left: 4px; } [dir="rtl"] .legend span::before { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .phone-in > span { border-right: 0; border-left: 1px solid var(--line-2); }
[dir="rtl"] .drawer { animation-name: slide-rtl; } @keyframes slide-rtl { from { transform: translateX(-30px); opacity: .4; } }
[dir="rtl"] svg.flip { transform: scaleX(-1); }
[dir="rtl"] .num, [dir="rtl"] input[type="date"], [dir="rtl"] input[inputmode="decimal"], [dir="rtl"] input[inputmode="numeric"], [dir="rtl"] input[type="email"], [dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 860px) {
  [dir="rtl"] .rail { left: auto; right: 0; transform: translateX(100%); }
  [dir="rtl"] .shell.open .rail { transform: none; }
}
/* bilingual documents (tax invoice, PO): English on the left, Arabic on the right, whatever the screen language */
[dir="rtl"] .doc[dir="ltr"] th, [dir="rtl"] .doc[dir="ltr"] td { text-align: left; }
[dir="rtl"] .doc[dir="ltr"] th.r, [dir="rtl"] .doc[dir="ltr"] td.r { text-align: right; }
.doc .bi { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.doc .ar { direction: rtl; unicode-bidi: isolate; text-align: right; }
.doc th .ar, .doc td .ar { display: block; font-weight: 500; font-size: 11.5px; color: #4B5068; }
.doc .qr { width: 118px; height: 118px; image-rendering: pixelated; }

/* =====================================================================================================================
   ui2: the refreshed Nest Construction look. Everything below refines the rules above (same class names, so page code is
   untouched): one type scale, quiet hairlines, flat surfaces separated by a tone step, shadows only on what floats,
   tabular figures for every number, and the Today dashboard (hero band, widgets, charts).
   Type scale: 12 · 13 · 14 · 16 · 20 · 28 · 34.  Space: 4 · 8 · 12 · 16 · 20 · 24 · 32.
   ===================================================================================================================== */
body { font-size: 14px; line-height: 1.5; letter-spacing: -.003em; }
h1 { font-size: 28px; font-weight: 750; letter-spacing: -.022em; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
.num, .tbl td.r, .kpi .v, .today .v { font-variant-numeric: tabular-nums; }
.sr { white-space: nowrap; left: 0; top: 0; clip-path: inset(50%); }

/* ---------- rail */
.rail { padding: 16px 10px 14px; scrollbar-width: thin; scrollbar-color: #ffffff22 transparent; }
.rail .brand { padding: 4px 8px 16px; margin-bottom: 4px; border-bottom: 1px solid #ffffff10; }
.rail .brand img { width: 34px; height: 34px; border-radius: 9px; background: #fff; padding: 3px; }
.rail .brand b { font-size: 14.5px; color: #fff; letter-spacing: -.01em; }
.rail .brand span { font-size: 12px; opacity: .6; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.rail .grp { font-size: 11.5px; font-weight: 600; opacity: .48; padding: 16px 10px 5px; letter-spacing: .01em; }
.rail a { padding: 7px 10px; font-size: 13.5px; font-weight: 550; color: #C3C7E2; border-radius: 8px; transition: background .12s, color .12s; }
.rail a svg { width: 18px; height: 18px; opacity: .72; }
.rail a:hover { background: #ffffff0d; color: #fff; }
.rail a.on { background: #ffffff14; color: #fff; }
.rail a.on svg { opacity: 1; color: #C4BFFF; }
.rail a.on::before { left: -10px; top: 7px; bottom: 7px; width: 3px; }
.rail .mod.open > .mrow > a.on { background: transparent; }
.rail .subnav { margin: 1px 0 6px 18px; padding-left: 10px; border-left-color: #ffffff17; }
.rail .subnav a { font-size: 13px; padding: 5px 10px; color: #9EA3C3; }
.rail .subnav a.on { background: #ffffff12; color: #fff; }
.rail .subnav a.on::before { left: -11px; background: var(--bus); }
.rail .badge { font-size: 11px; line-height: 18px; padding: 0 6px; }
.rail .foot { opacity: .55; line-height: 1.7; border-top: 1px solid #ffffff10; margin-top: 14px; }

/* ---------- top bar: search with a shortcut, compact pickers, account chip */
.top { height: 60px; padding: 0 24px; gap: 8px; background: var(--paper); backdrop-filter: none; border-bottom-color: var(--line); }
.top .search { flex: 0 1 440px; max-width: 440px; }
.top .search input { height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); padding-right: 64px; transition: border-color .12s, box-shadow .12s; }
.top .search input:hover { border-color: var(--line-2); }
.top .search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px/1 var(--f); color: var(--ink-3); background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; pointer-events: none; }
.top .search .results { top: 46px; padding: 6px; border-radius: 12px; }
.top .search .results button { border-radius: 8px; }
.top .search .results button.on { background: var(--sunk); }
.top .search .results .av { width: 32px; height: 32px; border-radius: 9px; }
.top .search .results .av svg { width: 16px; height: 16px; position: static; transform: none; color: var(--brand-ink); }
.pick { position: relative; display: inline-flex; align-items: center; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); transition: border-color .12s; min-width: 0; }
.pick:hover { border-color: var(--line-2); }
.pick:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent); }
.pick > svg { position: absolute; left: 10px; width: 16px; height: 16px; pointer-events: none; color: var(--ink-3); }
.pick::after { content: ''; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: solid var(--ink-3); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); pointer-events: none; }
.pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; height: 100%; padding: 0 30px 0 33px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; outline: none; max-width: 250px; text-overflow: ellipsis; }
.pick.lang select { max-width: 120px; }
.pick select option { background: var(--surface); color: var(--ink); }
.dotbadge { position: absolute; top: 2px; right: 0; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 99px; box-shadow: 0 0 0 2px var(--paper); }
.dotbadge.bus { background: var(--bus); }
.me-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px; border: 0; background: transparent; border-radius: 99px; cursor: pointer; text-align: left; }
.me-chip:hover { background: var(--sunk); }
.me-chip .av { width: 30px; height: 30px; font-size: 11.5px; background: var(--brand); color: #fff; }
.me-t b { display: block; font-size: 13px; line-height: 1.15; }
.me-t small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.2; white-space: nowrap; }
@media (max-width: 1180px) { .me-t { display: none; } .me-chip { padding: 0 4px; } }
@media (max-width: 560px) {
  .top { padding: 0 10px; gap: 4px; }
  .top .search { flex: 0 0 auto; max-width: none; width: 38px; }
  .top .search input { width: 38px; padding: 0; color: transparent; cursor: pointer; }
  .top .search input::placeholder { color: transparent; }
  .top .search input:focus { position: fixed; left: 10px; right: 10px; top: 11px; width: auto; z-index: 30; padding: 0 12px 0 36px; color: var(--ink); cursor: text; }
  .top .search input:focus::placeholder { color: var(--ink-3); }
  .top .search:focus-within > svg { position: fixed; left: 21px; top: 30px; z-index: 31; }
  .top .search .results { position: fixed; top: 56px; left: 10px; right: 10px; }
  .top .search kbd { display: none; }
  .top .grow { display: block; flex: 1; }
  .pick { flex: 0 1 auto; }
  .pick select { max-width: 112px; padding-right: 24px; font-size: 13px; }
  .pick.lang select { width: 36px; max-width: 36px; padding: 0; color: transparent; } .pick.lang::after { display: none; } .pick.lang > svg { left: 10px; }
  .pick::after { right: 9px; }
}

/* ---------- page header and breadcrumb */
.page { padding: 26px 28px 48px; max-width: 1400px; }
.phead { align-items: flex-end; gap: 6px 16px; margin-bottom: 20px; }
.phead .crumb { flex-basis: 100%; display: flex; gap: 7px; align-items: center; font-size: 12.5px; color: var(--ink-3); margin-bottom: -2px; flex-wrap: wrap; }
.phead .crumb a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.phead .crumb a:hover { color: var(--brand-ink); text-decoration: underline; }
.phead .crumb > span[aria-hidden] { opacity: .5; }
.phead p { margin-top: 4px; font-size: 14px; }
.phead .acts { gap: 8px; }

/* ---------- surfaces */
.panel { border-radius: var(--r-l); border-color: var(--line); }
.panel > .ph { padding: 16px 20px 0; min-height: 30px; }
.panel > .ph h2 { font-size: 15px; }
.panel > .pb { padding: 14px 20px 20px; }
.grid { gap: 16px; }

/* ---------- buttons and fields */
.btn { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 650; border-color: var(--line-2); transition: background .12s, border-color .12s, transform .08s, box-shadow .12s; }
.btn:hover { background: var(--sunk); border-color: color-mix(in srgb, var(--line-2) 70%, var(--ink-3)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.p { background: var(--brand); }
.btn.p:hover { background: color-mix(in srgb, var(--brand) 88%, #000); filter: none; }
.btn.bus:hover { background: color-mix(in srgb, var(--bus) 88%, #000); }
.btn.d:hover { background: var(--absent-bg); }
.btn.ghost:hover { background: var(--sunk); border-color: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; border-radius: 12px; }
.iconbtn { border-radius: 10px; transition: background .12s, color .12s; }
.input, select.input, textarea.input { height: 38px; border-radius: 10px; border-color: var(--line-2); transition: border-color .12s, box-shadow .12s; font-size: 14px; }
.input:hover { border-color: color-mix(in srgb, var(--line-2) 60%, var(--ink-3)); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808599' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
[dir="rtl"] select.input { padding-right: 12px; padding-left: 32px; background-position: left 11px center; }
.field > span { font-size: 12.5px; color: var(--ink-2); }
.form { gap: 14px 16px; }
.seg { border-radius: 10px; padding: 3px; }
.seg button { padding: 5px 12px; font-size: 13px; border-radius: 7px; transition: background .12s, color .12s; }
.seg button:hover:not(.on) { color: var(--ink); }
.seg button.on { box-shadow: 0 1px 2px rgba(18,20,42,.12), 0 0 0 1px var(--line); }
:root[data-mode='dark'] .seg button.on { background: var(--line-2); box-shadow: none; }
.tabs { gap: 2px; margin-bottom: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 10px 12px 11px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); border-bottom-width: 2px; transition: color .12s, border-color .12s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-color: var(--brand); }

/* ---------- tables: sticky header, hairlines, right-aligned tabular numbers, quiet hover */
.tblwrap { border-radius: inherit; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 14px; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); border-bottom: 0; z-index: 1; }
.tbl td { padding: 10px 14px; border-bottom-color: var(--line); font-size: 13.5px; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--raise); }
.tbl tbody tr.click:hover { background: var(--sunk); }
.tbl td.r, .tbl th.r, .tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.grp td { background: var(--sunk); font-size: 13px; }
.tbl tfoot td { border-top: 1px solid var(--line-2); background: var(--raise); }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.panel.flush .tbl th:first-child, .panel.flush .tbl td:first-child { padding-left: 20px; }
.panel.flush .tbl th:last-child, .panel.flush .tbl td:last-child { padding-right: 20px; }

/* ---------- status pills: a dot carries the tone as well as the colour */
.pill { padding: 2px 9px 2px 8px; font-size: 12px; font-weight: 600; line-height: 18px; gap: 6px; }
.pill.ok::before, .pill.bad::before, .pill.warn::before, .pill.info::before, .pill.bus::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip { background: var(--sunk); }

/* ---------- KPI tiles: icon and label, value, note or change */
.kpis { gap: 12px; }
.kpis.fit { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin: 0; }
@media (max-width: 1100px) { .kpis.fit { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.fit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { border-radius: var(--r-l); padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .l { order: -1; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.kpi .l svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.kpi .v { font-size: 24px; line-height: 1.15; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.delta { font-weight: 700; font-size: 11.5px; white-space: nowrap; }
.delta.up { color: var(--present); } .delta.down { color: var(--absent); }

/* ---------- loading, empty */
.sk { display: block; height: 12px; border-radius: 6px; background: var(--sunk); position: relative; overflow: hidden; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.page > .loading { padding: 32px 0; max-width: 720px; }
.empty { padding: 44px 20px; }
.empty-ic { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--sunk); color: var(--ink-3); }
.empty-ic svg { width: 20px; height: 20px; }

/* ---------- drawers, modals, toasts */
.scrim { background: rgba(10, 12, 28, .45); }
.drawer { padding: 22px 24px 40px; box-shadow: var(--shadow); }
.modal { border-radius: var(--r-xl); padding: 22px 24px; }
.dhead { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.toast { border-radius: 12px; padding: 11px 16px; font-size: 13.5px; }
@keyframes slide { from { transform: translateX(24px); opacity: .3; } }

/* ---------- the Today dashboard */
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; align-items: stretch; }
.dash > .w { min-width: 0; display: flex; flex-direction: column; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.dash > .w > * { flex: 1; }
.w-s { grid-column: span 1; } .w-m { grid-column: span 2; } .w-l { grid-column: 1 / -1; }
@media (max-width: 1100px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .w-m { grid-column: 1 / -1; } }
@media (max-width: 720px) { .dash { grid-template-columns: minmax(0, 1fr); gap: 12px; } .w-s, .w-m { grid-column: 1 / -1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.wp { display: flex; flex-direction: column; }
.wp > .pb { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.wp .ph .open { text-decoration: none; font-weight: 650; font-size: 12.5px; padding: 4px 8px; margin-right: -8px; border-radius: 7px; }
.wp .ph .open:hover { background: var(--sunk); }
.wp .ph .count { font-size: 12px; font-weight: 700; background: var(--bus-bg); color: var(--bus-ink); padding: 1px 8px; border-radius: 99px; }

/* hero band: a field of the Nest navy in both modes, the greeting and the pulse */
.dhero { background: var(--hero-bg); color: var(--hero-ink); border-radius: var(--r-xl); padding: 24px 26px 0; position: relative; overflow: hidden; }
.dhero h1 { font-size: 30px; color: #fff; }
.dhero .hero-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dhero .hero-top > div:first-child { flex: 1; min-width: 220px; }
.dhero .hero-top p { color: var(--hero-ink-2); margin-top: 4px; }
.dhero .btn { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #fff; }
.dhero .btn:hover { background: rgba(255,255,255,.14); }
.pulse { display: grid; grid-template-columns: minmax(296px, 1.4fr) repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; margin-top: 22px; }
.pm { padding: 4px 18px 20px; border-left: 1px solid var(--hero-line); min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pm.pm-lead { flex-direction: row; align-items: center; gap: 16px; border-left: 0; padding-left: 0; }
.pm-lead > div:not(.ring) { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pm .pl { font-size: 12.5px; color: var(--hero-ink-2); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm .pr { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pm .pv { font-size: 24px; font-weight: 750; letter-spacing: -.025em; color: #fff; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm.pm-lead .pv { font-size: 34px; }
.pm .ps { font-size: 12px; color: var(--hero-ink-2); line-height: 1.4; }
.pm .spark { flex: none; margin-bottom: 3px; }
.pm.bad .pv { color: #FF9C93; } .pm.warn .pv { color: #FFD08A; }
.dhero .delta.up { color: #6EE3A8; } .dhero .delta.down { color: #FF9C93; }
.dhero .ring span b { font-size: 21px; color: #fff; } .dhero .ring span small { color: var(--hero-ink-2); }
.hero-foot { display: flex; margin: 0 -26px; border-top: 1px solid var(--hero-line); background: rgba(255,255,255,.03); overflow-x: auto; scrollbar-width: none; }
.hero-foot > * { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 26px; border: 0; border-left: 1px solid var(--hero-line); background: transparent; color: inherit; font: inherit; text-align: left; white-space: nowrap; min-width: 0; }
.hero-foot > *:first-child { border-left: 0; }
.hero-foot button { cursor: pointer; transition: background .12s; } .hero-foot button:hover { background: rgba(255,255,255,.06); }
.hero-foot span { font-size: 12.5px; color: var(--hero-ink-2); } .hero-foot b { font-size: 14.5px; color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 1320px) { .pulse { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); row-gap: 10px; } .pm.pm-lead { grid-column: 1 / -1; padding-bottom: 14px; } .pm:nth-child(2) { border-left: 0; padding-left: 0; } }
@media (max-width: 720px) {
  .dhero { padding: 20px 16px 0; border-radius: 16px; } .dhero h1 { font-size: 23px; }
  .dhero .hero-top { flex-wrap: nowrap; } .dhero .hero-top > div:first-child { min-width: 0; } .dhero .hero-top .acts { flex-wrap: nowrap; gap: 6px; } .dhero .btn { padding: 0 10px; }
  .attn { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .ag { padding: 10px; gap: 8px; } .ag-i { display: none; } .ag-l small { display: none; } .ag > b { font-size: 22px; }
  .pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pm { padding: 4px 12px 14px; } .pm:nth-child(2n) { border-left: 0; padding-left: 0; } .pm.pm-lead { grid-column: 1 / -1; }
  .pm.pm-lead .pv { font-size: 28px; } .pm .pv { font-size: 20px; } .pm .spark { display: none; }
  .hero-foot { margin: 0 -16px; flex-wrap: wrap; } .hero-foot > * { flex: 1 1 50%; padding: 11px 16px; border-top: 1px solid var(--hero-line); } .hero-foot > *:nth-child(odd) { border-left: 0; }
}

/* small stats inside widgets */
.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stats.vert { flex-direction: column; gap: 12px; }
.st { display: flex; flex-direction: column; min-width: 0; }
.st b { font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.st span { font-size: 12.5px; color: var(--ink-3); }
.st.bad b { color: var(--absent); } .st.warn b { color: var(--late); } .st.ok b { color: var(--present); } .st.bus b { color: var(--bus-ink); }
.bad-t { color: var(--absent); } .warn-t { color: var(--late); } .ok-t { color: var(--present); } .-t { color: inherit; }
.pcode { font-weight: 700; font-size: 12px; letter-spacing: .02em; background: var(--sunk); color: var(--ink-2); padding: 1px 7px; border-radius: 6px; }
.none { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13.5px; padding: 6px 0; }
.none > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--present-bg); color: var(--present); flex: none; }
.none > span svg { width: 15px; height: 15px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; }
.keys > div { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.keys i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; align-self: center; }
.keys b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.keys > .faint { margin-left: auto; }

/* lists inside widgets */
.lis { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.li { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 9px; text-align: left; cursor: pointer; color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.li:hover { background: var(--sunk); }
.li-i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none; color: var(--ink-3); background: var(--sunk); }
.li-i svg { width: 15px; height: 15px; }
.li.bad .li-i { color: var(--absent); background: var(--absent-bg); } .li.warn .li-i { color: var(--late); background: var(--late-bg); } .li.info .li-i { color: var(--leave); background: var(--leave-bg); }
.li-r { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.acc { display: flex; flex-direction: column; }
.acc > div, .acc > .accb { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; min-width: 0; }
.acc > :first-child { border-top: 0; }
.acc.tight > div { padding: 7px 0; }
.acc .accb { width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; border-radius: 0; }
.acc .accb:hover .ell { color: var(--brand-ink); }
.acc b.num { font-weight: 700; white-space: nowrap; } .acc b.neg { color: var(--absent); }
.acc small, .ell small { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .r { text-align: right; flex: none; } .acc .r small { text-align: right; }
.ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--sunk); color: var(--ink-2); min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.date.bad { background: var(--absent-bg); color: var(--absent); }
.days { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 50px; height: 42px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); font-size: 10.5px; line-height: 1.1; }
.days b { font-size: 16px; } .days.bad { background: var(--absent-bg); color: var(--absent); } .days.warn { background: var(--late-bg); color: var(--late); }
.mbar { display: block; height: 4px; border-radius: 4px; background: var(--track); margin-top: 6px; overflow: hidden; max-width: 220px; }
.mbar > i { display: block; height: 100%; background: var(--late); border-radius: 4px; }
.mbar.bad > i { background: var(--absent); }
.stk .r b { display: block; }

/* needs attention: one card per kind, counted; one opens to its items */
.attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.ag { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; color: var(--ink); transition: border-color .12s, background .12s, transform .12s; position: relative; }
.ag:hover { border-color: var(--line-2); background: var(--raise); }
.ag.on { border-color: currentColor; }
.ag.bad.on { border-color: var(--absent); background: var(--absent-bg); } .ag.warn.on { border-color: var(--late); background: var(--late-bg); }
.ag > b { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ag-i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; }
.ag-i svg { width: 17px; height: 17px; }
.ag.bad .ag-i { background: var(--absent-bg); color: var(--absent); } .ag.warn .ag-i { background: var(--late-bg); color: var(--late); }
.ag.bad > b { color: var(--absent); }
.ag-l { font-size: 13px; font-weight: 650; line-height: 1.25; min-width: 0; }
.ag-l small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.attn-list { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); animation: rise .25s var(--ease) both; }

/* approvals by type */
.appr { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.appr button { display: grid; grid-template-columns: minmax(0, 2fr) minmax(36px, 1fr) 26px 54px; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; color: inherit; font-size: 13px; }
.appr button:hover { background: var(--sunk); }
.appr .al { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appr .ab { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.appr .ab i { display: block; height: 100%; background: var(--bus); border-radius: 4px; }
.appr b { text-align: right; font-variant-numeric: tabular-nums; }
.appr em { font-style: normal; text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.more { align-self: flex-start; text-decoration: none; }

/* project cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--ink); font: inherit; transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; min-width: 0; }
.pcard:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); transform: translateY(-2px); box-shadow: 0 10px 24px -18px rgba(30, 30, 90, .5); }
.pc-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-n { font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; letter-spacing: -.01em; }
.pc-c { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-m { display: flex; align-items: center; gap: 16px; margin: 8px 0 4px; }
.pc-bars { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pc-bars > div { display: grid; grid-template-columns: 68px minmax(0, 1fr) 64px; align-items: center; gap: 8px; font-size: 12px; }
.pc-bars span { color: var(--ink-3); }
.pc-bars i { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.pc-bars em { display: block; height: 100%; border-radius: 3px; }
.pc-bars b { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.pc-s { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.pc-k { display: flex; gap: 14px; }
.pc-k span { display: flex; flex-direction: column; font-size: 11.5px; color: var(--ink-3); text-align: right; }
.pc-k b { white-space: nowrap; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pc-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.pc-f .lab { display: inline-flex; align-items: center; gap: 5px; } .pc-f .lab svg { width: 14px; height: 14px; color: var(--ink-3); }
.pcard.wide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: 'h m s' 'n m s' 'c m s' 'f m s'; column-gap: 28px; row-gap: 6px; align-items: start; }
.pcard.wide .pc-h { grid-area: h; } .pcard.wide .pc-n { grid-area: n; min-height: 0; } .pcard.wide .pc-c { grid-area: c; } .pcard.wide .pc-f { grid-area: f; align-self: end; }
.pcard.wide .pc-m { grid-area: m; margin: 0; align-self: center; } .pcard.wide .pc-s { grid-area: s; border-top: 0; margin: 0; padding: 0; flex-direction: column; align-items: stretch; align-self: center; gap: 12px; }
.pcard.wide .pc-k { justify-content: space-between; }
@media (max-width: 900px) { .pcard.wide { display: flex; align-items: stretch; } .pcard.wide .pc-m { margin: 8px 0 4px; } .pcard.wide .pc-s { flex-direction: row; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; } .pcard.wide .pc-s .minicurve { width: 40%; } }
.pmini { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.pmini:hover { background: var(--sunk); }
.pmini small { display: block; font-size: 12px; color: var(--ink-3); }
.pmini .ring span { font-size: 10.5px; }

/* gauges and funnel */
.gauges { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.gauge { position: relative; display: flex; flex-direction: column; align-items: center; width: 132px; flex: none; }
.gauge b { position: absolute; top: 34px; font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.gauge b small { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-left: 1px; }
.gauge > span { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 4px; line-height: 1.3; }
.gauges .stats { flex: 1; min-width: 150px; }
.funnel-h { display: flex; align-items: center; gap: 18px; }
.custom .crow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); flex-wrap: wrap; row-gap: 4px; cursor: grab; }
.custom .crow.drag { background: var(--sunk); }
.custom .crow.add { border-style: dashed; cursor: default; flex-wrap: nowrap; }
.custom .crow b { font-size: 13.5px; min-width: 140px; }
.custom .grip { color: var(--ink-3); width: 14px; }

/* ---------- charts (charts.mjs) */
.chart-x { position: relative; width: 100%; min-width: 0; }
.chart-x svg { display: block; overflow: visible; }
.chart-x .tk { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-x g.dim path { opacity: .35; transition: opacity .12s; }
.chart-x rect:focus { outline: none; } .chart-x rect:focus-visible { outline: 2px solid var(--bus); }
.chart-x svg > g > path, .chart-x svg > path { animation: fadein .6s var(--ease) both; }
@keyframes fadein { from { opacity: 0; } }
.ctip { position: absolute; transform: translate(-50%, -100%); margin-top: -6px; background: var(--ink); color: var(--surface); border-radius: 10px; padding: 8px 10px; font-size: 12px; min-width: 150px; pointer-events: none; z-index: 5; box-shadow: var(--shadow); white-space: nowrap; }
.ctip b { display: block; font-size: 12px; margin-bottom: 4px; }
.ctip div { display: flex; align-items: center; gap: 7px; line-height: 1.6; }
.ctip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ctip span { margin-left: auto; padding-left: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ctip .net { border-top: 1px solid color-mix(in srgb, var(--surface) 25%, transparent); margin-top: 4px; padding-top: 3px; }
.lgd { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.lgd span { display: inline-flex; align-items: center; gap: 6px; }
.lgd i { width: 10px; height: 10px; border-radius: 3px; } .lgd i.dash { height: 2px; border-radius: 0; width: 14px; }
.spark { display: block; overflow: visible; }
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; }
.ring .ring-v { transition: stroke-dasharray .8s var(--ease); }
.ring > span { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; font-weight: 750; font-size: 14px; font-variant-numeric: tabular-nums; }
.ring > span b { font-size: 16px; } .ring > span small { font-size: 10.5px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: var(--lw, 120px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.hb.click { cursor: pointer; }
.hb-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-l small { display: block; font-size: 11.5px; color: var(--ink-3); }
.hb-t { height: 12px; background: var(--track); border-radius: 0 4px 4px 0; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 0 4px 4px 0; transform-origin: left; animation: growx .7s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } }
.hb-v { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 52px; text-align: right; }
.stackbar .sb { display: flex; gap: 2px; border-radius: 4px; overflow: hidden; background: var(--track); }
.stackbar .sb i { display: block; min-width: 3px; transition: opacity .12s; } .stackbar .sb i.dim { opacity: .35; }
.stackbar .sb-l { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px 12px; margin-top: 10px; }
.stackbar .sb-l span { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-3); position: relative; padding-left: 14px; }
.stackbar .sb-l i { position: absolute; left: 0; top: 4px; width: 9px; height: 9px; border-radius: 3px; }
.stackbar .sb-l em { font-style: normal; } .stackbar .sb-l b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.minicurve { display: block; overflow: visible; flex: 0 1 auto; min-width: 0; max-width: 100%; height: auto; }

/* ---------- sign-in (office, site app and portal share the gate) */
.gate-top { background: var(--hero-bg); border-bottom: 0; color: #fff; }
.gate-top .gate-school b { color: #fff; } .gate-top .gate-school span { color: var(--hero-ink-2); }
.gate-card { border-radius: 18px; padding: 24px 22px; }
.gate-card h1 { font-size: 22px; letter-spacing: -.02em; }
@media (min-width: 600px) { .gate { border-radius: 24px; } }

/* ---------- site app and portal: the same surfaces, phone first */
.papp { padding: 0 16px; }
.ptop { padding: 12px 0; background: var(--paper); }
.ptop b { font-size: 15px; letter-spacing: -.01em; }
.papp > select.input { height: 46px !important; border-radius: 12px; font-weight: 650; background-color: var(--surface); }
.tiles { gap: 10px; }
.tile { border-radius: 16px; padding: 16px; min-height: 112px; gap: 4px; transition: border-color .12s, transform .1s, background .12s; }
.tile:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--raise); }
.tile svg { width: 24px; height: 24px; color: var(--brand); margin-bottom: auto; stroke-width: 2; }
.tile b { font-size: 15px; letter-spacing: -.01em; margin-top: 12px; }
.papp .tabs { margin: 12px 0 16px !important; }
.papp .panel > .pb { padding: 14px 16px 16px; }

/* ---------- right to left */
[dir="rtl"] .pick > svg { left: auto; right: 10px; } [dir="rtl"] .pick::after { right: auto; left: 11px; }
[dir="rtl"] .pick select { padding: 0 33px 0 30px; }
[dir="rtl"] .top .search input { padding-left: 64px; padding-right: 36px; } [dir="rtl"] .top .search kbd { right: auto; left: 9px; }
[dir="rtl"] .pm { border-left: 0; border-right: 1px solid var(--hero-line); } [dir="rtl"] .pm.pm-lead { border-right: 0; padding-right: 0; padding-left: 18px; }
[dir="rtl"] .hero-foot > * { border-left: 0; border-right: 1px solid var(--hero-line); text-align: right; } [dir="rtl"] .hero-foot > *:first-child { border-right: 0; }
[dir="rtl"] .li, [dir="rtl"] .ag, [dir="rtl"] .appr button, [dir="rtl"] .pcard, [dir="rtl"] .pmini, [dir="rtl"] .acc .accb, [dir="rtl"] .me-chip { text-align: right; }
[dir="rtl"] .keys > .faint { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pc-k span, [dir="rtl"] .acc .r, [dir="rtl"] .appr b, [dir="rtl"] .appr em, [dir="rtl"] .hb-v { text-align: left; }
[dir="rtl"] .hb-t, [dir="rtl"] .hb-t i { border-radius: 4px 0 0 4px; transform-origin: right; }
[dir="rtl"] .stackbar .sb-l span { padding-left: 0; padding-right: 14px; } [dir="rtl"] .stackbar .sb-l i { left: auto; right: 0; }
[dir="rtl"] .rail .subnav { margin: 1px 18px 6px 0; padding-left: 0; padding-right: 10px; border-left: 0; border-right: 1px solid #ffffff17; }
[dir="rtl"] .rail .subnav a.on::before { left: auto; right: -11px; }
[dir="rtl"] .rail .chev { right: auto; left: 4px; } [dir="rtl"] .rail .mrow > a.has-sub { padding-right: 10px; padding-left: 36px; }
[dir="rtl"] .rail .chev svg { transform: scaleX(-1); } [dir="rtl"] .rail .chev[aria-expanded='true'] svg { transform: rotate(90deg); }
[dir="rtl"] .dotbadge { right: auto; left: 0; }
[dir="rtl"] .chart-x svg { direction: ltr; }
@media (max-width: 1320px) { [dir="rtl"] .pm:nth-child(2) { border-right: 0; padding-right: 0; } }

@media (max-width: 860px) { .page { padding: 18px 14px 40px; } .phead { margin-bottom: 16px; } h1 { font-size: 24px; } }
@media print { .dhero { background: #fff; color: #000; } .dash > .w { animation: none; } }
@media (prefers-reduced-motion: reduce) { .sk::after { display: none; } .pcard:hover { transform: none; } }

/* ---------- sign-in frame beside the product panel (laptops); phones keep the single card */
.gate-art { display: none; }
.small > svg, .muted > svg, .faint > svg { width: 1.1em; height: 1.1em; vertical-align: -.18em; }
@media (min-width: 1000px) {
  .gate-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); }
  .gate-art { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; background: var(--hero-bg); color: var(--hero-ink); padding: 44px 56px; position: relative; overflow: hidden; }
  .ga-brand { display: flex; align-items: center; gap: 12px; } .ga-brand img { background: #fff; border-radius: 11px; padding: 4px; } .ga-brand b { font-size: 17px; color: #fff; letter-spacing: -.01em; }
  .ga-body { max-width: 470px; }
  .ga-body h2 { font-size: 38px; line-height: 1.08; font-weight: 750; letter-spacing: -.03em; color: #fff; margin-bottom: 30px; }
  .ga-body ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
  .ga-body li { padding-left: 22px; position: relative; } .ga-body li::before { content: ''; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bus); }
  .ga-body li b { display: block; color: #fff; font-size: 15px; } .ga-body li span { color: var(--hero-ink-2); font-size: 14px; line-height: 1.5; }
  .ga-foot { color: var(--hero-ink-2); font-size: 12.5px; }
  .gate-shell .gate { margin: auto; align-self: center; width: min(480px, calc(100% - 48px)); }
}
@media (min-width: 1000px) {
  .gate-shell .gate-top:not(.has-photo) { background: var(--surface); border-bottom: 1px solid var(--line); }
  .gate-shell .gate-top:not(.has-photo) .gate-school b { color: var(--ink); } .gate-shell .gate-top:not(.has-photo) .gate-school span { color: var(--ink-2); }
  .gate-shell .gate-top:not(.has-photo) .gate-school img { box-shadow: 0 0 0 1px var(--line); }
}
/* amounts stay left-to-right inside Arabic text (₹12.90 Cr, not Cr ₹12.90) */
[dir="rtl"] .pv, [dir="rtl"] .st b, [dir="rtl"] .keys b, [dir="rtl"] .hb-v, [dir="rtl"] .acc b.num, [dir="rtl"] .hero-foot b, [dir="rtl"] .pc-bars b, [dir="rtl"] .pc-k b,
[dir="rtl"] .kpi .v, [dir="rtl"] .appr em, [dir="rtl"] .stackbar .sb-l b, [dir="rtl"] .ctip span, [dir="rtl"] .date, [dir="rtl"] .gauge b, [dir="rtl"] .ring > span { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; } .kpi .v { font-size: 20px; } .kpi .l { font-size: 12px; }
  .pick > svg { display: none; } .pick select { padding-left: 11px; } .pick.lang > svg { display: block; }
}
.top .search > svg { pointer-events: none; z-index: 1; }
[dir="rtl"] .pm .ps, [dir="rtl"] .pm .pl, [dir="rtl"] .st span, [dir="rtl"] .ag-l { unicode-bidi: plaintext; }
