/* ════════════════════════════════════════════════════════════════
   DAISY SCHOOL — STAFF PORTAL THEME  (loaded last on every portal)

   Colours come from the school crest: the magenta ring, the black
   lettering and the yellow daisy centre. Mukta is used throughout
   because it sets English and Nepali (Devanagari) in one family.
   Calm white surfaces; magenta only for actions and "you are here".
   ════════════════════════════════════════════════════════════════ */

:root:root {
  --ink: #1c2230;
  --ink-2: #4a5263;
  --ink-3: #737b8c;
  --line: #e3e5ea;
  --ground: #f4f5f7;
  --paper: #ffffff;
  --daisy: #b5076b;          /* crest magenta, darkened for AA contrast on white */
  --daisy-press: #94055a;
  --daisy-wash: #fbeef5;
  --daisy-wash-2: #f6d9e8;
  --leaf: #2e7d4f;
  --petal: #f4c430;

  /* map the old tokens used by every page onto the new palette */
  --brand: var(--daisy); --brand-dark: var(--daisy-press); --brand-deeper: #6e0443;
  --brand-light: #d0368c; --brand-pale: var(--daisy-wash); --brand-mid: var(--daisy-wash-2);
  --accent: var(--daisy);
  --blue-50: var(--daisy-wash); --blue-100: var(--daisy-wash-2); --blue-200: #efc0d8; --blue-300: #e397be;
  --blue-400: #d0368c; --blue-500: #c01a79; --blue-600: var(--daisy); --blue-700: var(--daisy-press);
  --blue-800: #7a044b; --blue-900: #5c0338;
  --bg: var(--ground); --surface: var(--paper); --surface-2: #fafafb;
  --text: var(--ink); --text-mid: var(--ink-2); --text-muted: var(--ink-3); --text-hint: #9aa1ae;
  --border: var(--line); --border-mid: #cfd3da;
  --gray-50: #fafafb; --gray-100: #f1f2f4; --gray-200: var(--line);
  --sh-xs: 0 1px 2px rgba(28,34,48,.06); --sh-sm: 0 1px 3px rgba(28,34,48,.08);
  --sh-md: 0 6px 18px -6px rgba(28,34,48,.16); --sh-lg: 0 18px 40px -12px rgba(28,34,48,.22);
  --topbar-h: 60px;

  --font: 'Mukta', 'Noto Sans Devanagari', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

html[data-theme="dark"]:root {
  --ink: #eceef2; --ink-2: #c3c8d2; --ink-3: #969dab; --line: #2b303b; --ground: #15181e; --paper: #1d2129;
  --daisy: #ec5aa8; --daisy-press: #f07cbb; --daisy-wash: #3a1d2d; --daisy-wash-2: #4b2238;
  --bg: var(--ground); --surface: var(--paper); --surface-2: #191c23;
  --text: var(--ink); --text-mid: var(--ink-2); --text-muted: var(--ink-3); --border: var(--line); --border-mid: #3a404c;
  --gray-50: #191c23; --gray-100: #22262f; --gray-200: var(--line);
  --blue-50: var(--daisy-wash); --blue-100: var(--daisy-wash-2); --blue-200: #5c2944; --blue-300: #7a3459;
}

/* ── Type: one family, sentence case, real hierarchy ─────────── */
html, body, button, input, select, textarea { font-family: var(--font) !important; }
body { font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .section-head h1, .topbar-name, .topbar-title, .dash-card-title, .dash-greeting, .portal-gate-name {
  font-family: var(--font) !important; letter-spacing: 0; }
.section-head h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.section-head p { color: var(--ink-3); }
/* labels were tracked-out capitals everywhere; plain sentence case reads calmer */
.tp-f-label, .form-label, .fg label, label.fl, .rc-label, .exam-gate-card label, .stat-label, .hero-stat-label,
.data-table thead th, .pp-card-title, .card-title, .sb-section-title {
  text-transform: none !important; letter-spacing: 0 !important; }
.tp-f-label, .form-label, .fg label { font-size: .86rem !important; font-weight: 600 !important; color: var(--ink-2) !important; }

/* ── Header: white, crest-led ─────────────────────────────────── */
.topbar {
  background: var(--paper) !important; color: var(--ink) !important;
  border-bottom: 1px solid var(--line); box-shadow: none !important;
}
.topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--daisy); }
.topbar { position: sticky; }
.topbar-name, .topbar-title { color: var(--ink) !important; font-weight: 700 !important; font-size: 1.05rem !important; }
.topbar-sub { color: var(--ink-3) !important; opacity: 1 !important; font-size: .78rem !important; }
.topbar-logo, .topbar-brand > .logo, .admin-logo { background: transparent !important; box-shadow: none !important; border: 0 !important; }
.topbar-brand svg { stroke: var(--daisy) !important; }
.topbar button, .topbar .tb-link, .topbar a.tb-link, .notif-btn {
  background: var(--paper) !important; color: var(--ink-2) !important; border: 1px solid var(--line) !important; box-shadow: none !important;
}
.topbar button:hover, .topbar .tb-link:hover { background: var(--gray-100) !important; color: var(--ink) !important; }
.topbar button svg, .notif-btn svg { stroke: currentColor !important; }
.admin-pill, .topbar-year { background: var(--daisy-wash) !important; color: var(--daisy) !important; border: 0 !important; }
html[data-theme="dark"] .topbar { background: var(--paper) !important; }

