/* ===== Raiganj Rabindra Mukta Vidhalaya — design system ===== */
:root {
  --brand: #1e4fa3; --brand-600: #183f84; --brand-700: #12316a; --brand-50: #eef3fc; --brand-100: #dbe6f8;
  --gold: #d6a84f; --gold-600: #b98b33; --gold-50: #fbf4e4;
  --bg: #f4f6fb; --card: #ffffff; --card2: #f8fafd; --line: #e3e8f1; --line2: #d3dae6;
  --text: #16213a; --text2: #3c4a63; --muted: #6b7a92;
  --green: #138a5e; --green-50: #e6f6ef; --red: #d03a3a; --red-50: #fdeceb; --orange: #d97a12; --orange-50: #fff3e3; --purple: #7c5cc4;
  --sidebar: #0f2550; --sidebar2: #0b1c3e; --sidebar-text: #c9d5ec;
  --radius: 14px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 70, .06), 0 1px 3px rgba(16, 33, 70, .05);
  --shadow: 0 4px 18px rgba(16, 33, 70, .08);
  --shadow-lg: 0 24px 60px rgba(10, 24, 54, .22);
  --font: 'Inter', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
body.dark {
  --bg: #0b1222; --card: #121b2e; --card2: #17223a; --line: #23314d; --line2: #2e3e5e;
  --text: #e8eef9; --text2: #c3cde0; --muted: #8b99b4;
  --brand-50: #172a4f; --brand-100: #1d3563; --gold-50: #2c2414; --green-50: #0f2b22; --red-50: #33171a; --orange-50: #33240f;
  --sidebar: #0a1426; --sidebar2: #070f1e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 6px 22px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
img { max-width: 100%; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--text); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1d1606; }
.btn.gold:hover { background: var(--gold-600); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { filter: brightness(.93); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.wa { background: #1faa59; border-color: #1faa59; color: #fff; }
.btn.wa:hover { background: #178a47; color: #fff; }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--text2); cursor: pointer; transition: all .15s; padding: 0; position: relative; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-50); }
.icon-btn.wa:hover { border-color: #1faa59; color: #1faa59; background: #e7f8ee; }
.icon-btn .ic { width: 16px; height: 16px; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text2); }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea, .input { width: 100%; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; min-height: 41px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 79, 163, .14); }
.field input:disabled, .field select:disabled { background: var(--card2); color: var(--muted); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 58, 58, .12); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.checkline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; font-size: 13px; }
.checkline input { width: 16px; height: 16px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { display: none; }
.switch i { width: 40px; height: 22px; border-radius: 22px; background: var(--line2); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { left: 21px; }

/* ===== Login ===== */
.login-screen { position: fixed; inset: 0; z-index: 500; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--card); }
.login-art { position: relative; background: var(--sidebar) url('/img/slide2.webp') center/cover; display: flex; align-items: flex-end; padding: 48px; color: #fff; }
.login-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 25, 60, .25), rgba(8, 20, 48, .92)); }
.login-art > div { position: relative; max-width: 520px; }
.login-art .eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .14em; font-size: 12px; }
.login-art h2 { font-size: 34px; line-height: 1.2; margin: 10px 0; }
.login-art p { color: #cfd9ee; margin: 0; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-card .logo { width: 84px; height: 84px; border-radius: 50%; display: block; margin: 0 auto 14px; box-shadow: var(--shadow-sm); }
.login-card h1 { text-align: center; font-size: 20px; margin: 0; }
.login-card .sub { text-align: center; color: var(--muted); margin: 4px 0 22px; font-size: 13px; }
.login-card form { display: grid; gap: 14px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; display: flex; }

/* ===== Shell ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: linear-gradient(180deg, var(--sidebar), var(--sidebar2)); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 60; }
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.brand img { width: 46px; height: 46px; border-radius: 50%; background: #fff; flex: none; }
.brand h2 { font-size: 13.5px; line-height: 1.25; margin: 0; color: #fff; font-weight: 700; }
.brand small { font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: #6f82a8; padding: 12px 12px 6px; }
.nav button { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--sidebar-text); cursor: pointer; text-align: left; font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s; }
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.active { background: linear-gradient(90deg, rgba(214, 168, 79, .22), rgba(214, 168, 79, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav button.active .ic { color: var(--gold); }
.nav .count { margin-left: auto; background: rgba(255, 255, 255, .1); border-radius: 20px; padding: 0 8px; font-size: 11px; font-weight: 700; }
.side-user { margin: 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); display: flex; align-items: center; gap: 10px; }
.side-user b { color: #fff; font-size: 13px; display: block; }
.side-user small { font-size: 11.5px; }
.side-user .icon-btn { margin-left: auto; background: transparent; border-color: rgba(255, 255, 255, .12); color: var(--sidebar-text); }
.side-user .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #1d1606; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 26px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search-wrap { position: relative; flex: 1; max-width: 460px; }
.search-wrap .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { width: 100%; padding: 10px 12px 10px 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); outline: none; }
.search-wrap input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 79, 163, .12); }
.search-wrap kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: var(--card2); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; display: none; z-index: 70; }
.search-results.show { display: block; }
.sr-item { display: flex; gap: 11px; align-items: center; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.active { background: var(--brand-50); }
.sr-item .meta { font-size: 12px; color: var(--muted); }
.sr-empty { padding: 16px; text-align: center; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.sync-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sync-state[data-state="saving"] i { background: var(--orange); animation: pulse 1s infinite; }
.sync-state[data-state="offline"] i { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.badge-dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--bg); }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 80; display: none; overflow: hidden; }
.dropdown.show { display: block; }
.dropdown-head { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.dropdown-list { max-height: 360px; overflow: auto; }
.notif { padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.notif:hover { background: var(--card2); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.content { padding: 24px 26px 60px; width: 100%; max-width: 1480px; margin: 0 auto; }

/* ===== Sections ===== */
.section { display: none; animation: fadeUp .3s ease both; }
.section.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.stack { display: grid; gap: 18px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.two-col > *, .stack > *, .grid > * { min-width: 0; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.kpi .kpi-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi .kpi-ic .ic { width: 22px; height: 22px; }
.kpi p { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi h3 { margin: 3px 0 2px; font-size: 24px; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-size: 12px; }
.tone-blue { background: var(--brand-50); color: var(--brand); }
.tone-gold { background: var(--gold-50); color: var(--gold-600); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-orange { background: var(--orange-50); color: var(--orange); }

/* Hero */
.hero { position: relative; border-radius: 18px; overflow: hidden; height: 250px; box-shadow: var(--shadow); margin-bottom: 18px; background: var(--sidebar); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9, 22, 52, .9) 0%, rgba(9, 22, 52, .55) 45%, rgba(9, 22, 52, .05) 100%); }
.hero-cap { position: absolute; z-index: 2; left: 34px; top: 50%; transform: translateY(-50%); color: #fff; max-width: 540px; }
.hero-cap .eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .14em; font-size: 11.5px; }
.hero-cap h2 { font-size: 30px; margin: 8px 0; line-height: 1.25; }
.hero-cap p { color: #d7e0f2; margin: 0 0 16px; }
.hero-dots { position: absolute; z-index: 3; bottom: 16px; left: 34px; display: flex; gap: 7px; }
.hero-dots button { width: 8px; height: 8px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .45); cursor: pointer; padding: 0; transition: width .3s; }
.hero-dots button.active { width: 24px; background: var(--gold); }

.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 20px 20px; }
.quick button { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; text-align: left; transition: all .15s; }
.quick button:hover { border-color: var(--brand); background: var(--brand-50); transform: translateY(-1px); }
.dash-quick { grid-template-columns: repeat(3, 1fr); }
.quick .qi { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 760px) { .dash-quick { grid-template-columns: 1fr 1fr; } }
.quick b { display: block; font-size: 13.5px; }
.quick small { color: var(--muted); font-size: 12px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 11px 14px; background: var(--card2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--card2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.inactive td { opacity: .55; }
.tbl tr.flag td { background: var(--red-50) !important; }
.tbl tr.flag td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl tr.flash td { animation: flash 2s ease; }
@keyframes flash { 0%, 40% { background: var(--gold-50); } }
.empty { text-align: center; padding: 40px 16px !important; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; display: block; margin: 0 auto 8px; opacity: .5; }
.person { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.person b { display: block; font-size: 13.5px; }
.person small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.thumb { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.green { background: var(--green-50); color: var(--green); }
.pill.red { background: var(--red-50); color: var(--red); }
.pill.orange { background: var(--orange-50); color: var(--orange); }
.pill.blue { background: var(--brand-50); color: var(--brand); }
.pill.gray { background: var(--card2); color: var(--muted); border: 1px solid var(--line); }
.pill.gold { background: var(--gold-50); color: var(--gold-600); }
.board-tag { font-weight: 700; font-size: 12px; }
.board-BOSSE { color: var(--gold-600); }
.board-NIOS { color: var(--brand); }
.board-WBCROS { color: var(--green); }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; min-width: 70px; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 6px; }
.toggle { width: 38px; height: 21px; border-radius: 21px; border: 0; background: var(--green); position: relative; cursor: pointer; flex: none; padding: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 20px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.off { background: var(--line2); }
.toggle.off::after { left: 3px; }

/* Filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
.filters .field.grow { max-width: 340px; flex: 2 1 220px; }
.filters .field label { font-size: 11.5px; }
.filters .field input, .filters .field select { min-height: 38px; padding: 8px 11px; }
.chip-group { display: flex; gap: 6px; align-items: center; }
.chip { padding: 7px 12px; border-radius: 20px; border: 1px solid var(--line2); background: var(--card); cursor: pointer; font-size: 12.5px; font-weight: 700; transition: all .15s; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.result-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.result-bar b { color: var(--text); }

/* ===== Admission form ===== */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px; position: relative; text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; }
.step .n { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; background: var(--card); transition: all .2s; }
.step.active { color: var(--text); }
.step.active .n { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-100); }
.step.done .n { border-color: var(--green); background: var(--green); color: #fff; }
.step.done { color: var(--text2); }
.pane { display: none; padding: 22px 20px; }
.pane.active { display: block; animation: fadeUp .25s ease both; }
.form-title { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--brand); margin: 22px 0 12px; display: flex; align-items: center; gap: 10px; }
.form-title:first-child { margin-top: 0; }
.form-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.note { padding: 11px 14px; border-radius: 10px; background: var(--brand-50); color: var(--text2); font-size: 12.5px; margin-top: 14px; border: 1px solid var(--brand-100); }
.note.warn { background: var(--orange-50); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--card2); border-radius: 0 0 var(--radius) var(--radius); position: sticky; bottom: 0; z-index: 5; }
.fee-strip { display: flex; gap: 18px; font-size: 13px; flex-wrap: wrap; }
.fee-strip b { font-size: 15px; }
.subject-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subject-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.subject-box h4 { margin: 0; padding: 10px 14px; background: var(--card2); border-bottom: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; }
.subject-box h4 span { color: var(--brand); }
.checkgrid { padding: 8px; display: grid; gap: 2px; max-height: 330px; overflow: auto; }
.checkgrid label { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 500; }
.checkgrid label:hover { background: var(--card2); }
.checkgrid label:has(input:checked) { background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
body.dark .checkgrid label:has(input:checked) { color: #b9cdf5; }
.checkgrid input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.edit-table { width: 100%; border-collapse: collapse; }
.edit-table th { font-size: 11.5px; text-align: left; color: var(--muted); padding: 0 6px 6px; font-weight: 700; }
.edit-table td { padding: 4px; }
.edit-table input, .edit-table select { width: 100%; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--card); min-width: 90px; outline: none; }
.edit-table input:focus, .edit-table select:focus { border-color: var(--brand); }
.upload { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px dashed var(--line2); border-radius: 12px; background: var(--card2); }
.upload .preview { width: 64px; height: 74px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); flex: none; }
.upload .preview img { width: 100%; height: 100%; object-fit: cover; }
.upload.sign .preview { width: 110px; height: 50px; }
.upload.sign .preview img { object-fit: contain; }
.upload input[type=file] { font-size: 12px; max-width: 100%; }
.affirm { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--gold-50); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); margin-top: 16px; font-size: 13px; cursor: pointer; }
.affirm input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
.edit-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--orange-50); color: var(--orange); font-weight: 600; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.fee-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.fee-card { padding: 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.fee-card span { font-size: 12px; color: var(--muted); font-weight: 600; }
.fee-card strong { display: block; font-size: 22px; margin-top: 2px; }

/* ===== Modals ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 14, 32, .55); backdrop-filter: blur(3px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.show { display: flex; animation: fadeIn .18s ease; }
.dialog-backdrop { z-index: 300; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(640px, 100%); max-height: calc(100vh - 32px); background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--line); }
.modal.wide { width: min(900px, 100%); }
.modal.dialog { width: min(440px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal-head h3 { margin: 0; font-size: 16.5px; }
.modal-head .sub { color: var(--muted); font-size: 12.5px; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--card2); flex-wrap: wrap; }
.dialog-text { color: var(--text2); line-height: 1.6; }
.form-msg { font-size: 12.5px; min-height: 18px; margin-top: 10px; color: var(--red); }
.form-msg.ok { color: var(--green); }
.student-chip { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); margin: 12px 0; }
.student-chip .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.student-chip .meta b { color: var(--text); }

/* Profile drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(6, 14, 32, .45); z-index: 150; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--card); z-index: 160; transform: translateX(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.show { transform: none; }
.drawer-top { padding: 20px; background: linear-gradient(135deg, var(--sidebar), var(--brand-600)); color: #fff; position: relative; }
.drawer-top .close { position: absolute; right: 14px; top: 14px; background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.drawer-top .who { display: flex; gap: 14px; align-items: center; }
.drawer-top .big-photo { width: 72px; height: 84px; border-radius: 12px; object-fit: cover; background: rgba(255, 255, 255, .15); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; flex: none; border: 2px solid rgba(255, 255, 255, .3); }
.drawer-top h3 { margin: 0; font-size: 18px; }
.drawer-top .sub { color: #c9d5ec; font-size: 12.5px; }
.drawer-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.drawer-money div { background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 9px 11px; }
.drawer-money span { font-size: 11px; color: #c9d5ec; }
.drawer-money b { display: block; font-size: 16px; }
.drawer-actions { display: flex; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.drawer-body { overflow: auto; padding: 6px 20px 30px; flex: 1; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.drawer h4 { font-size: 11.5px; letter-spacing: .1em; color: var(--brand); margin: 20px 0 10px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Attendance modal */
.att-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.att-table th, .att-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.att-table th:nth-child(2), .att-table td:nth-child(2) { text-align: left; }
.att-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.att-table input[type=text] { width: 90px; padding: 6px 8px; border: 1px solid var(--line2); border-radius: 7px; background: var(--card); }
.check-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.check-cards label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; }
.check-cards label:has(input:checked) { border-color: var(--green); background: var(--green-50); color: var(--green); }
.check-cards input { width: 17px; height: 17px; accent-color: var(--green); }

