/* Layout: navy side navigation + light working canvas; cards only for data groups. */
:root {
  --navy: #0B1A33; --navy-2: #13284A; --navy-3: #2A3D61; --nav-ink: #C9D3E6; --nav-muted: #8EA0BF;
  --bg: #EEF1F6; --surface: #FFFFFF; --surface-2: #F2F5FA; --surface-3: #F7F9FC;
  --ink: #0E1726; --ink-2: #3A4A63; --muted: #5B6B85; --line: #E1E6EF; --line-2: #D5DCE8;
  --blue: #1F4FD8; --blue-d: #163A9E; --blue-t: #E6EDFD; --on-blue: #FFFFFF;
  --amber: #F5B83D; --amber-d: #8A5E06; --amber-t: #FDF1D8;
  --green: #14794A; --green-t: #E3F5EC; --red: #B83C17; --red-2: #E2552B; --red-t: #FDE8E1;
  --violet: #6D28D9; --violet-t: #EFE8FC; --teal: #0F766E; --teal-t: #E0F2F1;
  --scrim: rgba(11,26,51,.5);
  --f-ui: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A1426; --surface: #111E36; --surface-2: #17274A; --surface-3: #142342;
  --ink: #E8EDF6; --ink-2: #C3CDE0; --muted: #93A2BE; --line: #22345A; --line-2: #2D4270;
  --blue: #5B8CFF; --blue-d: #86A8FF; --blue-t: #1A2D5C; --on-blue: #0A1426;
  --amber-d: #F5C566; --amber-t: #3A2E10; --green: #4CC38A; --green-t: #10321F; --red: #FF8A65; --red-2: #FF7A52; --red-t: #3A1C12;
  --violet: #B79BFF; --violet-t: #2A1E4E; --teal: #4FD1C5; --teal-t: #0F2F2C; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0A1426; --surface: #111E36; --surface-2: #17274A; --surface-3: #142342;
  --ink: #E8EDF6; --ink-2: #C3CDE0; --muted: #93A2BE; --line: #22345A; --line-2: #2D4270;
  --blue: #5B8CFF; --blue-d: #86A8FF; --blue-t: #1A2D5C; --on-blue: #0A1426;
  --amber-d: #F5C566; --amber-t: #3A2E10; --green: #4CC38A; --green-t: #10321F; --red: #FF8A65; --red-2: #FF7A52; --red-t: #3A1C12;
  --violet: #B79BFF; --violet-t: #2A1E4E; --teal: #4FD1C5; --teal-t: #0F2F2C; color-scheme: dark }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { color: var(--blue-d); }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; letter-spacing: -.01em; }
button { font: inherit; }
.mono { font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.s { width: 16px; height: 16px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 2px; }

/* Demo strip */

/* Shell */
.shell { display: flex; min-height: calc(100vh - 36px); }
.sidebar { width: 264px; flex: none; background: var(--navy); color: var(--nav-ink); padding: 22px 14px 28px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; color: #FFFFFF; }
.brand:hover { color: #FFFFFF; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: #1F4FD8; display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.brand-name { display: block; font-weight: 800; font-size: 20px; letter-spacing: .06em; }
.brand-sub { display: block; font-size: 10px; letter-spacing: .22em; color: var(--nav-muted); }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--nav-muted); padding: 18px 14px 8px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--nav-ink); font-weight: 600; min-height: 44px; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #FFFFFF; }
.nav-link.on { background: rgba(255,255,255,.11); color: #FFFFFF; font-weight: 700; }
.nav-link.on svg { color: #F5B83D; }
.nav-link.off { opacity: .45; cursor: default; }
.nav-link.off:hover { background: transparent; color: var(--nav-ink); }
.soon { margin-left: auto; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-block: 16px; padding-left: 28px; padding-right: 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.page-title { font-size: 25px; font-weight: 800; }
.page-title small { font-size: 15px; color: var(--muted); font-weight: 700; }
.tb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me { display: flex; align-items: center; gap: 10px; }
.me b { display: block; font-size: 14px; }
.me span { font-size: 12px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.avatar.b { background: var(--blue-t); color: var(--blue); }
.avatar.a { background: var(--amber-t); color: var(--amber-d); }
.avatar.g { background: var(--green-t); color: var(--green); }
.avatar.v { background: var(--violet-t); color: var(--violet); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.menu-btn { display: none !important; }
.content { padding-block: 26px 48px; padding-left: 28px; padding-right: 28px; display: flex; flex-direction: column; gap: 20px; max-width: 1440px; width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-d); color: var(--on-blue); }
.btn-amber { background: #F5B83D; color: #0B1A33; font-weight: 800; }
.btn-amber:hover { background: #E8A92A; color: #0B1A33; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-light { border-color: rgba(255,255,255,.28); color: #FFFFFF; background: transparent; }
.btn-light:hover { background: rgba(255,255,255,.08); color: #FFFFFF; }
.btn-danger { background: var(--red-t); color: var(--red); }
.btn-success { background: #14794A; color: #FFFFFF; }
.btn-success:hover { background: #0F6039; color: #FFFFFF; }
.btn-block { width: 100%; min-height: 52px; font-size: 16px; font-weight: 800; border-radius: 14px; }
.ibtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.ibtn:hover { background: var(--surface-2); }
.ibtn.plain { border: 0; background: transparent; color: var(--muted); }
.ibtn.plain:hover { background: var(--surface-2); color: var(--ink); }

/* Cards & chips */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 17px; font-weight: 800; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.t-b { background: var(--blue-t); color: var(--blue); }
.t-a { background: var(--amber-t); color: var(--amber-d); }
.t-g { background: var(--green-t); color: var(--green); }
.t-r { background: var(--red-t); color: var(--red); }
.t-v { background: var(--violet-t); color: var(--violet); }
.t-t { background: var(--teal-t); color: var(--teal); }
.t-x { background: var(--surface-2); color: var(--muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpi { padding: 18px; gap: 12px; color: inherit; cursor: pointer; text-align: left; }
.kpi:hover { border-color: var(--line-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-v { font-size: 29px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-l { font-size: 14px; color: var(--muted); font-weight: 600; }
.bar { height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 6px; background: currentColor; }

.hero { background: var(--navy); color: #FFFFFF; border-radius: 22px; padding: 26px 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 380px; background: repeating-linear-gradient(90deg, transparent 0 34px, rgba(245,184,61,.16) 34px 64px); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #F5B83D; }
.hero-t { font-size: 27px; font-weight: 800; line-height: 1.2; margin: 6px 0; }
.hero-s { color: #A9B7D0; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.split { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 3px; background: var(--bg); }
.legend { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.chart { display: flex; gap: 10px; height: 230px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font: 500 11px var(--f-mono); color: var(--muted); padding-bottom: 26px; text-align: right; }
.plot { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 26px; background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col i { width: 60%; max-width: 26px; min-height: 2px; background: var(--blue); border-radius: 6px 6px 2px 2px; }
.col:last-child i { background: #F5B83D; }
.col em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.col b { position: absolute; bottom: -24px; font-size: 12px; color: var(--muted); font-weight: 600; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 14px; border-top: 1px solid var(--bg); color: var(--ink); background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; }
.li:first-child { border-top: 0; }
.li:hover { background: var(--surface-3); color: var(--ink); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 14px; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tab { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.tab .n { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.tab.on { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.tab.on .n { background: #F5B83D; color: #0B1A33; }
.tcard { padding: 0; gap: 0; overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; height: 44px; flex: 1 1 240px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; flex: 1; min-width: 0; color: var(--ink); }
.sel { height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-weight: 600; font-size: 14px; background: var(--surface); color: var(--ink); }
.twrap { overflow-x: auto; }
table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
th { background: var(--surface-3); text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 12px 14px; font-weight: 700; white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid var(--bg); vertical-align: middle; }
tbody tr:hover td { background: var(--surface-3); }
.act { text-align: right; white-space: nowrap; }
.person { display: flex; align-items: center; gap: 12px; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.person b { display: block; }
.person span span { font-size: 12px; color: var(--muted); }
.tfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager button { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink); cursor: pointer; }
.pager button.on { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.pager button:disabled { color: var(--line-2); cursor: default; }

/* Forms */
.flay { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.fmain { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.faside { flex: 1 1 290px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 700; }
.opt { font-weight: 600; color: var(--muted); }
.in { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 12px; font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); }
.in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.in.ico-l { padding-left: 44px; }
.inwrap { position: relative; }
.inwrap > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.inwrap .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.bad { border-color: var(--red-2) !important; }
.err { color: var(--red); font-size: 13px; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); min-height: 44px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 700; padding: 0 0 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input, .oc input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 14px; cursor: pointer; }
.pill input:checked + span { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.pill input:focus-visible + span, .oc input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 2px; }
.ocs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.oc { position: relative; }
.oc span { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; height: 100%; }
.oc .ico { width: 40px; height: 40px; background: var(--bg); color: var(--ink-2); }
.oc small { font-size: 12px; color: var(--muted); font-weight: 600; }
.oc input:checked + span { border-color: var(--blue); background: var(--blue-t); }
.oc input:checked + span .ico { background: var(--blue); color: var(--on-blue); }
.ups { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.up { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px 12px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--surface-3); text-align: center; cursor: pointer; min-height: 140px; }
.up:hover { border-color: var(--blue); }
.up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.up small { font-size: 12px; color: var(--muted); word-break: break-all; }
.up.has { border-style: solid; border-color: var(--green); background: var(--green-t); }
.summary { background: var(--navy); color: #FFFFFF; border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.summary .r { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.summary .r span:first-child { color: var(--nav-ink); }
.summary hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 0; width: 100%; }
.summary .tot { font-size: 25px; font-weight: 800; }
.summary .in { background: var(--navy-2); color: #FFFFFF; border-color: rgba(255,255,255,.2); }
.note { display: flex; gap: 10px; padding: 13px 15px; border-radius: 14px; font-size: 13px; line-height: 1.5; align-items: flex-start; }
.note.w { background: var(--amber-t); color: var(--amber-d); }
.note.ok { background: var(--green-t); color: var(--green); }
.note.e { background: var(--red-t); color: var(--red); }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 22px; margin: 0; }
.dl dt { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.dl dd { margin: 4px 0 0; font-weight: 600; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tl li { display: flex; gap: 10px; font-size: 14px; }
.tl .dot { margin-top: 8px; color: var(--blue); flex: none; }

/* Login */
.auth { min-height: calc(100vh - 36px); display: flex; flex-wrap: wrap; background: var(--bg); }
.auth-brand { flex: 1 1 460px; min-height: 380px; background: var(--navy); color: #FFFFFF; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 52px; }
.road { position: absolute; left: 66%; top: -10%; bottom: -10%; width: 240px; transform: translateX(-10%) rotate(14deg); background: var(--navy-2); }
.road::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: repeating-linear-gradient(180deg, #F5B83D 0 48px, transparent 48px 88px); animation: drive 2.4s linear infinite; }
.road::after { content: ""; position: absolute; left: 14px; right: 14px; top: 0; bottom: 0; border-left: 3px solid rgba(255,255,255,.18); border-right: 3px solid rgba(255,255,255,.18); }
@keyframes drive { from { background-position: 0 0; } to { background-position: 0 88px; } }
.auth-brand > *:not(.road) { position: relative; }
.auth-copy { display: flex; flex-direction: column; gap: 14px; max-width: 420px; padding-block: 40px; }
.auth-copy h2 { font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.auth-copy p { font-size: 16px; line-height: 1.6; color: #A9B7D0; }
.auth-form-wrap { flex: 1 1 400px; display: flex; align-items: center; justify-content: center; padding-block: 44px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-form { width: 100%; max-width: 410px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h1 { font-size: 31px; font-weight: 800; }

/* Modal */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 80; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.modal { background: var(--surface); border-radius: 18px; padding: 22px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }

/* Students list & registration (photos, round actions) */
.search-pill { display: flex; align-items: center; height: 46px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); padding: 0 6px 0 18px; min-width: 220px; }
.search-pill input { border: 0; background: transparent; outline: none; font: inherit; font-size: 15px; flex: 1; min-width: 0; color: var(--ink); }
.search-pill button { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.round-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; color: #FFFFFF; cursor: pointer; box-shadow: 0 4px 12px rgba(11,26,51,.15); }
.rb-blue { background: #1F4FD8; } .rb-blue:hover { background: #163A9E; }
.rb-orange { background: #F97316; } .rb-orange:hover { background: #EA580C; }
.rb-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 999px; background: #F5B83D; color: #0B1A33; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.row-actions { display: flex; gap: 8px; align-items: center; }
.round-sm { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; color: #FFFFFF; }
.rs-white { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); box-shadow: 0 2px 6px rgba(11,26,51,.08); }
.rs-white:hover { background: var(--surface-2); }
.rs-blue { background: #1F4FD8; } .rs-blue:hover { background: #163A9E; }
.rs-violet { background: #9333EA; } .rs-violet:hover { background: #7E22CE; }
.photo-thumb { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); padding: 2px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface); cursor: pointer; }
.photo-thumb img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.photo-thumb span { width: 100%; height: 100%; border-radius: 50%; background: var(--blue-t); color: var(--blue); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.st-table td { padding-top: 9px; padding-bottom: 9px; }
.cell-name button { display: block; font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.cell-name .mono { font-size: 11px; }
.cell-clip { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-dot { width: 40px; height: 40px; border-radius: 50%; background: #9CA3AF; color: #FFFFFF; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.cert-dot.is-on { background: #14794A; }
.row-menu { position: fixed; z-index: 90; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(11,26,51,.2); padding: 6px; display: flex; flex-direction: column; }
.row-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.row-menu button:hover, .row-menu button:focus { background: var(--surface-2); outline: none; }
.identity { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.photo-pick { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 180px; text-align: center; cursor: pointer; }
.photo-frame { width: 160px; height: 190px; border-radius: 18px; border: 2px dashed var(--line-2); background: var(--surface-3); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty svg { width: 64px; height: 64px; color: var(--line-2); }
.photo-pick:hover .photo-frame { border-color: var(--blue); }
.photo-pick:focus-within .btn { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 2px; }
.place-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.place-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-3); }
.place-box legend { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 0 6px; }
.ocs { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
/* Printed registration form */
.sf .sf-sec { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #FFFFFF; background: #0B1A33; padding: 6px 10px; margin: 12px 0 0; border-left: 4px solid #F5B83D; }
.sf .sf-grid { width: 100%; min-width: 0; border-collapse: collapse; }
.sheet.sf .sf-grid td { width: 50%; padding: 5px 10px; border-bottom: 1px solid #E1E6EF; color: #0E1726; background: #FFFFFF !important; vertical-align: top; font-size: 12.5px; }
.sf-k { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: #5B6B85; font-weight: 700; }
.sf-v { display: block; font-size: 13px; }
.sf-photo { width: 130px; height: 160px; border: 1px solid #C9D3E6; border-radius: 8px; background: #F7F9FC; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; color: #8EA0BF; font-size: 11px; }
.sf-photo img { width: 100%; height: 100%; object-fit: cover; }
.sf-chk { display: inline-flex; width: 13px; height: 13px; border: 1px solid #5B6B85; margin-right: 6px; align-items: center; justify-content: center; font-size: 10px; vertical-align: -2px; }
@media (max-width: 900px) { .search-pill { min-width: 0; flex: 1 1 100%; } }

/* Finance */
.m-in { color: var(--green); font-weight: 800; }
.m-out { color: var(--red); font-weight: 800; }
.voided td { color: var(--muted); text-decoration: line-through; }
.voided td .chip, .voided td a { text-decoration: none; }
table.items { width: 100%; border-collapse: collapse; font-size: 14px; }
table.items td { padding: 10px 0; border-top: 1px solid var(--bg); background: transparent !important; }
table.items td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
table.items tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px; }
.bars2 { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 70%; justify-content: center; }
.bars2 span { flex: 1; max-width: 16px; min-height: 2px; border-radius: 4px 4px 1px 1px; }
/* Printable document (fixed paper colours, like the PDF) */
.sheet-wrap { overflow-x: auto; padding-block: 4px 12px; }
.sheet { width: 794px; min-height: 1060px; margin: 0 auto; background: #FFFFFF; color: #0E1726; padding: 56px 52px; box-shadow: 0 8px 30px rgba(11,26,51,.15); font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; }
.sheet .dt { width: 100%; border-collapse: collapse; min-width: 0; }
.sheet .dt td { padding: 0; border: 0; vertical-align: top; background: transparent !important; }
.sheet .d-r { text-align: right; }
.sheet .d-muted { color: #5B6B85; }
.d-brand { font-size: 26px; font-weight: 800; letter-spacing: 3px; color: #0B1A33; }
.d-sub { font-size: 9px; letter-spacing: 4px; color: #5B6B85; }
.d-title { font-size: 30px; font-weight: 800; color: #1F4FD8; letter-spacing: 1px; }
.d-bar { height: 6px; background: #0B1A33; border-bottom: 3px solid #F5B83D; margin: 14px 0 22px; }
.d-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #5B6B85; font-weight: 700; }
.d-box { border: 1px solid #E1E6EF; border-radius: 8px; padding: 12px 14px; }
.d-stamp { display: inline-block; border: 2px solid; border-radius: 4px; padding: 3px 10px; font-weight: 800; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.d-paid { color: #14794A; } .d-partial { color: #1F4FD8; } .d-unpaid { color: #8A5E06; } .d-overdue { color: #B83C17; } .d-void { color: #5B6B85; }
.d-items { width: 100%; min-width: 0; border-collapse: collapse; margin-top: 18px; }
.d-items th { background: #0B1A33; color: #FFFFFF; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; padding: 9px 10px; text-align: left; }
.d-items th.d-r { text-align: right; }
.d-items td { padding: 9px 10px; border-top: 0; border-bottom: 1px solid #E1E6EF; color: #0E1726; background: #FFFFFF !important; }
.d-items tr:nth-child(even) td { background: #F7F9FC !important; }
.d-tot td { padding: 5px 10px !important; }
.d-tot .g td { border-top: 2px solid #0B1A33; font-size: 16px; font-weight: 800; padding-top: 9px !important; }
.d-note { background: #FDF1D8; color: #6B4905; border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.d-sig td { padding-top: 40px !important; font-size: 11px; color: #5B6B85; width: 50%; }
.d-sig span { display: block; border-top: 1px solid #8EA0BF; padding-top: 5px; width: 80%; }
.d-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid #E1E6EF; font-size: 10px; color: #5B6B85; display: flex; justify-content: space-between; gap: 10px; }
/* Two-copy receipt (paper colours) */
.rc-sheet { min-height: 0; padding: 30px; gap: 0; }
.rc { position: relative; border: 1px solid #C9D3E6; border-radius: 10px; overflow: hidden; height: 470px; display: flex; flex-direction: column; }
.rc-head { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; background: #EEF3FD; border-bottom: 3px solid #1F4FD8; padding: 10px 14px; }
.rc-logo img { max-height: 56px; max-width: 100px; display: block; }
.rc-logo span { font-size: 20px; font-weight: 800; letter-spacing: 3px; color: #0B1A33; }
.rc-school b { display: block; font-size: 17px; color: #0B1A33; letter-spacing: .5px; }
.rc-school span { display: block; font-size: 11px; color: #0E1726; margin-top: 2px; }
.rc-badge { display: inline-block; background: #1F4FD8; color: #FFFFFF; font-weight: 800; font-size: 12px; padding: 6px 14px; border-radius: 5px; white-space: nowrap; }
.rc-reprint { color: #C8261B; font-weight: 800; font-size: 10px; letter-spacing: 1px; margin-top: 4px; }
.rc-body { display: grid; grid-template-columns: 36% 1fr; gap: 16px; padding: 14px 16px 8px; }
.rc-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-box { border: 1px solid #E1E6EF; border-radius: 6px; padding: 6px; background: #F7F9FC; display: flex; align-items: center; justify-content: center; min-height: 112px; }
.rc-box img { display: block; }
.qr-slot { width: 96px; height: 96px; background: #FFFFFF; font-size: 10px; color: #5B6B85; display: flex; align-items: center; justify-content: center; }
.rc-photo { width: 88px; height: 104px; object-fit: cover; border-radius: 4px; }
.rc-ph { width: 88px; height: 104px; background: #E6EDFD; color: #1F4FD8; font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.rc-name { font-size: 16px; font-weight: 800; margin: 2px 0 6px; color: #0E1726; }
.rc-facts { width: 100%; border-collapse: collapse; min-width: 0; font-size: 12px; }
.rc-facts td { padding: 4px 0; border-top: 1px solid #EEF1F6; background: transparent !important; color: #0E1726; }
.rc-facts td:first-child { color: #5B6B85; width: 42%; }
.rc-facts td:last-child { font-weight: 700; }
.rc-meta { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 12.5px; color: #0E1726; }
.rc-meta span:nth-child(even) { text-align: right; }
.rc-red { color: #C8261B; }
.rc-grade { background: #E6EDFD; color: #1F4FD8; padding: 1px 7px; border-radius: 4px; }
.rc-items { width: 100%; min-width: 0; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; position: relative; }
.rc-items th { background: #1F4FD8; color: #FFFFFF; font-size: 11px; text-align: left; padding: 7px 10px; }
.rc-items td { padding: 6px 10px; border-bottom: 1px solid #E1E6EF; color: #0E1726; background: transparent !important; }
.rc-items td:last-child { text-align: right; white-space: nowrap; }
.rc-items .t td { background: #0B1A33 !important; color: #FFFFFF; font-weight: 800; font-size: 14px; border: 0; }
.rc-items .ok td { color: #14794A; font-weight: 800; }
.rc-items .bal td { color: #C8261B; font-weight: 800; }
.rc-wm { position: absolute; inset: 40px 0 0; display: flex; align-items: center; justify-content: center; opacity: .07; font-size: 72px; font-weight: 800; color: #0B1A33; letter-spacing: 8px; pointer-events: none; }
.rc-wm img { width: 220px; }
.rc-void { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 96px; font-weight: 800; color: #C8261B; opacity: .2; transform: rotate(-18deg); pointer-events: none; z-index: 2; }
.rc-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #E1E6EF; margin-inline: 16px; padding: 6px 0 8px; font-size: 10px; color: #5B6B85; }
.inv-title { font-size: 15px; font-weight: 800; letter-spacing: 3px; color: #1F4FD8; margin-bottom: 4px; }
.inv-state { display: inline-block; margin-top: 2px; border: 1.5px solid; border-radius: 5px; padding: 2px 9px; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.inv-sub th { background: #E6EDFD; color: #1F4FD8; }
.inv-sub td.rc-red { color: #C8261B; }
.inv-note { border-radius: 8px; padding: 10px 12px; font-size: 12px; margin-top: 14px; }
.rc-cut { border-top: 1px dashed #8EA0BF; margin: 16px 0; text-align: center; height: 0; }
.rc-cut span { position: relative; top: -9px; background: #FFFFFF; padding: 0 10px; font-size: 11px; color: #8EA0BF; }
@media (max-width: 1100px) { .g-21 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease; padding-top: calc(22px + env(safe-area-inset-top, 0px)); padding-left: calc(14px + env(safe-area-inset-left, 0px)); }
  .sidebar.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menu-btn { display: inline-flex !important; }
  .topbar, .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .faside { position: static; }
  .auth-brand { padding: 28px max(16px, env(safe-area-inset-left, 0px)); min-height: 0; }
  .auth-copy { padding-block: 20px; }
  .auth-copy h2 { font-size: 28px; }
  .me div { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
.ct-wrap { overflow-x: auto; padding: 4px 0 12px; }
.ct { position: relative; width: 1123px; height: 794px; margin: 0 auto; background: #FFFFFF; color: #0E1726; box-shadow: 0 10px 40px rgba(11,26,51,.18); font-family: "DejaVu Sans", Arial, sans-serif; text-align: center; overflow: hidden; }
.ct-frame { position: absolute; inset: 26px; border: 10px solid #0B1A33; }
.ct-line { position: absolute; inset: 44px; border: 2px solid #F5B83D; }
.ct-c { position: absolute; width: 52px; height: 52px; border: 0 solid #F5B83D; }
.ct-c.tl { left: 53px; top: 53px; border-width: 5px 0 0 5px; } .ct-c.tr { right: 53px; top: 53px; border-width: 5px 5px 0 0; }
.ct-c.bl { left: 53px; bottom: 53px; border-width: 0 0 5px 5px; } .ct-c.br { right: 53px; bottom: 53px; border-width: 0 5px 5px 0; }
.ct-body { position: absolute; left: 76px; right: 76px; top: 66px; }
.ct-school { font-size: 13px; font-weight: 800; letter-spacing: 4px; color: #0B1A33; text-transform: uppercase; margin-top: 6px; }
.ct-tag { font-size: 10px; color: #5B6B85; letter-spacing: 1px; margin-top: 3px; }
.ct-title { font-family: Georgia, "DejaVu Serif", serif; font-size: 56px; font-weight: 700; letter-spacing: 14px; color: #0B1A33; margin-top: 14px; line-height: 1; }
.ct-sub { font-size: 12px; font-weight: 800; letter-spacing: 5px; color: #B07D12; margin-top: 10px; }
.ct-rule { width: 226px; height: 2px; background: #F5B83D; margin: 14px auto 0; }
.ct-lead { font-size: 13px; color: #5B6B85; margin-top: 18px; }
.ct-name { font-family: Georgia, "DejaVu Serif", serif; font-size: 42px; font-weight: 700; font-style: italic; color: #1F4FD8; margin-top: 8px; line-height: 1.15; }
.ct-nl { width: 566px; height: 1px; background: #C9D3E6; margin: 8px auto 0; }
.ct-facts { font-size: 12px; color: #5B6B85; margin-top: 10px; } .ct-facts b { color: #0B1A33; }
.ct-text { font-size: 15px; width: 620px; margin: 14px auto 0; line-height: 1.45; }
.ct-so { font-size: 12px; color: #5B6B85; font-style: italic; width: 720px; margin: 5px auto 0; }
.ct-side { position: absolute; top: 290px; width: 128px; }
.ct-side.l { left: 90px; } .ct-side.r { right: 90px; }
.ct-photo { width: 113px; height: 140px; border: 2px solid #F5B83D; padding: 3px; margin: 0 auto; background: #FFFFFF; }
.ct-photo img, .ct-photo span { width: 100%; height: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; background: #F4F6FA; color: #8EA0BF; font-size: 10px; }
.ct-tiny { font-size: 9.5px; color: #5B6B85; margin-top: 5px; letter-spacing: .5px; }
.ct .qr-slot { margin: 0 auto; width: 100px; height: 100px; }
.ct-bottom { position: absolute; left: 90px; right: 90px; top: 540px; display: grid; grid-template-columns: 1fr 350px 1fr; align-items: end; }
.ct-who { font-size: 13px; font-weight: 800; color: #0B1A33; min-height: 18px; }
.ct-bar { border-top: 1.5px solid #0B1A33; width: 234px; margin: 6px auto 0; padding-top: 6px; font-size: 10.5px; color: #5B6B85; letter-spacing: 1px; text-transform: uppercase; }
.ct-seal { width: 128px; height: 128px; border-radius: 50%; background: #0B1A33; border: 5px solid #F5B83D; margin: 0 auto; color: #FFFFFF; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ct-seal .k { font-size: 8.5px; letter-spacing: 2px; color: #F5B83D; } .ct-seal .g { font-size: 36px; font-weight: 800; line-height: 1.05; } .ct-seal .v { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.ct-meta { font-size: 11px; color: #5B6B85; margin-top: 10px; } .ct-meta b { color: #0B1A33; font-family: ui-monospace, Menlo, monospace; }
.day-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; }
.rb-white { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; } .rb-white:hover { background: var(--surface-2); }
.day-pick { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; }
.day-pick > span:last-child { display: flex; flex-direction: column; }
.day-name { font-size: 18px; font-weight: 800; line-height: 1.2; }
.day-input { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 0; min-height: 28px; cursor: pointer; }
.card-pad { padding: 18px 18px 4px; }
.class-fields { display: grid; grid-template-columns: 1.1fr 1.6fr .8fr .7fr 1.4fr; gap: 14px; padding: 16px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.lesson-table td { padding-top: 9px; padding-bottom: 9px; }
.lesson-table tr.is-picked td { background: color-mix(in srgb, var(--blue) 7%, var(--surface)) !important; }
.pick { width: 20px; height: 20px; accent-color: var(--blue); cursor: pointer; }
.who { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.who b { display: block; color: var(--ink); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .mono { font-size: 11px; }
.prog { display: flex; flex-direction: column; gap: 6px; }
.prog .num { font-size: 13px; color: var(--muted); } .prog b { color: var(--ink); font-size: 15px; }
.lesson-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.lesson-stats div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.lesson-stats b { display: block; font-size: 20px; font-weight: 800; }
.lesson-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.lesson-add { border: 1px dashed var(--line-2); border-radius: 14px; padding: 4px 14px; }
.lesson-add[open] { padding-bottom: 14px; }
.lesson-add summary { cursor: pointer; font-weight: 700; color: var(--blue); min-height: 44px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 1200px) { .class-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .class-fields .field:nth-child(2) { grid-column: 1 / -1; } }
@media (max-width: 560px) { .class-fields { grid-template-columns: 1fr; } }
.ir-who { background: #EEF3FD; border-left: 4px solid #1F4FD8; border-radius: 8px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; color: #0E1726; }
.ir-who .n { font-size: 20px; font-weight: 800; color: #0B1A33; }
.ir-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.ir-kpis div { border: 1px solid #E1E6EF; border-radius: 8px; padding: 9px 6px; text-align: center; color: #0E1726; }
.ir-kpis b { display: block; font-size: 21px; color: #0B1A33; }
.ir-kpis span { font-size: 9px; text-transform: uppercase; letter-spacing: .6px; color: #5B6B85; font-weight: 700; }
.ir-sec { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #FFFFFF; background: #0B1A33; padding: 6px 12px; margin: 16px 0 0; border-left: 4px solid #F5B83D; }
.sheet table.ir { width: 100%; min-width: 0; border-collapse: collapse; font-size: 11.5px; color: #0E1726; }
.sheet table.ir th { background: #1F4FD8; color: #FFFFFF; font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; padding: 6px 8px; text-align: left; white-space: nowrap; }
.sheet table.ir td { padding: 5px 8px; border-bottom: 1px solid #E1E6EF; vertical-align: top; background: #FFFFFF !important; border-top: 0; }
.sheet table.ir tr:nth-child(even) td { background: #F7F9FC !important; }
.sheet table.ir .r { text-align: right; white-space: nowrap; } .sheet table.ir .c { text-align: center; }
.sheet table.ir tr.tot:nth-child(n) td { background: #0B1A33 !important; color: #FFFFFF; font-weight: 800; }
.ir-ok { color: #14794A; font-weight: 800; } .ir-no { color: #C8261B; font-weight: 800; }
.ir-names { color: #5B6B85; font-size: 10px; }
.report-filter { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 14px; align-items: end; }
.report-filter .quick { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.report-filter .quick button { border: 0; cursor: pointer; }
@media (max-width: 900px) { .report-filter { grid-template-columns: 1fr 1fr; } .report-filter .field:first-child { grid-column: 1 / -1; } }
#printRoot { display: none; }
.doc-busy { opacity: .6; pointer-events: none; }
@media print {
  body.print-mode > *:not(#printRoot) { display: none !important; }
  body.print-mode { background: #FFFFFF !important; margin: 0; }
  body.print-mode #printRoot { display: block; }
  #printRoot .sheet, #printRoot .ct { box-shadow: none !important; margin: 0 auto !important; }
  #printRoot .sheet { width: 100% !important; min-height: 0 !important; padding: 0 !important; }
  #printRoot * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Server-rendered additions (plain PHP version) ---------- */
[hidden] { display: none !important; }
.pager a, .pager span.pbtn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.pager a.on { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.pager a:hover { border-color: var(--blue); }
.row-menu a, .row-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.row-menu a:hover, .row-menu a:focus { background: var(--surface-2); outline: none; color: var(--ink); }
#scrim { z-index: 40; }
a.kpi, a.li, a.tab, a.round-btn, a.round-sm, a.photo-thumb, a.avatar, a.btn { text-decoration: none; }
a.kpi { color: inherit; } a.kpi:hover { color: inherit; }
a.round-btn:hover, a.round-sm:hover { color: #FFFFFF; }
a.tab:hover { color: var(--ink); } a.tab.on:hover { color: #FFFFFF; }
.cell-name a { font-weight: 700; color: var(--ink); display: block; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95; max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(11,26,51,.25); background: #0B1A33; color: #FFFFFF; }
.toast.bad { background: #8C2D10; }
.void-box summary { list-style: none; display: inline-flex; }
.void-box summary::-webkit-details-marker { display: none; }
.doc-page { background: var(--bg); min-height: 100vh; }
.doc-toolbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.doc-stage { padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.doc-stage > .sheet, .doc-stage > .ct { flex: none; }
.doc-scroll { overflow-x: auto; padding-bottom: 8px; }
.inline-form { display: inline; }
.btn-sm { min-height: 38px; }
@media print {
  .doc-toolbar, .doc-note { display: none !important; }
  .doc-page { background: #FFFFFF !important; }
  .doc-stage { padding: 0 !important; display: block; }
  .doc-scroll { overflow: visible !important; padding: 0 !important; }
  .doc-stage .sheet, .doc-stage .ct { box-shadow: none !important; margin: 0 auto !important; }
  .doc-stage .sheet { width: 100% !important; min-height: 0 !important; padding: 0 !important; }
  .doc-stage * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.st-table .cell-name { min-width: 200px; } .st-table .cell-name a { white-space: normal; }
@page { size: A4; margin: 10mm; }
@media print {
  .doc-stage .rc-sheet { padding: 0 !important; }
  .doc-stage .rc-sheet .rc { height: 132mm !important; break-inside: avoid; }
  .doc-stage .rc-sheet .rc-cut { margin: 4mm 0 !important; }
  .doc-stage .sheet.land, .doc-stage .ct { break-inside: avoid; }
}
@page land { size: A4 landscape; margin: 0; }
@media print {
  html, body.doc-page { height: auto !important; min-height: 0 !important; }
  .doc-page { min-height: 0 !important; }
  .doc-page > *:not(.doc-stage):not(script) { display: none !important; }
  .doc-land .doc-stage { page: land; }
  .doc-stage > * { break-after: auto; }
  .doc-stage > *:last-child { break-after: avoid; margin-bottom: 0 !important; }
}
@media print {
  .doc-land .ct { width: 296mm !important; height: 209mm !important; margin: 0 !important; }
  .doc-land .doc-scroll, .doc-land .doc-stage { margin: 0 !important; padding: 0 !important; }
}
@media print { body.doc-page { margin: 0 !important; padding: 0 !important; } }
.rb-purple { background: #7C3AED; } .rb-purple:hover { background: #6D28D9; }
.sheet.sl table.ir { margin-top: 14px; }
.sheet.sl table.ir td { font-size: 11px; }
.sl-st { font-size: 9.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.sl-pending { background: #FEF3C7; color: #92600A; } .sl-approved { background: #DBEAFE; color: #1E40AF; } .sl-certified { background: #DCFCE7; color: #166534; }
@media print { .sheet.sl table.ir tr { break-inside: avoid; } .sheet.sl table.ir thead { display: table-header-group; } }
.sheet.sl table.ir td, .sheet.sl table.ir th { padding: 5px 6px; }
.sheet.sl table.ir td:nth-child(3) { white-space: nowrap; }
/* Monthly closing statement */
.ms-card { gap: 6px; }
.ms-sec { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--blue, #1F4FD8); margin: 14px 0 6px; }
.ms-card .ms-sec:first-child { margin-top: 0; }
.ms-wrap { overflow-x: auto; }
table.ms { width: 100%; min-width: 0; border-collapse: collapse; font-size: 13.5px; }
table.ms th { background: #1F4FD8; color: #FFFFFF; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; text-align: left; white-space: nowrap; }
table.ms td { padding: 8px 10px; border-bottom: 1px solid var(--line, #E1E6EF); }
table.ms .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } table.ms .c { text-align: center; }
table.ms tr.ms-grp td { font-weight: 800; background: var(--surface-3, #F3F6FB); color: var(--ink, #0E1726); }
table.ms tr.ms-sub td { font-weight: 700; color: var(--ink-2, #33415C); border-bottom: 2px solid var(--line-2, #C9D3E6); }
table.ms tr.ms-tot td { background: #0B1A33; color: #FFFFFF; font-weight: 800; }
table.ms tr.ms-tot.ms-loss td { background: #B42318; }
table.ms.ms-res { max-width: 520px; margin-left: auto; }
.ms-note { color: var(--muted, #5B6B85); font-size: 12px; }
table.ms tr.ms-tot .ms-note { color: #C9D3E6; }
.ms-none { color: var(--muted, #5B6B85); font-size: 13px; text-align: center; }
.ms-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ms-split > div { border: 1px solid var(--line-2, #C9D3E6); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ms-split span { font-size: 12px; font-weight: 700; color: var(--muted, #5B6B85); }
.ms-split b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink, #0E1726); }
.ms-split small { font-size: 12px; color: #B07D12; font-weight: 800; }
@media (max-width: 640px) { .ms-split { grid-template-columns: 1fr; } table.ms { font-size: 12.5px; } }
.sheet.ms-sheet table.ms { font-size: 11.5px; } .sheet.ms-sheet table.ms td { padding: 5px 8px; border-bottom-color: #E1E6EF; color: #0E1726; background: #FFFFFF; }
.sheet.ms-sheet table.ms th { padding: 6px 8px; font-size: 9.5px; }
.sheet.ms-sheet table.ms tr.ms-grp td { background: #F3F6FB; color: #0E1726; } .sheet.ms-sheet table.ms tr.ms-tot td { background: #0B1A33; color: #FFFFFF; }
.sheet.ms-sheet table.ms tr.ms-tot.ms-loss td { background: #B42318; }
.sheet.ms-sheet .ms-sec { color: #1F4FD8; font-size: 10.5px; margin: 12px 0 5px; }
.sheet.ms-sheet .ms-split b { font-size: 17px; color: #0E1726; } .sheet.ms-sheet .ms-split > div { border-color: #C9D3E6; padding: 8px 12px; }
.sheet.ms-sheet .ms-split span, .sheet.ms-sheet .ms-none, .sheet.ms-sheet .ms-note { color: #5B6B85; }
.ms-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 800; letter-spacing: .5px; background: #FEF3C7; color: #92600A; font-size: 10px; }
.ms-badge.ok { background: #DCFCE7; color: #166534; }
@media print { .sheet.ms-sheet table.ms tr { break-inside: avoid; } }
.btn-wa { background: #1FA855; color: #FFFFFF; font-weight: 800; border-color: transparent; }
.btn-wa:hover { background: #178A45; color: #FFFFFF; }
.btn-wa.pulse { animation: wa-pulse 1.4s ease-in-out 3; }
@keyframes wa-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,168,85,.55); } 50% { box-shadow: 0 0 0 10px rgba(31,168,85,0); } }
@media (prefers-reduced-motion: reduce) { .btn-wa.pulse { animation: none; outline: 3px solid rgba(31,168,85,.5); } }
@media (max-width: 560px) { .doc-toolbar .row-gap { flex-wrap: wrap; justify-content: flex-end; } }
@media (max-width: 560px) {
  .doc-toolbar { flex-wrap: nowrap; gap: 8px; padding: 10px 12px; }
  .doc-toolbar .row-gap { flex-wrap: nowrap; gap: 6px; }
  .doc-toolbar .btn { min-height: 40px; padding: 0 12px; font-size: 14px; gap: 6px; }
  .doc-toolbar .tb-l { display: none; }
}
/* Profit split editor */
.ms-sec-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ms-edit { min-height: 34px; padding: 0 12px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.ms-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green, #15803D); text-transform: none; letter-spacing: 0; font-weight: 700; }
.ms-lock svg { width: 14px; height: 14px; }
.ms-split { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sp-head, .sp-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 110px 44px; gap: 10px; align-items: center; }
.sp-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.sp-head span:nth-child(3) { text-align: right; }
.sp-rows { display: flex; flex-direction: column; gap: 10px; }
.sp-pct { position: relative; display: block; } .sp-pct .in { padding-right: 30px; width: 100%; }
.sp-pct i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-weight: 700; pointer-events: none; }
.sp-amt { text-align: right; font-size: 15px; }
.sp-del { min-height: 44px; width: 44px; padding: 0; justify-content: center; }
.sp-total { font-size: 14px; color: var(--muted); } .sp-total b { font-size: 20px; color: var(--ink); margin-left: 6px; }
.sp-total.ok b { color: var(--green); } .sp-total.bad b { color: var(--red); }
.sp-quick { min-height: 34px; padding: 0 12px; font-size: 13px; }
@media (max-width: 560px) {
  .sp-head { display: none; }
  .sp-row { grid-template-columns: minmax(0, 1fr) 96px 44px; grid-template-areas: "n p d" "a a a"; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .sp-row > input { grid-area: n; } .sp-row .sp-pct { grid-area: p; } .sp-row .sp-del { grid-area: d; } .sp-row .sp-amt { grid-area: a; text-align: left; font-size: 13px; color: var(--muted); }
}
.sp-pct input::-webkit-outer-spin-button, .sp-pct input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-pct input[type=number] { -moz-appearance: textfield; appearance: textfield; }