/* ── Navigation ───────────────────────────────────────────────── */
.bottom-nav { background: color-mix(in srgb, var(--paper) 94%, transparent) !important; }
.nav-tab { color: var(--ink-3) !important; }
.nav-tab.active { color: var(--daisy) !important; }
.nav-tab.active .tab-icon { background: var(--daisy-wash) !important; }
@media (min-width: 900px) {
  :is(body.app-admin, body.app-exam, body.app-portal, body.app-principal) .nav-tab.active { background: var(--daisy-wash) !important; }
  :is(body.app-admin, body.app-exam, body.app-portal, body.app-principal) .nav-tab.active::before {
    content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--daisy); }
  :is(body.app-admin, body.app-exam, body.app-portal, body.app-principal) .nav-tab { position: relative; }
}

/* ── Surfaces: fewer shadows, clear borders ───────────────────── */
.dash-card, .card, .panel, .pp-card, .exam-card, .form-card, .table-wrap, .rc-card {
  box-shadow: none !important; border: 1px solid var(--line) !important; border-radius: 12px !important; background: var(--paper);
}
.dash-card-head { background: transparent !important; border-bottom: 1px solid var(--line) !important; }
.dash-card-icon { background: var(--daisy-wash) !important; color: var(--daisy) !important; }
.dash-card-icon svg { stroke: var(--daisy) !important; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary, .tp-btn-sign, .btn-p, button.primary, .exam-gate-card button[type=submit] {
  background: var(--daisy) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; border-radius: 10px !important;
}
.btn-primary:hover, .tp-btn-sign:hover, .btn-p:hover { background: var(--daisy-press) !important; }
.btn-secondary { border-radius: 10px !important; }
.subtab.active { background: var(--ink) !important; border-color: var(--ink) !important; box-shadow: none !important; }
html[data-theme="dark"] .subtab.active { background: var(--daisy) !important; border-color: var(--daisy) !important; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────────── */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  border-radius: 10px !important; border-color: var(--border-mid) !important; background-color: var(--paper) !important; color: var(--ink) !important;
}
input[type=checkbox], input[type=radio] { accent-color: var(--daisy); }
input::placeholder, textarea::placeholder { color: #9aa1ae !important; }

/* ── Tables ───────────────────────────────────────────────────── */
.data-table thead th { background: var(--gray-50) !important; color: var(--ink-2) !important; font-size: .8rem !important; font-weight: 600 !important; border-bottom: 1px solid var(--line); }
@media (hover: hover) { .data-table tbody tr:hover td { background: #fbf7f9; } html[data-theme="dark"] .data-table tbody tr:hover td { background: #22262f; } }
td, th { font-variant-numeric: tabular-nums; }

/* ── Focus that keyboard users can see ────────────────────────── */
:focus-visible { outline: 2px solid var(--daisy) !important; outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--daisy) !important; box-shadow: 0 0 0 3px var(--daisy-wash-2) !important; outline: none !important; }

.toast { border-radius: 10px !important; box-shadow: var(--sh-lg) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .bottom-nav, .toast, .notif-panel, .portal-profile-strip { display: none !important; }
  body { background: #fff !important; }
}

/* ════════════════════════════════════════════════════════════════
   SIGN-IN (one page for every portal)
   ════════════════════════════════════════════════════════════════ */
.si {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom, 0px)); background: var(--ground);
  border-top: 4px solid var(--daisy);
}
.si-inner { width: 100%; max-width: 380px; }
.si-crest { display: block; width: 76px; height: 76px; margin: 0 auto 14px; }
.si-school { text-align: center; font-size: 1.6rem; font-weight: 700; line-height: 1.15; color: var(--ink); }
.si-what { text-align: center; color: var(--ink-3); margin: 2px 0 26px; }
.si-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 24px 22px 20px; }
.si-google { min-height: 44px; display: flex; justify-content: center; }
.si-google-note { font-size: .82rem; color: var(--ink-3); text-align: center; margin-top: 8px; }
.si-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .85rem; margin: 18px 0 14px; }
.si-or::before, .si-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.si-field { display: block; margin-bottom: 12px; }
.si-field span { display: block; font-size: .88rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.si-field input { width: 100%; height: 46px; padding: 0 14px; font-size: 1rem; border: 1px solid var(--border-mid); }
.si-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); margin: 4px 0 16px; }
.si-row input { width: 18px; height: 18px; }
.si-btn { width: 100%; height: 46px; border: 0; border-radius: 10px; background: var(--daisy); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; }
.si-btn:hover { background: var(--daisy-press); }
.si-err { display: none; background: #fdecec; color: #9b1c1c; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-bottom: 14px; }
.si-err.show { display: block; }
.si-help { font-size: .85rem; color: var(--ink-3); text-align: center; margin-top: 18px; line-height: 1.5; }
.si-pick { display: grid; gap: 10px; }
.si-pick a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; background: var(--paper); }
.si-pick a:hover { border-color: var(--daisy); background: var(--daisy-wash); }
.si-pick a svg { width: 18px; height: 18px; stroke: var(--daisy); fill: none; stroke-width: 2; }
.si-hello { text-align: center; margin-bottom: 14px; color: var(--ink-2); }
.si-link { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--ink-3); font-size: .88rem; cursor: pointer; text-decoration: underline; }
html[data-theme="dark"] .si-err { background: #3b1f22; color: #f5b5b5; }

/* forced first-password screen (teachers) */
.pf-meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: -4px 0 6px; }
.pf-meter span { display: block; height: 100%; width: 0; background: #c2412d; transition: width .25s ease; }
.pf-meter span[data-level="2"] { background: #c98a0b; }
.pf-meter span[data-level="3"], .pf-meter span[data-level="4"], .pf-meter span[data-level="5"] { background: var(--leaf); }
.pf-hint { font-size: .82rem; color: var(--ink-3); margin: 0 0 12px; }

/* ════════════════════════════════════════════════════════════════
   TEACHER PORTAL — HOME / NOTICES / BOOKS / MORE
   ════════════════════════════════════════════════════════════════ */
.th-date { color: var(--ink-3); font-size: .95rem; }
.th-hello { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--ink); margin: 2px 0 4px; }
.th-role { color: var(--ink-2); font-size: .95rem; }
.th-head { padding: 6px 2px 22px; }
.th-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .th-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.th-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.th-sec-head h2 { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.th-sec-head button { background: none; border: 0; color: var(--daisy); font-weight: 600; font-size: .92rem; cursor: pointer; padding: 6px 2px; }

/* notices: a plain list, newest first; the newest carries the daisy-yellow mark */
.nt-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.nt-item { padding: 14px 16px; border-top: 1px solid var(--line); }
.nt-item:first-child { border-top: 0; }
.nt-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.nt-title { font-weight: 600; color: var(--ink); line-height: 1.35; }
.nt-when { color: var(--ink-3); font-size: .82rem; white-space: nowrap; }
.nt-msg { color: var(--ink-2); margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; }
.nt-item.is-clamped .nt-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nt-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--petal); box-shadow: 0 0 0 2px #fff4cc; margin-right: 8px; vertical-align: 2px; }
.nt-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }

