/* =========================================================================
   Lions Vidhya Mandir — School ERP · styles
   Palette: school maroon + crest gold on warm cream (mobile-first)
   ========================================================================= */
@font-face { font-family: 'Gloock'; src: url(../fonts/gloock.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url(../fonts/lexend.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F6F0E4; --bg2: #EFE6D3; --surface: #FFFDF8; --surface2: #FAF5EA; --raised: #FFFFFF;
  --ink: #24130F; --ink2: #5A463F; --muted: #8B786F; --line: #E8DDC9; --line2: #DACBB0;
  --primary: #7A1C30; --primary2: #9B2A43; --primary-ink: #7A1C30; --on-primary: #FFF8EC; --primary-soft: #F5E4E2;
  --gold: #C9921C; --gold2: #E3B44A; --gold-ink: #8A5F06; --gold-soft: #FBEFD3;
  --green: #1D7A4E; --green-soft: #E1F1E7; --red: #C0392B; --red-soft: #FBE4E0; --amber: #B5761A; --amber-soft: #FCEED5;
  --teal: #2D6E70; --teal-soft: #DFEEEC; --plum: #6B2F6B; --plum-soft: #F1E3F0;
  --side: #3B0D19; --side2: #250810; --on-side: #F4E6CF; --on-side2: #CDB49B;
  --shadow: 0 1px 2px rgba(60, 20, 10, .06), 0 6px 18px -8px rgba(60, 20, 10, .16);
  --shadow-lg: 0 24px 60px -20px rgba(40, 10, 5, .45);
  --r: 16px; --r-sm: 10px;
  --f-ui: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
  --f-d: 'Gloock', Georgia, 'Times New Roman', serif;
  --top-h: 60px; --side-w: 262px; --bnav-h: 66px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #140A0B; --bg2: #1B0F11; --surface: #1F1214; --surface2: #251619; --raised: #2A191C;
  --ink: #F4E9DA; --ink2: #D2BFAE; --muted: #9D887C; --line: #3A2629; --line2: #4A3134;
  --primary: #A3324B; --primary2: #C14A63; --primary-ink: #F0A3B1; --on-primary: #FFF8EC; --primary-soft: #3A1A20;
  --gold: #E0B04A; --gold2: #F0C866; --gold-ink: #F0C866; --gold-soft: #3A2C12;
  --green: #4CC08A; --green-soft: #15301F; --red: #F07B6C; --red-soft: #3B1A16; --amber: #EDB25A; --amber-soft: #3A2A12;
  --teal: #6FC2C2; --teal-soft: #142D2D; --plum: #D29BD2; --plum-soft: #2E1A2E;
  --side: #1A0A0E; --side2: #120609; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-ui); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
body.noscroll { overflow: hidden; }
a { color: var(--primary-ink); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.d { font-family: var(--f-d); font-weight: 400; letter-spacing: .2px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: var(--gold2); color: #2a1300; }

/* ------------------------------------------------------------- shell */
.app { min-height: 100vh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top .brand-m { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.top .brand-m .crest { flex: none; }
.top-t { min-width: 0; }
.top-t small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top-title { font-family: var(--f-d); font-size: 19px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.top-search { display: none; }
.top-a { display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--ink2); }
.icon-btn:hover { background: var(--surface2); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--bg); }
.me-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 3px; border-radius: 14px; }
.me-btn .me-t { display: none; text-align: left; line-height: 1.15; }
.me-btn .me-t b { font-size: 13px; font-weight: 600; display: block; }
.me-btn .me-t small { font-size: 11px; color: var(--muted); }
.main { padding: 16px 14px calc(var(--bnav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1320px; margin: 0 auto; }
.page { animation: rise .32s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* bottom nav (phones) */
.bnav { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: calc(var(--bnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.bnav a, .bnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--muted); border: 0; background: none; padding: 6px 0; }
.bnav a .ic, .bnav button .ic { width: 22px; height: 22px; }
.bnav a.on { color: var(--primary-ink); }
.bnav a.on .ic { stroke-width: 2.4; }
.bnav .fab { width: 54px; height: 54px; margin: -26px auto 0; border-radius: 18px; background: linear-gradient(145deg, var(--primary2), var(--primary)); color: var(--on-primary); display: grid; place-items: center; box-shadow: 0 10px 24px -8px var(--primary), inset 0 1px 0 rgba(255, 255, 255, .25); border: 2px solid var(--gold2); }
.bnav .fab .ic { width: 26px; height: 26px; }

/* sidebar (desktop) */
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: radial-gradient(120% 60% at 0 0, #5A1626 0, transparent 60%), linear-gradient(180deg, var(--side), var(--side2)); color: var(--on-side); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #5a2433 transparent; }
  .side-brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid rgba(231, 184, 75, .16); }
  .side-brand b { font-family: var(--f-d); font-weight: 400; font-size: 17px; line-height: 1.15; display: block; color: #FBEFD6; }
  .side-brand small { font-size: 11px; color: var(--on-side2); letter-spacing: .3px; }
  .nav { padding: 10px 10px 18px; display: flex; flex-direction: column; gap: 2px; }
  .nav h6 { margin: 14px 10px 6px; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #B08F78; font-weight: 600; }
  .nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--on-side); font-size: 13.5px; position: relative; transition: background .15s; }
  .nav a .ic { color: #D9B98D; }
  .nav a:hover { background: rgba(255, 255, 255, .06); }
  .nav a.on { background: linear-gradient(90deg, rgba(227, 180, 74, .22), rgba(227, 180, 74, .04)); color: #FFF4DE; }
  .nav a.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold2); }
  .nav a.on .ic { color: var(--gold2); }
  .nav a i { margin-left: auto; font-style: normal; font-size: 11px; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
  .side-foot { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid rgba(231, 184, 75, .14); font-size: 11.5px; color: var(--on-side2); }
  .side-foot b { color: #F2CF6B; font-weight: 500; }
  .bnav, .top .brand-m .crest, .m-only { display: none !important; }
  .top { padding: 0 24px; }
  .top-search { display: flex; align-items: center; gap: 8px; width: min(380px, 34vw); height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; cursor: text; }
  .top-search kbd { margin-left: auto; }
  .me-btn .me-t { display: block; }
  .main { padding: 24px 28px 48px; }
}
@media (max-width: 1023px) { .d-only { display: none !important; } }

/* ------------------------------------------------------------- page head */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 0 16px; }
.ph h1 { font-family: var(--f-d); font-weight: 400; font-size: 26px; letter-spacing: .2px; }
.ph p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.ph-a { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1023px) { .ph h1 { font-size: 22px; } }

/* ------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { background: var(--surface2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(160deg, var(--primary2), var(--primary)); color: var(--on-primary); border-color: transparent; box-shadow: 0 6px 16px -8px var(--primary), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: linear-gradient(160deg, var(--gold2), var(--gold)); color: #2B1700; border-color: transparent; box-shadow: 0 6px 16px -8px var(--gold); }
.btn.soft { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--surface2); }
.btn.danger { background: var(--red); color: #fff; border-color: transparent; }
.btn.ok { background: var(--green); color: #fff; border-color: transparent; }
.btn.wa { background: #1FA855; color: #fff; border-color: transparent; }
.btn.wa:hover { background: #18944A; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; gap: 5px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; gap: 4px; }
.btn.xs .ic { width: 13px; height: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
kbd { font: 500 11px var(--f-ui); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line2); background: var(--surface2); color: var(--ink2); }

/* ------------------------------------------------------------- cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.card-h h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-h h2 .ic { color: var(--gold); }
.card-b { padding: 14px 16px 16px; }
.card-b.flush { padding: 10px 0 4px; }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 14px; }
.g2, .g3, .g4, .g-kpi { display: grid; gap: 12px; grid-template-columns: 1fr; }
.g-kpi { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(2, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g-kpi { grid-template-columns: repeat(4, 1fr); } .g-21 { grid-template-columns: 2fr 1fr; } .g-12 { grid-template-columns: 1fr 2fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.sb { justify-content: space-between; }
.sp { flex: 1; }
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 14px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* KPI */
.kpi { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 13px; box-shadow: var(--shadow); color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(60, 20, 10, .5); }
.kpi::after { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold2), transparent); opacity: .7; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.kpi.gold .kpi-ic { background: var(--gold-soft); color: var(--gold-ink); }
.kpi.green .kpi-ic { background: var(--green-soft); color: var(--green); }
.kpi.red .kpi-ic { background: var(--red-soft); color: var(--red); }
.kpi.teal .kpi-ic { background: var(--teal-soft); color: var(--teal); }
.kpi.plum .kpi-ic { background: var(--plum-soft); color: var(--plum); }
.kpi-v { font-family: var(--f-d); font-size: 27px; margin-top: 10px; line-height: 1.05; letter-spacing: .2px; white-space: nowrap; }
.kpi-v small { font-family: var(--f-ui); font-size: 13px; color: var(--muted); margin-left: 3px; }
.kpi-l { font-size: 12.5px; color: var(--ink2); margin-top: 3px; font-weight: 500; }
.kpi-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.trend { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.trend.up { background: var(--green-soft); color: var(--green); }
.trend.down { background: var(--red-soft); color: var(--red); }
@media (max-width: 420px) { .kpi-v { font-size: 22px; } }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 20px 18px; color: #FFF6E6; background: radial-gradient(90% 120% at 100% 0, rgba(227, 180, 74, .35), transparent 55%), radial-gradient(70% 90% at 0 100%, #A3324B 0, transparent 60%), linear-gradient(135deg, #5B1426, #3A0B17); box-shadow: 0 18px 40px -22px #3A0B17; margin-bottom: 14px; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 230, 180, .12) 1px, transparent 1.2px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1.5px solid rgba(242, 207, 107, .35); box-shadow: 0 0 0 26px rgba(242, 207, 107, .06), 0 0 0 54px rgba(242, 207, 107, .04); pointer-events: none; }
.hero-in { position: relative; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.hero .hi { font-size: 12.5px; color: #F2CF6B; letter-spacing: .4px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.hero h1 { font-family: var(--f-d); font-weight: 400; font-size: 27px; margin-top: 4px; }
.hero p { color: #EBD7C0; font-size: 13px; margin-top: 4px; }
.hero-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-stats div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(242, 207, 107, .22); border-radius: 14px; padding: 8px 12px; min-width: 92px; }
.hero-stats b { font-family: var(--f-d); font-weight: 400; font-size: 20px; display: block; color: #FFF3DA; }
.hero-stats small { font-size: 11px; color: #E3C9AA; }
.hero .btn { border-color: rgba(242, 207, 107, .4); }
@media (min-width: 1024px) { .hero { padding: 26px 28px; } .hero h1 { font-size: 32px; } }

/* quick actions */
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 700px) { .qa { grid-template-columns: repeat(6, 1fr); } }
.qa a, .qa button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 500; text-align: center; box-shadow: var(--shadow); transition: transform .15s; }
.qa a:hover, .qa button:hover { transform: translateY(-2px); }
.qa span.qi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.qa span.qi.g { background: var(--gold-soft); color: var(--gold-ink); }
.qa span.qi.t { background: var(--teal-soft); color: var(--teal); }
.qa span.qi.gr { background: var(--green-soft); color: var(--green); }
.qa span.qi.p { background: var(--plum-soft); color: var(--plum); }
.qa .ic { width: 21px; height: 21px; }

/* chips / tabs / seg */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink2); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.chip:hover { border-color: var(--primary-ink); color: var(--ink); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 6px 14px -8px var(--primary); }
.chip i { font-style: normal; font-size: 11px; opacity: .75; background: rgba(0, 0, 0, .08); padding: 0 6px; border-radius: 9px; }
.chip.on i { background: rgba(255, 255, 255, .2); }
.chip.sm { height: 28px; font-size: 12px; padding: 0 10px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: none; padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary-ink); border-bottom-color: var(--gold); }
.tabs button i { font-style: normal; font-size: 11px; background: var(--surface2); border: 1px solid var(--line); padding: 0 6px; border-radius: 9px; margin-left: 4px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 9px; font-size: 13px; color: var(--ink2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow); font-weight: 500; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; background: var(--surface2); color: var(--ink2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.info { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.badge.gold { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.badge.pr { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.badge.plum { background: var(--plum-soft); color: var(--plum); border-color: transparent; }

/* avatar */
.av { --s: 40px; --c: var(--primary); width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-size: calc(var(--s) * .36); font-weight: 600; color: #fff; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); overflow: hidden; letter-spacing: .3px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--gold2); }

/* list rows */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--ink); min-width: 0; }
.li:first-child { border-top: 0; }
a.li:hover, .li.hov:hover { background: var(--surface2); }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .e { text-align: right; flex: none; display: flex; align-items: center; gap: 6px; }
.li .e b { display: block; font-weight: 600; }
.li .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface2); color: var(--ink2); }
.li .ico.bad { background: var(--red-soft); color: var(--red); }
.li .ico.warn { background: var(--amber-soft); color: var(--amber); }
.li .ico.info { background: var(--teal-soft); color: var(--teal); }
.li .ico.ok { background: var(--green-soft); color: var(--green); }
.li .ico.gold { background: var(--gold-soft); color: var(--gold-ink); }
.card-b.flush .li { padding-left: 16px; padding-right: 16px; }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface2); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface2) 60%, transparent); }
.tbl tfoot td { font-weight: 600; background: var(--surface2); border-top: 1px solid var(--line2); }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl .who { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.tbl .who b { font-weight: 500; display: block; }
.tbl .who small { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .tbl-wrap:not(.wide) .tbl thead { display: none; }
  .tbl-wrap:not(.wide) .tbl, .tbl-wrap:not(.wide) .tbl tbody, .tbl-wrap:not(.wide) .tbl tr, .tbl-wrap:not(.wide) .tbl td { display: block; width: 100%; }
  .tbl-wrap:not(.wide) .tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl-wrap:not(.wide) .tbl td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl-wrap:not(.wide) .tbl td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .tbl-wrap:not(.wide) .tbl td > .tv { min-width: 0; text-align: right; }
  .tbl-wrap:not(.wide) .tbl td:first-child > .tv { text-align: left; width: 100%; }
  .tbl-wrap:not(.wide) .tbl td:first-child { text-align: left; }
  .tbl-wrap:not(.wide) .tbl td:empty, .tbl-wrap:not(.wide) .tbl td > .tv:empty { display: none; }
  .tbl-wrap:not(.wide) .tbl td:first-child::before { display: none; }
  .tbl-wrap:not(.wide) .tbl tfoot { display: block; }
  .tbl-wrap:not(.wide) .tbl td.r, .tbl-wrap:not(.wide) .tbl td.c { text-align: right; }
}

/* forms */
.form { display: grid; grid-template-columns: 1fr; gap: 12px 14px; }
@media (min-width: 640px) { .form.two { grid-template-columns: 1fr 1fr; } .form.three { grid-template-columns: repeat(3, 1fr); } .span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--ink2); }
.field .req { color: var(--red); font-weight: 600; }
.field small { color: var(--muted); font-size: 11.5px; }
input[type=text], input[type=number], input[type=tel], input[type=date], input[type=month], input[type=time], input[type=password], input[type=search], input[type=email], select, textarea { width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line2); background: var(--raised); color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; font-size: 14px; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B786F' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.inp-pre { position: relative; }
.inp-pre .pre { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.inp-pre input { padding-left: 26px; }
.search-in { position: relative; flex: 1; min-width: 180px; }
.search-in .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-in input { padding-left: 38px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input:not([type=checkbox]):not([type=radio]) { width: auto; min-width: 130px; height: 38px; font-size: 13px; }
.filters .check { gap: 6px; font-size: 13px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 40px; height: 23px; border-radius: 20px; background: var(--line2); position: relative; transition: .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { left: 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* empty */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { width: 38px; height: 38px; color: var(--line2); margin-bottom: 8px; }
.empty.big { padding: 70px 16px; }
.empty.big h3 { color: var(--ink); font-family: var(--f-d); font-weight: 400; font-size: 22px; margin-bottom: 6px; }
.empty.big .btn { margin-top: 16px; }

/* progress */
.pbar { display: block; height: 7px; border-radius: 6px; background: var(--line); overflow: hidden; min-width: 60px; }
.pbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green), #3EAF79); }
.pbar.warn i { background: linear-gradient(90deg, var(--amber), var(--gold2)); }
.pbar.bad i { background: linear-gradient(90deg, var(--red), #E06A5B); }
.pbar.pr i { background: linear-gradient(90deg, var(--primary), var(--primary2)); }
.ring text { font-size: 13px; font-weight: 600; fill: var(--ink); font-family: var(--f-ui); }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font-size: 12px; font-family: var(--f-ui); }
.chart .vl { fill: var(--ink2); font-size: 11.5px; font-weight: 600; font-family: var(--f-ui); }
.chart .bar rect { transition: opacity .15s; }
.chart .bar:hover rect { opacity: .85; }
.chart .bar.hi rect:first-child { fill: var(--gold); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut .d-c { font-family: var(--f-d); font-size: 24px; fill: var(--ink); }
.donut .d-s { font-size: 10.5px; fill: var(--muted); font-family: var(--f-ui); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 140px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { flex: 1; color: var(--ink2); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 96px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; }
.hbar .pbar { height: 9px; }
.hbar b { text-align: right; font-weight: 600; }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(24, 8, 6, .0); transition: background .18s; }
.modal-wrap.open { background: rgba(24, 8, 6, .5); }
.modal { width: 100%; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); transform: translateY(30px); opacity: 0; transition: transform .2s ease, opacity .2s; padding-bottom: env(safe-area-inset-bottom); }
.modal-wrap.open .modal { transform: none; opacity: 1; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-family: var(--f-d); font-weight: 400; font-size: 20px; }
.modal-b { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-f { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface2); border-radius: 0 0 22px 22px; }
.modal .lead { font-size: 15px; color: var(--ink2); }
@media (min-width: 760px) {
  .modal-wrap { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; max-width: 560px; max-height: 90vh; transform: translateY(12px) scale(.98); }
  .modal.sm { max-width: 420px; } .modal.lg { max-width: 820px; } .modal.xl { max-width: 1080px; } .modal.doc { max-width: 980px; }
  .modal-f { border-radius: 0 0 20px 20px; }
}
.modal.doc .modal-b { padding: 0; background: #8E7F76; }
:root[data-theme="dark"] .modal.doc .modal-b { background: #0d0607; }
.paper-scroll { overflow: auto; padding: 16px 8px; height: 100%; }
.paper-stack { --k: 1; transform: scale(var(--k)); transform-origin: top left; display: flex; flex-direction: column; gap: 16px; margin: 0 auto; }
.paper-stack .paper { box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

/* toast */
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--bnav-h) + 18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
@media (min-width: 1024px) { #toasts { bottom: 28px; } }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 14px; background: #2A1512; color: #FCEBD2; font-size: 13.5px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: .25s; }
.toast.in { opacity: 1; transform: none; }
.toast .ic { color: #6CD49E; }
.toast.bad .ic { color: #FF8A7A; }
.toast.info .ic { color: var(--gold2); }

/* search popup */
.search-pop { position: fixed; inset: 0; z-index: 120; background: rgba(24, 8, 6, .45); display: none; align-items: flex-start; justify-content: center; padding: 10px; }
.search-pop.open { display: flex; }
.sp-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; margin-top: 6vh; animation: rise .2s; }
.sp-in { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.sp-in input { border: 0; box-shadow: none !important; background: transparent; font-size: 16px; height: 46px; padding: 0; }
.sp-res { max-height: 60vh; overflow-y: auto; padding: 6px 0 10px; }
.sp-res h6 { margin: 10px 16px 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.sp-res a { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: var(--ink); }
.sp-res a:hover, .sp-res a:first-of-type { background: var(--surface2); }
.sp-res a span { flex: 1; min-width: 0; }
.sp-res a b { display: block; font-weight: 500; }
.sp-res a small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-hint { padding: 18px 16px; color: var(--muted); font-size: 13px; }

/* "More" menu sheet */
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.menu-grid a { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 2px; border-radius: 14px; color: var(--ink); font-size: 11.5px; text-align: center; line-height: 1.2; }
.menu-grid a:hover { background: var(--surface2); }
.menu-grid a span { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.menu-grid a:nth-child(3n+2) span { background: var(--gold-soft); color: var(--gold-ink); }
.menu-grid a:nth-child(3n) span { background: var(--teal-soft); color: var(--teal); }
.menu-grid h6 { grid-column: 1 / -1; margin: 10px 4px 2px; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------- attendance */
.cls-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .cls-grid { grid-template-columns: repeat(4, 1fr); } }
.cls-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); transition: transform .15s; }
.cls-tile:hover { transform: translateY(-2px); }
.cls-tile b { font-size: 15px; font-weight: 600; }
.cls-tile small { color: var(--muted); font-size: 11.5px; }
.cls-tile .ct-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cls-tile.pending { border-style: dashed; border-color: var(--amber); background: color-mix(in srgb, var(--amber-soft) 50%, var(--surface)); }
.att-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); margin-bottom: 12px; }
.att-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.att-sum span b { font-family: var(--f-d); font-weight: 400; font-size: 20px; margin-right: 4px; }
.att-sum .p b { color: var(--green); } .att-sum .a b { color: var(--red); } .att-sum .l b { color: var(--amber); }
.att-list { display: flex; flex-direction: column; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); }
.att-row:first-child { border-top: 0; }
.att-row .roll { width: 26px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; flex: none; }
.att-row .t { flex: 1; min-width: 0; }
.att-row .t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-row .t small { color: var(--muted); font-size: 11.5px; }
.pal { display: flex; gap: 5px; flex: none; }
.pal button { width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid var(--line2); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--muted); transition: all .12s; }
.pal button.P.on { background: var(--green); border-color: var(--green); color: #fff; }
.pal button.A.on { background: var(--red); border-color: var(--red); color: #fff; }
.pal button.L.on { background: var(--amber); border-color: var(--amber); color: #fff; }
.pal button.H.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.att-row.is-A { background: color-mix(in srgb, var(--red-soft) 55%, transparent); }
.sticky-bar { position: sticky; bottom: calc(var(--bnav-h) + 10px + env(safe-area-inset-bottom)); z-index: 30; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line2); box-shadow: var(--shadow-lg); margin-top: 12px; }
@media (min-width: 1024px) { .sticky-bar { bottom: 16px; } }
/* register grid */
.reg { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.reg th, .reg td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 5px 4px; text-align: center; min-width: 26px; }
.reg th { background: var(--surface2); font-weight: 600; color: var(--muted); font-size: 11px; position: sticky; top: 0; }
.reg td.nm, .reg th.nm { text-align: left; min-width: 150px; position: sticky; left: 0; background: var(--surface); z-index: 1; padding-left: 10px; }
.reg th.nm { background: var(--surface2); z-index: 2; }
.reg .P { color: var(--green); font-weight: 700; } .reg .A { color: #fff; background: var(--red); font-weight: 700; } .reg .L { color: #fff; background: var(--amber); font-weight: 700; } .reg .H { color: #fff; background: var(--teal); }
.reg .off { background: repeating-linear-gradient(45deg, var(--surface2), var(--surface2) 3px, var(--bg2) 3px, var(--bg2) 6px); color: var(--muted); }
.reg th.sun { color: var(--red); }
/* month calendar */
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.mcal .dh { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.mcal .dd { aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; background: var(--surface2); border: 1px solid transparent; position: relative; color: var(--ink2); }
.mcal .dd.P { background: var(--green-soft); color: var(--green); font-weight: 600; }
.mcal .dd.A { background: var(--red-soft); color: var(--red); font-weight: 600; }
.mcal .dd.L { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.mcal .dd.H { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.mcal .dd.hol { background: var(--gold-soft); color: var(--gold-ink); }
.mcal .dd.sun { color: var(--muted); opacity: .6; }
.mcal .dd.today { border-color: var(--primary-ink); }
.mcal .dd small { font-size: 9px; font-weight: 500; line-height: 1; margin-top: 1px; }
.mcal .dd.blank { background: none; }
.cal-big .dd { aspect-ratio: auto; min-height: 76px; align-items: stretch; justify-content: flex-start; padding: 6px; text-align: left; font-size: 12px; cursor: pointer; }
.cal-big .dd > b { font-size: 13px; }
.cal-big .ev { display: block; font-size: 10.5px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-soft); color: var(--primary-ink); }
.cal-big .ev.holiday { background: var(--gold-soft); color: var(--gold-ink); }
.cal-big .ev.exam { background: var(--plum-soft); color: var(--plum); }
.cal-big .ev.ptm { background: var(--teal-soft); color: var(--teal); }
.cal-big .ev.bday { background: var(--green-soft); color: var(--green); }
@media (max-width: 700px) { .cal-big .dd { min-height: 48px; padding: 4px; } .cal-big .ev { font-size: 0; height: 5px; padding: 0; } }
.legend-row { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* fees */
.fee-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .fee-tiles { grid-template-columns: repeat(6, 1fr); } }
.ft { border-radius: 13px; padding: 9px 10px; border: 1.5px solid var(--line); background: var(--surface); position: relative; text-align: left; transition: all .12s; }
.ft b { display: block; font-size: 13px; font-weight: 600; }
.ft small { display: block; font-size: 11.5px; color: var(--muted); }
.ft .st { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; }
.ft.paid { background: var(--green-soft); border-color: transparent; } .ft.paid .st { background: var(--green); }
.ft.due { background: var(--red-soft); border-color: transparent; } .ft.due .st { background: var(--red); }
.ft.part { background: var(--amber-soft); border-color: transparent; } .ft.part .st { background: var(--amber); }
.ft.future { background: var(--surface2); border-style: dashed; } .ft.future .st { background: var(--line2); }
button.ft { cursor: pointer; }
button.ft.sel { border-color: var(--primary-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
button.ft.sel::after { content: '✓'; position: absolute; right: 8px; bottom: 6px; font-size: 13px; font-weight: 700; color: var(--primary-ink); }
.pay-box { border-radius: 16px; padding: 14px; background: linear-gradient(160deg, var(--surface2), var(--surface)); border: 1px solid var(--line2); }
.pay-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; gap: 10px; }
.pay-line.tot { border-top: 1px dashed var(--line2); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 600; }
.pay-line.tot b { font-family: var(--f-d); font-weight: 400; font-size: 26px; color: var(--primary-ink); }
.big-amt { font-family: var(--f-d); font-size: 30px; line-height: 1.1; }
.stu-pick { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.wa-queue .li.done { opacity: .5; }

/* marks grid */
.mk-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.mk { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.mk th, .mk td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; text-align: center; }
.mk th { position: sticky; top: 0; background: var(--surface2); font-size: 11.5px; font-weight: 600; color: var(--ink2); z-index: 2; white-space: nowrap; }
.mk td.nm, .mk th.nm { position: sticky; left: 0; background: var(--surface); text-align: left; min-width: 170px; z-index: 1; }
.mk th.nm { background: var(--surface2); z-index: 3; }
.mk input { width: 56px; height: 34px; text-align: center; padding: 0 4px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.mk input.bad { border-color: var(--red); background: var(--red-soft); }
.mk td.tot { font-weight: 600; white-space: nowrap; }
.grade { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 7px; font-weight: 700; font-size: 12px; background: var(--surface2); }
.grade.A1, .grade.A2 { background: var(--green-soft); color: var(--green); }
.grade.B1, .grade.B2 { background: var(--teal-soft); color: var(--teal); }
.grade.C1, .grade.C2 { background: var(--amber-soft); color: var(--amber); }
.grade.D, .grade.E { background: var(--red-soft); color: var(--red); }

/* timetable */
.tt { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 760px; }
.tt th { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px; text-align: center; }
.tt th small { display: block; font-weight: 400; font-size: 10.5px; }
.tt td { padding: 0; }
.tt .cell { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 54px; padding: 6px 8px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); text-align: left; width: 100%; cursor: pointer; }
.tt .cell b { font-size: 12.5px; font-weight: 600; }
.tt .cell small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt .cell.clash { border-color: var(--red); background: var(--red-soft); }
.tt .cell.now { box-shadow: 0 0 0 2px var(--gold); }
.tt .day { font-weight: 600; font-size: 12.5px; color: var(--ink2); padding: 0 6px; text-align: left; white-space: nowrap; }
.tt .brk { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; color: var(--gold-ink); background: var(--gold-soft); border-radius: 10px; text-align: center; letter-spacing: 1px; }
.s-eng { --sc: #7A1C30; } .s-hin { --sc: #B5761A; } .s-mat { --sc: #2D6E70; } .s-evs, .s-sci { --sc: #1D7A4E; } .s-sst { --sc: #6B2F6B; } .s-comp { --sc: #3F4C8A; } .s-gk { --sc: #8A5F06; } .s-draw { --sc: #B2463B; } .s-oral { --sc: #5E6B2A; } .s-games { --sc: #4A5A5A; }
.tt .cell[class*="s-"] { border-left: 4px solid var(--sc); }
.subj-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--sc, var(--muted)); margin-right: 6px; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--surface2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 120px; }
.kcol h4 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.kcard b { font-weight: 600; display: block; }
.kcard small { color: var(--muted); font-size: 12px; display: block; }
.kcard .row { margin-top: 8px; }

/* profile */
.prof { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.prof h1 { font-family: var(--f-d); font-weight: 400; font-size: 26px; }
.prof .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kv { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .kv { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }
.photo-up { position: relative; }
.photo-up label { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2b1700; border: 2px solid var(--surface); cursor: pointer; }
.photo-up label .ic { width: 15px; height: 15px; }
.photo-up input { display: none; }

/* notices / homework */
.notice { padding: 14px 16px; border-top: 1px solid var(--line); }
.notice:first-child { border-top: 0; }
.notice h4 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notice p { color: var(--ink2); font-size: 13.5px; margin-top: 4px; white-space: pre-line; }
.notice .row { margin-top: 8px; }
.pin { color: var(--gold); }
.hw-day { margin-bottom: 14px; }
.hw-day h5 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 0 0 8px; }
.hw { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; border-left: 4px solid var(--sc, var(--gold)); }
.hw .t { flex: 1; min-width: 0; }
.hw b { font-size: 13px; }
.hw p { margin-top: 3px; font-size: 14px; }
.hw small { color: var(--muted); font-size: 11.5px; }

/* alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); font-size: 13.5px; }
.alert .ic { margin-top: 2px; }
.alert.warn { background: var(--amber-soft); border-color: transparent; color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.alert.info { background: var(--teal-soft); border-color: transparent; }
.alert.bad { background: var(--red-soft); border-color: transparent; }
.alert.gold { background: var(--gold-soft); border-color: transparent; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.login-art { position: relative; overflow: hidden; color: #FFF3DD; padding: 28px 22px 70px; background: radial-gradient(80% 60% at 100% 0, rgba(227, 180, 74, .32), transparent 60%), radial-gradient(70% 70% at 0 100%, #9B2A43 0, transparent 60%), linear-gradient(150deg, #5B1426, #2A0710); }
.login-art::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 230, 180, .14) 1px, transparent 1.3px); background-size: 20px 20px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%); }
.login-art > * { position: relative; }
.la-brand { display: flex; align-items: center; gap: 14px; }
.la-brand b { font-family: var(--f-d); font-weight: 400; font-size: 21px; line-height: 1.15; display: block; }
.la-brand small { color: #E3C9AA; font-size: 12px; }
.login-art h1 { font-family: var(--f-d); font-weight: 400; font-size: 32px; line-height: 1.12; margin-top: 30px; max-width: 520px; }
.login-art h1 em { font-style: normal; color: #F2CF6B; }
.login-art p.sub { color: #EBD5BC; margin-top: 10px; max-width: 470px; font-size: 14px; }
.la-feats { display: none; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; max-width: 560px; }
.la-feats div { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(242, 207, 107, .18); font-size: 12.5px; color: #F1DEC5; }
.la-feats .ic { color: #F2CF6B; margin-top: 1px; }
.la-feats b { display: block; color: #FFF3DD; font-weight: 500; font-size: 13px; }
.login-box { margin: -48px 14px 28px; position: relative; z-index: 2; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 20px 18px; max-width: 460px; margin: 0 auto; }
.login-card h2 { font-family: var(--f-d); font-weight: 400; font-size: 24px; }
.login-card > p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 16px 0; padding: 5px; background: var(--surface2); border-radius: 14px; border: 1px solid var(--line); }
.role-tabs button { border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-size: 12.5px; font-weight: 500; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.role-tabs button.on { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow); }
.demo-hint { margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-ink); font-size: 12.5px; }
.demo-hint b { color: var(--ink); }
.demo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo-chips button { border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); background: var(--surface); color: var(--ink2); border-radius: 20px; padding: 5px 10px; font-size: 12px; }
.demo-chips button:hover { border-color: var(--primary-ink); color: var(--ink); }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.login-foot b { color: var(--primary-ink); font-weight: 500; }
@media (min-width: 1024px) {
  .login { grid-template-columns: 1.15fr 1fr; }
  .login-art { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; }
  .login-art h1 { font-size: 46px; }
  .la-feats { display: grid; }
  .login-box { margin: 0; display: grid; place-items: center; padding: 30px; }
  .login-card { padding: 30px 28px; width: 100%; }
}

/* ------------------------------------------------------------- parent app */
.papp { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--bnav-h) + 20px + env(safe-area-inset-bottom)); }
.p-top { padding: 16px 16px 70px; padding-top: calc(16px + env(safe-area-inset-top)); color: #FFF3DD; background: radial-gradient(80% 90% at 100% 0, rgba(227, 180, 74, .35), transparent 60%), linear-gradient(150deg, #6A1A2D, #34091A); border-radius: 0 0 28px 28px; position: relative; overflow: hidden; }
.p-top::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 230, 180, .12) 1px, transparent 1.3px); background-size: 18px 18px; }
.p-top > * { position: relative; }
.p-top .row b { font-family: var(--f-d); font-weight: 400; font-size: 16px; }
.p-top .icon-btn { color: #F2D9B8; }
.p-top .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.kid-switch { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; }
.kid-switch button { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 30px; border: 1px solid rgba(242, 207, 107, .3); background: rgba(255, 255, 255, .07); color: #F7E6CC; font-size: 13px; }
.kid-switch button.on { background: #FFF3DD; color: #4A1020; border-color: transparent; font-weight: 600; }
.p-kid { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.p-kid h2 { font-family: var(--f-d); font-weight: 400; font-size: 24px; }
.p-kid small { color: #E9D1B5; font-size: 12.5px; }
.p-body { margin: -52px 12px 0; position: relative; display: flex; flex-direction: column; gap: 12px; }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.p-stats > * { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; text-align: center; box-shadow: var(--shadow); color: var(--ink); }
.p-stats b { font-family: var(--f-d); font-weight: 400; font-size: 21px; display: block; line-height: 1.1; }
.p-stats small { font-size: 11px; color: var(--muted); }
.p-today { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; }
.p-today.P { background: var(--green-soft); color: var(--green); }
.p-today.A { background: var(--red-soft); color: var(--red); }
.p-today.L { background: var(--amber-soft); color: var(--amber); }
.p-today.N { background: var(--surface2); color: var(--muted); }
.p-today b { display: block; font-size: 15px; }
.p-today small { color: var(--ink2); }
.p-today .ic { width: 26px; height: 26px; }
.papp .bnav { max-width: 560px; margin: 0 auto; }
@media (min-width: 760px) { .papp .bnav { left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; border: 1px solid var(--line); } }
.papp .bnav { grid-template-columns: repeat(5, 1fr); display: grid !important; }

/* ------------------------------------------------------------- printable paper */
.paper { width: 210mm; min-height: 297mm; background: #fff; color: #1d0f0c; padding: 9mm 10mm; position: relative; font-family: var(--f-ui); font-size: 11.5px; line-height: 1.38; overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper.land { width: 297mm; min-height: 210mm; }
.paper.half { min-height: 0; height: auto; }
.paper * { color-scheme: light; }
.doc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid #7A1C30; position: relative; }
.doc-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: #C9921C; }
.dh-t { flex: 1; min-width: 0; }
.dh-n { font-family: var(--f-d); font-size: 23px; color: #5B1426; line-height: 1.1; }
.dh-a { font-size: 10.5px; color: #5a463f; margin-top: 2px; }
.dh-b { text-align: right; }
.dh-b b { display: inline-block; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; background: #7A1C30; padding: 5px 10px; border-radius: 4px; }
.dh-b span { display: block; font-size: 10.5px; color: #5a463f; margin-top: 4px; }
.doc-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.doc-tbl th, .doc-tbl td { border: 1px solid #CDBBA0; padding: 5px 7px; }
.doc-tbl th { background: #F5E9D6; color: #5B1426; font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.doc-tbl .r { text-align: right; } .doc-tbl .c { text-align: center; }
.doc-tbl tfoot td, .doc-tbl tr.tot td { background: #FBF4E8; font-weight: 700; }
.doc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin: 10px 0; }
.doc-kv div { display: flex; gap: 6px; padding: 3.5px 0; border-bottom: 1px dotted #CDBBA0; font-size: 11.5px; }
.doc-kv span { color: #6b574e; min-width: 92px; }
.doc-kv b { font-weight: 600; color: #1d0f0c; }
.sign-row { display: flex; justify-content: space-between; gap: 20px; margin-top: 26px; font-size: 11px; }
.sign-row div { flex: 1; text-align: center; border-top: 1px solid #6b574e; padding-top: 4px; color: #5a463f; }
.doc-note { font-size: 10px; color: #7a675e; margin-top: 8px; }
.watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: .045; }
.watermark svg { width: 120mm; height: auto; }
.stamp { width: 26mm; height: 26mm; border-radius: 50%; border: 2px solid #7A1C30; color: #7A1C30; display: grid; place-items: center; text-align: center; font-size: 8px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; transform: rotate(-12deg); opacity: .8; }

/* receipt (2 copies on A4) */
.rcpt { padding: 7mm 9mm; border: 1.5px solid #7A1C30; border-radius: 3mm; position: relative; }
.rcpt + .cut { border-top: 1.5px dashed #9b8a80; margin: 6mm -10mm; position: relative; }
.rcpt + .cut::after { content: '✂  cut here'; position: absolute; left: 50%; top: -8px; transform: translateX(-50%); background: #fff; padding: 0 8px; font-size: 9px; color: #9b8a80; }
.rc-copy { position: absolute; top: 3mm; right: 9mm; font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: #9b8a80; }
.rc-meta { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 11.5px; }
.rc-meta b { color: #5B1426; }
.rc-amt { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 8px; }
.rc-amt .w { font-size: 11px; color: #5a463f; flex: 1; }
.rc-amt .w b { color: #1d0f0c; }
.rc-paid { font-family: var(--f-d); font-size: 22px; color: #5B1426; border: 1.5px solid #C9921C; border-radius: 3mm; padding: 2mm 5mm; background: #FBF4E8; white-space: nowrap; }
.rc-qr { text-align: center; font-size: 8.5px; color: #6b574e; }

/* report card — single page */
.rc-card { border: 2px solid #7A1C30; outline: 1px solid #C9921C; outline-offset: -5px; padding: 7mm 7.5mm; min-height: calc(297mm - 18mm); display: flex; flex-direction: column; position: relative; }
.rc-ribbon { text-align: center; margin: 8px 0 6px; }
.rc-ribbon b { display: inline-block; font-family: var(--f-d); font-weight: 400; font-size: 17px; color: #fff; background: linear-gradient(90deg, #5B1426, #7A1C30, #5B1426); padding: 3px 26px; border-radius: 30px; letter-spacing: .5px; }
.rc-ribbon span { display: block; font-size: 10.5px; color: #6b574e; margin-top: 3px; letter-spacing: .5px; }
.rc-stu { display: flex; gap: 10px; align-items: stretch; }
.rc-stu .doc-kv { flex: 1; margin: 0; }
.rc-photo { width: 25mm; height: 30mm; border: 1px solid #CDBBA0; border-radius: 2mm; display: grid; place-items: center; background: #FBF4E8; overflow: hidden; flex: none; }
.rc-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-photo .ini { font-family: var(--f-d); font-size: 26px; color: #7A1C30; }
.rc-marks { margin-top: 8px; }
.rc-marks th { font-size: 9.5px; padding: 4px 3px; line-height: 1.2; }
.rc-marks th small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; color: #7a675e; }
.rc-marks td { padding: 4.2px 4px; font-size: 11.5px; }
.rc-marks td:first-child { font-weight: 600; text-align: left; }
.rc-marks .up { color: #b3a49a; }
.rc-marks .gcell { font-weight: 700; color: #5B1426; }
.rc-low { display: grid; grid-template-columns: 1.05fr 1fr; gap: 9px; margin-top: 8px; }
.rc-box { border: 1px solid #CDBBA0; border-radius: 2mm; padding: 6px 8px; }
.rc-box h5 { margin: 0 0 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #7A1C30; }
.rc-bars { display: flex; align-items: flex-end; gap: 6px; height: 21mm; padding-top: 4px; }
.rc-bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 8.5px; color: #6b574e; gap: 2px; }
.rc-bars i { width: 70%; background: linear-gradient(180deg, #C9921C, #7A1C30); border-radius: 2px 2px 0 0; display: block; min-height: 1px; }
.rc-bars em { font-style: normal; font-weight: 700; color: #1d0f0c; font-size: 8.5px; }
.rc-remark { margin-top: 8px; border: 1px solid #CDBBA0; border-radius: 2mm; padding: 6px 9px; font-size: 11.5px; }
.rc-remark b { color: #7A1C30; }
.rc-result { margin-top: 7px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 2mm; background: #FBF4E8; border: 1px solid #E6D3B3; font-size: 12px; }
.rc-result b { color: #5B1426; }
.rc-scale { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 7px; font-size: 9px; color: #6b574e; }
.rc-scale b { color: #1d0f0c; }
.rc-card .sign-row { margin-top: auto; padding-top: 18px; }

/* ID cards */
.id-sheet { display: grid; grid-template-columns: repeat(3, 54mm); grid-auto-rows: 86mm; gap: 4mm 6mm; justify-content: center; padding-top: 3mm; }
.idc { width: 54mm; height: 86mm; border-radius: 3mm; overflow: hidden; background: #fff; border: .3mm solid #d9c7a8; display: flex; flex-direction: column; position: relative; font-size: 7.6px; color: #1d0f0c; }
.idc-top { background: linear-gradient(150deg, #7A1C30, #3A0B17); color: #FBEFD6; padding: 2.4mm 2.5mm 7mm; display: flex; gap: 1.8mm; align-items: center; position: relative; }
.idc-top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 6mm; background: #fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.idc-top b { font-family: var(--f-d); font-weight: 400; font-size: 8.6px; line-height: 1.1; display: block; }
.idc-top small { font-size: 6px; color: #E9C98F; display: block; }
.idc-ph { width: 20mm; height: 20mm; margin: -6.5mm auto 0; border-radius: 50%; border: .9mm solid #C9921C; overflow: hidden; background: #FBF4E8; position: relative; z-index: 1; display: grid; place-items: center; }
.idc-ph img { width: 100%; height: 100%; object-fit: cover; }
.idc-ph .ini { font-family: var(--f-d); font-size: 22px; color: #7A1C30; }
.idc-n { text-align: center; font-weight: 700; font-size: 9.6px; margin-top: 1.4mm; color: #5B1426; }
.idc-c { text-align: center; font-size: 7.4px; margin-top: .3mm; }
.idc-c b { background: #F5E9D6; color: #5B1426; padding: .3mm 2mm; border-radius: 2mm; }
.idc-kv { padding: 1.4mm 3mm 0; display: grid; grid-template-columns: auto 1fr; gap: .45mm 2mm; font-size: 7.2px; }
.idc-kv span { color: #7a675e; }
.idc-kv b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idc-bot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 3mm 2mm; }
.idc-bot .sg { font-size: 6px; color: #7a675e; text-align: center; border-top: .2mm solid #7a675e; padding-top: .4mm; width: 16mm; }
.idc-band { height: 2mm; background: linear-gradient(90deg, #C9921C, #E3B44A, #C9921C); }

/* certificates */
.cert { border: 3mm solid transparent; border-image: repeating-linear-gradient(45deg, #7A1C30 0 4px, #C9921C 4px 8px) 12; padding: 3mm; min-height: calc(297mm - 18mm); }
.cert-in { border: 1px solid #C9921C; min-height: calc(297mm - 36mm); padding: 10mm 12mm; display: flex; flex-direction: column; position: relative; }
.cert-title { text-align: center; margin: 12mm 0 6mm; }
.cert-title h2 { font-family: var(--f-d); font-weight: 400; font-size: 30px; color: #5B1426; letter-spacing: 1px; }
.cert-title p { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: #8A5F06; margin-top: 3px; }
.cert-body { font-size: 14px; line-height: 2.1; text-align: justify; }
.cert-body u { text-decoration: none; border-bottom: 1px dotted #6b574e; font-weight: 600; padding: 0 4px; font-family: var(--f-d); font-size: 15.5px; }
.cert-meta { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 4mm; }
.cert .doc-tbl td { font-size: 12px; padding: 6px 9px; }
.cert-merit .cert-body { text-align: center; font-size: 15px; }
.cert-merit .cert-name { font-family: var(--f-d); font-size: 34px; color: #5B1426; display: block; margin: 4mm 0; line-height: 1.2; }

/* salary slip / gate pass / generic */
.slip { border: 1.5px solid #7A1C30; border-radius: 3mm; padding: 7mm 9mm; }
.slip h3 { font-family: var(--f-d); font-weight: 400; font-size: 18px; color: #5B1426; text-align: center; margin: 8px 0; }
.net-box { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 2mm; background: #FBF4E8; border: 1px solid #E6D3B3; }
.net-box b { font-family: var(--f-d); font-weight: 400; font-size: 22px; color: #5B1426; }
.rep-paper h3 { font-family: var(--f-d); font-weight: 400; font-size: 17px; color: #5B1426; margin: 10px 0 6px; }

/* ------------------------------------------------------------- print */
.print-root { display: none; }
@media print {
  @page { margin: 0; }
  html, body { background: #fff !important; }
  body.printing > *:not(.print-root) { display: none !important; }
  body.printing .print-root { display: block !important; }
  .print-root .paper { box-shadow: none !important; margin: 0; page-break-after: always; break-after: page; }
  .print-root .paper:last-child { page-break-after: auto; break-after: auto; }
  .print-root .paper:not(.land) { width: 210mm; height: 297mm; min-height: 0; }
  .print-root .paper.land { width: 297mm; height: 210mm; min-height: 0; }
}
.col{min-width:0}

@media (max-width: 420px) { .pal { gap: 4px; } .pal button { width: 33px; height: 36px; font-size: 12.5px; } .att-row { padding: 8px 10px; gap: 8px; } .att-row .av { --s: 30px !important; } }

/* ------------------------------------------------------------- v2.1 · SR No. + head-wise fees */
.sr-tag { display: inline-block; font-family: var(--f-mono, ui-monospace, monospace); font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 6px; background: var(--gold-soft); color: var(--gold-ink); margin-right: 4px; letter-spacing: .2px; }
.sr-big { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 2px; }
.sr-big b { font-size: 17px; color: var(--gold-ink); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.sr-search { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border-radius: 16px; border: 2px solid var(--gold2); background: var(--raised); margin-bottom: 8px; box-shadow: 0 8px 22px -14px var(--gold); }
.sr-search .ic { color: var(--gold-ink); flex: none; }
.sr-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; height: 48px; padding: 0; font-size: 16px; font-weight: 500; }
.sr-search kbd { flex: none; }
#fee-list a.exact { background: var(--gold-soft); }
.fh-rows { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.fh-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-top: 1px solid var(--line); transition: background .15s; }
.fh-rows .fh-row:first-child { border-top: 0; }
.fh-row > label { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; cursor: pointer; }
.fh-row > label b { font-size: 13px; font-weight: 600; }
.fh-row > label small { font-size: 11.5px; color: var(--muted); }
.fh-row > label em { font-style: normal; color: var(--red); font-weight: 500; }
.fh-in { flex: none; width: 124px; display: flex; flex-direction: column; align-items: flex-end; }
.fh-in .inp-pre { width: 100%; }
.fh-in input { height: 38px; text-align: right; font-weight: 600; font-size: 15px; }
.fh-n { font-size: 11px; font-weight: 600; min-height: 0; line-height: 1.3; }
.fh-n:empty { display: none; }
.fh-row.zero { background: var(--surface2); }
.fh-row.zero > label b { color: var(--ink2); font-weight: 500; }
.fh-row.zero input { color: var(--ink2); font-weight: 500; }
.fh-row.less { background: var(--green-soft); } .fh-row.less .fh-n { color: var(--green); }
.fh-row.left { background: var(--red-soft); } .fh-row.left .fh-n { color: var(--red); }
.fh-row.more { background: var(--gold-soft); } .fh-row.more .fh-n { color: var(--gold-ink); }
.fh-row.fh-fine { border: 1px dashed var(--line2); border-radius: 14px; }
.fee-form-card .seg { width: 100%; }
.fee-form-card .seg label { flex: 1; text-align: center; }
.fee-grid th small { display: block; font-size: 9.5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.fee-grid input { width: 74px; height: 36px; padding: 0 8px; text-align: right; }
.fee-grid td, .fee-grid th { padding: 6px 6px; }
.head-grid input, .head-grid select { height: 36px; min-width: 120px; }
.sf-tbl td { vertical-align: middle; }
.sf-tbl td .btn.xs { margin-top: 3px; }
.reg-sum td, .reg-sum th { white-space: nowrap; }
.reg-print th, .reg-print td { font-size: 10px; padding: 3px 5px; }

/* receipt — school's own format: Student's copy + School copy side by side */
.rx-paper { display: grid; grid-template-columns: 1fr 1fr; gap: 7mm; align-items: start; padding: 8mm 8mm; }
.rx { position: relative; border: 1.4px solid #3a2a26; border-radius: 1.5mm; padding: 3.5mm 4mm 4mm; font-size: 10.6px; line-height: 1.35; color: #1d0f0c; font-family: var(--f-ui), 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', sans-serif; overflow: hidden; }
.rx-h { text-align: center; border-bottom: 1.6px solid #7A1C30; padding-bottom: 2mm; margin-bottom: 1.5mm; }
.rx-copy { font-weight: 700; font-size: 11.5px; letter-spacing: .5px; }
.rx-brand { display: flex; align-items: center; justify-content: center; gap: 2.5mm; margin-top: 1mm; text-align: left; }
.rx-n { font-weight: 700; font-size: 12.5px; color: #5B1426; letter-spacing: .3px; line-height: 1.2; }
.rx-a { font-size: 9.5px; color: #4a3a34; }
.rx-kv > div { display: flex; justify-content: space-between; gap: 6px; padding: .75mm 0; border-bottom: 1px dotted #cdbba0; }
.rx-kv span { color: #4a3a34; }
.rx-kv b { font-weight: 600; text-align: right; }
.rx-kv > div:first-child b { color: #5B1426; }
.rx-t { width: 100%; border-collapse: collapse; margin-top: 2.2mm; }
.rx-t th, .rx-t td { border: 1px solid #5a463f; padding: .95mm 1.6mm; font-size: 10.4px; }
.rx-t th { background: #F5E9D6; text-align: left; font-size: 11px; }
.rx-t .r { text-align: right; width: 19mm; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rx-t tr.z td { color: #5f4f49; }
.rx-t small { display: block; color: #1D7A4E; font-size: 8.8px; font-weight: 600; }
.rx-line { display: flex; justify-content: space-between; padding: 1mm .8mm 0; }
.rx-line b { font-variant-numeric: tabular-nums; }
.rx-line.cc { color: #1D7A4E; }
.rx-line.tot { font-weight: 700; font-size: 12px; border-top: 1.4px solid #3a2a26; margin-top: 1mm; padding-top: 1.3mm; }
.rx-w { margin-top: 1.3mm; font-size: 9.8px; }
.rx-meta { font-size: 9.2px; color: #5a463f; margin-top: .8mm; }
.rx-sign { display: flex; justify-content: space-between; gap: 6mm; margin-top: 9mm; font-size: 9.8px; text-align: center; }
.rx-sign div { flex: 1; border-top: 1px solid #5a463f; padding-top: 1mm; }
.rx-note { margin-top: 2.6mm; font-size: 10px; color: #2d1f1b; border-top: 1px dashed #cdbba0; padding-top: 1.4mm; line-height: 1.45; }
.rx-x { position: absolute; top: 42%; left: 6%; right: 6%; text-align: center; font-size: 30px; font-weight: 800; color: rgba(192, 57, 43, .32); border: 3px solid rgba(192, 57, 43, .32); transform: rotate(-18deg); pointer-events: none; }
@media (max-width: 520px) { .fh-in { width: 112px; } .sr-search input { font-size: 15px; } }
[hidden] { display: none !important; }

/* ---- school data load (v2.2) */
.dl-card { margin: 4px 0 16px; padding: 14px; border-radius: 16px; background: linear-gradient(140deg, var(--gold-soft), var(--surface2)); border: 1px solid var(--line2); }
.dl-h { display: flex; gap: 12px; align-items: flex-start; }
.dl-h > .ic { flex: none; width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: var(--primary); color: var(--on-primary); }
.dl-h b { display: block; font-size: 14px; color: var(--ink); }
.dl-h small { display: block; margin-top: 3px; font-size: 12px; color: var(--ink2); line-height: 1.45; }
.dl-f { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dl-f input { flex: 1 1 170px; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--raised); color: var(--ink); font: inherit; font-size: 14px; }
.dl-f input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.dl-f .btn { height: 44px; flex: 0 0 auto; }
.dl-file { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--primary-ink); text-decoration: underline; cursor: pointer; }
