/* Aerolab Dashboard. Brand green accent, red used only as the active-nav marker, status colours for meaning only. */
:root {
  --paper: #f2f6f1; --panel: #fff; --ink: #13200f; --ink-2: #44523f; --ink-3: #66745f; --line: #dce5d9; --line-2: #e9efe6;
  --accent: #2c731d; --accent-soft: #e5f1e1; --accent-bright: #9ad88a;
  --good: #1b7f56; --good-soft: #e1f3ea; --warn: #9a5f00; --warn-soft: #fbefd5; --bad: #c0352b; --bad-soft: #fbe4e1;
  --nav: #0f2d13; --nav-ink: #cfe3ca; --nav-active: #1d4f1a;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 14px; margin: 16px 0 4px; font-weight: 600; }
.sub-h { margin-top: 18px; }
p { margin: 0 0 10px; max-width: 75ch; }
a { color: var(--accent); }
code { font-size: 12.5px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--ink-3); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.num { text-align: right; }
[hidden] { display: none !important; }
ul.plain { margin: 6px 0 12px; padding-left: 18px; } ul.plain li { margin: 3px 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.nav { background: var(--nav); color: var(--nav-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { color: #fff; font-weight: 600; font-size: 17px; padding: 2px 10px 18px; display: flex; flex-direction: column; line-height: 1.2; gap: 6px; }
.brand img { width: 150px; height: auto; display: block; }
.brand span { font-weight: 400; font-size: 12.5px; color: var(--accent-bright); }
.nav nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: block; padding: 8px 10px; border-radius: var(--r); color: var(--nav-ink); text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: var(--nav-active); color: #fff; box-shadow: inset 3px 0 0 #e4161b; }
.nav-group { margin: 16px 10px 4px; font-size: 12px; color: #9db997; }
.nav-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 2px; }
.who { padding: 0 10px 8px; display: flex; flex-direction: column; } .who strong { color: #fff; font-weight: 500; } .who span { font-size: 12.5px; color: #9db997; }
.nav-btn { background: none; border: 0; color: var(--nav-ink); text-align: left; padding: 7px 10px; border-radius: var(--r); font: inherit; cursor: pointer; }
.nav-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.main { min-width: 0; }
#view { padding: 24px 28px 60px; max-width: 1280px; outline: none; }
.topbar { display: none; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-toggle { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; }
.scrim { display: none; }

/* ---------- page structure ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sub { color: var(--ink-3); margin: 4px 0 0; }
.crumbs { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; } .panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .grid-2 > .panel { margin-bottom: 16px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 6px 0; }
.loading { display: flex; align-items: center; gap: 10px; padding: 28px 4px; color: var(--ink-3); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* stat strip: one ruled band of figures instead of a row of cards */
.stat-strip { display: flex; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.stat { flex: 1 1 150px; padding: 14px 18px; border-left: 1px solid var(--line); min-width: 0; } .stat:first-child { border-left: 0; }
.stat-v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.stat-v.bad { color: var(--bad); } .stat-v.warn { color: var(--warn); } .stat-v.good { color: var(--good); }
.stat-l { color: var(--ink-2); font-size: 13px; } .stat-s { color: var(--ink-3); font-size: 12px; }

/* ---------- notices ---------- */
.notice { padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); border-left: 3px solid var(--accent); margin: 0 0 14px; max-width: none; }
.notice p:last-child { margin-bottom: 0; }
.notice.good { background: var(--good-soft); border-color: var(--good); } .notice.warn { background: var(--warn-soft); border-color: var(--warn); } .notice.bad { background: var(--bad-soft); border-color: var(--bad); }

/* ---------- buttons and forms ---------- */
.btn { font: inherit; font-weight: 500; padding: 7px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: var(--r); cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4; }
.btn:hover:not(:disabled) { border-color: #b9bed3; background: #fafbfe; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover:not(:disabled) { background: #2833b8; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger:hover:not(:disabled) { background: #a02a21; }
.btn.small { padding: 3px 10px; font-size: 12.5px; } .btn.block { display: block; width: 100%; margin-top: 10px; text-align: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 2px 8px; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 0 0 12px; min-width: 0; }
.field > span { font-size: 13px; color: var(--ink-2); }
.field.inline { margin: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9cde0; border-radius: var(--r); padding: 7px 10px; min-width: 0; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
textarea { resize: vertical; width: 100%; }
.check, .radio { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; } legend { font-size: 13px; color: var(--ink-2); padding: 0; margin-bottom: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; } .filters .field { margin: 0; } .filters.panel { margin-bottom: 16px; }
.form-error { color: var(--bad); font-weight: 500; margin: 6px 0; }
.range { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid #c9cde0; border-radius: var(--r); overflow: hidden; background: #fff; }
.seg button { font: inherit; border: 0; background: none; padding: 7px 12px; cursor: pointer; border-left: 1px solid var(--line); } .seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { font: inherit; font-size: 13px; border: 1px solid var(--line); background: #fff; padding: 3px 12px; border-radius: 99px; cursor: pointer; }
.chip-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; } .tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 500; }

/* ---------- tables ---------- */
.dt-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.dt-search { width: min(320px, 100%); } .dt-count { color: var(--ink-3); font-size: 12.5px; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; position: sticky; top: 0; }
.tbl th.num { text-align: right; }
.tbl th.sortable { cursor: pointer; user-select: none; } .tbl th.sortable:hover { color: var(--ink); }
.tbl th .arr { font-size: 9px; margin-left: 5px; color: var(--accent); }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl.compact td, .tbl.compact th { padding: 5px 10px; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: #f6f7fd; }
.tbl tr.dim td { color: var(--ink-3); }
.tbl tr.changed td { background: var(--warn-soft); }
.tbl tr.streak-row td { background: var(--bad-soft); }
.tbl td.empty { text-align: center; color: var(--ink-3); padding: 24px; }
.row-link { text-decoration: none; color: var(--ink); } .row-link:hover { color: var(--accent); }
.dt-pager, .pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 10px; color: var(--ink-3); font-size: 13px; }

/* ---------- status marks ---------- */
.pct { display: inline-block; min-width: 54px; text-align: center; padding: 1px 8px; border-radius: 99px; font-weight: 500; font-size: 13px; }
.pct.good { background: var(--good-soft); color: var(--good); } .pct.warn { background: var(--warn-soft); color: var(--warn); } .pct.bad { background: var(--bad-soft); color: var(--bad); } .pct.none { color: var(--ink-3); }
.chip, .tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; background: var(--line-2); color: var(--ink-2); margin: 1px 0; }
.chip.bad, .tag.bad { background: var(--bad-soft); color: var(--bad); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.good, .tag.ok { background: var(--good-soft); color: var(--good); }
.st { font-weight: 500; } .st.Present { color: var(--good); } .st.Absent { color: var(--bad); } .st.Late { color: var(--warn); } .st.Excused { color: var(--ink-3); } .st.Cancelled { color: var(--ink-3); text-decoration: line-through; } .st.Held { color: var(--good); }
.mini-bar { display: inline-block; width: 54px; height: 6px; background: var(--line); border-radius: 3px; vertical-align: middle; overflow: hidden; margin-right: 4px; } .mini-bar i { display: block; height: 100%; background: var(--accent); }

/* heat strip: the dashboard's signature mark. One cell per week or per session. */
.strip { display: inline-flex; gap: 2px; vertical-align: middle; }
.strip .c { width: 11px; height: 20px; border-radius: 2px; background: var(--line-2); display: block; }
.c.good { background: #2f9e6f; } .c.warn { background: #e0a526; } .c.bad { background: #d4493d; } .c.none { background: var(--line-2); }
.sess-strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 10px; }
.sess-strip .c, .legend .c { width: 14px; height: 26px; border-radius: 2px; display: inline-block; }
.c.Present { background: #2f9e6f; } .c.Late { background: #e0a526; } .c.Absent { background: #d4493d; } .c.Excused { background: #aeb4cc; }
.c.streak { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--ink-2); } .legend .c { height: 12px; width: 12px; vertical-align: -1px; margin-right: 4px; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { font-size: 11px; fill: var(--ink-3); font-family: var(--font); }
.chart .thresh { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; } .chart .dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 56px; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); }
a.hbar:hover .hb-label { color: var(--accent); }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hb-val { text-align: right; color: var(--ink-2); font-size: 13px; }
.hb-track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; } .hb-fill { display: block; height: 100%; border-radius: 5px; }
.hb-fill.good { background: #2f9e6f; } .hb-fill.warn { background: #e0a526; } .hb-fill.bad { background: #d4493d; } .hb-fill.accent { background: var(--accent); } .hb-fill.none { background: var(--line); }
.meters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; flex-wrap: wrap; }
.meter-track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; } .meter-track i { display: block; height: 100%; }
.meter-track i.good { background: #2f9e6f; } .meter-track i.warn { background: #e0a526; } .meter-track i.bad { background: #d4493d; }
.good-text { color: var(--good); } .warn-text { color: var(--warn); font-weight: 500; } .bad-text { color: var(--bad); font-weight: 500; }

/* ---------- drawer, toast ---------- */
.drawer-host { position: fixed; inset: 0; z-index: 100; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 23, 43, .45); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(20, 23, 43, .18); animation: slide .16s ease-out; outline: none; }
.drawer.wide { width: min(760px, 100%); }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); } .drawer-head h2 { margin: 0; font-size: 17px; }
.drawer-body { padding: 16px 18px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; position: sticky; bottom: -24px; background: var(--panel); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 10px; } .drawer-foot .muted { margin-right: auto; }
.sess-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin-bottom: 12px; } .sess-meta div { display: flex; flex-direction: column; } .sess-meta .muted { font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 18px 16px; position: relative; } .timeline li::before { content: ''; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; } .tl-head time { color: var(--ink-3); font-size: 12.5px; margin-left: auto; } .tl-reason { margin: 4px 0 0; font-size: 13px; }
.diff { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.diff-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.diff-k { color: var(--ink-3); min-width: 70px; }
del { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; padding: 0 4px; border-radius: 3px; }
ins { background: var(--good-soft); color: var(--good); text-decoration: none; padding: 0 4px; border-radius: 3px; }
.diff-arrow { color: var(--ink-3); }
#toast-host { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); max-width: 360px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.good { background: var(--good); } .toast.bad { background: var(--bad); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--nav) 0 38%, var(--paper) 38%); }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; width: min(400px, 100%); box-shadow: 0 10px 40px rgba(20, 23, 43, .15); }
.auth-card h1 { margin-bottom: 4px; } .auth-card .field input { width: 100%; } .demo { margin-top: 14px; }

/* ---------- wizard, progress ---------- */
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 4px; padding: 0; margin: 0 0 16px; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; color: var(--ink-3); background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.stepper .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 12px; font-weight: 500; }
.stepper li.now { color: var(--accent); border-color: var(--accent); font-weight: 500; } .stepper li.now .n { background: var(--accent); color: #fff; }
.stepper li.done { color: var(--good); } .stepper li.done .n { background: var(--good); color: #fff; }
.wizard { min-height: 220px; } .wz-nav { display: flex; justify-content: space-between; }
.prog-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 12px; align-items: center; margin: 8px 0; }
.bar { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.export-form .filters { margin-bottom: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: 260px; transform: translateX(-102%); transition: transform .18s; }
  .nav-open .nav { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(20, 23, 43, .45); }
  .topbar { display: flex; }
  #view { padding: 16px 14px 48px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stat { flex-basis: 45%; } .stat:nth-child(odd) { border-left: 0; } .stat-v { font-size: 22px; }
  .prog-row { grid-template-columns: 1fr; gap: 4px; }
  .hbar { grid-template-columns: minmax(80px, 40%) 1fr 52px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- print (school report) ---------- */
.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 11px; }
  .nav, .topbar, .scrim, .no-print, .dt-tools, .dt-pager, .btn, .chips, .crumbs, #toast-host, .drawer-host { display: none !important; }
  .shell { display: block; } #view { padding: 0; max-width: none; }
  .print-only { display: block !important; }
  .panel, .stat-strip { border: 1px solid #bbb; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow: visible; } .tbl th { position: static; }
  .tbl tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .pct, .chip, .tag { border: 1px solid #ccc; background: none !important; }
  .c, .hb-fill, .mini-bar i, .line { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.auth-logo { width: min(240px, 70%); height: auto; display: block; margin: 0 0 14px; }
