/* Chalkwren: a working school management demo (concept project, fictional data only). */
:root {
  --bg: #f3f4f8; --surface: #ffffff; --surface-2: #f7f8fb; --surface-3: #eef0f6; --border: #e3e6ef; --border-2: #d2d7e4;
  --text: #141a33; --text-2: #394062; --muted: #687092; --faint: #9aa0b9;
  --primary: #2f4fe0; --primary-2: #2440c4; --primary-soft: #e9edff; --primary-ring: rgba(47, 79, 224, .22);
  --accent: #f5a524; --accent-2: #b86e00; --accent-soft: #fff3d9;
  --green: #0f9468; --green-soft: #e1f5ec; --amber: #c06f00; --amber-soft: #fff1d4; --red: #dc4338; --red-soft: #fdeceb;
  --blue: #2f4fe0; --blue-soft: #e9edff; --violet: #7346d1; --violet-soft: #f1ebfd; --rose: #c8357c; --rose-soft: #fdebf4;
  --side: #121831; --side-2: #1c2446; --side-3: #263059; --side-text: #c8cde2; --side-muted: #7f87a8;
  --shadow-sm: 0 1px 2px rgba(20, 26, 51, .06);
  --shadow: 0 1px 2px rgba(20, 26, 51, .05), 0 8px 24px rgba(20, 26, 51, .06);
  --shadow-lg: 0 30px 80px rgba(20, 26, 51, .24);
  --r: 16px; --r-sm: 11px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Sitka Heading", "Sitka Subheading", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --numf: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0e1d; --surface: #11172e; --surface-2: #151c37; --surface-3: #1a2242; --border: #212a4b; --border-2: #2e385f;
  --text: #eef0f8; --text-2: #cdd2e6; --muted: #959cbb; --faint: #646b8c;
  --primary: #7b93ff; --primary-2: #a5b5ff; --primary-soft: rgba(123, 147, 255, .15); --primary-ring: rgba(123, 147, 255, .32);
  --accent: #ffbf47; --accent-2: #ffd27f; --accent-soft: rgba(255, 191, 71, .14);
  --green: #3ddc9b; --green-soft: rgba(61, 220, 155, .12); --amber: #ffc24d; --amber-soft: rgba(255, 194, 77, .13);
  --red: #ff7a70; --red-soft: rgba(255, 122, 112, .14); --blue: #a5b5ff; --blue-soft: rgba(123, 147, 255, .16);
  --violet: #c2a8ff; --violet-soft: rgba(167, 139, 250, .16); --rose: #ff8cc0; --rose-soft: rgba(255, 140, 192, .14);
  --side: #070a16; --side-2: #131a33; --side-3: #1c2546;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.i { flex: none; display: block; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 20px 14px 16px; gap: 16px; background-image: radial-gradient(circle at 0 100%, rgba(245, 165, 36, .10), transparent 45%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand b { display: block; color: #fff; font: 700 19px/1.1 var(--display); letter-spacing: -.005em; }
.brand small { color: var(--side-muted); font-size: 12px; display: block; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.nav-sec { font: 700 10.5px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); padding: 12px 12px 6px; opacity: .8; }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--side-text); font-weight: 600; font-size: 14px; position: relative; }
.nav-i:hover { background: var(--side-2); color: #fff; }
.nav-i.on { background: linear-gradient(135deg, rgba(245, 165, 36, .2), rgba(245, 165, 36, .06)); color: #fff; }
.nav-i.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-i.on .i { color: #ffc24d; }
.nb { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--accent); color: #2b1d00; font: 750 11px/20px var(--font); text-align: center; }
.nb.warn { background: #3b2330; color: #ff9fb0; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.shift { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--side-muted); padding: 10px 12px; border-radius: 11px; background: var(--side-2); }
.shift b { color: #fff; font-weight: 650; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc9b; box-shadow: 0 0 0 4px rgba(61, 220, 155, .16); flex: none; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.me .who { min-width: 0; flex: 1; text-align: left; border: 0; background: none; padding: 0; color: inherit; }
.me b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.me .icon-btn { color: var(--side-muted); border-color: transparent; background: transparent; box-shadow: none; width: 36px; height: 36px; }
.me .icon-btn:hover { color: #fff; background: var(--side-2); }
.demo-tag { font-size: 11.5px; color: var(--side-muted); padding: 0 12px; line-height: 1.4; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font); color: #fff; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; border-radius: 22px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-brand { display: none; align-items: center; gap: 10px; font: 700 17px var(--display); }
.top-brand svg { width: 32px; height: 32px; }
.search-trigger { flex: 1; max-width: 440px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-align: left; box-shadow: var(--shadow-sm); }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px var(--font); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.clock { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding: 0 6px; white-space: nowrap; }
.clock b { color: var(--text); font-weight: 700; }
.clock .per { color: var(--accent-2); font-weight: 700; background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); flex: none; }
.icon-btn:hover { border-color: var(--border-2); color: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--red); color: #fff; font: 700 10.5px/19px var(--font); font-style: normal; text-align: center; padding: 0 5px; border: 2px solid var(--bg); }
.page { padding: 26px 28px 48px; min-width: 0; }
.tabbar { display: none; }

/* ---------- common ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font: 700 30px/1.12 var(--display); letter-spacing: -.01em; }
.ph p { color: var(--muted); margin-top: 6px; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; font-size: 13px; margin-bottom: 10px; }
.crumb:hover { color: var(--primary); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font: 700 17px var(--display); letter-spacing: -.005em; }
.card-h small { color: var(--muted); }
.card-h .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: block; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 18px; }
.btn { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: var(--border-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #3c5cf0, #2b48d6); border-color: #2440c4; color: #fff; box-shadow: 0 8px 18px rgba(47, 79, 224, .26), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:hover { border-color: #1d36ad; background: linear-gradient(180deg, #4766f5, #2e4cdc); }
[data-theme="dark"] .btn-primary { background: linear-gradient(180deg, #6680ff, #4f6bf5); border-color: #6680ff; }
.btn-accent { background: linear-gradient(180deg, #ffb83d, #f5a017); border-color: #e59611; color: #2b1d00; box-shadow: 0 8px 18px rgba(245, 165, 36, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-2); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; gap: 6px; }
.btn-lg { height: 52px; font-size: 15.5px; border-radius: 14px; }
.w100 { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--border-2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip b { font-weight: 700; opacity: .6; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button, .seg a { height: 34px; padding: 0 13px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { padding: 11px 14px; border: 0; background: none; font-weight: 650; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs .on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .cnt { font-size: 11px; font-weight: 750; padding: 1px 7px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.input, select.input, textarea.input { height: 42px; width: 100%; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px; outline: none; min-width: 0; }
select.input { padding-right: 30px; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, .lbl-s { font-weight: 650; font-size: 13px; color: var(--text-2); }
.search { position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 40px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nd::before { display: none; }
.p-green { background: var(--green-soft); color: var(--green); }
.p-amber { background: var(--amber-soft); color: var(--amber); }
.p-red { background: var(--red-soft); color: var(--red); }
.p-blue { background: var(--blue-soft); color: var(--blue); }
.p-violet { background: var(--violet-soft); color: var(--violet); }
.p-rose { background: var(--rose-soft); color: var(--rose); }
.p-gold { background: var(--accent-soft); color: var(--accent-2); }
.p-gray { background: var(--surface-3); color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--border-2); border: 0; flex: none; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.empty { display: grid; place-items: center; gap: 8px; text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .i { color: var(--faint); }
.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6c86ff, var(--primary)); }
.bar.g > i { background: var(--green); } .bar.a > i { background: #f0a020; } .bar.r > i { background: var(--red); } .bar.y > i { background: linear-gradient(90deg, #ffc65c, var(--accent)); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kv small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kv b { font-size: 14.5px; overflow-wrap: anywhere; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 600; }
.note.blue { background: var(--blue-soft); color: var(--blue); }
.note.red { background: var(--red-soft); color: var(--red); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }
table.t td.c, table.t th.c { text-align: center; }
.cell-main { font-weight: 650; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.who-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who-cell b { display: block; white-space: nowrap; }
.who-cell small { color: var(--muted); font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.pager .row { gap: 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 380px; }
.toolbar select.input { width: auto; min-width: 140px; }
.attbar { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.attbar .bar { flex: 1; height: 6px; }
.attbar b { font-size: 13px; min-width: 40px; text-align: right; }

/* ---------- KPIs and charts ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 650; font-size: 13px; }
.kpi .lbl .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi.gold .lbl .ico { background: var(--accent-soft); color: var(--accent-2); }
.kpi.green .lbl .ico { background: var(--green-soft); color: var(--green); }
.kpi.red .lbl .ico { background: var(--red-soft); color: var(--red); }
.kpi .val { font: 750 30px/1.1 var(--numf); letter-spacing: -.02em; margin-top: 14px; }
.kpi .val small { font-size: 16px; color: var(--muted); font-weight: 650; letter-spacing: 0; }
.kpi .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.delta { font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.spark { width: 104px; height: 34px; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 12.5px var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.mix { flex: 1; display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.mix-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.mix-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mix-row b { margin-left: auto; }

/* ---------- dashboard ---------- */
.dayline { display: grid; grid-template-columns: var(--cols); gap: 4px; position: relative; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px 14px; box-shadow: var(--shadow); }
.dayline .lab { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--muted); gap: 10px; }
.dayline .lab b { color: var(--text); font: 700 15px var(--display); }
.ds { position: relative; height: 46px; border-radius: 10px; background: var(--surface-3); display: flex; flex-direction: column; justify-content: center; padding: 0 9px; overflow: hidden; min-width: 0; }
.ds b { font-size: 12.5px; white-space: nowrap; position: relative; }
.ds small { font-size: 11px; color: var(--muted); white-space: nowrap; position: relative; }
.ds.brk { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--surface-3) 6px, var(--surface-3) 12px); }
.ds.done { background: var(--primary-soft); }
.ds.done b { color: var(--primary-2); }
.ds.now { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.ds.now b { color: var(--accent-2); }
.ds .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(245, 165, 36, .22); }
.ctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ct { border: 1px solid var(--border); border-radius: 13px; padding: 10px 11px 11px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0; transition: transform .15s, border-color .15s, box-shadow .15s; }
.ct:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--shadow); }
.ct .between b { font: 700 14px var(--font); }
.ct .pct { font: 750 19px/1 var(--numf); letter-spacing: -.01em; }
.ct small { color: var(--muted); font-size: 11.5px; }
.ct .bar { height: 5px; }
.ct.hi .pct { color: var(--green); }
.ct.mid .pct { color: var(--primary); }
.ct.lo .pct { color: var(--amber); }
.ct.pending { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }
.ct.pending .pct { color: var(--accent-2); font-size: 13px; font-family: var(--font); font-weight: 750; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow small { color: var(--muted); font-size: 12.5px; }
.date-badge { width: 52px; text-align: center; padding: 6px 0 7px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-2); flex: none; line-height: 1.05; }
.date-badge b { display: block; font: 750 19px var(--numf); }
.date-badge small { display: block; font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.date-badge.gold { background: var(--accent-soft); color: var(--accent-2); }
.bday { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.bday .grow b { display: block; font-size: 13.5px; }
.bday .grow small { color: var(--muted); font-size: 12.5px; }
.cake { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--rose-soft); color: var(--rose); flex: none; }
.notice-mini { padding: 11px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 12px; align-items: flex-start; }
.notice-mini:last-child { border-bottom: 0; }
.notice-mini .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex: none; }
.notice-mini b { display: block; font-size: 13.5px; }
.notice-mini small { color: var(--muted); font-size: 12.5px; }