/* Charts */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding: 20px 20px 10px; }
.chart-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; position: relative; }
.chart-bars .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--brand); transition: height .5s cubic-bezier(.2, .8, .2, 1); position: relative; min-height: 3px; }
.chart-bars .bar:hover { filter: brightness(1.15); }
.chart-bars .val { font-size: 11px; font-weight: 700; color: var(--text2); }
.chart-bars .lbl { font-size: 11px; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 24px; padding: 22px; flex-wrap: wrap; justify-content: center; }
.donut { width: 170px; height: 170px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ''; position: absolute; inset: 28px; border-radius: 50%; background: var(--card); }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.donut .center b { font-size: 26px; }
.donut .center small { color: var(--muted); font-size: 11.5px; }
.legend { display: grid; gap: 10px; min-width: 170px; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; }
.hbar { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.hbar .track { height: 10px; border-radius: 6px; background: var(--card2); overflow: hidden; border: 1px solid var(--line); }
.hbar .track i { display: block; height: 100%; border-radius: 6px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }

/* WhatsApp */
.wa-tpls { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.wa-tpls button { padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line2); background: var(--card); font-size: 12px; cursor: pointer; font-weight: 600; }
.wa-tpls button:hover { border-color: #1faa59; color: #1faa59; }
.wa-preview { white-space: pre-wrap; background: #e7f8ee; color: #0e3b23; padding: 12px 14px; border-radius: 12px 12px 12px 3px; font-size: 13px; margin-top: 10px; border: 1px solid #c3ebd3; }
body.dark .wa-preview { background: #0f2b1d; color: #c7f0d7; border-color: #1b4d33; }
.tokens { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.tokens code { background: var(--card2); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); cursor: pointer; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-grid .card-body { padding: 18px 20px; display: grid; gap: 14px; }
.danger-zone { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }

/* Toast */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 400; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px; transform: translateX(30px); opacity: 0; transition: all .25s; }
.toast.show { transform: none; opacity: 1; }
.toast-ic { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex: none; }
.toast.success .toast-ic { background: var(--green); }
.toast.error .toast-ic { background: var(--red); }
.toast.info .toast-ic { background: var(--brand); }
.toast.warn .toast-ic { background: var(--orange); }
.pdf-loading { position: fixed; inset: 0; z-index: 450; background: rgba(6, 14, 32, .55); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; }
.pdf-loading.show { display: flex; }
.pdf-loading > div { background: var(--card); padding: 26px 34px; border-radius: 16px; text-align: center; box-shadow: var(--shadow-lg); }
.spinner { width: 44px; height: 44px; margin: 0 auto 12px; border: 4px solid var(--line); border-top-color: var(--gold); border-right-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 600; }
.boot img { width: 72px; height: 72px; border-radius: 50%; animation: pulse 1.4s infinite; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subject-cols { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .step .lbl { display: none; }
  .stepper { display: flex; justify-content: space-between; }
}
@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .nav-overlay { position: fixed; inset: 0; background: rgba(6, 14, 32, .5); z-index: 55; display: none; }
  body.nav-open .nav-overlay { display: block; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 50px; }
  .sync-state span, .search-wrap kbd, .theme-label { display: none; }
}
@media (max-width: 620px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; flex-direction: column; gap: 8px; }
  .kpi h3 { font-size: 19px; }
  .kpi .kpi-ic { width: 36px; height: 36px; }
  .hero { height: 200px; }
  .hero-cap { left: 20px; right: 20px; }
  .hero-cap h2 { font-size: 21px; }
  .hero-cap p { display: none; }
  .hero-dots { left: 20px; }
  .page-head h1 { font-size: 20px; }
  .fee-cards { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr; }
  .check-cards { grid-template-columns: repeat(2, 1fr); }
  .filters .field { max-width: none; flex-basis: 100%; }
  .drawer-money { grid-template-columns: 1fr 1fr 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .form-foot { flex-wrap: wrap; }
  .fee-strip { width: 100%; justify-content: space-between; order: -1; padding-bottom: 10px; border-bottom: 1px dashed var(--line2); }
  .form-foot { padding: 12px 16px; }
  .hbar { grid-template-columns: 90px 1fr 70px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .top-actions { gap: 4px; }
}
@media print {
  .sidebar, .topbar { display: none; }
}
