/* Pathshala — three switchable themes in the style of the Edukat education
   template (html[data-theme="1" | "2" | "3"]). Shared base first, then each
   theme's overrides. */
:root {
  --red: #ff1949;
  --red-dark: #d20b3e;
  --grad: linear-gradient(90deg, #d20b3e 0%, #ff1949 100%);
  --navy: #111d30;
  --ink: #232323;
  --text: #666666;
  --line: #e7e7e7;
  --soft: #f3f7fd;
  --yellow: #e8b52f;
  --blue: #2e6bd9;
  --green: #17a673;
  --ok: #15875a; --ok-soft: #e3f6ec;
  --bad: #d3163f; --bad-soft: #ffe8ed;
  --warn: #b77400; --warn-soft: #fff4dc;
  --wa: #e7fbe9;
  --r: 6px;
  --shadow: 0 5px 30px rgba(17, 29, 48, .08);
  --f: "Manrope", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--text); font: 15px/1.7 var(--f); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, b, strong { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red); text-decoration: none; }
[hidden] { display: none !important; }
.hi { font-family: "Noto Sans Devanagari", var(--f); color: var(--text); font-weight: 500; font-size: .82em; margin-left: 4px; }
code { background: var(--soft); padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 20px; }

/* ---------- Buttons & form ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--line); background: #fff; border-radius: 4px; padding: 11px 24px; font-weight: 800; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); cursor: pointer; white-space: nowrap; transition: .25s; }
.btn:hover { border-color: var(--red); color: var(--red); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(255, 25, 73, .22); }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.wide { width: 100%; padding: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font-weight: 700; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 11px 14px; background: #fff; font-weight: 500; outline: none; color: var(--ink); transition: border-color .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--red); }
.err { color: var(--bad); font-size: 14px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand small { display: block; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.3; }
.logo { width: 50px; height: 50px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; }
.logo svg { width: 30px; height: 30px; }

/* ---------- Top bar + header ---------- */
.topbar { background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; }
.topbar i { font-style: normal; color: var(--red); margin-right: 4px; }
.tb-r em { font-style: normal; color: var(--red); text-transform: capitalize; margin-left: 6px; }
.tb-r b { color: #fff; margin: 0 6px; }
.topbar .link:hover { color: var(--red); }
.hdr { background: #fff; position: relative; z-index: 20; box-shadow: 0 1px 0 var(--line); }
.hdr-in { display: flex; align-items: center; gap: 24px; min-height: 88px; }
#nav { display: flex; gap: 6px; margin-left: auto; }
#nav a { display: flex; align-items: center; padding: 10px 12px; color: var(--ink); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
#nav a i { display: none; }
#nav a span em { display: block; font-style: normal; font-weight: 600; font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--text); font-family: "Noto Sans Devanagari", var(--f); line-height: 1.2; }
#nav a:hover, #nav a.on { color: var(--red); }
.hdr-cta { width: 50px; height: 50px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }

/* ---------- Page banner (Edukat inner-page breadcrumb area) ---------- */
.banner { position: relative; overflow: hidden; }
.banner-in { position: relative; z-index: 1; }
.pre { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--red); }
.banner h1 { font-size: clamp(30px, 4.4vw, 50px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 8px 0 12px; }
.banner h1 b { font-weight: 800; }
.banner h1 .hi { font-size: .5em; font-weight: 600; }
.crumb { font-weight: 700; font-size: 14px; }
.crumb a { color: inherit; }
.crumb span { color: var(--red); margin: 0 6px; }
.scene { position: absolute; inset: 0; pointer-events: none; }
.scene i { position: absolute; }

/* ---------- Main content ---------- */
.main { padding: 50px 0 90px; }
.main section { display: grid; gap: 24px; }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ph-sub { font-size: 15px; font-weight: 600; }
.card { background: #fff; border-radius: var(--r); padding: 30px; display: grid; gap: 20px; min-width: 0; box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-h h3 { font-size: 20px; font-weight: 800; position: relative; padding-bottom: 12px; }
.card-h h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px; border-radius: 3px; background: var(--red); }
.more { font-weight: 800; font-size: 13px; text-transform: uppercase; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.stat { background: #fff; border-radius: var(--r); padding: 26px; display: grid; gap: 2px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; background: var(--soft); color: var(--red); margin-bottom: 12px; }
.stat small { color: var(--text); font-weight: 700; font-size: 13px; }
.stat b { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat span { font-size: 13px; font-weight: 600; }
.stat.warn b { color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.empty { text-align: center; padding: 26px 10px; font-weight: 600; }

/* Tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); padding: 12px; background: var(--soft); white-space: nowrap; }
.tbl th:first-child { border-radius: 4px 0 0 4px; }
.tbl th:last-child { border-radius: 0 4px 4px 0; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fff7f9; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .btn { padding: 7px 14px; font-size: 12px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 30px; padding: 3px 12px; white-space: nowrap; }
.pill.paid, .pill.present { background: var(--ok-soft); color: var(--ok); }
.pill.due, .pill.absent { background: var(--bad-soft); color: var(--bad); }
.pill.partial, .pill.late { background: var(--warn-soft); color: var(--warn); }
.pill.grey { background: var(--soft); color: var(--text); }
.mini { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.mini:last-child { border-bottom: 0; }
.mini b { display: block; }
.mini small { font-weight: 600; }

/* Attendance */
.att-list { display: grid; gap: 10px; }
.att-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 4px; cursor: pointer; user-select: none; transition: .15s; }
.att-item:hover { box-shadow: var(--shadow); }
.att-item b { display: block; }
.att-item small { font-weight: 600; }
.att-item.absent { background: var(--bad-soft); border-color: #f7c2cd; border-left-color: var(--red); }
.att-item.late { background: var(--warn-soft); border-color: #f1d9a6; border-left-color: var(--yellow); }
.att-item.locked { cursor: default; }
.att-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.banner-msg { border-radius: 4px; padding: 12px 16px; font-size: 14px; font-weight: 700; background: var(--ok-soft); color: var(--ok); }

/* Messages */
.msg-list { display: grid; gap: 14px; }
.msg { display: grid; gap: 6px; max-width: 660px; }
.msg-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; font-weight: 600; }
.bubble { background: var(--wa); border-radius: 14px 14px 14px 3px; padding: 12px 16px; font-family: "Noto Sans Devanagari", var(--f); line-height: 1.7; color: var(--ink); }
.msg.skipped .bubble { background: var(--soft); color: var(--text); }

/* Footer */
.ftr { background: var(--navy); color: rgba(255, 255, 255, .7); padding: 34px 0; font-size: 14px; font-weight: 600; }
.ftr-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ftr .brand b { color: #fff; font-size: 20px; }
.ftr .brand small { color: rgba(255, 255, 255, .6); }
.ftr .logo { width: 42px; height: 42px; }
.tabbar { display: none; }

/* Modal & toast */
.modal { position: fixed; inset: 0; background: rgba(17, 29, 48, .55); display: grid; place-items: center; padding: 16px; z-index: 80; }
.modal-box { position: relative; width: min(540px, 100%); max-height: 90svh; overflow-y: auto; background: #fff; border-radius: 8px; padding: 32px; border-top: 4px solid var(--red); }
.modal-box h3 { font-size: 22px; font-weight: 800; margin-bottom: 18px; padding-right: 30px; }
.modal-box form { display: grid; gap: 14px; }
.modal-x { position: absolute; top: 14px; right: 18px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--text); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; margin-bottom: 18px; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; color: var(--ink); }
.sub { font-size: 15px; font-weight: 800; color: var(--ink); margin: 18px 0 8px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 90px); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 4px; font-size: 14px; font-weight: 700; z-index: 90; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }

/* ---------- Login (shared) ---------- */
.login { min-height: 100svh; position: relative; overflow: hidden; display: grid; align-content: center; gap: 20px; padding: 40px 20px; }
.login-in { position: relative; z-index: 1; width: min(1140px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 440px; gap: 60px; align-items: center; }
.login-hero h1 { font-size: clamp(34px, 4.8vw, 58px); font-weight: 400; letter-spacing: -.02em; line-height: 1.15; margin: 10px 0 18px; }
.login-hero h1 b { font-weight: 800; }
.login-hero .lead { font-size: 17px; max-width: 520px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; font-weight: 700; color: var(--ink); }
.ticks li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; margin-right: 10px; }
.login-card { background: #fff; border-radius: 8px; padding: 36px; box-shadow: 0 20px 60px rgba(17, 29, 48, .14); display: grid; gap: 22px; }
.login-card h2 { font-size: 26px; font-weight: 800; }
.login-card form { display: grid; gap: 14px; }
.demo-creds { border-top: 1px dashed var(--line); padding-top: 18px; display: grid; gap: 8px; font-size: 13px; }
.demo-creds button { text-align: left; border: 1px solid var(--line); background: var(--soft); border-radius: 4px; padding: 10px 14px; cursor: pointer; font-weight: 700; color: var(--ink); }
.demo-creds button:hover { border-color: var(--red); color: var(--red); }
.made { position: relative; z-index: 1; text-align: center; font-size: 13px; font-weight: 600; }

/* ---------- Theme picker ---------- */
.themer { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 70; display: flex; align-items: flex-start; }
.themer-tab { writing-mode: vertical-rl; transform: rotate(180deg); background: var(--red); color: #fff; border: 0; border-radius: 0 6px 6px 0; padding: 14px 10px; font-weight: 800; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; box-shadow: var(--shadow); }
.themer-body { background: #fff; border-radius: 8px 0 0 8px; box-shadow: 0 10px 40px rgba(17, 29, 48, .2); padding: 18px; width: 270px; display: grid; gap: 8px; }
.themer-body p { font-weight: 800; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.themer-body button { display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 6px; padding: 10px; cursor: pointer; }
.themer-body button b { display: block; font-size: 14px; }
.themer-body button small { font-weight: 600; font-size: 12px; }
.themer-body button.on { border-color: var(--red); background: #fff7f9; }
.sw { width: 44px; height: 34px; border-radius: 4px; flex: none; }
.sw1 { background: linear-gradient(180deg, var(--navy) 0 20%, #fff 20% 45%, var(--soft) 45%); box-shadow: inset 0 0 0 1px var(--line); }
.sw2 { background: linear-gradient(135deg, rgba(17,29,48,.85), rgba(80,55,30,.85)), linear-gradient(90deg, #6d5a44, #2a3440); }
.sw3 { background: linear-gradient(180deg, var(--navy) 0 20%, #fff 20% 40%, #9a7426 40% 75%, var(--red) 75%); }

/* =====================================================================
   THEME 1 — Classic (Edukat index-4): white header, soft lavender
   banner card with striped circle + dashed red arcs, clean shadow cards.
   ===================================================================== */
[data-theme="1"] .banner { padding: 0 20px; }
[data-theme="1"] .banner-in { background: var(--soft); border-radius: 8px; padding: 56px 60px; max-width: 1290px; overflow: hidden; }
[data-theme="1"] .banner .scene { max-width: 1290px; left: 20px; right: 20px; margin: 0 auto; z-index: 2; }
[data-theme="1"] .banner .scene i:nth-child(1), [data-theme="1"] .login .scene i:nth-child(1) {
  width: 150px; height: 150px; right: 18%; top: -30px; border-radius: 50%;
  background: repeating-linear-gradient(135deg, var(--ink) 0 1.5px, transparent 1.5px 7px); opacity: .9; }
[data-theme="1"] .banner .scene i:nth-child(2), [data-theme="1"] .login .scene i:nth-child(2) {
  width: 300px; height: 300px; right: -60px; bottom: -190px; border-radius: 50%; border: 3px dashed var(--red); }
[data-theme="1"] .banner .scene i:nth-child(3), [data-theme="1"] .login .scene i:nth-child(3) {
  width: 90px; height: 90px; right: 8%; top: 30%; border-radius: 50%; background: var(--red); opacity: .12; }
[data-theme="1"] .banner h1 { font-weight: 400; }
[data-theme="1"] .stat .ic { background: #ffe8ed; }
[data-theme="1"] .login { background: #fff; }
[data-theme="1"] .login::before { content: ""; position: absolute; inset: 24px; background: var(--soft); border-radius: 10px; }

/* =====================================================================
   THEME 2 — Campus (Edukat index-3): header sits transparent over a dark
   photo-style banner, white nav, light pre-title, cards with a red
   bottom edge, outline buttons.
   ===================================================================== */
[data-theme="2"] .topbar { position: relative; z-index: 21; background: rgba(10, 12, 20, .72); }
[data-theme="2"] .hdr { position: absolute; left: 0; right: 0; top: 44px; background: transparent; box-shadow: none; border-bottom: 1px solid rgba(255, 255, 255, .15); }
[data-theme="2"] .hdr .brand b, [data-theme="2"] #nav a { color: #fff; }
[data-theme="2"] .hdr .brand small, [data-theme="2"] #nav a span em { color: rgba(255, 255, 255, .7); }
[data-theme="2"] #nav a:hover, [data-theme="2"] #nav a.on { color: #fff; box-shadow: inset 0 -3px 0 var(--red); }
[data-theme="2"] .hdr-cta { background: transparent; border: 2px solid rgba(255, 255, 255, .5); }
[data-theme="2"] .banner, [data-theme="2"] .login { background: #1b1a1c; }
[data-theme="2"] .banner { padding: 190px 0 90px; }
[data-theme="2"] .banner .scene, [data-theme="2"] .login .scene {
  background:
    linear-gradient(90deg, rgba(10, 12, 20, .88) 0%, rgba(10, 12, 20, .55) 55%, rgba(10, 12, 20, .35) 100%),
    radial-gradient(ellipse 30% 45% at 72% 60%, rgba(255, 110, 80, .55), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 214, 160, .12) 0 60px, transparent 60px 150px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .35) 0 6px, transparent 6px 46px),
    linear-gradient(180deg, #8a6a45 0%, #4b3a2b 45%, #2a2621 100%); }
[data-theme="2"] .banner .scene i:nth-child(1), [data-theme="2"] .login .scene i:nth-child(1) {
  left: 0; right: 0; top: 0; height: 36%; background: repeating-linear-gradient(90deg, rgba(255, 236, 200, .35) 0 90px, transparent 90px 220px); filter: blur(10px); opacity: .6; }
[data-theme="2"] .banner .scene i:nth-child(2), [data-theme="2"] .login .scene i:nth-child(2) {
  width: 36%; height: 120%; right: 12%; top: 5%; border-radius: 45% 45% 0 0; background: radial-gradient(ellipse at 50% 30%, rgba(230, 90, 70, .5), transparent 65%); filter: blur(24px); }
[data-theme="2"] .banner .pre, [data-theme="2"] .login .pre { color: #fff; font-weight: 400; font-size: 22px; letter-spacing: 0; }
[data-theme="2"] .banner h1, [data-theme="2"] .banner h1 b, [data-theme="2"] .login-hero h1, [data-theme="2"] .login-hero h1 b { color: #fff; font-weight: 800; }
[data-theme="2"] .banner h1 .hi { color: rgba(255, 255, 255, .7); }
[data-theme="2"] .crumb, [data-theme="2"] .crumb a, [data-theme="2"] .crumb b { color: #fff; }
[data-theme="2"] .login-hero .lead, [data-theme="2"] .ticks, [data-theme="2"] .made { color: rgba(255, 255, 255, .85); }
[data-theme="2"] .card, [data-theme="2"] .stat { box-shadow: 0 10px 40px rgba(17, 29, 48, .1); border-bottom: 3px solid var(--red); }
[data-theme="2"] .main { background: #fafafa; }
[data-theme="2"] .stats { margin-top: -110px; position: relative; z-index: 2; }
[data-theme="2"] .btn:not(.primary) { background: transparent; }
[data-theme="2"] .login-card { border-bottom: 4px solid var(--red); }

/* =====================================================================
   THEME 3 — Bold (Edukat index-1): top bar + white header, warm golden
   photo-style banner with centered title, overlapping solid colour tiles.
   ===================================================================== */
[data-theme="3"] .banner, [data-theme="3"] .login { background: #6b4f1c; }
[data-theme="3"] .banner { padding: 80px 0 150px; text-align: center; }
[data-theme="3"] .banner .scene, [data-theme="3"] .login .scene {
  background:
    linear-gradient(180deg, rgba(120, 88, 20, .82), rgba(80, 58, 14, .88)),
    radial-gradient(ellipse 25% 55% at 62% 40%, rgba(255, 220, 170, .5), transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(40, 30, 10, .6), transparent 70%),
    linear-gradient(120deg, #c89b3c, #7a5a1e); }
[data-theme="3"] .banner .scene i:nth-child(1), [data-theme="3"] .login .scene i:nth-child(1) {
  width: 22%; height: 90%; left: 58%; top: 8%; border-radius: 50% 50% 10% 10%; background: radial-gradient(ellipse at 50% 30%, rgba(255, 230, 200, .35), transparent 70%); filter: blur(20px); }
[data-theme="3"] .banner .pre { color: var(--red); background: rgba(255,255,255,.95); display: inline-block; padding: 2px 12px; border-radius: 3px; }
[data-theme="3"] .banner h1 { color: #fff; text-transform: uppercase; font-weight: 400; }
[data-theme="3"] .banner h1 b { color: #fff; }
[data-theme="3"] .banner h1 .hi { color: rgba(255,255,255,.8); text-transform: none; }
[data-theme="3"] .crumb, [data-theme="3"] .crumb a, [data-theme="3"] .crumb b { color: #fff; }
[data-theme="3"] .main { background: var(--soft); }
[data-theme="3"] .stats { margin-top: -130px; position: relative; z-index: 2; }
[data-theme="3"] .main section:not(:has(> .stats:first-child)) { margin-top: -120px; position: relative; z-index: 2; background: #fff; border-radius: 8px; padding: 34px; box-shadow: 0 10px 40px rgba(17, 29, 48, .12); }
[data-theme="3"] .main section:not(:has(> .stats:first-child)) .card { box-shadow: none; border: 1px solid var(--line); }
[data-theme="3"] .stat { color: rgba(255, 255, 255, .9); text-align: center; justify-items: center; box-shadow: 0 10px 30px rgba(17, 29, 48, .15); }
[data-theme="3"] .stat b, [data-theme="3"] .stat small, [data-theme="3"] .stat span { color: #fff; }
[data-theme="3"] .stat .ic { background: rgba(255, 255, 255, .95); }
[data-theme="3"] .stat:nth-child(1) { background: var(--red); }
[data-theme="3"] .stat:nth-child(1) .ic { color: var(--red); }
[data-theme="3"] .stat:nth-child(2) { background: var(--yellow); }
[data-theme="3"] .stat:nth-child(2) .ic { color: var(--yellow); }
[data-theme="3"] .stat:nth-child(3) { background: var(--navy); }
[data-theme="3"] .stat:nth-child(3) .ic { color: var(--navy); }
[data-theme="3"] .stat:nth-child(4) { background: var(--blue); }
[data-theme="3"] .stat:nth-child(4) .ic { color: var(--blue); }
[data-theme="3"] .stat.warn b { color: #fff; }
[data-theme="3"] .login-in { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 34px; }
[data-theme="3"] .login-hero { max-width: 760px; }
[data-theme="3"] .login-hero h1, [data-theme="3"] .login-hero h1 b { color: #fff; text-transform: uppercase; }
[data-theme="3"] .login-hero .lead { color: rgba(255,255,255,.9); margin: 0 auto; }
[data-theme="3"] .login-hero .pre { color: var(--red); background: #fff; display: inline-block; padding: 2px 12px; border-radius: 3px; }
[data-theme="3"] .ticks { display: none; }
[data-theme="3"] .login-card { width: min(440px, 100%); text-align: left; }
[data-theme="3"] .made { color: rgba(255,255,255,.85); }


/* =====================================================================
   Role screens (owner / principal / teacher / student) — shared by all
   three themes; colours come from the theme tokens above.
   ===================================================================== */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.note { font-size: 13px; font-weight: 600; margin-top: -8px; }
.of { font-style: normal; font-size: .5em; font-weight: 700; color: var(--text); margin-left: 2px; }
[data-theme="3"] .stat .of { color: rgba(255, 255, 255, .8); }
.bad { color: var(--bad) !important; }
.legend { font-size: 12px; font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* Charts: thin single-series bars, recessive grid, ink-coloured text */
.chart-card { gap: 10px; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.zero { stroke: #b9bccb; }
.chart .tick { font: 600 10.5px var(--f); fill: var(--text); }
.chart .val { font: 800 11.5px var(--f); fill: var(--ink); }
.chart .bar path { fill: var(--red); transition: opacity .15s; }
.chart .bar.partial path { stroke: var(--red); stroke-width: 1.5; }
.chart .stripe-bg { fill: #ffe8ed; }
.chart .stripe { stroke: var(--red); stroke-width: 2.5; }
.chart .bar .hit { fill: transparent; }
.chart .bar { cursor: default; outline: none; }
.chart .bar.dim path { opacity: .35; }
.chart .bar:focus-visible path { stroke: var(--ink); stroke-width: 2; }
.chart-tip { position: absolute; transform: translateY(-100%); background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 4px; pointer-events: none; white-space: nowrap; z-index: 3; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }

/* Horizontal share bars (expense split) */
.hbar { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.hbar:last-child { border-bottom: 0; }
.hbar-h { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; color: var(--ink); font-size: 14px; }
.hbar-track { height: 8px; background: var(--soft); border-radius: 4px; margin: 6px 0 2px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.hbar small { font-size: 12px; font-weight: 600; }
.meter-cell { min-width: 120px; }
.meter { height: 8px; background: var(--bad-soft); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.meter-cell small { font-size: 12px; font-weight: 700; }
.tbl tfoot td { border-top: 2px solid var(--line); border-bottom: 0; }

/* Tabs & segmented control */
.tabs, .seg { display: inline-flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 6px; width: fit-content; }
.tabs button, .seg button { border: 0; background: transparent; padding: 9px 18px; border-radius: 4px; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--ink); }
.tabs button.on, .seg button.on { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(255, 25, 73, .25); }

/* Register grids (attendance history, staff month, fee lookup) */
.tbl.reg th, .tbl.reg td.cell { text-align: center; padding: 8px 3px; min-width: 26px; }
.tbl.reg .sticky { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; min-width: 150px; box-shadow: 1px 0 0 var(--line); }
.tbl.reg th.sticky { background: var(--soft); }
.dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 800; }
.dot.present, .dot.fee-paid { background: var(--ok-soft); color: var(--ok); }
.dot.late, .dot.fee-partial { background: var(--warn-soft); color: var(--warn); }
.dot.leave { background: var(--soft); color: var(--text); }
.dot.absent, .dot.fee-due { background: var(--bad-soft); color: var(--bad); }
.att-item.leave { background: var(--soft); border-left-color: #9aa0b4; }
.pill.leave { background: var(--soft); color: var(--text); }
.pill.open { background: var(--warn-soft); color: var(--warn); }
.pill.resolved { background: var(--ok-soft); color: var(--ok); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
input[type="file"] { padding: 9px; background: var(--soft); }
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: none; font-size: 34px; line-height: 1; color: #d6d8e2; cursor: pointer; padding: 0 2px; transition: transform .1s; }
.stars button.on { color: #f5a300; }
.stars button:hover { transform: scale(1.12); }
.stars-ro { color: #f5a300; letter-spacing: 2px; font-size: 16px; }

/* Feedback & assignment lists */
.fb-list, .asg-list { display: grid; gap: 14px; }
.fb, .asg { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 16px 18px; display: grid; gap: 8px; }
.fb.complaint { border-left-color: var(--red); }
.fb.suggestion { border-left-color: var(--yellow); }
.fb.rating { border-left-color: var(--ok); }
.fb-h, .asg-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fb-h small { font-weight: 600; flex: 1; min-width: 180px; }
.fb p, .asg p { color: var(--ink); }
.reply { background: var(--ok-soft); color: var(--ok) !important; border-radius: 4px; padding: 8px 12px; font-size: 14px; }
.fb .btn { justify-self: start; padding: 8px 16px; font-size: 12px; }
.asg { border-left-color: var(--red); }
.asg-h b { font-size: 16px; }
.asg-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; align-items: center; }
.due-on { color: var(--red); }
.file { font-weight: 800; background: var(--soft); padding: 3px 10px; border-radius: 4px; }
.del { color: var(--bad); margin-left: auto; font-size: 13px; }

/* Marks */
.marks-list { display: grid; gap: 24px; }
.overall { text-align: right; line-height: 1.1; }
.overall b { font-size: 30px; font-weight: 800; color: var(--red); display: block; }
.overall small { font-weight: 700; font-size: 12px; }
.marks-card h3 .pill { margin-left: 6px; vertical-align: middle; }

/* Four demo sign-ins */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-creds .demo-grid button { display: grid; gap: 1px; }
.demo-grid b { font-size: 14px; }
.demo-grid small { font-size: 11px; font-weight: 600; color: var(--text); }
.demo-grid button:hover b { color: var(--red); }

@media (max-width: 1100px) { .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .form-grid { grid-template-columns: 1fr; }
  .tbl.reg .sticky { min-width: 120px; }
  .tabbar a span { font-size: 10px; }
}

/* ---------- Phone ---------- */
@media (max-width: 960px) {
  .hdr-in { min-height: 0; padding-block: 10px 0; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
  .hdr-cta { width: 42px; height: 42px; font-size: 16px; }
  #nav { order: 3; width: calc(100% + 40px); margin: 0 -20px; padding: 0 14px 4px; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { flex: none; padding: 8px 10px 10px; font-size: 12px; }
  #nav a.on { box-shadow: inset 0 -3px 0 var(--red); }
  .brand b { font-size: 20px; }
  .logo { width: 42px; height: 42px; }
  .topbar-in { font-size: 13px; min-height: 38px; justify-content: flex-end; }
  .tb-l { display: none; }
  .tb-r { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [data-theme="2"] .hdr { top: 38px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 14px; }
  .stat { padding: 18px; }
  .stat b { font-size: 26px; }
  .stat .ic { width: 42px; height: 42px; font-size: 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .main { padding: 30px 0 calc(env(safe-area-inset-bottom, 0px) + 40px); }
  .ftr { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 30px); }
  .login-in { grid-template-columns: 1fr; gap: 26px; }
  .login-hero .lead, .ticks { display: none; }
  .login-card { padding: 26px; }
  [data-theme="1"] .banner-in { padding: 36px 26px; }
  [data-theme="1"] .banner .scene i:nth-child(1) { width: 90px; height: 90px; right: -24px; top: -34px; opacity: .55; }
  [data-theme="1"] .banner .scene i:nth-child(2) { width: 180px; height: 180px; right: -110px; bottom: -130px; }
  [data-theme="1"] .banner .scene i:nth-child(3) { width: 60px; height: 60px; right: 4%; top: auto; bottom: 14px; }
  [data-theme="1"] .login::before { inset: 10px; }
  [data-theme="2"] .banner { padding: 150px 0 70px; }
  [data-theme="2"] .banner .pre, [data-theme="2"] .login .pre { font-size: 15px; }
  [data-theme="2"] .stats { margin-top: -60px; }
  [data-theme="3"] .banner { padding: 50px 0 110px; }
  [data-theme="3"] .stats { margin-top: -90px; }
  [data-theme="3"] .main section:not(:has(> .stats:first-child)) { margin-top: -90px; padding: 16px; }
  .tabbar { display: none; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 3px solid var(--red); padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px); z-index: 60; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; font-size: 11px; font-weight: 800; color: var(--ink); text-transform: uppercase; }
  .tabbar a i { font-style: normal; width: 32px; height: 26px; display: grid; place-items: center; border-radius: 4px; }
  .tabbar a span em { display: none; }
  .tabbar a.on { color: var(--red); }
  .tabbar a.on i { background: #ffe8ed; }
  .hide-sm { display: none; }
  .themer { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: none; }
  .themer-tab { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
