/* AcNEXUS School Management System */
:root {
  --brand: #14532d;
  --brand-ink: #fff;
  --ink: #18212b;
  --ink-2: #4a5663;
  --ink-3: #7b8794;
  --line: #e3e7ec;
  --line-2: #eef1f4;
  --bg: #f5f6f8;
  --card: #fff;
  --input-bg: #fff;
  --surface-2: #fafbfc;
  --login: var(--brand);
  --side-bg: #0f1720; --side-ink: #fff; --side-ink-2: #c9d2dc; --side-ink-3: #7b8794; --side-line: rgba(255, 255, 255, .07); --side-hover: rgba(255, 255, 255, .06);
  --side-accent: var(--brand); --side-accent-ink: #fff;
  --pos: #15803d;
  --neg: #b42318;
  --warn: #b45309;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 .8em; }
a { color: var(--brand); }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
.muted { color: var(--ink-3); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 13px; }
.r { text-align: right; } .nowrap { white-space: nowrap; }
.neg { color: var(--neg); } .pos { color: var(--pos); } .ok-text { color: var(--pos); font-weight: 600; }
.danger-text { color: var(--neg) !important; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn-light { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-light:hover:not(:disabled) { background: var(--line-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); }
.btn-danger { background: var(--neg); color: #fff; }
.btn-small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 42px; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: var(--line-2); } .icon-btn:disabled { opacity: .3; }
.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font-weight: 600; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--neg); }
.field input, .field select, .field textarea, .filters input, .filters select, .item-row input, .table input {
  height: 36px; padding: 0 10px; border: 1px solid #cfd6de; border-radius: 8px; background: var(--input-bg); width: 100%; min-width: 0; }
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 0; border-color: var(--brand); }
input.invalid, select.invalid { border-color: var(--neg); background: #fff5f5; }
input[type=color] { padding: 2px; height: 36px; width: 70px; }
.hint { color: var(--ink-3); font-size: 11.5px; }
.grid2, .grid3 { display: grid; gap: 0 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap { gap: 16px; margin-bottom: 16px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 8px 0 12px; }
.checks { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.checks-wrap { display: grid; gap: 8px; }
.sec { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 14px 0 8px; font-weight: 700; }
.item-row { display: grid; grid-template-columns: 1fr 130px 32px; gap: 8px; margin-bottom: 8px; }
.items-total { text-align: right; margin-top: 8px; font-size: 15px; }
.readonly-box { padding: 8px 10px; background: var(--line-2); border-radius: 8px; font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
label.inline input { width: auto; }

/* ---------- auth / setup ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: var(--login-bg, linear-gradient(160deg, color-mix(in srgb, var(--login) 92%, #000) 0%, var(--login) 55%, color-mix(in srgb, var(--login) 70%, #fff) 100%)); background-size: cover; background-position: center; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 16px; padding: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.auth-card.wide { max-width: 760px; }
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img, .auth-brand .logo-fallback { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 10px; }
.auth-brand h1 { font-size: 21px; margin-bottom: 2px; }
.motto { color: var(--ink-3); font-style: italic; margin: 0; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.auth-foot { color: var(--login-ink, rgba(255, 255, 255, .8)); font-size: 12.5px; margin-top: 18px; }
.logo-fallback { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; font-size: 20px; }
.auth .logo-fallback { font-size: 32px; border-radius: 16px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.choice:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.choice strong { font-size: 15px; } .choice span { color: var(--ink-2); font-size: 13px; }
.setup h3.sec { border-top: 1px solid var(--line); padding-top: 14px; }
.setup-actions { display: flex; justify-content: space-between; margin-top: 18px; }
.recovery { font-family: var(--mono); font-size: 26px; letter-spacing: .08em; text-align: center; padding: 16px; background: #fffbea; border: 2px dashed #e0b84f; border-radius: 10px; margin: 16px 0; font-weight: 700; }
.alert { background: #fef3f2; border: 1px solid #fecdca; color: #912018; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }
.notice { background: #fffaeb; border: 1px solid #fedf89; color: #7a4a05; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.boot-error { max-width: 520px; margin: 80px auto; padding: 24px; background: var(--card); border-radius: 12px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100%; }
.side { width: 240px; flex: none; background: var(--side-bg); color: var(--side-ink-2); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--side-line); }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.brand strong { display: block; color: var(--side-ink); font-size: 14px; line-height: 1.25; }
.brand span { font-size: 11.5px; color: var(--side-ink-3); }
.side nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-ink-2); text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.side nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.side nav a.active { background: var(--side-accent); color: var(--side-accent-ink); }
.side-foot { padding: 12px 16px; font-size: 11px; color: var(--side-ink-3); display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--side-line); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top h2 { margin: 0; font-size: 18px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
#view { padding: 24px; max-width: 1280px; width: 100%; outline: none; }
.scrim { display: none; }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.sync-pill .ico { width: 15px; height: 15px; }
.sync-pill.ok { color: var(--pos); background: #f0fdf4; border-color: #bbf7d0; }
.sync-pill.warn { color: var(--warn); background: #fffbeb; border-color: #fde68a; }
.sync-pill.err { color: var(--neg); background: #fef2f2; border-color: #fecaca; }
.sync-pill.off { color: var(--ink-3); }
.sync-pill.busy .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 8px; text-align: left; }
.user-btn:hover { background: var(--line-2); }
.user-name { display: flex; flex-direction: column; font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-name small { font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 15%, #fff); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 22px; }
.dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); min-width: 200px; padding: 6px; z-index: 30; }
.dropdown.open { display: block; }
.dropdown button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.dropdown button:hover { background: var(--line-2); }

/* ---------- content ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3, .card-head h4 { margin: 0; }
.card-head.pad { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--line); }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); margin: 14px -18px -18px; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.flush .card-foot { margin: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h3 { margin: 0; }
.filters, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input[type=search] { width: 260px; }
.filters select, .filters input { width: auto; }
.filters .field { margin: 0; flex-direction: row; align-items: center; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat strong { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.hello { margin-bottom: 18px; } .hello h2 { margin-bottom: 2px; } .hello p { margin: 0; }
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.quick { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.quick:hover { border-color: var(--brand); color: var(--brand); }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; }
.hbar div { background: var(--line-2); height: 10px; border-radius: 5px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 80px; height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.bar i { display: block; height: 100%; background: var(--pos); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; }
.seg.att button.on.P { background: var(--pos); } .seg.att button.on.L { background: #d97706; } .seg.att button.on.A { background: var(--neg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
.chip small { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); } .chip.on small { color: rgba(255, 255, 255, .8); }

/* tables */
.scroll-x { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th.r, .table td.r { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); background: var(--surface-2); }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table.clickable tbody tr { cursor: pointer; } .table.clickable tbody tr:hover { background: var(--surface-2); }
.table tr.voided td { color: var(--ink-3); text-decoration: line-through; } .table tr.voided td:last-child { text-decoration: none; }
.table-foot { padding: 10px 14px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--surface-2); }
.table input { height: 32px; }
.score-table input.score { width: 80px; text-align: right; }
.remarks-table input { min-width: 120px; } .remarks-table input.wide { min-width: 260px; }
.grade-table input { max-width: 200px; }
.broadsheet th, .broadsheet td { white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); text-transform: capitalize; text-decoration: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); }
.b-pending { background: #eff4ff; color: #1d4ed8; } .b-interview { background: #fef6e7; color: #a15c07; } .b-admitted, .b-approved { background: #ecfdf3; color: #067647; } .b-declined { background: #fef3f2; color: #b42318; } .b-draft { background: #fef6e7; color: #a15c07; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 13px; } .kv dd { margin: 0; }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head h2 { margin: 0; } .profile-head p { margin: 0; }
.stat-inline { margin-left: auto; text-align: right; } .stat-inline span { display: block; font-size: 12px; color: var(--ink-3); } .stat-inline strong { font-size: 22px; }
.result-block { margin-bottom: 18px; } .result-block h4 { margin: 0; }
.bal-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.bal-box:empty { display: none; }
.bal-box div { background: var(--line-2); border-radius: 8px; padding: 8px 10px; } .bal-box span { display: block; font-size: 11.5px; color: var(--ink-3); } .bal-box b { font-variant-numeric: tabular-nums; }
.struct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.struct { margin: 0; } .struct .table { margin-bottom: 10px; }
.logo-edit { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.logo-edit img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.calc-test { margin-top: 14px; padding: 10px 12px; background: var(--line-2); border-radius: 8px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.calc-test input { height: 32px; width: 120px; padding: 0 8px; border: 1px solid #cfd6de; border-radius: 6px; }
.danger-zone { border-color: #fecdca; }
.empty { text-align: center; padding: 48px 20px; }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 10%, #fff); border: 2px dashed color-mix(in srgb, var(--brand) 35%, #fff); }
.empty h3 { margin-bottom: 4px; } .empty p { color: var(--ink-3); max-width: 420px; margin: 0 auto 14px; }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 23, 32, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 100; overflow-y: auto; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; max-height: 88vh; }
.modal-wide { max-width: 860px; }
.modal-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: #0f1720; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; transition: opacity .4s, transform .4s; border-left: 4px solid var(--pos); }
.toast-err { border-left-color: #f04438; } .toast-warn { border-left-color: #f79009; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 50; }
  .menu-btn { display: inline-grid; }
  .top { padding: 0 12px; }
  #view { padding: 16px; }
  .user-name { display: none; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid2, .grid3, .choice-grid { grid-template-columns: 1fr; }
  .sync-pill span { display: none; }
  .filters input[type=search] { width: 100%; }
  .filters, .actions { width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  .bal-box { grid-template-columns: 1fr 1fr; }
  .table th, .table td { padding: 8px; }
  .top h2 { font-size: 16px; }
  .stat-inline { margin-left: 0; text-align: left; }
}

/* ---------- printing ---------- */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; }
  body { background: #fff; font-size: 11.5pt; }
  .sheet { page-break-after: always; break-after: page; }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
}
#print-area { color: #000; font-family: "Segoe UI", Arial, sans-serif; }
.lh { display: flex; align-items: center; gap: 14px; border-bottom: 2.5px double #000; padding-bottom: 8px; margin-bottom: 12px; }
.lh-logo { width: 70px; height: 70px; object-fit: contain; }
.lh-text { flex: 1; text-align: center; }
.lh h1 { font-size: 19pt; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
.lh.asis h1 { text-transform: none; }
.lh-motto { font-style: italic; font-size: 10pt; }
.lh-contact { font-size: 9pt; }
.lh-sub { margin-top: 5px; font-weight: 700; font-size: 11pt; text-transform: uppercase; letter-spacing: .04em; }
.ptable { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 10pt; }
.ptable th, .ptable td { border: 1px solid #555; padding: 4px 6px; text-align: left; }
.ptable th { background: #eee; }
.ptable td.n { text-align: right; font-variant-numeric: tabular-nums; }
.pmeta, .rc-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px 12px; font-size: 10.5pt; margin-bottom: 8px; }
.rc-remarks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; margin: 10px 0; font-size: 10.5pt; }
.rc-remarks .span3 { grid-column: 1 / -1; border-bottom: 1px dotted #777; padding-bottom: 4px; }
.rc-sign { display: flex; justify-content: space-between; margin-top: 26px; font-size: 10.5pt; }
.rc-key { margin-top: 14px; font-size: 8.5pt; color: #333; }
.pfoot { margin-top: 18px; font-size: 8.5pt; color: #555; text-align: right; }
.letter { font-size: 12pt; line-height: 1.6; } .letter-title { text-align: center; text-decoration: underline; margin: 16px 0; } .letter .sign { margin-top: 48px; }
.receipt { font-size: 11pt; } .rc-title { text-align: center; font-weight: 800; font-size: 14pt; letter-spacing: .1em; margin-bottom: 10px; } .rc-title span { font-size: 9pt; font-weight: 400; letter-spacing: 0; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; } .rc-grid .span2 { grid-column: 1 / -1; border-bottom: 1px dotted #777; padding-bottom: 3px; }
.rc-amount { margin: 16px 0 8px; padding: 10px; border: 2px solid #000; font-size: 17pt; font-weight: 800; text-align: center; }
.rc-bal { text-align: center; font-size: 10.5pt; }
.feebill, .payslip { padding-bottom: 6px; }
.feebill .lh h1, .payslip .lh h1 { font-size: 15pt; } .feebill .lh-logo, .payslip .lh-logo { width: 54px; height: 54px; }
hr.cut { border: 0; border-top: 1.5px dashed #888; margin: 18px 0; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.net-pay { text-align: right; font-size: 14pt; margin: 6px 0; padding: 6px 10px; border: 2px solid #000; }
@media screen { #print-area .sheet { background: #fff; } }

/* ---------- v1.1: record forms, roles, photos, print preview ---------- */
.field.span, .grid3 > .span, .grid2 > .span { grid-column: 1 / -1; }
details.fs { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--card); }
details.fs > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
details.fs > summary::-webkit-details-marker { display: none; }
details.fs > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
details.fs[open] > summary::before { transform: rotate(45deg); }
details.fs[open] > summary { border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
details.fs > .grid3, details.fs > .grid2, details.fs > p { padding: 0 14px; }
details.fs > .grid3:last-child, details.fs > .grid2:last-child { padding-bottom: 4px; }
.checks.flat { border: 0; padding: 4px 0; margin: 0; }
.checks.col { flex-direction: column; gap: 6px; }
.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.photo-row p { margin: 6px 0 0; }
.photo { width: 72px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; background: var(--line-2); }
.photo.ph { display: grid; place-items: center; font-weight: 700; font-size: 22px; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); }
.photo.big { width: 96px; height: 116px; }
.perm { display: inline-block; background: var(--line-2); border-radius: 6px; padding: 1px 7px; margin: 2px 2px 2px 0; font-size: 11.5px; color: var(--ink-2); }
.list-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.alert-chip { display: inline-block; background: #fef3f2; color: #b42318; border: 1px solid #fecdca; border-radius: 99px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.info-chip { display: inline-block; background: var(--line-2); color: var(--ink-2); border-radius: 99px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

/* print preview */
.modal-preview { max-width: 980px; }
.preview { background: #e9ecef; padding: 18px; border-radius: 8px; max-height: 64vh; overflow: auto; }
.preview .sheet { background: #fff; margin: 0 auto 18px; padding: 12mm; box-shadow: 0 2px 10px rgba(0,0,0,.15); width: 210mm; max-width: 100%; color: #000; font-family: "Segoe UI", Arial, sans-serif; font-size: 11pt; }
.preview.A5 .sheet { width: 148mm; padding: 9mm; }
.preview.A4L .sheet { width: 297mm; }
.preview .sheet:last-child { margin-bottom: 0; }

/* printed record forms */
.pf-sec { margin-bottom: 8px; break-inside: avoid; }
.pf-sec h4 { font-size: 10.5pt; text-transform: uppercase; letter-spacing: .05em; background: #eee; padding: 3px 6px; margin: 8px 0 4px; }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px 14px; }
.pf-f { display: flex; flex-direction: column; font-size: 9.5pt; border-bottom: 1px dotted #888; padding-bottom: 2px; min-height: 30px; }
.pf-f span { font-size: 8pt; color: #444; }
.pf-f b { font-weight: 600; white-space: pre-wrap; }
.pf-f.span { grid-column: 1 / -1; }
.pf-checks { border-bottom: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 16px; min-height: 0; }
.pf-checks i { font-style: normal; font-size: 9.5pt; }
.pf-photo, .pf-photo-box { float: right; width: 30mm; height: 36mm; object-fit: cover; margin: 0 0 6px 10px; border: 1px solid #555; }
.pf-photo-box { display: grid; place-items: center; text-align: center; font-size: 8pt; color: #666; }
.pf-declare { margin-top: 14px; font-size: 10pt; clear: both; }

/* ---------- v1.2: store ---------- */
.pos-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.pos-cart { position: sticky; top: 76px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 64vh; overflow-y: auto; padding: 2px; }
.item-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; min-height: 92px; }
.item-tile:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 4%, #fff); }
.item-tile strong { font-size: 13.5px; line-height: 1.25; }
.item-tile .size { font-size: 12px; font-weight: 700; color: var(--brand); }
.item-tile .price { font-weight: 700; margin-top: auto; font-variant-numeric: tabular-nums; }
.item-tile .stk { font-size: 11.5px; color: var(--ink-3); }
.item-tile.out { opacity: .6; }
.cart-table td { vertical-align: middle; }
.cart-table .qty { width: 52px; height: 30px; text-align: center; padding: 0 4px; }
.cart-total { display: flex; justify-content: space-between; padding: 8px 2px; border-top: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.cart-total.big { font-size: 18px; border-top: 2px solid var(--ink); margin-bottom: 10px; }
.pos-cart .actions { justify-content: flex-end; }
.recv-row, .recv-head { display: grid; grid-template-columns: minmax(0, 1fr) 100px 120px 32px; gap: 8px; margin-bottom: 8px; }
.pack-row { grid-template-columns: minmax(0, 1fr) 90px 32px; }
.recv-head { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; margin: 8px 0 4px; }
.recv-row select, .recv-row input { height: 36px; padding: 0 10px; border: 1px solid #cfd6de; border-radius: 8px; background: var(--input-bg); width: 100%; min-width: 0; }
.pf-top { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.pf-top .pf-id { flex: 1; } .pf-top .pf-id h3 { margin: 0 0 4px; }
.pf-top .pf-photo, .pf-top .pf-photo-box { float: none; margin: 0; flex: none; }
.decision { font-weight: 700; } .decision.repeat { color: var(--neg); } .decision.promote { color: var(--pos); }
@media (max-width: 900px) { .pos-layout { grid-template-columns: 1fr; } .pos-cart { position: static; } .item-grid { max-height: none; } }
.annual-table select { height: 32px; padding: 0 6px; border: 1px solid #cfd6de; border-radius: 6px; background: var(--input-bg); }
.annual-table input { min-width: 180px; }

/* ---------- v1.3: accounts ---------- */
.tabs .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.hbar.wide { grid-template-columns: minmax(120px, 200px) 1fr 90px; }
.hbar.wide span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.budget-grid label { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 8px; font-size: 13px; }
.budget-grid input { height: 32px; padding: 0 8px; border: 1px solid #cfd6de; border-radius: 6px; text-align: right; }

/* ---------- v1.4 ---------- */
.nav-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--side-ink-3); padding: 12px 12px 4px; }
.side nav a { padding: 7px 12px; }
.tt th, .tt td { text-align: center; vertical-align: middle; border: 1px solid var(--line-2); min-width: 92px; }
.tt td[data-k] { cursor: pointer; height: 56px; padding: 4px; }
.tt td[data-k]:hover { background: var(--surface-2); }
.tt .brk { background: var(--surface-2); color: var(--ink-3); font-size: 12px; writing-mode: vertical-rl; min-width: 34px; }
.tt-cell { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.2; }
.tt-cell span { color: var(--ink-3); font-size: 11.5px; }
.tt-cell.clash { background: #fef3f2; border-radius: 6px; padding: 3px; } .tt-cell.clash b { color: var(--neg); }
.tt-empty { color: var(--line); font-size: 18px; }
.dev-table select { height: 32px; border: 1px solid #cfd6de; border-radius: 6px; padding: 0 4px; max-width: 150px; }
.dev-table input { min-width: 180px; }
/* ID cards & certificates */
.idsheet { display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 2.5mm 6mm; justify-content: center; }
.idcard { width: 85.6mm; height: 54mm; border: 0.2mm solid #999; border-radius: 3mm; overflow: hidden; position: relative; font-size: 7.5pt; color: #000; background: #fff; break-inside: avoid; }
.idc-head { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 2mm; height: 11mm; padding: 0 2mm; }
.idc-head b { display: block; font-size: 8pt; line-height: 1.1; } .idc-head span { font-size: 6pt; letter-spacing: .08em; }
.idc-logo { width: 8.5mm; height: 8.5mm; object-fit: contain; background: #fff; border-radius: 1mm; }
.idc-body { display: flex; gap: 3mm; padding: 2.5mm 3mm 0; }
.idc-photo { width: 20mm; height: 24mm; object-fit: cover; border: 0.2mm solid #aaa; flex: none; }
.idc-ph { display: grid; place-items: center; color: #999; font-size: 6pt; }
.idc-text { display: flex; flex-direction: column; gap: .6mm; } .idc-text b { font-size: 8.5pt; line-height: 1.15; }
.idc-bar { position: absolute; left: 26mm; bottom: 5mm; width: 55.6mm; height: 8mm; }
.idc-code { position: absolute; left: 26mm; width: 55.6mm; bottom: 1.5mm; text-align: center; font-size: 6pt; }
.cert { text-align: center; border: 4px double var(--brand); padding: 14mm 18mm; min-height: 170mm; display: flex; flex-direction: column; align-items: center; gap: 2mm; }
.cert-logo { width: 22mm; height: 22mm; object-fit: contain; }
.cert-school { font-size: 15pt; font-weight: 700; margin: 0; } .cert-motto { font-style: italic; color: #555; margin: 0; }
.cert-title { font-size: 28pt; margin: 6mm 0 2mm; font-family: Georgia, serif; } .cert-name { font-size: 24pt; font-weight: 700; margin: 2mm 0; border-bottom: 1px solid #999; padding: 0 10mm 1mm; }
.cert-text { font-size: 13pt; max-width: 200mm; } .cert-small { color: #555; margin: 0; } .cert .rc-sign { width: 100%; margin-top: auto; }

/* ---------- v1.5: HR & operations ---------- */
.item-row.po-row { grid-template-columns: 1fr 80px 120px 32px; }
.item-row.inst-row { grid-template-columns: 1fr 150px 100px 32px; }
.leave-cal th, .leave-cal td { padding: 4px 3px; text-align: center; min-width: 20px; }
.leave-cal td:first-child, .leave-cal th:first-child { text-align: left; min-width: 150px; }
.leave-cal .we { background: var(--bg, #f3f4f6); }
.leave-cal td.on { background: var(--brand); }
.signin { text-align: center; padding: 28px 16px; }
.signin p { margin: 8px 0 16px; }
.btn-big { font-size: 17px; padding: 14px 30px; }
.appr { margin: 12px 0 4px; }
.appr th.c, .appr td.c { text-align: center; width: 44px; }
.appr input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); }
.stat strong small { font-size: 14px; color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .item-row.po-row, .item-row.inst-row { grid-template-columns: 1fr 1fr; }
  .item-row.po-row input:first-child, .item-row.inst-row input:first-child { grid-column: 1 / -1; }
}

/* ---------- v1.6: communication, portal, campuses ---------- */
.msg-prev { padding: 8px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.msg-prev:last-child { border-bottom: 0; }
.msg-prev .small { margin-top: 3px; white-space: pre-wrap; }
.campus-sel { border: 1px solid var(--line, #d1d5db); border-radius: 99px; padding: 5px 10px; font: inherit; font-size: 13px; background: var(--card); max-width: 170px; }
.campus-tag { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: var(--bg, #f3f4f6); }
.pin-slip { padding: 2mm 0; }
.pin-slip .rc-grid { margin: 8px 0; }
@media (max-width: 640px) { .campus-sel { max-width: 110px; } .campus-tag { display: none; } }

/* ---------- v1.7: licence ---------- */
.sheet { position: relative; }
.wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; z-index: 2;
  font: 700 64px/1 "Segoe UI", Arial, sans-serif; color: rgba(0, 0, 0, .07); transform: rotate(-35deg); white-space: nowrap; letter-spacing: 4px; }
.preview.A5 .wm { font-size: 44px; }
.lic { margin-bottom: 14px; }
.center { text-align: center; }

/* ---------- appearance (Settings → Appearance) ---------- */
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.theme-pre { border: 2px solid var(--line); border-radius: 10px; padding: 0; overflow: hidden; cursor: pointer; background: var(--card); text-align: left; }
.theme-pre.on { border-color: var(--brand); }
.theme-pre .sw { display: flex; height: 54px; } .theme-pre .sw i { flex: 1; } .theme-pre .sw i:first-child { flex: .9; }
.theme-pre span { display: block; padding: 6px 10px; font-size: 12.5px; font-weight: 600; }
.colour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.colour-field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); }
.colour-field input[type=color] { width: 44px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: #fff; flex: none; cursor: pointer; }
.colour-field b { display: block; font-size: 13px; } .colour-field small { color: var(--ink-3); font-size: 11.5px; }
.theme-preview { display: flex; height: 190px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 11px; }
.theme-preview .tp-side { width: 32%; background: var(--side-bg); color: var(--side-ink-2); padding: 10px 8px; }
.theme-preview .tp-side b { color: var(--side-ink); display: block; margin-bottom: 8px; } .theme-preview .tp-side div { padding: 4px 6px; border-radius: 5px; margin-bottom: 3px; }
.theme-preview .tp-side .on { background: var(--side-accent); color: var(--side-accent-ink); }
.theme-preview .tp-main { flex: 1; background: var(--bg); padding: 10px; } .theme-preview .tp-card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px; color: var(--ink); margin-bottom: 6px; }
.theme-preview .tp-btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border-radius: 5px; padding: 3px 8px; }
.login-prev { height: 150px; border-radius: 10px; background: var(--login-bg, var(--login)); background-size: cover; background-position: center; display: grid; place-items: center; border: 1px solid var(--line); }
.login-prev div { background: var(--card); color: var(--ink); width: 46%; height: 64%; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: grid; place-items: center; font-size: 11px; }

.preview .sheet, #print-area .sheet { color: #000; }
.theme-dark .preview { background: #2a333d; }
.theme-dark .notice { background: #3a2f10; border-color: #6b5410; color: #f6d68a; }
.theme-dark .alert { background: #3b1414; border-color: #7f1d1d; color: #fecaca; }
.theme-dark input[type=date], .theme-dark input[type=month], .theme-dark input[type=time] { color-scheme: dark; }

/* ---------- dashboard charts ---------- */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948; }
.theme-dark { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-card { margin: 0; min-width: 0; }
.dash-card.wide { grid-column: span 2; }
.dash-card .card-head { align-items: flex-start; margin-bottom: 6px; }
.dash-card .card-head p { margin: 2px 0 0; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-card.wide { grid-column: auto; } }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { font-family: var(--font); }
svg.chart .ax { font-size: 11px; fill: var(--ink-3); text-anchor: middle; } svg.chart .ax.r { text-anchor: end; }
svg.chart .vl { font-size: 11px; fill: var(--ink-2); text-anchor: middle; font-weight: 600; }
svg.chart .gl { stroke: var(--line); stroke-width: 1; } svg.chart .bl { stroke: var(--ink-3); stroke-opacity: .45; stroke-width: 1; }
svg.chart .ring { stroke: var(--card); stroke-width: 2; }
svg.chart .hit .xh, svg.chart .hit .dot { opacity: 0; transition: opacity .1s; } svg.chart .hit:hover .xh, svg.chart .hit:hover .dot { opacity: 1; }
svg.chart .xh { stroke: var(--ink-3); stroke-dasharray: 3 3; }
svg.chart g[data-tip]:hover path { filter: brightness(1.08); }
.donut { display: flex; align-items: center; justify-content: center; gap: 14px 18px; flex-wrap: wrap; }
.donut svg { width: 150px; height: 150px; flex: none; }
.donut path { stroke: var(--card); stroke-width: 1.5; cursor: default; transition: opacity .1s; } .donut svg:hover path:not(:hover) { opacity: .55; }
.donut .dn-c { font-size: 20px; font-weight: 700; fill: var(--ink); text-anchor: middle; font-family: var(--font); }
.donut .dn-s { font-size: 10px; fill: var(--ink-3); text-anchor: middle; font-family: var(--font); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 200px; font-size: 12.5px; }
.legend li { display: flex; align-items: center; gap: 7px; padding: 3px 0; color: var(--ink-2); }
.legend li span { flex: 1; min-width: 0; line-height: 1.3; }
.legend li b { color: var(--ink); font-weight: 600; } .legend li em { font-style: normal; color: var(--ink-3); width: 34px; text-align: right; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend.row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 4px; } .legend.row li { padding: 0; }
.chart-empty { display: grid; place-items: center; height: 150px; color: var(--ink-3); font-size: 13px; border: 1px dashed var(--line); border-radius: 8px; }
.ctip { position: fixed; z-index: 200; display: none; pointer-events: none; background: #111827; color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 260px; }
.ctip .ct-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; } .ctip .ct-row span { flex: 1; opacity: .8; } .ctip .ct-row i { width: 9px; height: 9px; border-radius: 2px; }
.theme-dark .ctip { background: #f0efec; color: #111; }
.stats.colourful .stat { border-left: 4px solid var(--c1); }
.stats.colourful .stat:nth-child(6n+2) { border-left-color: var(--c3); } .stats.colourful .stat:nth-child(6n+3) { border-left-color: var(--c2); }
.stats.colourful .stat:nth-child(6n+4) { border-left-color: var(--c8); } .stats.colourful .stat:nth-child(6n+5) { border-left-color: var(--c7); } .stats.colourful .stat:nth-child(6n+6) { border-left-color: var(--c4); }

/* ---------- class assessments ---------- */
.ca-book th.ca-type { text-align: center; border-left: 2px solid var(--line); background: var(--surface-2); }
.ca-book .ca-col { font-weight: 600; font-size: 12.5px; }
.ca-book tr.ca-avg td { background: var(--surface-2); font-size: 12.5px; }
.ca-book input.score { width: 74px; text-align: right; }
.score-table td.ca-auto { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.item-row.ca-type-row { grid-template-columns: 1fr 110px 80px 32px; }

/* My profile */
.grid-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-side { grid-template-columns: 1fr; } }
.notice.warn { background: #fef3f2; border-color: #fecdca; color: #912018; }
.notice.ok-notice { background: #ecfdf3; border-color: #abefc6; color: #05603a; }
.theme-dark .notice.warn { background: #3b1512; border-color: #7a271a; color: #fda29b; }
.theme-dark .notice.ok-notice { background: #0b2e1c; border-color: #085d3a; color: #75e0a7; }
.auth-portal { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line, #e5e7eb); color: var(--ink-3, #6b7280); text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--ink-3, #6b7280); }
.pw-eye:hover { color: var(--ink, #111827); background: rgba(0,0,0,.05); }
.pw-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-eye svg { width: 20px; height: 20px; fill: currentColor; }
.theme-dark .pw-eye:hover { background: rgba(255,255,255,.08); }

/* Sign-in tabs: Staff · Parent · Student (staff app and parent & student portal) */
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--line-2); border-radius: 10px; margin: 0 0 16px; }
.auth-tabs a, .auth-tabs button { display: block; text-align: center; padding: 8px 6px; border-radius: 7px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); text-decoration: none; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.auth-tabs a:hover, .auth-tabs button:hover { color: var(--ink); background: color-mix(in srgb, var(--card) 60%, transparent); }
.auth-tabs .on { background: var(--card); color: var(--brand); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.auth-hint { margin: 0 0 12px; }
/* parent & student portal */
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--side-hover); color: var(--side-ink); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.side nav a.active .nav-count { background: rgba(255,255,255,.25); color: inherit; }
.portal-notice { border-left: 4px solid var(--brand); }
.portal-notice .card-head { margin-bottom: 4px; }
.portal-pay { display: flex; gap: 10px; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.portal-pay .field { flex: 1; min-width: 180px; }
.id-preview { height: 36px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--line); font-weight: 700; color: var(--brand); }
/* lists that scroll inside their card (message recipients, WhatsApp list) */
.scroll-y { overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
/* tab bars scroll sideways only — no stray up/down arrows */
.tabs { overflow-y: hidden; scrollbar-width: thin; }
.update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 12px; background: #111827; color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 13.5px; max-width: calc(100% - 24px); }
.att-box { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.att-list:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); max-width: 100%; }
.att-chip a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.att-ico { font-size: 10px; font-weight: 800; letter-spacing: .03em; color: #fff; background: var(--brand); border-radius: 6px; padding: 4px 5px; }
.att-chip .icon-btn { width: 24px; height: 24px; font-size: 16px; }
.att-count { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
/* WAEC CA */
.table-scroll { overflow-x: auto; }
.checks-row { display: flex; flex-wrap: wrap; gap: 0 22px; }
.checks-row .check-line { margin: 4px 0; }
.sub-tabs { margin-top: -6px; }
.sub-tabs a { font-size: 13px; padding: 8px 12px; }
.idx-in { width: 150px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--ink); }
