/* EduCloud Pro — design system.
   Layout: white working surface, a quiet sidebar with one coloured glyph per module, and one colour system that
   runs through the whole app: the five school "bands" (pre-primary to senior) keep their colour everywhere. */
:root {
  --paper: #FFFFFF; --mist: #F5F6FC; --mist-2: #ECEEF8; --line: #E4E6F2; --line-2: #D3D6E8;
  --ink: #13152F; --ink-2: #4A4E6E; --ink-3: #7A7E9C;
  --blue: #2B33C9; --blue-2: #4650F0; --blue-soft: #ECEDFE; --on-blue: #FFFFFF;
  --pre: #D6457A; --pri: #E08A00; --mid: #0B9A8A; --sec: #2B6CE6; --sen: #7A4FD3;
  --pre-s: #FCE8EF; --pri-s: #FDF1DC; --mid-s: #DFF4F1; --sec-s: #E4EDFD; --sen-s: #EEE7FB;
  --good: #188038; --good-s: #E3F3E8; --warn: #B06000; --warn-s: #FDF0DA; --bad: #C5221F; --bad-s: #FCE8E6;
  --shadow: 0 1px 2px rgba(19, 21, 47, .06), 0 8px 24px -12px rgba(19, 21, 47, .18);
  --shadow-lg: 0 24px 60px -20px rgba(19, 21, 47, .35);
  --f-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Fira Sans', 'Segoe UI', system-ui, sans-serif;
  --r: 14px; --r-sm: 10px; --side: 244px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0F1126; --mist: #161938; --mist-2: #1D2147; --line: #262B55; --line-2: #343A6B;
  --ink: #EEF0FF; --ink-2: #B4B9DE; --ink-3: #8389B5;
  --blue: #8C93FF; --blue-2: #A5ABFF; --blue-soft: #232862; --on-blue: #0F1126;
  --pre: #F27BA5; --pri: #F2B04A; --mid: #46CDBD; --sec: #7BA7FF; --sen: #B093F5;
  --pre-s: #3A1A2A; --pri-s: #3A2C10; --mid-s: #10332F; --sec-s: #17284D; --sen-s: #2A2050;
  --good: #5FD08A; --good-s: #12301F; --warn: #F2B04A; --warn-s: #3A2C10; --bad: #FF8A80; --bad-s: #3D1A18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #0F1126; --mist: #161938; --mist-2: #1D2147; --line: #262B55; --line-2: #343A6B;
  --ink: #EEF0FF; --ink-2: #B4B9DE; --ink-3: #8389B5;
  --blue: #8C93FF; --blue-2: #A5ABFF; --blue-soft: #232862; --on-blue: #0F1126;
  --pre: #F27BA5; --pri: #F2B04A; --mid: #46CDBD; --sec: #7BA7FF; --sen: #B093F5;
  --pre-s: #3A1A2A; --pri-s: #3A2C10; --mid-s: #10332F; --sec-s: #17284D; --sen-s: #2A2050;
  --good: #5FD08A; --good-s: #12301F; --warn: #F2B04A; --warn-s: #3A2C10; --bad: #FF8A80; --bad-s: #3D1A18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; margin: 0; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; } a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; border-radius: 6px; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .tiny { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; align-content: start; } .stack.sm { gap: 8px; }
[hidden] { display: none !important; }

/* band colours: put .b-pre .b-pri .b-mid .b-sec .b-sen on anything */
.b-pre { --band: var(--pre); --band-s: var(--pre-s); } .b-pri { --band: var(--pri); --band-s: var(--pri-s); } .b-mid { --band: var(--mid); --band-s: var(--mid-s); }
.b-sec { --band: var(--sec); --band-s: var(--sec-s); } .b-sen { --band: var(--sen); --band-s: var(--sen-s); }
.cls { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--band-s, var(--mist-2)); color: var(--band, var(--ink-2)); font-weight: 500; font-size: 13px; white-space: nowrap; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--paper); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--blue); color: var(--on-blue); }
.brand b { font: 600 17px var(--f-display); letter-spacing: -.02em; display: block; line-height: 1.1; } .brand small { color: var(--ink-3); font-size: 11.5px; }
.school { margin: 4px 12px 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--mist); }
.school b { display: block; font-weight: 500; font-size: 14px; line-height: 1.25; } .school span { font-size: 12px; color: var(--ink-3); }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav h5 { margin: 14px 10px 4px; font: 500 11.5px var(--f-body); color: var(--ink-3); letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 9px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.nav a .g { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--band-s); color: var(--band); }
.nav a:hover { background: var(--mist); color: var(--ink); }
.nav a.on { background: var(--blue-soft); color: var(--ink); } .nav a.on .g { background: var(--band); color: var(--paper); }
.nav a .cnt { margin-left: auto; font-size: 11.5px; background: var(--bad-s); color: var(--bad); border-radius: 999px; padding: 0 7px; }
.side-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); display: grid; gap: 8px; }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-s); color: var(--warn); font-weight: 500; }
.plan.ok { background: var(--good-s); color: var(--good); } .plan.bad { background: var(--bad-s); color: var(--bad); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 21px; white-space: nowrap; }
.search { flex: 1; max-width: 440px; position: relative; margin-left: 10px; }
.search input { width: 100%; padding: 9px 12px 9px 38px; border: 1px solid var(--line); border-radius: 999px; background: var(--mist); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; max-height: 60vh; overflow-y: auto; }
.search .results button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.search .results button:hover, .search .results button.on { background: var(--mist); }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.iconbtn:hover { background: var(--mist); color: var(--ink); }
.session { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.user { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--band-s, var(--blue-soft)); color: var(--band, var(--blue)); font: 600 12px var(--f-display); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
#view { padding: 24px 28px 60px; max-width: 1320px; width: 100%; }
.menu-btn, .tabbar { display: none; }
.demo-flag { background: var(--pri-s); color: var(--pri); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.net-bar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100; background: linear-gradient(90deg, var(--blue-2), var(--mid), var(--pri)); transform-origin: left; animation: net 1.1s ease-in-out infinite; }
@keyframes net { 0% { transform: scaleX(.05); opacity: 1; } 70% { transform: scaleX(.85); } 100% { transform: scaleX(1); opacity: .2; } }
.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 16px; border-radius: var(--r-sm); background: var(--warn-s); color: var(--warn); margin-bottom: 16px; font-weight: 500; }
.banner.bad { background: var(--bad-s); color: var(--bad); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--mist); text-decoration: none; }
.btn.pri { background: var(--blue); border-color: var(--blue); color: var(--on-blue); } .btn.pri:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn.good { background: var(--good); border-color: var(--good); color: var(--paper); }
.btn.danger { color: var(--bad); border-color: var(--bad-s); background: var(--bad-s); }
.btn.ghost { border-color: transparent; background: none; color: var(--blue); } .btn.ghost:hover { background: var(--blue-soft); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; } .btn.lg { padding: 13px 22px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.field { display: grid; gap: 5px; min-width: 0; } .field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; } .field small { color: var(--ink-3); font-size: 12px; }
.in, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); min-width: 0; }
.field textarea { min-height: 84px; resize: vertical; }
.in:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue-2); outline-offset: 0; border-color: transparent; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; } .form .wide { grid-column: 1 / -1; } .form.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form h4 { grid-column: 1 / -1; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; } .check input { width: 17px; height: 17px; accent-color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.chip:hover { background: var(--mist); } .chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg { display: inline-flex; padding: 3px; background: var(--mist-2); border-radius: 11px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); font-size: 14px; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.err { color: var(--bad); font-size: 13.5px; background: var(--bad-s); padding: 8px 12px; border-radius: 8px; }

/* ---------- surfaces ---------- */
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); padding: 18px; min-width: 0; }
.card > h3 { margin-bottom: 12px; } .card.flat { background: var(--mist); border-color: transparent; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stat { padding: 14px 16px; border-radius: var(--r); background: var(--mist); min-width: 0; }
.stat span { font-size: 13px; color: var(--ink-2); display: block; } .stat b { font: 600 25px/1.2 var(--f-display); letter-spacing: -.02em; display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--ink-3); font-size: 12.5px; } .stat.good b { color: var(--good); } .stat.bad b { color: var(--bad); } .stat.warn b { color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--mist-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-s); color: var(--good); } .pill.warn { background: var(--warn-s); color: var(--warn); } .pill.bad { background: var(--bad-s); color: var(--bad); } .pill.info { background: var(--blue-soft); color: var(--blue); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); } .tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.head p { color: var(--ink-3); margin-top: 2px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); } .empty b { display: block; font: 600 17px var(--f-display); color: var(--ink); margin-bottom: 4px; } .empty .btn { margin-top: 14px; }
.list { display: grid; } .list > * { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; } .list > *:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.bar { height: 8px; border-radius: 99px; background: var(--mist-2); overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 99px; background: var(--band, var(--blue)); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px; padding: 9px 12px; background: var(--mist); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; } .tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.tbl tbody tr[data-act] { cursor: pointer; } .tbl tbody tr[data-act]:hover { background: var(--mist); }
.tbl tfoot td { font-weight: 600; background: var(--mist); border-top: 1px solid var(--line-2); }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 0; } .tbl .who b { font-weight: 500; display: block; } .tbl .who small { color: var(--ink-3); }
.tbl input.cell { width: 76px; padding: 5px 7px; border: 1px solid var(--line-2); border-radius: 7px; text-align: right; background: var(--paper); }