/* books: spines standing on a shelf — the one bold element of the design */
.shelf { display: flex; align-items: flex-end; gap: 8px; padding: 0 6px; border-bottom: 6px solid #d9cbb8; min-height: 176px; }
html[data-theme="dark"] .shelf { border-bottom-color: #4a3f33; }
.spine {
  --c: var(--daisy);
  position: relative; flex: 1 1 0; max-width: 74px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  height: 160px; padding: 12px 0 10px; border-radius: 5px 5px 2px 2px; background: var(--c); color: #fff; text-decoration: none;
  box-shadow: inset -6px 0 0 rgba(0,0,0,.12), inset 2px 0 0 rgba(255,255,255,.18);
  transition: transform .18s ease;
}
.spine:nth-child(2) { --c: #2e7d4f; height: 150px; }
.spine:nth-child(3) { --c: #2d4a7a; height: 168px; }
.spine:nth-child(4) { --c: #a8640c; height: 146px; }
.spine:nth-child(5) { --c: #4a5263; height: 158px; }
.spine:hover, .spine:focus-visible { transform: translateY(-8px); }
.spine-name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .82rem; font-weight: 600; letter-spacing: .04em; opacity: .92; }
.spine-grade { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.spine-band { position: absolute; left: 0; right: 0; top: 34px; height: 3px; background: rgba(255,255,255,.35); }
.shelf-note { color: var(--ink-3); font-size: .88rem; margin-top: 10px; }
.shelf--big { min-height: 230px; justify-content: flex-start; gap: 14px; }
.shelf--big .spine { height: 210px; max-width: 88px; }
.shelf--big .spine:nth-child(2) { height: 196px; } .shelf--big .spine:nth-child(3) { height: 220px; }
.shelf--big .spine:nth-child(4) { height: 190px; } .shelf--big .spine:nth-child(5) { height: 204px; }

/* More: plain grouped list */
.more-group { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
.more-group h2 { font-size: .9rem; font-weight: 600; color: var(--ink-3); padding: 12px 16px 4px; }
.more-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 16px; background: none; border: 0; border-top: 1px solid var(--line);
  color: var(--ink); font-size: 1rem; text-align: left; text-decoration: none; cursor: pointer; }
.more-group h2 + .more-item { border-top: 0; }
.more-item:hover { background: var(--gray-50); }
.more-item svg.mi { width: 20px; height: 20px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; flex: 0 0 auto; }
.more-item span { flex: 1; }
.more-item small { display: block; color: var(--ink-3); font-size: .85rem; }
.more-item .chev { width: 16px; height: 16px; stroke: #b3b8c2; fill: none; stroke-width: 2; }
.more-item.danger { color: #b42318; }
.more-item.danger svg.mi { stroke: #b42318; }
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--daisy); font-weight: 600; cursor: pointer; padding: 4px 0 14px; font-size: .95rem; }
.back-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.tb-avatar { width: 36px; height: 36px; border-radius: 50%; border: 0 !important; background: var(--daisy-wash) !important; color: var(--daisy) !important; font-weight: 700; font-size: .85rem; cursor: pointer; }
.spine.book-card { border: 0 !important; background: var(--c) !important; padding: 26px 0 10px !important; font-size: inherit !important; white-space: normal; overflow: visible; }
.spine-band { top: 10px; height: 2px; box-shadow: 0 5px 0 rgba(255,255,255,.35); }
.section-head, .section-head h1, .section-head p { text-align: left !important; justify-content: flex-start !important; }
/* The old per-portal login screens are replaced by the single sign-in page. */
#loginScreen, #examGate { display: none !important; }
/* Sentence case everywhere: no shouty tracked-out capitals. */
body *:not(.keep-caps) { text-transform: none !important; }
label, .rc-field label, .pp-card h3, .chart-title, .card-label, th { letter-spacing: 0 !important; }
body *:not(.spine-name) { letter-spacing: normal !important; }

/* ════════════════════════════════════════════════════════════════
   ADMIN · PRINCIPAL · EXAM — shared workflow pieces
   ════════════════════════════════════════════════════════════════ */
.qa-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.qa { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.qa:first-child { background: var(--daisy); border-color: var(--daisy); color: #fff; }
.qa:first-child svg { stroke: #fff; }
.qa:hover { border-color: var(--daisy); }
.qa svg { width: 17px; height: 17px; stroke: var(--daisy); fill: none; stroke-width: 2; }

.todo { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.todo-item + .todo-item { border-top: 1px solid var(--line); }
.todo-item button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink); font-size: 1rem; }
.todo-item button:hover { background: var(--gray-50); }
.todo-item b { min-width: 44px; height: 32px; padding: 0 8px; border-radius: 8px; background: #fff6d6; color: #7a5a00; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-item span { flex: 1; font-weight: 600; line-height: 1.3; }
.todo-item small { display: block; font-weight: 400; color: var(--ink-3); font-size: .86rem; margin-top: 2px; }
.todo-item svg { width: 16px; height: 16px; stroke: #b3b8c2; fill: none; stroke-width: 2; }
html[data-theme="dark"] .todo-item b { background: #3a3215; color: #f4d77a; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts > div { padding: 12px 16px; border-top: 1px solid var(--line); }
.facts > div:nth-child(-n+2) { border-top: 0; }
.facts > div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts dt { color: var(--ink-3); font-size: .86rem; }
.facts dd { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.acct-h { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 26px 0 10px; }
.acct-h:first-of-type { margin-top: 6px; }
.acct-note { color: var(--ink-3); font-size: .88rem; margin: -4px 0 10px; }
.roll-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; padding: 10px 12px; background: var(--paper); border: 1px dashed var(--border-mid); border-radius: 10px; color: var(--ink-2); font-size: .9rem; }

/* paper status (Principal home + Exam office) */
.qs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.qs-bar select { min-width: 180px; height: 40px; padding: 0 10px; }
.qs-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-2); font-size: .95rem; margin-bottom: 12px; }
.qs-sum b { font-variant-numeric: tabular-nums; color: var(--ink); }
.qs-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.qs-dot.locked { background: var(--leaf); } .qs-dot.draft { background: #c98a0b; } .qs-dot.none { background: #c2412d; }
.qs-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.qs-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line); }
.qs-row:first-child { border-top: 0; }
.qs-class { flex: 0 0 120px; font-weight: 600; color: var(--ink); }
.qs-papers { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.qs-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .84rem; border: 1px solid var(--line); background: var(--gray-50); color: var(--ink-2); }
.qs-chip.locked { border-color: #bfe0cc; background: #eef8f2; color: #1f5c39; }
.qs-chip.draft { border-color: #f0d9a8; background: #fff8e8; color: #7a5300; }
.qs-none { color: #b42318; font-size: .9rem; }
html[data-theme="dark"] .qs-chip.locked { background: #183325; color: #9fe0b9; border-color: #24533a; }
html[data-theme="dark"] .qs-chip.draft { background: #352a12; color: #f1cf86; border-color: #5a4518; }
@media (max-width: 560px) { .qs-row { flex-direction: column; gap: 6px; } .qs-class { flex: none; } }

.notice-form { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.notice-form input, .notice-form textarea { width: 100%; padding: 10px 12px; font-size: 1rem; margin-bottom: 10px; }
.notice-form textarea { min-height: 110px; resize: vertical; }
.notice-form .row { display: flex; gap: 8px; justify-content: flex-end; }
.btn-plain { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; min-height: 40px; color: var(--ink); font-weight: 600; cursor: pointer; }
.btn-main { background: var(--daisy); border: 0; border-radius: 10px; padding: 0 16px; min-height: 40px; color: #fff; font-weight: 600; cursor: pointer; }
.btn-main:hover { background: var(--daisy-press); }
.nt-by { color: var(--ink-3); font-size: .82rem; margin-top: 4px; }
.glance-h { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 0 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.info-card { box-shadow: none !important; border: 1px solid var(--line) !important; border-radius: 12px !important; }
.dash-section-title { font-size: 1rem !important; color: var(--ink-2) !important; }
@media (max-width: 560px) {
  body.app-exam #examUserName { display: none !important; }
  body.app-exam .topbar-links { flex-wrap: nowrap !important; gap: 6px; }
  body.app-exam .topbar { min-height: 60px; }
  .qs-remind { margin-left: 0 !important; width: 100%; }
}

/* ── Class roles grid (Admin) ── */
.cr-grade { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.cr-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.cr-head h3 { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.cr-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.cr-pick { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.cr-pick span { font-size: .84rem; color: var(--ink-3); font-weight: 600; }
.cr-pick select { height: 40px; padding: 0 10px; }
.cr-warn { color: #8a5a00; font-size: .84rem; margin: -4px 0 10px; }

/* ── Progress monitoring (Admin, Principal) ── */
.pm-tabs { margin-bottom: 12px !important; }
.pm-note { color: var(--ink-3); font-size: .88rem; margin: 0 0 10px; }
.pm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pm-teacher { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pm-th { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pm-th span { color: var(--ink-3); font-size: .9rem; }
.pm-row { border-top: 1px solid var(--line); }
.pm-teacher .pm-row:first-of-type { border-top: 0; }
.pm-list > li > .pm-row { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.pm-row summary { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; list-style: none; }
.pm-row summary::-webkit-details-marker { display: none; }
.pm-cls { flex: 0 0 150px; font-weight: 600; color: var(--ink); }
.pm-cls small { display: block; font-weight: 400; color: var(--ink-3); font-size: .82rem; }
.pm-title { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-muted { color: var(--ink-3); }
.pm-details { padding: 0 16px 14px; color: var(--ink-2); white-space: pre-line; overflow-x: auto; }
.pm-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--gray-100); overflow: hidden; }
.pm-bar i { display: block; height: 100%; background: var(--leaf); }
.pm-count { flex: 0 0 70px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pm-table { width: 100%; border-collapse: collapse; font-size: .92rem; white-space: normal; }
.pm-table th, .pm-table td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.pm-table th { color: var(--ink-3); font-weight: 600; border-top: 0; }
@media (max-width: 600px) { .pm-row summary { flex-wrap: wrap; } .pm-cls { flex: 1 0 100%; } }

/* ── Teacher: My classes, Progress form ── */
.mc-roles { list-style: none; margin: 0; padding: 4px 16px 12px; color: var(--ink-2); }
.mc-roles li { padding: 3px 0; }
.mc-grade { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 8px 14px 12px; margin: 0 0 12px; }
.mc-grade legend { font-weight: 700; color: var(--ink); padding: 0 6px; }
.mc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 0; }
.mc-row label { display: flex; align-items: center; gap: 8px; min-width: 120px; font-weight: 600; color: var(--ink); cursor: pointer; }
.mc-row input[type=checkbox] { width: 20px; height: 20px; }
.mc-subj { flex: 1; min-width: 160px; height: 40px; padding: 0 12px; display: none; }
.mc-row.on .mc-subj { display: block; }
.mc-save { position: sticky; bottom: calc(var(--botnav-h, 68px) + 12px); display: flex; justify-content: flex-end; padding: 8px 0; }
@media (min-width: 900px) { .mc-save { bottom: 12px; } }
.pf-count { color: var(--ink-2); margin: 0 0 12px; }
.pf-card { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.pf-card.done { border-left-color: var(--leaf); }
.pf-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 1.05rem; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 12px; }
@media (max-width: 600px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-card textarea { width: 100%; padding: 10px 12px; font-size: 1rem; min-height: 96px; resize: vertical; }
.pf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pf-foot .btn-main { margin-left: auto; }
.pf-date { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.pf-date input { width: 130px; height: 38px; padding: 0 10px; }
.pf-meets { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.pf-meet { border-top: 1px solid var(--line); padding: 10px 14px; }
.pf-meet:first-child { border-top: 0; }
.pf-meet-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pf-meet-head input { width: 22px; height: 22px; flex: 0 0 auto; }
.pf-meet-head small { display: block; color: var(--ink-3); font-size: .85rem; }
.pf-meet-form { display: none; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 10px 0 2px 34px; }
.pf-meet.on .pf-meet-form { display: flex; }
.pf-meet.on { background: #f3faf6; }
html[data-theme="dark"] .pf-meet.on { background: #17261d; }
.pf-meet-form label { display: flex; flex-direction: column; gap: 3px; font-size: .84rem; color: var(--ink-3); }
.pf-meet-form input, .pf-meet-form select { height: 38px; padding: 0 10px; }
.pf-meet-form .pm-on { width: 130px; }
.pm-notes-l { flex: 1; min-width: 180px; }
#pfSection { height: 40px; padding: 0 10px; }
.home-prog { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.home-prog li + li { border-top: 1px solid var(--line); }
.home-prog button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 13px 16px; background: none; border: 0; text-align: left; color: var(--ink); font-size: .98rem; cursor: pointer; }
.home-prog button:hover { background: var(--gray-50); }
.home-prog b { color: var(--daisy); white-space: nowrap; }
.tp-view-only { padding: 10px 14px; color: var(--ink-3); font-size: .85rem; border-top: 1px solid var(--line); }

/* ── Books (Admin upload, staff shelf) ── */
.bk-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 12px; }
@media (max-width: 600px) { .bk-grid { grid-template-columns: 1fr; } }
.bk-form input[type=file] { padding: 8px; height: auto; }
.bk-progress { position: relative; height: 26px; border-radius: 8px; background: var(--gray-100); overflow: hidden; margin-bottom: 10px; }
.bk-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--daisy-wash-2); transition: width .2s ease; }
.bk-progress span { position: relative; display: block; text-align: center; line-height: 26px; font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.shelf { overflow-x: auto; scrollbar-width: thin; }
.spine { flex: 0 0 64px; max-width: 64px; }
.shelf--big .spine { flex: 0 0 78px; max-width: 78px; }
.spine:nth-child(5n+1) { --c: var(--daisy); } .spine:nth-child(5n+2) { --c: #2e7d4f; } .spine:nth-child(5n+3) { --c: #2d4a7a; }
.spine:nth-child(5n+4) { --c: #a8640c; } .spine:nth-child(5n) { --c: #4a5263; }
.spine-name { max-height: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0 !important; font-size: .78rem; }
.shelf--big .spine-name { max-height: 130px; }
.spine-grade { font-size: 1.15rem; text-align: center; padding: 0 4px; line-height: 1.1; }
.book-list { list-style: none; margin: 18px 0 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.book-list li + li { border-top: 1px solid var(--line); }
.book-list button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 16px; background: none; border: 0; text-align: left; color: var(--ink); font-size: 1rem; cursor: pointer; }
.book-list button:hover { background: var(--gray-50); }
.book-list small { color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.book-list i { width: 10px; height: 28px; border-radius: 2px; background: var(--c, var(--daisy)); flex: 0 0 auto; }
.home-prog small { display: block; color: var(--ink-3); font-size: .85rem; }
.home-notice button { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 12px; padding: 12px 16px; text-align: left; cursor: pointer;
  background: #fff8e1; border: 1px solid #f3dc95; border-radius: 12px; color: var(--ink); font-size: .95rem; }
.home-notice b { color: #7a5a00; }
html[data-theme="dark"] .home-notice button { background: #322a12; border-color: #5a4a1a; }
html[data-theme="dark"] .home-notice b { color: #f4d77a; }
.nav-tab { position: relative; }
.nav-dot { position: absolute; top: 8px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--petal); box-shadow: 0 0 0 2px var(--paper); }
@media (min-width: 900px) { .nav-dot { top: 50%; right: 14px; margin-top: -4px; } }
.lbl-short { display: none; }
@media (max-width: 899px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
.home-links { margin: -8px 0 24px; }
@media (max-width: 480px) { .home-links .qa { flex: 1 1 0; justify-content: center; padding: 0 10px; } }

/* ── First sign-in setup ── */
.si.ob { align-items: flex-start; }
.si.ob .si-inner { max-width: 560px; }
.ob-step { text-align: center; color: var(--daisy); font-weight: 600; font-size: .9rem; margin: -4px 0 6px; }
.ob-card .mc-grade { padding: 6px 12px 10px; }
.ob-card .mc-roles { padding: 0 0 10px; }
.ob-card .si-btn { margin-top: 6px; }
.ob-docs { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ob-docs li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ob-docs li:first-child { border-top: 0; }
.ob-docs b { color: #b42318; font-weight: 600; font-size: .9rem; }
.ob-docs li.have b { color: var(--leaf); }
.ob-docs .ob-all { color: var(--leaf); font-weight: 600; justify-content: center; }
.ob-linked { color: var(--leaf); font-weight: 600; text-align: center; margin: 0 0 12px; }
#obGoogleBtn { margin: 6px 0 4px; }

/* ── Reminders (Admin) ── */
.rm-dlg { width: min(520px, calc(100vw - 24px)); border: 0; border-radius: 16px; padding: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--sh-lg); }
.rm-dlg::backdrop { background: rgba(20, 24, 33, .45); }
.rm-dlg h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; }
.rm-who { color: var(--ink-2); margin: 0 0 12px; }
.rm-dlg select, .rm-dlg textarea { width: 100%; padding: 8px 10px; font-size: 1rem; }
.rm-dlg select:not([multiple]) { height: 42px; }
.rm-hint { display: block; color: var(--ink-3); font-size: .84rem; margin: 2px 0 10px; }
.rm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.pm-remind { margin-left: 10px; padding: 3px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--daisy); font-weight: 600; font-size: .82rem; cursor: pointer; }
.pm-remind:hover { border-color: var(--daisy); }
.pm-remind-all { min-height: 34px; margin-left: auto; font-size: .88rem; color: var(--daisy); }
.qs-sum { align-items: center; }

/* ── Teacher inbox: reminders from the office ── */
.inbox { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.inbox li { background: #fff8e1; border: 1px solid #f3dc95; border-radius: 12px; padding: 12px 14px; }
.inbox li.read { background: var(--paper); border-color: var(--line); }
.inbox-top { display: flex; justify-content: space-between; gap: 10px; }
.inbox-top b { color: var(--ink); }
.inbox-top span { color: var(--ink-3); font-size: .82rem; white-space: nowrap; }
.inbox p { margin: 6px 0 10px; color: var(--ink-2); white-space: pre-line; font-size: .95rem; }
.inbox .row { display: flex; gap: 8px; flex-wrap: wrap; }
html[data-theme="dark"] .inbox li:not(.read) { background: #322a12; border-color: #5a4a1a; }
.rm-dlg { margin: auto; max-height: calc(100dvh - 24px); overflow: auto; }
