/* Infinzio Campus — design system */
:root {
  --bg: #f4f5f9; --panel: #ffffff; --panel2: #f8f9fc; --ink: #101828; --ink2: #344054; --muted: #667085; --line: #e7e9f0; --line2: #d5d9e4;
  --brand: #4f46e5; --brand-ink: #3730a3; --brand-soft: #eef0ff; --accent: #f59e0b;
  --ok: #059669; --ok-soft: #e7f8f1; --warn: #d97706; --warn-soft: #fff5e1; --dan: #e11d48; --dan-soft: #ffe9ee; --info: #0284c7; --info-soft: #e5f4fd;
  --c1: #4f46e5; --c2: #0ea5a4; --c3: #f59e0b; --c4: #e11d48; --c5: #8b5cf6; --c6: #10b981;
  --sb: #0c1024; --sb2: #151a35; --sb-ink: #c7cbe0; --sb-mute: #7a80a3;
  --r: 14px; --r-sm: 9px; --sh: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .05); --sh-lg: 0 24px 60px rgba(16, 24, 40, .22);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
[data-theme='dark'] {
  --bg: #0a0d18; --panel: #121729; --panel2: #171d33; --ink: #e8eaf3; --ink2: #c3c8da; --muted: #8b92ad; --line: #232a43; --line2: #2f3756;
  --brand: #818cf8; --brand-ink: #c7d2fe; --brand-soft: #1e2347; --ok: #34d399; --ok-soft: #0f2a24; --warn: #fbbf24; --warn-soft: #2d2412; --dan: #fb7185; --dan-soft: #321522; --info: #38bdf8; --info-soft: #0f2533;
  --c1: #818cf8; --c2: #2dd4bf; --c3: #fbbf24; --c4: #fb7185; --c5: #a78bfa; --c6: #34d399;
  --sb: #070914; --sb2: #10142a; --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
.ic { flex: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.sp { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.boot { padding: 60px; text-align: center; color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: 264px 1fr; height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.view { flex: 1; overflow: auto; }
.page { padding: 26px 30px 60px; max-width: 1500px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* sidebar */
.sb { background: linear-gradient(180deg, var(--sb), var(--sb2)); color: var(--sb-ink); display: flex; flex-direction: column; height: 100vh; overflow: hidden; border-right: 1px solid rgba(255, 255, 255, .04); }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 14px; }
.sb-brand b { color: #fff; font-size: 16px; display: block; letter-spacing: -.01em; }
.sb-brand small { color: var(--sb-mute); font-size: 11.5px; }
.logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #6366f1, #0ea5a4); box-shadow: 0 6px 18px rgba(99, 102, 241, .45); }
.sb-school { margin: 4px 14px 10px; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); cursor: pointer; text-align: left; color: var(--sb-ink); }
.sb-school:hover { background: rgba(255, 255, 255, .09); }
.sch-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff; flex: none; letter-spacing: .02em; }
.sch-t { min-width: 0; flex: 1; }
.sch-t b { display: block; color: #fff; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-t small { color: var(--sb-mute); font-size: 11px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; scrollbar-color: #2a3058 transparent; }
.sb-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--sb-mute); padding: 14px 10px 6px; font-weight: 700; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--sb-ink); font-weight: 500; font-size: 13.5px; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link.on { background: linear-gradient(90deg, rgba(99, 102, 241, .32), rgba(99, 102, 241, .08)); color: #fff; box-shadow: inset 2px 0 0 #818cf8; }
.sb-link .ic { opacity: .85; }
.sb-link .nb { margin-left: auto; font-size: 10.5px; background: #e11d48; color: #fff; padding: 1px 7px; border-radius: 99px; font-weight: 700; }
.sb-foot { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sb-foot b { color: #fff; font-size: 13px; display: block; }
.sb-foot small { color: var(--sb-mute); font-size: 11.5px; }

/* topbar */
.top { height: 62px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.top-search { display: flex; align-items: center; gap: 10px; width: min(440px, 46vw); height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; text-align: left; }
.top-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 6px; background: var(--panel); color: var(--muted); }
.role-pick { display: flex; align-items: center; gap: 6px; padding-left: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--muted); }
.role-pick select { border: 0; background: transparent; height: 36px; padding-right: 8px; font-weight: 600; color: var(--ink); cursor: pointer; outline: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink2); position: relative; flex: none; }
.icon-btn:hover { background: var(--panel2); }
.bell i { position: absolute; top: -5px; right: -5px; background: var(--dan); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--panel); }
.only-m { display: none; }

/* page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 25px; font-weight: 800; }
.page-head .sub { margin: 5px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 10px; cursor: pointer; background: none; border: 0; padding: 0; }
.crumb:hover { color: var(--brand); }

/* grid & cards */
.grid { display: grid; gap: 16px; margin-bottom: 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)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 0; flex-wrap: wrap; }
.card-h h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h h3 .ic { color: var(--brand); }
.card-b { padding: 14px 18px 18px; }
.card-b.flush { padding: 10px 0 0; }
.card-b.flush .tbl-tools { padding: 0 18px; }
.card.hero { background: radial-gradient(1200px 300px at 0% 0%, rgba(99, 102, 241, .18), transparent 60%), radial-gradient(700px 260px at 100% 0%, rgba(14, 165, 164, .16), transparent 60%), var(--panel); }

/* KPI */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); position: relative; overflow: hidden; min-width: 0; }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi.t-ok .kpi-ic { background: var(--ok-soft); color: var(--ok); } .kpi.t-warn .kpi-ic { background: var(--warn-soft); color: var(--warn); } .kpi.t-dan .kpi-ic { background: var(--dan-soft); color: var(--dan); } .kpi.t-info .kpi-ic { background: var(--info-soft); color: var(--info); }
.kpi-l { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi-v { font-size: 25px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; }
.kpi-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-spark { position: absolute; right: 12px; bottom: 12px; width: 90px; height: 28px; color: var(--brand); opacity: .7; }
.spark { width: 100%; height: 100%; }
.up { color: var(--ok); font-weight: 700; } .down { color: var(--dan); font-weight: 700; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--ink); transition: .15s; }
.btn:hover { background: var(--panel2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
[data-theme='dark'] .btn.pri { color: #0a0d18; }
.btn.pri:hover { filter: brightness(1.07); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.dan { background: var(--dan); border-color: var(--dan); color: #fff; }
.btn.ghost { background: transparent; }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
[data-theme='dark'] .btn.soft { color: var(--brand); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; justify-content: center; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn); } .b-dan { background: var(--dan-soft); color: var(--dan); } .b-info { background: var(--info-soft); color: var(--info); } .b-mute { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); } .b-brand { background: var(--brand-soft); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); margin: 0 4px 4px 0; }
.chip.dan { background: var(--dan-soft); color: var(--dan); border-color: transparent; } .chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; } .chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

/* avatar */
.av { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: hsl(var(--h), 55%, 32%); background: hsl(var(--h), 75%, 90%); flex: none; letter-spacing: .02em; }
[data-theme='dark'] .av { color: hsl(var(--h), 80%, 82%); background: hsl(var(--h), 35%, 24%); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { display: block; font-weight: 600; white-space: nowrap; }
.who small { color: var(--muted); font-size: 12px; }

/* inputs */
.inp { height: 38px; border: 1px solid var(--line2); border-radius: 10px; padding: 0 11px; background: var(--panel); outline: none; width: 100%; transition: .15s; }
textarea.inp { height: auto; padding: 9px 11px; resize: vertical; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.inp.err { border-color: var(--dan); }
.inp.sm { height: 32px; font-size: 13px; border-radius: 8px; width: auto; }
.inp.lg { height: 46px; font-size: 15px; }
select.inp { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.fld em { color: var(--dan); font-style: normal; }
.fld small { color: var(--muted); font-size: 11.5px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 6px 0; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .inp { width: auto; }

/* segmented, tabs */
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--sh); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-color: var(--brand); }
.pane { display: none; } .pane.on { display: block; animation: fade .2s ease; }

/* tables */
.tbl-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tsearch { position: relative; }
.tsearch .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tsearch input { padding-left: 32px; width: 240px; }
.tbl-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.2px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--panel2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--muted); font-size: 12.5px; }
.card-b.flush .tbl-foot { padding: 10px 18px; }
.card .tbl th:first-child, .card .tbl td:first-child { padding-left: 18px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini th, .mini td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.mini th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini .num { text-align: right; font-variant-numeric: tabular-nums; }
.mini tfoot td { font-weight: 800; border-bottom: 0; }

/* lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; color: inherit; }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; border-radius: 10px; padding: 11px 10px; }
.li.click:hover, .li.on { background: var(--panel2); }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-weight: 600; }
.li-main small { color: var(--muted); font-size: 12.3px; }
.li-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.li-ic.t-dan { background: var(--dan-soft); color: var(--dan); } .li-ic.t-warn { background: var(--warn-soft); color: var(--warn); } .li-ic.t-info { background: var(--info-soft); color: var(--info); } .li-ic.t-ok { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty .ic { opacity: .5; }
.empty p { margin: 8px 0 0; }

/* alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.a-dan { background: var(--dan-soft); color: var(--dan); } .a-warn { background: var(--warn-soft); color: var(--warn); } .a-info { background: var(--info-soft); color: var(--info); } .a-ok { background: var(--ok-soft); color: var(--ok); }
.alert b { font-weight: 800; }

/* progress, charts */
.progress { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 60px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .4s; }
.progress.ok i { background: var(--ok); } .progress.warn i { background: var(--warn); } .progress.dan i { background: var(--dan); }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.chart .ax.v { fill: var(--ink2); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.3px; color: var(--ink2); }
.legend.col { flex-direction: column; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.d-v { font-size: 20px; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.d-l { font-size: 9.5px; fill: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: .06em; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hb { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; font-size: 12.8px; }
.hb-l { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 9px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 99px; }
.hb b { text-align: right; font-variant-numeric: tabular-nums; }

/* key-value */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; margin: 0; font-size: 13.3px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 13, 28, .5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 18px; width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--sh-lg); border: 1px solid var(--line); }
.modal.wide { width: min(980px, 100%); } .modal.xl { width: min(1180px, 100%); }
.modal.palette { width: min(640px, 100%); align-self: start; margin-top: 8vh; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h3 { font-size: 16.5px; font-weight: 800; }
.modal header .icon-btn { width: 32px; height: 32px; border: 0; }
.modal-b { padding: 18px 20px; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel2); border-radius: 0 0 18px 18px; }
.list.pal { margin-top: 10px; max-height: 50vh; overflow: auto; }
body.modal-open .view { overflow: hidden; }

/* toast */
#toast-root { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 12px; background: #101828; color: #fff; box-shadow: var(--sh-lg); font-weight: 600; font-size: 13px; animation: slidein .25s ease; max-width: 380px; transition: .4s; }
.toast.t-ok .ic { color: #34d399; } .toast.t-dan .ic { color: #fb7185; } .toast.t-info .ic { color: #93c5fd; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* profile header */
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile h2 { font-size: 22px; font-weight: 800; }
.profile .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.profile .meta span { display: inline-flex; align-items: center; gap: 5px; }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin-top: 18px; border: 1px solid var(--line); }
.stat-strip div { background: var(--panel); padding: 12px 16px; }
.stat-strip b { display: block; font-size: 19px; font-weight: 800; }
.stat-strip small { color: var(--muted); font-size: 12px; }

/* attendance heat & marking */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; }
.heat i { aspect-ratio: 1; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; }
.heat i.P { background: var(--ok); } .heat i.A { background: var(--dan); } .heat i.L { background: var(--warn); } .heat i.N { background: var(--line); color: var(--muted); }
.mark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mark { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.mark .who { flex: 1; }
.pal3 { display: flex; gap: 4px; }
.pal3 button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; font-weight: 800; font-size: 12px; color: var(--muted); }
.pal3 button.on.P { background: var(--ok); color: #fff; border-color: var(--ok); } .pal3 button.on.A { background: var(--dan); color: #fff; border-color: var(--dan); } .pal3 button.on.L { background: var(--warn); color: #fff; border-color: var(--warn); }

/* timetable */
.tt { display: grid; gap: 6px; overflow-x: auto; }
.tt-row { display: grid; grid-template-columns: 74px repeat(8, minmax(110px, 1fr)); gap: 6px; }
.tt-h { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; padding: 6px 0; }
.tt-d { font-weight: 800; display: grid; place-items: center; background: var(--panel2); border-radius: 10px; border: 1px solid var(--line); }
.tt-c { border-radius: 10px; padding: 8px 10px; min-height: 58px; border: 1px solid transparent; cursor: pointer; transition: .15s; background: hsl(var(--h), 70%, 95%); }
[data-theme='dark'] .tt-c { background: hsl(var(--h), 30%, 18%); }
.tt-c:hover { border-color: var(--brand); transform: translateY(-1px); }
.tt-c b { display: block; font-size: 12.5px; color: hsl(var(--h), 55%, 30%); }
[data-theme='dark'] .tt-c b { color: hsl(var(--h), 80%, 80%); }
.tt-c small { font-size: 11px; color: var(--muted); }
.tt-c.sub { outline: 2px dashed var(--warn); }
.tt-c.free { background: var(--panel2); border: 1px dashed var(--line2); cursor: default; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 300px; }
.kcol h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; padding: 4px 4px 10px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--sh); }
.kcard b { display: block; font-weight: 700; }
.kcard small { color: var(--muted); display: block; font-size: 12px; }
.kcard .row { margin-top: 8px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dh { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px; }
.cal .dc { min-height: 92px; border: 1px solid var(--line); border-radius: 11px; padding: 6px 7px; background: var(--panel); font-size: 12px; }
.cal .dc.out { opacity: .4; }
.cal .dc.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal .dc > b { font-size: 12px; color: var(--muted); }
.cal .ev { display: block; margin-top: 4px; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--brand-soft); color: var(--brand); }
.ev.Holiday { background: var(--dan-soft); color: var(--dan); } .ev.Exam { background: var(--warn-soft); color: var(--warn); } .ev.Health { background: var(--ok-soft); color: var(--ok); } .ev.Sports, .ev.Activity { background: var(--info-soft); color: var(--info); }

/* map */
.map { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #eef2f7; }
[data-theme='dark'] .map { background: #0e1426; }
.map svg { display: block; width: 100%; height: auto; }
.map .road { stroke: #fff; stroke-width: 9; fill: none; stroke-linecap: round; }
[data-theme='dark'] .map .road { stroke: #1c2440; }
.map .blk { fill: #e2e8f0; } [data-theme='dark'] .map .blk { fill: #131b33; }
.map .park { fill: #d1fae5; } [data-theme='dark'] .map .park { fill: #10291f; }
.map .water { fill: #dbeafe; } [data-theme='dark'] .map .water { fill: #0f2236; }
.map .rt { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; }
.map .stop { stroke: #fff; stroke-width: 2; }
.map .stoplbl { font-size: 10px; font-weight: 700; fill: var(--ink2); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; font-family: var(--font); }
.busm { transition: transform 1s linear; }
.map-legend { position: absolute; left: 12px; top: 12px; background: var(--panel); border-radius: 10px; padding: 8px 10px; box-shadow: var(--sh); font-size: 12px; display: flex; flex-direction: column; gap: 5px; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 11px 14px; border-radius: 16px; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
[data-theme='dark'] .msg.me { color: #0a0d18; }
.msg.bot { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-bottom-left-radius: 5px; max-width: 92%; }
.msg.bot .mini { margin-top: 8px; background: var(--panel); border-radius: 8px; }
.chat-in { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.sug { border: 1px solid var(--line2); background: var(--panel); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--ink2); }
.sug:hover { border-color: var(--brand); color: var(--brand); }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

/* phone frame for apps */
.apps-wrap { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.phone { width: 380px; flex: none; border-radius: 44px; padding: 12px; background: #0b0f1c; box-shadow: 0 30px 70px rgba(16, 24, 40, .35), inset 0 0 0 2px #2a3150; }
.phone-scr { border-radius: 34px; overflow: hidden; background: var(--bg); height: 760px; display: flex; flex-direction: column; position: relative; }
.phone-bar { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 12px; font-weight: 700; flex: none; }
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 14px; background: #0b0f1c; }
.phone-body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; scrollbar-width: none; }
.phone-nav { display: flex; justify-content: space-around; border-top: 1px solid var(--line); background: var(--panel); padding: 8px 0 14px; flex: none; }
.phone-nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.phone-nav button.on { color: var(--brand); }
.app-hero { border-radius: 20px; padding: 16px; color: #fff; background: linear-gradient(135deg, #4f46e5, #0ea5a4); margin: 6px 0 14px; }
.app-hero small { opacity: .85; }
.app-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; margin-bottom: 10px; }
.app-card h4 { font-size: 13.5px; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.app-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 10.8px; font-weight: 600; color: var(--ink2); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; cursor: pointer; text-align: center; }
.app-tile .ic { color: var(--brand); }
.apps-side { flex: 1; min-width: 300px; }

/* certificate / print */
.cert { border: 10px double #b08d2e; padding: 40px 48px; text-align: center; background: #fffdf6; color: #1f2937; font-family: Georgia, 'Times New Roman', serif; border-radius: 6px; }
.cert h2 { font-size: 30px; letter-spacing: .04em; color: #7a5b12; margin: 8px 0 4px; }
.cert .sch { font-size: 22px; font-weight: 700; }
.cert p { font-size: 16px; line-height: 1.8; }
.cert .sig { display: flex; justify-content: space-between; margin-top: 46px; font-size: 13px; }
.cert .sig span { border-top: 1px solid #555; padding-top: 6px; min-width: 160px; }
.doc { background: #fff; color: #111827; padding: 28px 32px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
.doc h2 { font-size: 20px; } .doc .mini th, .doc .mini td { border-color: #e5e7eb; color: #111827; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #111827; padding-bottom: 12px; margin-bottom: 16px; gap: 20px; }
.doc .mini th { color: #6b7280; }
#print-root { display: none; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .doc, #print-root .cert { border-radius: 0; }
}

/* misc */
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.big-num { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.sos { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; border: 0; border-radius: 18px; padding: 16px; font-weight: 800; font-size: 16px; width: 100%; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 24px rgba(225, 29, 72, .35); }
.camp-card { cursor: pointer; transition: .15s; }
.camp-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.camp-ban { height: 86px; border-radius: 12px; margin-bottom: 12px; display: flex; align-items: flex-end; padding: 10px 12px; color: #fff; font-weight: 800; }
.feature-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line2); border-radius: 99px; cursor: pointer; transition: .2s; }
.toggle span::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.toggle input:checked + span { background: var(--brand); }
.toggle input:checked + span::after { left: 19px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mod-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 13px; }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel); }
.plan.hot { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.plan .price { font-size: 26px; font-weight: 800; margin: 6px 0; }
.plan ul { padding-left: 18px; margin: 10px 0 0; color: var(--ink2); font-size: 13px; line-height: 1.8; }
.insight { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 8px; }
.insight b { display: block; }
.insight small { color: var(--muted); }
.risk { font-weight: 800; font-variant-numeric: tabular-nums; }
.health-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--dan); font-weight: 700; font-size: 12px; }
.idcard { width: 340px; border-radius: 16px; overflow: hidden; border: 1px solid #e5e7eb; background: #fff; color: #111827; font-family: var(--font); }
.idcard .top-b { background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.idcard .body { padding: 14px 16px; font-size: 12.5px; }
.idcard .bg { font-size: 30px; font-weight: 800; color: #e11d48; }

/* sign-in & sync status */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); overflow: auto; }
.login-art { background: radial-gradient(900px 500px at 10% 0%, rgba(99, 102, 241, .55), transparent 60%), radial-gradient(700px 400px at 100% 100%, rgba(14, 165, 164, .45), transparent 60%), var(--sb); color: #fff; padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.login-art h1 { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.login-art p { color: #c7cbe0; font-size: 16px; max-width: 460px; margin: 0; }
.login-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; max-width: 480px; }
.login-feats span { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.login-card { align-self: center; justify-self: center; width: min(400px, 92vw); display: flex; flex-direction: column; gap: 14px; padding: 36px 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-lg); margin: 40px 0; }
.login-card h2 { font-size: 24px; font-weight: 800; }
.login-card .muted { margin: 0; }
.login-card .alert { margin: 0; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px var(--ok-soft); transition: .2s; }
.sync-dot.busy { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sync-dot.err { background: var(--dan); box-shadow: 0 0 0 3px var(--dan-soft); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { padding: 36px 24px; } .login-feats { display: none; } }

@media (max-width: 1200px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21, .g12, .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sb { position: fixed; z-index: 40; width: 270px; left: -280px; transition: left .25s; }
  body.sb-open .sb { left: 0; box-shadow: var(--sh-lg); }
  .only-m { display: grid; }
  .page { padding: 18px 14px 50px; }
  .g2, .g4, .g5 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .top-search span, .top-search kbd { display: none; } .top-search { width: 40px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .phone { width: 100%; }
}
.sync-dot.offline { background: var(--muted); box-shadow: 0 0 0 3px var(--line); }
.lmap { height: 420px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; }
.phone-scr .lmap { height: 260px; }
.md p { margin: 0 0 8px; } .md ul { margin: 4px 0 8px; padding-left: 20px; } .md table { margin: 6px 0; }
@media (max-width: 600px) { .apps-wrap .apps-side { display: none; } .phone { padding: 0; border-radius: 0; box-shadow: none; background: none; } .phone-scr { height: auto; min-height: calc(100vh - 140px); border-radius: 0; } .phone-notch, .phone-bar { display: none; } }

/* ---------- easier to use (m-ux.js) ---------- */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.demo-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: linear-gradient(90deg, #4f46e5, #0f766e); color: #fff; padding: 10px 16px; font-size: 13.5px; position: sticky; top: 0; z-index: 30; }
.demo-banner .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.tour-spot { position: fixed; z-index: 90; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 14, 30, .55); pointer-events: none; transition: all .2s; }
.tour-tip { position: fixed; z-index: 91; background: var(--panel); color: var(--text); border-radius: 14px; padding: 14px 16px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; gap: 6px; }
.tour-tip p { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.app-top { display: none; }
@media (max-width: 700px) {
  body.app-mode #sidebar, body.app-mode #topbar, body.app-mode .page-head, body.app-mode .page > .toolbar { display: none !important; }
  body.app-mode .layout { display: block; }
  body.app-mode .page { padding: 0 !important; }
  body.app-mode .apps-wrap { display: block; }
  body.app-mode .apps-side { display: none; }
  body.app-mode .phone { width: 100%; padding: 0; border-radius: 0; box-shadow: none; background: none; }
  body.app-mode .phone-scr { border-radius: 0; height: calc(100dvh - 52px); min-height: 0; }
  body.app-mode .phone-notch, body.app-mode .phone-bar { display: none; }
  body.app-mode .phone-nav { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  body.app-mode .app-top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  body.app-mode .app-top b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.app-mode .app-top .sch-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; flex: none; }
}

/* tutor chat, QR boxes */
.tutor-log { max-height: 50vh; min-height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--panel2); border-radius: 12px; }
.tmsg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.tmsg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.tmsg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.qr-box svg { display: block; border-radius: 8px; border: 1px solid var(--line); }
.idc-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.gate-cam { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.gate-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gate-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; }
.gal-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gal-album { all: unset; cursor: pointer; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
.gal-album:focus-visible { outline: 3px solid var(--brand); }
.gal-album img, .gal-empty { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: grid; place-items: center; background: var(--panel2); color: var(--muted); }
.gal-album > div:last-child { padding: 10px 12px; display: grid; } .gal-album small { color: var(--muted); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; } .gal-grid.sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 12px; }
.gal-ph { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.gal-ph img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.gal-ph figcaption { padding: 8px 10px; display: grid; gap: 2px; font-size: 13px; position: relative; } .gal-ph figcaption .btn { position: absolute; right: 6px; top: 6px; }
/* boarding roll call */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rc-kid { all: unset; cursor: pointer; border-radius: 12px; padding: 10px 12px; border: 2px solid var(--line); background: var(--panel); display: grid; gap: 2px; }
.rc-kid small { color: var(--muted); font-size: 12px; } .rc-kid:focus-visible { outline: 3px solid var(--brand); }
.rc-kid.ok { border-color: var(--ok); background: var(--ok-soft); } .rc-kid.dan { border-color: var(--dan); background: var(--dan-soft); }
.rc-kid.info { border-color: var(--info); background: var(--info-soft); } .rc-kid.warn { border-color: var(--warn); background: var(--warn-soft); }