/* ---------- modal, toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(11, 13, 46, .45); z-index: 60; display: grid; place-items: center; padding: 20px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; animation: pop .18s; }
.modal.wide { max-width: 920px; } .modal.narrow { max-width: 440px; }
.modal > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal > .body { padding: 20px; overflow-y: auto; } .modal > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .2s; font-weight: 500; }
.toast.bad { background: var(--bad); color: #fff; } .toast.good { background: var(--good); color: #fff; }

/* ---------- signature pieces ---------- */
/* the day rail: today's bell schedule with a marker for now */
.rail { display: flex; gap: 4px; align-items: stretch; overflow-x: auto; padding-bottom: 2px; }
.rail div { flex: 1 0 64px; padding: 8px 6px; border-radius: 10px; background: var(--mist); text-align: center; font-size: 12px; color: var(--ink-3); position: relative; }
.rail div b { display: block; font: 600 14px var(--f-display); color: var(--ink-2); } .rail div.brk { flex: 0 0 54px; background: none; border: 1px dashed var(--line-2); }
.rail div.now { background: var(--blue); color: var(--on-blue); } .rail div.now b { color: var(--on-blue); } .rail div.past { opacity: .55; }
/* roll call: one tile per roll number. tap to change. */
.roll { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.roll button { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 9px 8px 8px; cursor: pointer; text-align: left; display: grid; gap: 1px; position: relative; min-width: 0; }
.roll button i { font: 600 18px var(--f-display); font-style: normal; color: var(--ink-3); } .roll button span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.roll button em { position: absolute; top: 8px; right: 9px; font-style: normal; font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 6px; background: var(--good-s); color: var(--good); }
.roll button[data-c="A"] { background: var(--bad-s); border-color: transparent; } .roll button[data-c="A"] em { background: var(--bad); color: #fff; }
.roll button[data-c="L"] { background: var(--warn-s); border-color: transparent; } .roll button[data-c="L"] em { background: var(--warn); color: #fff; }
.roll button[data-c="H"] { background: var(--sen-s); border-color: transparent; } .roll button[data-c="H"] em { background: var(--sen); color: #fff; }
.roll button[data-c="LV"] { background: var(--sec-s); border-color: transparent; } .roll button[data-c="LV"] em { background: var(--sec); color: #fff; }
.classgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.classgrid button { border: 1px solid var(--line); border-left: 4px solid var(--band); background: var(--paper); border-radius: 12px; padding: 11px 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.classgrid button:hover { background: var(--mist); } .classgrid b { font: 600 15px var(--f-display); } .classgrid span { font-size: 12.5px; color: var(--ink-3); }
.classgrid .todo { color: var(--warn); } .classgrid .done { color: var(--good); }
/* register (month view) */
.reg td, .reg th { padding: 4px 5px; text-align: center; font-size: 12px; min-width: 24px; } .reg td:first-child, .reg th:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); min-width: 150px; z-index: 1; }
.reg .A { color: var(--bad); font-weight: 600; } .reg .L { color: var(--warn); } .reg .LV { color: var(--sec); } .reg .H { color: var(--sen); } .reg .off { background: var(--mist); color: var(--ink-3); }
/* timetable */
.tt { display: grid; gap: 4px; min-width: 760px; } .tt > div { border-radius: 9px; padding: 6px 7px; min-height: 52px; font-size: 12.5px; }
.tt .hd { background: none; color: var(--ink-3); font-weight: 500; min-height: 0; display: grid; place-items: center; text-align: center; }
.tt .slot { background: var(--mist); cursor: pointer; display: grid; align-content: center; gap: 1px; border: 1px solid transparent; } .tt .slot:hover { border-color: var(--blue-2); }
.tt .slot b { font-weight: 500; font-size: 13px; line-height: 1.2; } .tt .slot span { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt .slot.filled { background: var(--tint, var(--blue-soft)); } .tt .brk { background: none; border: 1px dashed var(--line-2); display: grid; place-items: center; color: var(--ink-3); font-size: 11.5px; min-height: 0; }
/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kanban section { background: var(--mist); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; } .kanban h4 { display: flex; justify-content: space-between; padding: 2px 4px; color: var(--ink-2); }
.kanban article { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; cursor: pointer; display: grid; gap: 3px; } .kanban article:hover { border-color: var(--blue-2); }
/* bars chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; } .bars div { flex: 1; display: grid; gap: 4px; justify-items: center; align-content: end; height: 100%; min-width: 0; }
.bars i { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--blue-soft); display: block; min-height: 2px; } .bars div:last-child i { background: var(--blue); } .bars span { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
/* fee ledger lines */
.ledger label { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; } .ledger label:hover { background: var(--mist); }
.ledger label.paid { opacity: .55; cursor: default; } .ledger label.over b.amt { color: var(--bad); } .ledger input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--blue); }
.ledger .when { font-size: 12.5px; color: var(--ink-3); } .total-box { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 16px 18px; } .total-box b { font: 600 30px var(--f-display); display: block; font-variant-numeric: tabular-nums; }
/* store billing */
.pos #itQ { min-width: 200px; }
.pos { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.items button { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 10px; text-align: left; cursor: pointer; display: grid; gap: 2px; } .items button:hover { border-color: var(--blue-2); background: var(--mist); }
.items b { font-weight: 500; font-size: 13.5px; line-height: 1.25; } .items span { font-size: 12.5px; color: var(--ink-3); } .items .low { color: var(--bad); }
.cart .line { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto 26px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; } .qty button { border: 0; background: var(--mist); width: 26px; height: 28px; cursor: pointer; } .qty input { width: 38px; border: 0; text-align: center; background: none; }
.x { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; } .x:hover { color: var(--bad); background: var(--bad-s); }
.firm { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); background: var(--mid-s); color: var(--mid); font-weight: 500; flex-wrap: wrap; }
.lock { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 18px; background: var(--mist); }
.doc-frame { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.report-list button { display: flex; width: 100%; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font-weight: 500; color: var(--ink-2); }
.report-list button:hover { background: var(--mist); color: var(--ink); } .report-list button.on { background: var(--blue-soft); color: var(--blue); }
.dm { color: var(--ink-3); font-size: 12px; line-height: 1.5; } .dm a { color: var(--ink-2); font-weight: 600; }

/* ---------- small screens ---------- */
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21, .g12, .pos { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .app.open .side { transform: none; } .app.open::after { content: ''; position: fixed; inset: 0; background: rgba(11, 13, 46, .4); z-index: 25; }
  .pos #cart { order: -1; }
  .menu-btn { display: grid; } .user { padding: 3px; } .search { min-width: 0; } .top { padding: 10px 16px; gap: 8px; } .top h1 { font-size: 18px; } .session, .user span, .demo-flag { display: none; } .search { margin-left: 0; }
  #view { padding: 16px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; background: var(--paper); border-top: 1px solid var(--line); z-index: 22; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; color: var(--ink-3); text-decoration: none; font-weight: 500; } .tabbar a.on { color: var(--blue); }
  .g2, .g3, .form, .form.three { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 21px; } .scrim { padding: 0; place-items: end center; } .modal, .modal.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 94dvh; }
  .head { align-items: flex-start; } .toasts { bottom: 84px; } .roll { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}
@media (max-width: 520px) { .top h1, #quickBtn { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .top, .tabbar, .toasts, .no-print { display: none !important; } .app { display: block; } #view { padding: 0; max-width: none; } .tbl-wrap { border: 0; overflow: visible; } }