/* ---------- profile ---------- */
.prof { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.prof h1 { font: 700 30px/1.1 var(--display); }
.prof .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prof .acts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.ms { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.ms small { color: var(--muted); font-size: 12px; font-weight: 650; display: block; }
.ms b { font: 750 21px var(--numf); display: block; margin-top: 4px; }
.ms span { font-size: 12px; color: var(--muted); }
.gcard { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface-2); display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.gcard .grow b { display: block; }
.gcard .grow small { color: var(--muted); display: block; font-size: 12.5px; overflow-wrap: anywhere; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: 0; }
.doc-ico { width: 40px; height: 46px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; position: relative; }
.doc-ico::after { content: ""; position: absolute; right: 0; top: 0; width: 12px; height: 12px; background: linear-gradient(225deg, var(--surface) 50%, rgba(0, 0, 0, .08) 50%); border-radius: 0 9px 0 4px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dh { font-size: 11px; font-weight: 750; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.cal .d { aspect-ratio: 1 / .82; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--faint); border: 1px solid transparent; min-width: 0; }
.cal .d small { font-size: 9.5px; font-weight: 700; letter-spacing: .03em; }
.cal .d.P { background: var(--green-soft); color: var(--green); }
.cal .d.L { background: var(--amber-soft); color: var(--amber); }
.cal .d.A { background: var(--red-soft); color: var(--red); }
.cal .d.H { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 5px, var(--surface-3) 5px, var(--surface-3) 10px); color: var(--faint); }
.cal .d.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal .d.x { visibility: hidden; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- attendance ---------- */
.att-sum { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.as { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-weight: 650; font-size: 13px; }
.as b { font: 750 16px var(--numf); }
.as i { width: 10px; height: 10px; border-radius: 3px; }
.att-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.ar .roll { width: 28px; font: 750 13px var(--numf); color: var(--muted); text-align: center; flex: none; }
.ar .grow b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar .grow small { color: var(--muted); font-size: 12px; }
.ar.A { border-color: rgba(220, 67, 56, .35); background: linear-gradient(90deg, var(--red-soft), var(--surface) 60%); }
.ar.L { border-color: rgba(192, 111, 0, .3); background: linear-gradient(90deg, var(--amber-soft), var(--surface) 60%); }
.pla { display: inline-flex; gap: 4px; flex: none; }
.pla button { width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 750; font-size: 13px; color: var(--muted); }
.pla button.on.P { background: var(--green); border-color: var(--green); color: #fff; }
.pla button.on.L { background: #f0a020; border-color: #f0a020; color: #2b1d00; }
.pla button.on.A { background: var(--red); border-color: var(--red); color: #fff; }
[data-theme="dark"] .pla button.on.P, [data-theme="dark"] .pla button.on.A { color: #0a0e1d; }
.att-bar { position: sticky; top: 80px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 14px; }
.saved-line { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.saved-line.ok { color: var(--green); }
.saved-line.pend { color: var(--accent-2); }
.mgrid { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.mgrid th, .mgrid td { padding: 6px 3px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.mgrid th { color: var(--muted); font-weight: 700; font-size: 11px; }
.mgrid th.we, .mgrid td.we { background: var(--surface-2); }
.mgrid td.nm, .mgrid th.nm { text-align: left; padding-left: 10px; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 160px; font-size: 13px; }
.mgrid td.nm b { font-weight: 650; }
.mgrid .sq { width: 16px; height: 16px; border-radius: 5px; display: inline-block; vertical-align: middle; }
.sq.P { background: var(--green); opacity: .85; } .sq.L { background: #f0a020; } .sq.A { background: var(--red); } .sq.H { background: transparent; } .sq.N { background: var(--surface-3); }
.mgrid td.tot { font-weight: 750; padding: 6px 8px; }
.mgrid tr.today-col td.tdc { background: var(--accent-soft); }

/* ---------- timetable ---------- */
.tt-wrap { overflow-x: auto; }
.tt { display: grid; grid-template-columns: 74px repeat(var(--n), minmax(96px, 1fr)); gap: 6px; min-width: 900px; }
.tt .hd { font-size: 12px; font-weight: 750; color: var(--muted); padding: 6px 8px; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.tt .hd b { color: var(--text); font-size: 13px; }
.tt .hd.now b { color: var(--accent-2); }
.tt .dl { font: 700 15px var(--display); display: flex; flex-direction: column; justify-content: center; padding-left: 4px; }
.tt .dl small { font: 600 11.5px var(--font); color: var(--muted); }
.tt .dl.today { color: var(--accent-2); }
.tc { position: relative; min-height: 70px; border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; border: 1.5px solid transparent; text-align: left; min-width: 0; cursor: grab; transition: transform .12s, box-shadow .12s; user-select: none; }
.tc:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tc b { font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc small { font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc.brk { cursor: default; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--surface-3) 6px, var(--surface-3) 12px); color: var(--faint); align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.tc.brk:hover { box-shadow: none; transform: none; }
.tc.free { background: var(--surface); border: 1.5px dashed var(--border-2); color: var(--faint); cursor: default; }
.tc.sel { box-shadow: 0 0 0 3px var(--primary-ring); border-color: var(--primary); }
.tc.over { border-color: var(--primary); border-style: dashed; box-shadow: 0 0 0 3px var(--primary-ring); }
.tc.dragging { opacity: .4; }
.tc.now { box-shadow: 0 0 0 2px var(--accent); }
.tc.clash { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.tc .cl { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font: 800 11px var(--font); }
.tc.moved::after { content: ""; position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.tc.clash.moved::after { display: none; }
.s-0 { background: #e9edff; color: #2440c4; } .s-1 { background: #fde8ef; color: #b02a5b; } .s-2 { background: #fff1d4; color: #9a5a00; } .s-3 { background: #e1f5ec; color: #0b7a55; }
.s-4 { background: #efe8fd; color: #6236c4; } .s-5 { background: #e4f4ff; color: #0f6aa6; } .s-6 { background: #fdebdc; color: #a8501a; } .s-7 { background: #e8f5d9; color: #4d7a12; }
.s-8 { background: #fbe7fb; color: #9c2a9c; } .s-9 { background: #eceef4; color: #4a5272; } .s-10 { background: #dff6f3; color: #11756c; } .s-11 { background: #f9f0d9; color: #7d6510; }
[data-theme="dark"] .s-0 { background: #1d2754; color: #b4c2ff; } [data-theme="dark"] .s-1 { background: #3a1a2a; color: #ffaccb; } [data-theme="dark"] .s-2 { background: #3a2b10; color: #ffd27f; }
[data-theme="dark"] .s-3 { background: #0f3327; color: #7ee8bd; } [data-theme="dark"] .s-4 { background: #2a1f4a; color: #cdb6ff; } [data-theme="dark"] .s-5 { background: #102c40; color: #9fd8ff; }
[data-theme="dark"] .s-6 { background: #3a2312; color: #ffbe8f; } [data-theme="dark"] .s-7 { background: #23331a; color: #bde68f; } [data-theme="dark"] .s-8 { background: #361a36; color: #f3a9f3; }
[data-theme="dark"] .s-9 { background: #1f2540; color: #b9bfd8; } [data-theme="dark"] .s-10 { background: #0f302c; color: #86e6da; } [data-theme="dark"] .s-11 { background: #332a12; color: #ecd58a; }
.clash-banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-weight: 650; margin-bottom: 14px; flex-wrap: wrap; }
.clash-banner .grow { min-width: 200px; }
.clash-banner small { display: block; font-weight: 500; color: var(--text-2); }
.ok-banner { display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 650; margin-bottom: 14px; }
.tt-day { display: none; }
.tt-list { display: none; }

/* ---------- exams ---------- */
.exam-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.exam { display: flex; flex-direction: column; gap: 12px; }
.exam .top-l { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exam h4 { font: 700 18px var(--display); }
.exam .dates { color: var(--muted); font-size: 13px; }
.exam .bar { height: 7px; }
.marks-tbl input.mk { width: 82px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 0 10px; text-align: right; font: 650 14px var(--numf); outline: none; }
.marks-tbl input.mk:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.marks-tbl input.mk.bad { border-color: var(--red); background: var(--red-soft); }
.marks-tbl input.mk:disabled { opacity: .5; }
.grade { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 8px; font: 750 12.5px var(--font); }
.g-A1, .g-A2 { background: var(--green-soft); color: var(--green); }
.g-B1, .g-B2 { background: var(--blue-soft); color: var(--blue); }
.g-C1, .g-C2 { background: var(--accent-soft); color: var(--accent-2); }
.g-D { background: var(--amber-soft); color: var(--amber); }
.g-E { background: var(--red-soft); color: var(--red); }
.g-- { background: var(--surface-3); color: var(--faint); }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sel-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 750 12px var(--font); background: var(--surface-3); color: var(--text-2); }
.rank.r1 { background: linear-gradient(135deg, #ffd36b, #f5a524); color: #3a2700; }
.rank.r2 { background: linear-gradient(135deg, #e8ebf3, #c3c9da); color: #2b3150; }
.rank.r3 { background: linear-gradient(135deg, #f5c9a6, #d99566); color: #3d1f08; }

/* report card */
.rc { background: #fffefb; color: #141a33; border-radius: 14px; border: 1px solid #e6e2d6; padding: 26px 28px; font-size: 13px; position: relative; overflow: hidden; }
.rc::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, #121831 0 60%, #f5a524 60% 80%, #2f4fe0 80%); }
.rc-h { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1.5px solid #141a33; }
.rc-h svg { width: 50px; height: 50px; flex: none; }
.rc-h h3 { font: 700 21px/1.15 var(--display); }
.rc-h small { color: #5b6283; display: block; font-size: 12px; }
.rc-h .ttl { margin-left: auto; text-align: right; }
.rc-h .ttl b { display: block; font: 700 14px var(--display); letter-spacing: .02em; }
.rc-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; padding: 14px 0; border-bottom: 1px dashed #cfcab9; }
.rc-info small { display: block; font-size: 10.5px; color: #6c7290; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rc-info b { font-size: 13.5px; }
.rc table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.rc th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6c7290; border-bottom: 1px solid #d9d4c4; padding: 8px 6px; }
.rc td { padding: 8px 6px; border-bottom: 1px solid #ece8dc; }
.rc td.r, .rc th.r { text-align: right; }
.rc td.c, .rc th.c { text-align: center; }
.rc tfoot td { font-weight: 800; border-bottom: 0; border-top: 1.5px solid #141a33; }
.rc .grade { background: #f1eee4; color: #141a33; }
.rc-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.rc-sum div { border: 1px solid #e6e2d6; border-radius: 10px; padding: 9px 11px; background: #fbf9f3; }
.rc-sum small { display: block; font-size: 10.5px; color: #6c7290; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rc-sum b { font: 750 18px var(--numf); }
.rc-rem { margin-top: 14px; padding: 12px 14px; border-left: 3px solid #f5a524; background: #fff8e8; border-radius: 0 10px 10px 0; font-style: italic; color: #394062; }
.rc-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 34px; text-align: center; font-size: 11.5px; color: #6c7290; }
.rc-sign div { border-top: 1px solid #9aa0b9; padding-top: 6px; }
.rc-foot { margin-top: 16px; font-size: 11px; color: #8a90aa; text-align: center; }

/* ---------- fees ---------- */
.receipt { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; background: #fffefb; color: #141a33; border: 1px dashed #cfcab9; border-radius: 12px; padding: 18px; }
.receipt .rh { display: flex; align-items: center; gap: 10px; justify-content: center; }
.receipt .rh svg { width: 30px; height: 30px; }
.receipt h3 { text-align: center; font: 700 16px var(--display); }
.receipt .c { text-align: center; color: #5b6283; font-size: 11.5px; }
.receipt hr { border: 0; border-top: 1px dashed #c9c4b3; margin: 10px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; }
.receipt .r span:last-child { text-align: right; }
.receipt .tot { font-weight: 800; font-size: 15px; }
.receipt .words { font-style: italic; color: #394062; font-size: 11.5px; margin-top: 4px; }
.receipt .stamp { margin: 10px auto 0; width: max-content; border: 2px solid #0f9468; color: #0f9468; border-radius: 8px; padding: 3px 12px; font-weight: 800; letter-spacing: .14em; transform: rotate(-4deg); }
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.att-fab { display: none; }
.pay-amt { text-align: center; padding: 6px 0 2px; }
.pay-amt small { color: var(--muted); font-weight: 650; }
.pay-amt div { font: 800 40px var(--numf); letter-spacing: -.02em; }
.pay-panel { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr { width: 170px; height: 170px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.change { font: 750 18px var(--numf); color: var(--green); }
.card-art { width: 230px; max-width: 100%; height: 140px; border-radius: 16px; background: linear-gradient(135deg, #121831, #2f4fe0); color: #fff; padding: 16px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.card-art .chip-art { width: 34px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #ffd36b, #c27803); }
.qline { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); cursor: pointer; }
.qline.on { border-color: var(--primary); background: var(--primary-soft); }
.qline input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.qline .grow b { display: block; }
.qline .grow small { color: var(--muted); font-size: 12.5px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; width: 100%; }
.pick:hover { border-color: var(--primary); }
.pick .grow b { display: block; font-size: 13.5px; }
.pick .grow small { color: var(--muted); font-size: 12px; }
.band { display: flex; flex-direction: column; gap: 6px; }
.band .ln { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); padding: 4px 0; border-bottom: 1px dashed var(--border); }
.band .tot { display: flex; justify-content: space-between; font: 750 16px var(--numf); padding-top: 8px; }
.band h4 { font: 700 17px var(--display); }
.band .gr { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.qtrack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qt { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.qt small { color: var(--muted); font-size: 12px; font-weight: 650; display: block; }
.qt b { font: 750 18px var(--numf); display: block; margin: 4px 0 6px; }
.qt.paid { background: var(--green-soft); border-color: transparent; }
.qt.due { background: var(--red-soft); border-color: transparent; }
.qt.up { background: var(--accent-soft); border-color: transparent; }

/* ---------- staff ---------- */
.staff-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.sc { display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; transition: transform .15s, box-shadow .15s; }
.sc:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.sc .head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.sc .head .grow b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc .head .grow small { color: var(--muted); font-size: 12.5px; }
.sc .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
.sc .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 10px; }
.load { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.load div { text-align: center; font-size: 11px; color: var(--muted); font-weight: 650; }
.load i { display: block; height: 56px; border-radius: 8px; background: var(--surface-3); position: relative; overflow: hidden; margin-bottom: 4px; }
.load i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: linear-gradient(180deg, #6c86ff, var(--primary)); border-radius: 8px 8px 0 0; }

/* ---------- notices ---------- */
.notices { display: flex; flex-direction: column; gap: 14px; }
.notice { display: flex; gap: 16px; align-items: flex-start; }
.notice .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.notice.pinned { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.notice.pinned .ico { background: var(--accent); color: #2b1d00; }
.notice h4 { font: 700 18px var(--display); }
.notice p { color: var(--text-2); margin-top: 6px; line-height: 1.55; }
.notice .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.notice .acts { display: flex; gap: 6px; flex: none; }
.aud-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- transport ---------- */
.tr-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.map-card { padding: 0; overflow: hidden; }
.map { display: block; width: 100%; height: auto; background: #eef2f0; }
[data-theme="dark"] .map { background: #0f1529; }
.map .land { fill: #eef1ec; } [data-theme="dark"] .map .land { fill: #10172c; }
.map .block { fill: #e3e8e1; } [data-theme="dark"] .map .block { fill: #151d36; }
.map .park { fill: #cfe9cf; } [data-theme="dark"] .map .park { fill: #173326; }
.map .water { fill: #bcdcf2; } [data-theme="dark"] .map .water { fill: #16304a; }
.map .river { fill: none; stroke: #bcdcf2; stroke-width: 26; stroke-linecap: round; } [data-theme="dark"] .map .river { stroke: #16304a; }
.map .road { fill: none; stroke: #ffffff; stroke-width: 9; stroke-linecap: round; } [data-theme="dark"] .map .road { stroke: #1d2747; }
.map .road.minor { stroke-width: 5; }
.map .rail { fill: none; stroke: #a5abbf; stroke-width: 3; stroke-dasharray: 10 6; }
.map .rt { fill: none; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; transition: opacity .2s, stroke-width .2s; }
.map .rt.dim { opacity: .18; }
.map .rt.sel { stroke-width: 8.5; opacity: 1; }
.map .stop { cursor: pointer; }
.map .stop circle { fill: #fff; stroke-width: 4; }
.map .stop.dim { opacity: .25; }
.map .stop text { font: 700 14px var(--font); fill: #2b3150; paint-order: stroke; stroke: rgba(255, 255, 255, .92); stroke-width: 4px; stroke-linejoin: round; }
[data-theme="dark"] .map .stop text { fill: #dfe3f2; stroke: rgba(10, 14, 29, .9); }
.map .lbl { font: 700 12.5px var(--font); fill: #7c839e; letter-spacing: .12em; text-transform: uppercase; }
.map .school text { font: 800 15px var(--font); fill: #141a33; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
[data-theme="dark"] .map .school text { fill: #fff; stroke: #0a0e1d; }
.route-chips { display: flex; flex-direction: column; gap: 8px; }
.rchip { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); text-align: left; width: 100%; }
.rchip.on { border-color: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 25%, transparent); }
.rchip .sw { width: 14px; height: 36px; border-radius: 6px; background: var(--rc); flex: none; }
.rchip .grow b { display: block; font-size: 13.5px; }
.rchip .grow small { color: var(--muted); font-size: 12px; }
.stops { display: flex; flex-direction: column; }
.stp { display: flex; gap: 12px; position: relative; padding-bottom: 14px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding-left: 0; padding-right: 0; }
.stp::before { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--rc); opacity: .35; }
.stp:last-child::before { display: none; }
.stp > i { width: 16px; height: 16px; border-radius: 50%; border: 3.5px solid var(--rc); background: var(--surface); margin-top: 2px; flex: none; }
.stp.end > i { background: var(--rc); }
.stp .grow b { display: block; font-size: 13.5px; }
.stp .grow small { color: var(--muted); font-size: 12px; }
.stp .t { font: 700 12.5px var(--numf); color: var(--text-2); }
.stp:hover .grow b { color: var(--primary); }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; }
.set-row small { color: var(--muted); }
.sc-keys { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; font-size: 13.5px; }
.scale-t { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.scale-t div { text-align: center; border-radius: 10px; padding: 8px 2px; }
.scale-t b { display: block; font-size: 14px; }
.scale-t small { font-size: 11px; }

/* ---------- parent view ---------- */
.kid { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; background: linear-gradient(120deg, #121831, #1f2b62 60%, #2f4fe0 140%); color: #fff; border: 0; }
.kid::after { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 165, 36, .45), rgba(245, 165, 36, 0) 68%); }
.kid > * { position: relative; z-index: 1; }
.kid h1 { font: 700 30px/1.1 var(--display); }
.kid p { color: #c8cde2; margin-top: 4px; }
.kid .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kid .meta span { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; }
.kid .acts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.kid .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.kid .btn-accent { background: linear-gradient(180deg, #ffb83d, #f5a017); border-color: #e59611; color: #2b1d00; }
.subj-bars { display: flex; flex-direction: column; gap: 12px; }
.sb { display: grid; grid-template-columns: 130px minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 13.5px; }
.sb .track { position: relative; height: 12px; border-radius: 7px; background: var(--surface-3); }
.sb .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: linear-gradient(90deg, #6c86ff, var(--primary)); }
.sb .track em { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--accent); }
.sb .v { text-align: right; font-weight: 750; }
.today-tt { display: flex; flex-direction: column; gap: 6px; }
.tp { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 11px; font-size: 13px; }
.tp.now { box-shadow: inset 0 0 0 2px var(--accent); }
.tp .tm { font: 650 12px var(--numf); color: var(--muted); }
.tp b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 30, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; overflow-x: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(760px, 100%); }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 8px; }
.modal-h h2 { font: 700 22px var(--display); letter-spacing: -.005em; }
.modal-h p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.modal-b { padding: 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.overlay.side-panel { place-items: stretch end; padding: 0; }
.overlay.side-panel .modal { width: min(460px, 100%); max-height: none; height: 100vh; border-radius: 22px 0 0 22px; animation: slide .2s ease-out; }
.overlay.top-panel { place-items: start center; padding-top: 12vh; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pal-in input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; height: 34px; min-width: 0; }
.pal-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.pal-g { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 10px 6px; }
.pal-i { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; border: 0; background: none; text-align: left; min-width: 0; }
.pal-i > span.t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-i.on { background: var(--primary-soft); }
.pal-i .k { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pal-i .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 750; flex: none; }
.pop { position: absolute; top: 52px; right: 0; width: 370px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: pop .15s ease-out; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pop-h b { font: 700 16px var(--display); }
.ntf { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ntf:last-child { border-bottom: 0; }
.ntf .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.ntf.unread .ico { background: var(--accent-soft); color: var(--accent-2); }
.ntf small { color: var(--muted); }
.role-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.role-c { border: 1px solid var(--border); border-radius: 14px; padding: 14px 12px; background: var(--surface); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; min-width: 0; }
.role-c.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.role-c b { font-size: 14px; }
.role-c small { color: var(--muted); font-size: 12px; line-height: 1.35; }
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #141a33; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .18s ease-out; max-width: 380px; }
.toast .i { color: #3ddc9b; }
.toast.warn .i { color: #ffc24d; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
[data-theme="dark"] .toast { background: #eef0f8; color: #141a33; }
[data-theme="dark"] .toast .i { color: #0f9468; }
[data-theme="dark"] .toast.warn .i { color: #c06f00; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; background: #0e1330; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.login-art::before { content: ""; position: absolute; width: 660px; height: 660px; right: -230px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 165, 36, .5), rgba(245, 165, 36, 0) 68%); }
.login-art::after { content: ""; position: absolute; width: 560px; height: 560px; left: -200px; bottom: -240px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 79, 224, .55), rgba(47, 79, 224, 0) 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand b { font-size: 22px; }
.login-art h2 { font: 700 46px/1.08 var(--display); letter-spacing: -.01em; max-width: 540px; }
.login-art h2 em { font-style: italic; color: #ffc24d; }
.login-art p.lead { color: #c8cde2; font-size: 16px; max-width: 460px; margin-top: 16px; }
.chalk { position: absolute; inset: 0; z-index: 0; opacity: .06; background-image: linear-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .9) 1px, transparent 1px); background-size: 34px 34px; }
.feat { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.feat div { display: flex; align-items: center; gap: 12px; color: #e2e5f2; font-weight: 600; }
.feat .i { color: #ffc24d; }
.floaters { position: relative; height: 170px; margin-top: 30px; }
.fl { position: absolute; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); border-radius: 16px; padding: 14px 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, .3); }
.fl small { color: #b8bed6; font-size: 12px; }
.fl b { display: block; font: 750 22px var(--numf); }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-box .m-brand { display: none; align-items: center; gap: 10px; font: 700 20px var(--display); }
.login-box .m-brand svg { width: 38px; height: 38px; }
.login-box h1 { font: 700 34px var(--display); letter-spacing: -.01em; }
.login-box > p { color: var(--muted); margin-top: -8px; }
.role-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; color: var(--text-2); }
.role-chips button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-ring); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 650; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-note { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-wrap { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1080px) {
  .g2-1, .g1-2, .g3, .settings, .tr-wrap { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-box .m-brand { display: flex; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 0 16px; height: 62px; gap: 10px; }
  .top-brand { display: flex; }
  .search-trigger { display: none; }
  .clock, .top .btn-primary span, .top .btn-accent span { display: none; }
  .top .btn-primary, .top .btn-accent { width: 42px; padding: 0; }
  .page { padding: 18px 16px 110px; }
  .ph { margin-bottom: 16px; }
  .ph h1 { font-size: 25px; }
  .ph-actions .btn { height: 38px; padding: 0 12px; font-size: 13px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .grid { gap: 12px; }
  .card { padding: 16px; }
  .kpi .val { font-size: 23px; }
  .kpi .lbl { font-size: 12px; }
  .kpi .lbl .ico { width: 28px; height: 28px; }
  .kpi .foot { flex-wrap: wrap; }
  .spark { display: none; }
  .dayline { --cols: repeat(10, minmax(0, 1fr)) !important; padding: 12px; gap: 3px; }
  .ds { height: 34px; padding: 0; align-items: center; }
  .ds b { font-size: 10px; }
  .ds small { display: none; }
  .ctiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .att-grid { grid-template-columns: minmax(0, 1fr); }
  .att-bar { position: static; }
  .att-fab { display: flex; position: fixed; left: 16px; right: 16px; bottom: 82px; z-index: 55; box-shadow: 0 14px 34px rgba(20, 26, 51, .35); }
  .att-grid { margin-bottom: 70px; }
  .pay-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .sel-row .field:first-child { grid-column: 1 / -1; }
  .tabs a, .tabs button { padding: 10px 11px; }
  .marks-tbl input.mk { width: 58px; padding: 0 8px; }
  .marks-tbl .who-cell .avatar { display: none; }
  .marks-tbl table.t td, .marks-tbl table.t th { padding: 9px 6px; }
  .pla button { width: 34px; }
  .sel-row { grid-template-columns: 1fr 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-wrap { display: none; }
  .tt-day { display: flex; margin-bottom: 12px; }
  .tt-list { display: flex; flex-direction: column; gap: 8px; }
  .tt-list .tc { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 11px 12px; cursor: pointer; }
  .tt-list .tc .pt { width: 64px; flex: none; font: 650 12px var(--numf); opacity: .8; }
  .tt-list .tc .tx { min-width: 0; display: flex; flex-direction: column; }
  .tt-list .tc.brk { justify-content: center; padding: 8px; }
  .tr-wrap { gap: 12px; }
  .pop { position: fixed; top: 70px; left: 12px; right: 12px; width: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); border: 0; background: none; padding: 4px 0; min-width: 0; }
  .tabbar .on { color: var(--primary); }
  .tabbar .on .i { color: var(--primary); }
  .hide-m { display: none !important; }
  table.t td, table.t th { padding: 10px 8px; }
  .two, .three { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }
  #toasts { left: 16px; right: 16px; bottom: 90px; align-items: stretch; }
  .toast { max-width: none; }
  .modal-h { padding: 18px 18px 6px; }
  .modal-b { padding: 12px 18px; }
  .modal-f { padding: 12px 18px 18px; }
  .modal-f .btn { flex: 1; }
  .overlay { padding: 12px; }
  .overlay.side-panel .modal { border-radius: 0; width: 100%; }
  .rc { padding: 18px 14px; }
  .rc-h { flex-wrap: wrap; }
  .rc-h .ttl { margin-left: 0; text-align: left; width: 100%; }
  .rc-info { grid-template-columns: 1fr 1fr; }
  .rc-sum { grid-template-columns: 1fr 1fr; }
  .rc-sign { gap: 10px; }
  .qtrack { grid-template-columns: 1fr 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .prof h1, .kid h1 { font-size: 24px; }
  .prof .acts, .kid .acts { margin-left: 0; width: 100%; }
  .prof .acts .btn, .kid .acts .btn { flex: 1; }
  .sb { grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 8px; font-size: 12.5px; }
  .notice { flex-wrap: wrap; }
  .notice .acts { width: 100%; justify-content: flex-end; }
  .toolbar .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .toolbar select.input { flex: 1; min-width: 0; }
  .role-g { grid-template-columns: 1fr; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut-wrap svg { margin: 0 auto; }
  .scale-t { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .exam-g, .staff-g { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  body * { visibility: hidden !important; }
  .printable, .printable * { visibility: visible !important; }
  .printable { position: fixed; left: 0; top: 0; width: 100%; border: 0; }
  .receipt.printable { width: 80mm; }
}
