/* ==========================================================
   School Manager - design system
   Brand: dark slate + lime (matches STEP SCHOOL identity)
   No external fonts or libraries: everything loads instantly.
   ========================================================== */
:root {
  --slate-950: #121a20;
  --slate-900: #1b252c;
  --slate-800: #26323a;
  --slate-700: #34424b;
  --slate-500: #6b7a85;
  --slate-300: #c3ccd3;
  --slate-200: #dde3e8;
  --slate-100: #edf1f4;
  --slate-50:  #f5f7f9;

  --lime-600: #6fa012;
  --lime-500: #8cc63f;
  --lime-400: #a4dd2f;
  --lime-100: #eef8d9;

  --red-600: #c43c3c;
  --red-100: #fde8e8;
  --amber-600: #b7791f;
  --amber-100: #fdf3dc;
  --green-600: #1f8a4c;
  --green-100: #e2f5ea;
  --blue-600: #2a78d6;
  --blue-100: #e3effc;

  --bg: var(--slate-50);
  --surface: #ffffff;
  --text: #182127;
  --text-2: #4e5c66;
  --muted: #7b8892;
  --line: var(--slate-200);
  --accent: var(--lime-400);
  --accent-ink: #132003;

  --series-1: #2a78d6;
  --series-2: #eb6834;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 1px 3px rgba(16, 24, 32, .08);
  --shadow-lg: 0 10px 30px rgba(16, 24, 32, .14);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --topbar-h: 104px; /* header row 60 + module tabs 44 */
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- App shell ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; min-height: 100vh; }

.topbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--slate-800), var(--slate-900));
  color: #fff;
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sidebar-w) - 16px); min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 17px; letter-spacing: -.5px;
}
.brand-text { min-width: 0; }
.brand-text b { display: block; font-size: 14px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { display: block; font-size: 11.5px; color: var(--slate-300); white-space: nowrap; }

/* Top menu: one line, labels never break; what does not fit goes under "More". */
.topbar { flex-wrap: wrap; row-gap: 0; height: var(--topbar-h); align-content: flex-start; }
.topbar > .brand, .topbar > .spacer { height: 60px; }
.modules { display: flex; align-items: center; gap: 2px; order: 10; flex: 0 0 100%; height: 44px; min-width: 0; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, .08); }
.modules a, .mod-more > button {
  display: flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
  padding: 7px 11px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  color: var(--slate-300); font-weight: 600; font-size: 13px; font-family: inherit;
}
.modules a[hidden] { display: none; }
.modules a .i { width: 16px; height: 16px; }
.modules a:hover, .mod-more > button:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.modules a.active, .mod-more > button.active { background: var(--accent); color: var(--accent-ink); }
.mod-more { flex: none; }
.mod-more .chev { width: 14px; height: 14px; }
.mod-drop { position: fixed; margin-top: 6px; min-width: 220px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.mod-drop a { color: var(--text); border-radius: 8px; padding: 9px 12px; }
.mod-drop a:hover { background: var(--slate-100); color: var(--text); }
.mod-drop a.active { background: var(--accent); color: var(--accent-ink); }

.topbar .spacer { flex: 1; }
.global-search { position: relative; width: 300px; max-width: 32vw; }
.global-search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  border-radius: 8px; border: 1px solid var(--slate-700);
  background: var(--slate-950); color: #fff; outline: none;
}
.global-search input::placeholder { color: var(--slate-500); }
.global-search input:focus { border-color: var(--accent); }
.global-search svg { position: absolute; left: 10px; top: 9px; color: var(--slate-500); }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 999px; cursor: pointer; }
.user-chip:hover { background: rgba(255, 255, 255, .08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--slate-700); font-weight: 700; font-size: 12px; }
.user-chip small { display: block; color: var(--slate-300); font-size: 11px; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  background: var(--slate-900);
  color: var(--slate-300);
  padding: 12px 10px 24px;
  overflow-y: auto;
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
}
.nav-group { margin-bottom: 2px; }
.nav-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: #e8edf0; font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-align: left;
}
.nav-head:hover { background: var(--slate-800); }
.nav-head .chev { margin-left: auto; width: 15px; height: 15px; transition: transform .15s; color: var(--slate-500); }
.nav-group.open .nav-head .chev { transform: rotate(180deg); }
.nav-items { display: none; padding: 2px 0 6px 18px; }
.nav-group.open .nav-items { display: block; }
.nav-items a {
  display: block; padding: 7px 10px 7px 18px; margin: 1px 0;
  color: var(--slate-300); font-size: 13px; border-radius: 6px;
  border-left: 2px solid var(--slate-700);
}
.nav-items a:hover { color: #fff; background: var(--slate-800); text-decoration: none; }
.nav-items a.active { color: var(--accent); border-left-color: var(--accent); background: rgba(164, 221, 47, .08); font-weight: 600; }
.nav-single { margin-bottom: 6px; }
.nav-single.active { background: rgba(164, 221, 47, .12); color: var(--accent); }

/* ---------------- Page ---------------- */
.main { min-width: 0; }
.page { padding: 22px 26px 40px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 700; }
.page-head p { margin: 3px 0 0; color: var(--muted); }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }

/* ---------------- Stat tiles ---------------- */
.stat { padding: 16px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.stat .value { font-size: 25px; font-weight: 700; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 3px; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.stat.sm { padding: 10px 12px; gap: 3px; }
.stat.sm .label { font-size: 11.5px; gap: 6px; }
.stat.sm .ico { width: 24px; height: 24px; border-radius: 6px; }
.stat.sm .ico .i { width: 14px; height: 14px; }
.stat.sm .value { font-size: 19px; letter-spacing: -.2px; }
.stat.sm .value small { font-size: 11px; }
.stat.sm .sub { font-size: 11px; line-height: 1.35; }
.ico.lime { background: var(--lime-100); color: var(--lime-600); }
.ico.blue { background: var(--blue-100); color: var(--blue-600); }
.ico.red { background: var(--red-100); color: var(--red-600); }
.ico.amber { background: var(--amber-100); color: var(--amber-600); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--slate-900); background: var(--slate-900); color: #fff;
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--slate-700); border-color: var(--slate-700); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--lime-500); color: var(--accent-ink); }
.btn.primary:hover { background: var(--lime-500); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--slate-100); }
.btn.danger { background: var(--surface); color: var(--red-600); border-color: #f0c4c4; }
.btn.danger:hover { background: var(--red-100); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.input, .field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--slate-300); border-radius: 8px;
  background: #fff; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field textarea { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--lime-500); box-shadow: 0 0 0 3px rgba(140, 198, 63, .22);
}
.field input.big { height: 48px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }

.seg { display: inline-flex; padding: 3px; background: var(--slate-100); border-radius: 9px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--slate-50); border-radius: var(--radius) var(--radius) 0 0; }
.filters .field { width: 170px; }
.filters .field.wide { width: 260px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-2); font-weight: 700; padding: 10px 12px;
  background: var(--slate-50); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; white-space: nowrap;
}
table.data th.num { text-align: right; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
table.data tbody tr:hover td { background: #fafcf5; }
table.data tfoot td { font-weight: 700; background: var(--slate-50); border-top: 2px solid var(--line); border-bottom: 0; }
table.data .name { font-weight: 600; white-space: nowrap; }
table.data .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
table.data .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ref { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }

.amt-due { color: var(--red-600); font-weight: 700; }
.amt-clear { color: var(--green-600); font-weight: 600; }
.amt-adv { color: var(--blue-600); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-100); color: var(--green-600); }
.badge.due { background: var(--red-100); color: var(--red-600); }
.badge.warn { background: var(--amber-100); color: var(--amber-600); }
.badge.info { background: var(--blue-100); color: var(--blue-600); }
.badge.neutral { background: var(--slate-100); color: var(--text-2); }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------------- Student picker / profile ---------------- */
.picker { position: relative; }
.picker input { padding-left: 38px !important; height: 46px !important; font-size: 15px; }
.picker svg.i { position: absolute; left: 12px; top: 14px; color: var(--muted); z-index: 1; }
.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 340px; overflow-y: auto; padding: 4px;
}
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.picker-item:hover, .picker-item.active { background: var(--lime-100); }
.picker-item .who { flex: 1; min-width: 0; }
.picker-item .who b { display: block; }
.picker-item .who span { font-size: 12px; color: var(--muted); }

.profile { display: flex; gap: 14px; align-items: center; }
.profile .avatar-lg { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--slate-800); color: var(--accent); font-weight: 800; font-size: 19px; flex: none; }
.profile h3 { font-size: 17px; }
.profile .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.kv > div { background: #fff; padding: 12px 16px; }
.kv span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kv b { font-size: 17px; font-variant-numeric: tabular-nums; }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.summary-strip > div { padding: 12px 16px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.summary-strip b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------------- Chart ---------------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid-line { stroke: var(--slate-100); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .bar { transition: opacity .12s; }
.chart .bar-group:hover .bar { opacity: .85; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: var(--slate-900); color: #fff; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; box-shadow: var(--shadow-lg); min-width: 150px; transform: translate(-50%, -100%);
}
.tooltip b { display: block; margin-bottom: 4px; }
.tooltip div { display: flex; justify-content: space-between; gap: 14px; }
.tooltip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ---------------- Alerts / toast ---------------- */
.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert.ok { background: var(--green-100); color: #145c33; }
.alert.error { background: var(--red-100); color: #8f2525; }
.alert.info { background: var(--blue-100); color: #1c4f8f; }
.alert.warn { background: var(--amber-100); color: #7a4a06; }
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--slate-900); color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--accent); font-weight: 600; }
.toast.error { border-left-color: #ff6b6b; }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: radial-gradient(circle at 20% 20%, rgba(164, 221, 47, .18), transparent 45%),
              linear-gradient(160deg, var(--slate-800), var(--slate-950));
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h2 { font-size: 34px; line-height: 1.15; max-width: 440px; letter-spacing: -.5px; }
.login-art h2 em { color: var(--accent); font-style: normal; }
.login-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: var(--slate-300); }
.login-art li { display: flex; gap: 10px; align-items: center; }
.login-art li svg { color: var(--accent); }
.login-form { display: grid; place-items: center; padding: 32px 16px; background: #fff; }
.login-box { width: 100%; max-width: 360px; }
.login-box h1 { font-size: 24px; margin-bottom: 4px; }
.login-box p { color: var(--muted); margin: 0 0 24px; }
.login-box .field { margin-bottom: 14px; }
.login-box .secure { margin-top: 18px; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }


/* ---------------- App extras ---------------- */
.boot { display: grid; place-items: center; height: 100vh; grid-column: 1 / -1; color: var(--muted); }
.view { min-height: 100%; }
.brand, .brand:hover { color: #fff; text-decoration: none; }
.user-menu { position: relative; }
.user-chip { border: 0; background: none; color: #fff; text-align: left; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; background: none;
  border-radius: 7px; color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--slate-100); text-decoration: none; }
.global-search .picker input { height: 36px !important; font-size: 13.5px; border-color: var(--slate-700); background: var(--slate-950); color: #fff; }
.global-search .picker input:focus { box-shadow: none; border-color: var(--accent); }
.global-search .picker svg.i { top: 9px; left: 10px; }
.global-search .picker-list { color: var(--text); min-width: 380px; right: 0; left: auto; }
.nav-scrim { display: none; }

.hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; min-height: 38px; }
.check input { width: 16px; height: 16px; accent-color: var(--lime-600); }
.input.sm, .field .input.sm { height: 32px; padding: 0 9px; font-size: 13px; }
td .input.sm { min-width: 70px; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
.form-grid.cols-3-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.card.narrow { max-width: 760px; }
.net-fee { height: 38px; display: flex; align-items: center; font-size: 17px; font-weight: 700; color: var(--lime-600); }
.kv-inline { text-align: right; }
.kv-inline span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.kv-inline b { font-size: 17px; }
.extra-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 8px; margin: 6px 0; max-width: 560px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; cursor: pointer;
  border: 2px dashed var(--slate-300); border-radius: var(--radius); background: var(--slate-50); text-align: center;
}
.dropzone:hover { border-color: var(--lime-500); background: var(--lime-100); }
.dropzone svg.i { width: 26px; height: 26px; color: var(--lime-600); }

/* receipt: adjust against invoices */
.adjust-table tr.row-on td { background: #f6fbea; }
.adjust-table input.over { border-color: var(--red-600); background: var(--red-100); }
.adjust-table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--lime-600); cursor: pointer; }
.adjust-table tfoot td { font-size: 13px; }

/* class promotion: fee increase bar */
.inc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; background: var(--lime-100); border-bottom: 1px solid var(--line); }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
th .check { min-height: 0; font-size: 11.5px; color: inherit; }

/* expenses */
.cat-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cat-grid button {
  border: 1px solid var(--slate-300); background: #fff; border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.cat-grid button:hover { border-color: var(--lime-500); }
.cat-grid button.on { background: var(--accent); border-color: var(--lime-500); color: var(--accent-ink); }
.filters .or { align-self: center; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; padding-top: 18px; }

/* monthly cash report */
.cash-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--line); }
.cash-flow .cf { padding: 14px 16px; border-right: 1px solid var(--line); position: relative; }
.cash-flow .cf:last-child { border-right: 0; }
.cash-flow .cf span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.cash-flow .cf b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; margin: 2px 0; }
.cash-flow .cf small { color: var(--muted); font-size: 11.5px; }
.cash-flow .cf.plus b::before { content: "+ "; color: var(--green-600); }
.cash-flow .cf.minus b::before { content: "− "; color: var(--red-600); }
.cash-flow .cf.total { background: var(--lime-100); }
.close-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-bottom: 1px solid var(--line); background: var(--slate-50); }
.close-bar > span:first-child { display: block; flex: 1; min-width: 240px; }
.close-bar > span:first-child svg.i { vertical-align: -4px; margin-right: 4px; }

/* daily & monthly detailed reports */
.report-date { padding: 12px 16px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--line); }
.mode-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.mode-strip > div { padding: 10px 16px; border-right: 1px solid var(--line); }
.mode-strip > div:last-child { border-right: 0; }
.mode-strip span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.mode-strip b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.mode-strip small { color: var(--muted); font-size: 11.5px; }
.mode-strip .hand { background: var(--amber-100); }
.section-head { border-top: 1px solid var(--line); background: var(--slate-50); }
.section-head b { font-variant-numeric: tabular-nums; }
.day-block { border-top: 2px solid var(--slate-300); break-inside: avoid; page-break-inside: avoid; }
.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 16px; background: var(--lime-100); font-size: 13.5px; }
.day-head span { color: var(--text-2); }
td.moved { color: var(--text-2); font-style: italic; }
.ledger-table th .sub { text-transform: none; letter-spacing: 0; font-weight: 600; }
.ledger-table tr.day-start td { border-top: 1px solid var(--slate-300); }
.ledger-table tr.opening-row td { background: var(--lime-100); }
.ledger-table td:last-child { font-weight: 600; }
.signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 48px 24px 20px; border-top: 1px solid var(--line); }
.signatures div { border-top: 1px solid var(--text); padding-top: 6px; text-align: center; font-size: 12.5px; color: var(--text-2); }

/* users & permissions */
.perm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.perm-group { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 4px; margin-bottom: 8px; }
.perm-group > span { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 2px; }
.perm-group.careful { border-color: #f0c4c4; background: #fff8f8; }
.perm-group.careful > span { color: var(--red-600); }
.check.perm { min-height: 30px; font-weight: 500; color: var(--text); align-items: flex-start; padding: 4px 0; }
.check.perm input { margin-top: 2px; flex: none; }
.link-btn { border: 0; background: none; color: var(--blue-600); cursor: pointer; padding: 0; font-size: 12.5px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
input[type=date][readonly] { background: var(--slate-50); color: var(--text-2); cursor: not-allowed; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 300; background: rgba(18, 26, 32, .45); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-body { padding: 22px 22px 18px; font-size: 14.5px; line-height: 1.5; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; background: var(--slate-50); border-top: 1px solid var(--line); }
.btn.danger-solid { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn.danger-solid:hover { background: #a83232; }

/* statements & journal */
.statement table.data td { padding: 8px 14px; }
tr.sec td { background: var(--slate-50); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; color: var(--text-2); }
tr.sub-total td { font-weight: 700; border-top: 1px solid var(--slate-300); }
tr.grand-total td { font-weight: 800; font-size: 15px; background: var(--lime-100); border-top: 2px solid var(--lime-500); }
.indent { padding-left: 18px !important; display: inline-block; }
td.indent { display: table-cell; padding-left: 28px !important; }
table.journal tr.v-first td { border-top: 1px solid var(--slate-200); }
table.journal td { border-bottom: 0; padding-top: 5px; padding-bottom: 5px; }
table.compare td, table.compare th { padding: 7px 8px; font-size: 12.5px; }
.report-grid > div { border-right: 1px solid var(--line); min-width: 0; }
.report-grid > div:last-child { border-right: 0; }
.statement-grid { gap: 0; }
.statement-grid > div:first-child { border-right: 1px solid var(--line); }

/* ---------------- Fee voucher & receipt (screen + print) ---------------- */
.voucher-stack { display: flex; flex-direction: column; gap: 18px; }
.voucher-sheet { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); }
.voucher {
  display: flex; flex-direction: column; padding: 10px 12px; border-right: 1px dashed #777;
  font-size: 11.5px; line-height: 1.35; color: #111; background: #fff; min-width: 0;
}
.voucher:last-child { border-right: 0; }
.voucher .v-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 6px; }
.voucher .v-head b { display: block; font-size: 14px; letter-spacing: .3px; text-transform: uppercase; }
.voucher .v-head span { display: block; font-size: 11px; font-weight: 600; }
.voucher .v-head small { display: block; font-size: 10px; color: #333; }
.voucher .v-head span.copy, .voucher .copy { display: inline-block; margin-top: 5px; padding: 1px 10px; border: 1px solid #111; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.voucher .v-bank { text-align: center; font-size: 10.5px; border-bottom: 1px solid #999; padding-bottom: 5px; margin-bottom: 6px; }
.voucher dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 0 0 6px; }
.voucher dt { color: #444; }
.voucher dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.voucher table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.voucher th, .voucher td { border: 1px solid #333; padding: 3px 6px; }
.voucher th { background: #e9e9e9; text-align: left; font-size: 10.5px; }
.voucher th.num { text-align: right; }
.voucher .tot td { font-weight: 700; }
.voucher .grand td { font-weight: 800; font-size: 12.5px; background: #ededed; }
.voucher .note { font-size: 10px; color: #333; margin-top: 5px; }
.voucher .v-rules { font-size: 9px; line-height: 1.25; }
.voucher .v-rules ol { margin: 1px 0 0; padding-left: 13px; }
.voucher .v-rules li { margin: 0; }
/* Printed challan: the rules small, so a challan with every line still fits its page. */
@media print {
  .voucher-sheet .v-rules, .student-sheet .v-rules { font-size: 7.5pt; line-height: 1.2; }
  .voucher-sheet .voucher td, .voucher-sheet .voucher th, .student-sheet .voucher td, .student-sheet .voucher th { padding-top: 2px; padding-bottom: 2px; }
}
.voucher .v-bankuse { font-size: 10px; margin-top: 8px; padding-top: 4px; border-top: 1px solid #999; }
.voucher .sign { display: flex; justify-content: space-between; margin-top: 22px; font-size: 10px; }
.voucher .sign span { border-top: 1px solid #111; padding-top: 2px; min-width: 75px; text-align: center; }
.voucher .v-foot { display: flex; justify-content: space-between; font-size: 9px; color: #444; margin-top: 8px; padding-top: 3px; border-top: 1px solid #ccc; }
.voucher .copy-bar { margin-top: auto; background: #111; color: #fff; text-align: center; font-weight: 700; font-size: 11px; padding: 3px; letter-spacing: .4px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.voucher .v-foot + .copy-bar { margin-top: 6px; }

/* receipt: single student copy, half an A4 page */
.receipt-sheet { max-width: 720px; }
.receipt-sheet .voucher { border: 1px solid var(--line); padding: 14px 18px; font-size: 12px; }
.receipt-sheet .r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.cut-line { display: none; }
.print-head { text-align: center; margin-bottom: 12px; }
.print-head b { font-size: 16px; }
.print-head h2 { font-size: 15px; margin-top: 4px; }

/* ---------------- Admission challan, salary, certificates ---------------- */
.enroll-table input.input.sm { width: 110px; }
.enroll-table input[type=checkbox] { width: 16px; height: 16px; }
.compact-note { font-size: 13px; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-row img { height: 48px; width: auto; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; }
table.data tr.group-row td { background: var(--slate-100); font-size: 12.5px; padding: 6px 12px; }
table.data tr.sub-total td { font-weight: 700; background: var(--slate-50, #f7f9fa); }
table.data tr.grand td { font-weight: 800; }
.salary-edit input.input.sm { width: 74px; padding: 4px 6px; }
.salary-edit input.input.sm:not(.num) { width: 130px; }
.salary-edit td, .salary-edit th { padding: 6px 6px; white-space: nowrap; }
.salary-sheet td, .salary-sheet th { padding: 5px 6px; }
.salary-sheet .sign-cell { min-width: 70px; }
.letterhead { display: flex; align-items: center; justify-content: center; gap: 14px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 10px; text-align: center; }
.letterhead img { height: 64px; width: auto; }
.letterhead b { display: block; font-size: 20px; letter-spacing: .4px; text-transform: uppercase; }
.letterhead span { display: block; font-weight: 600; }
.letterhead small { display: block; font-size: 11px; color: #333; }
.letterhead.small img { height: 38px; }
.letterhead.small b { font-size: 14px; }
.letterhead.small { padding-bottom: 4px; margin-bottom: 6px; }
.slips { display: grid; gap: 16px; max-width: 760px; }
.slip { background: #fff; border: 1px solid #333; padding: 10px 14px; font-size: 11.5px; color: #111; }
.slip .slip-title { text-align: center; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.slip .r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.slip dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 0 0 6px; }
.slip dt { color: #444; } .slip dd { margin: 0; font-weight: 600; }
.slip table { width: 100%; border-collapse: collapse; }
.slip th, .slip td { border: 1px solid #333; padding: 2px 6px; }
.slip th { background: #e9e9e9; text-align: left; } .slip th.num { text-align: right; }
.slip .tot td { font-weight: 700; } .slip .grand td { font-weight: 800; background: #ededed; }
.slip .note { margin-top: 4px; font-size: 10.5px; }
.slip .sign { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; font-size: 10px; }
.slip .sign span { border-top: 1px solid #111; padding-top: 2px; min-width: 110px; text-align: center; }
.cert-preview { margin-top: 16px; overflow-x: auto; }
/* Certificate = one A4 page on letterhead paper: 4 inch empty space on top for the printed letterhead. */
.certificate { background: #fff; color: #111; width: 210mm; min-height: 297mm; margin: 0 auto; border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 0 22mm 16mm; box-sizing: border-box; display: flex; flex-direction: column; font-size: 14.5pt; line-height: 2; }
.cert-space { height: 2in; flex: none; border-bottom: 1px dashed #c4ccd2; display: flex; align-items: flex-end; justify-content: center; color: #9aa5ad; font-size: 10pt; padding-bottom: 6px; }
.cert-meta { display: flex; justify-content: space-between; font-size: 12pt; margin-top: 8mm; }
/* Date pushed out towards the right edge (6 mm from the paper edge; printers cannot print closer). */
.cert-date { margin-right: -16mm; }
.cert-title { text-align: center; font-size: 21pt; text-decoration: underline; text-underline-offset: 6px; margin: 10mm 0 8mm; letter-spacing: .5px; }
.cert-body { text-align: justify; }
.cert-remarks { margin-top: 6mm; }
.cert-sign { display: flex; justify-content: space-between; margin-top: auto; padding-top: 20mm; }
.cert-sign div { border-top: 1px solid #111; padding-top: 4px; min-width: 55mm; text-align: center; font-size: 12pt; line-height: 1.5; }
.cert-foot { margin-top: 8mm; font-size: 10pt; color: #666; text-align: center; }
.certificate .editable { outline: 1px dashed var(--accent, #9bd31e); outline-offset: 4px; cursor: text; }
.certificate .editable:focus { outline: 2px solid var(--accent, #9bd31e); }

/* ---------------- Dashboard range, clickable cards, follow-ups ---------------- */
.range-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 16px; margin-bottom: 16px; }
.range-bar .field { min-width: 150px; }
a.stat-link { color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.stat-link:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
a.stat-link .sub::after { content: '  →'; color: var(--accent-700, var(--text-2)); font-weight: 600; }
table.data tr.row-overdue td { background: #fdecec; }
table.data tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 #d33; }

/* ---------------- Attendance ---------------- */
.att-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.att-bar .att-count { flex: 1; }
.att-seg button { min-width: 78px; }
.att-seg button[data-k="P"].on { background: #2e9e57; color: #fff; }
.att-seg button[data-k="A"].on { background: #d33d3d; color: #fff; }
.att-seg button[data-k="L"].on { background: #e0a020; color: #fff; }
.att-seg button:disabled { opacity: .75; cursor: not-allowed; }
table.att-table tr.att-A td { background: #fdf0f0; }
table.att-table tr.att-L td { background: #fdf7e8; }

/* ---------------- School calendar ---------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.cal-h { background: var(--slate-100); text-align: center; font-weight: 700; font-size: 12px; padding: 6px 0; text-transform: uppercase; letter-spacing: .4px; }
.cal-day { background: #fff; min-height: 92px; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.cal-day.blank { background: var(--slate-50, #f7f9fa); }
.cal-num { font-weight: 800; font-size: 14px; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent, #9bd31e); }
.cal-day.off { background: #f3f4f6; }
.cal-day.off .cal-num { color: #b42318; }
.cal-day.weekly { background: #f5f5f5; }
.cal-day.k-summer { background: #fff4e0; } .cal-day.k-winter { background: #e8f1fd; } .cal-day.k-sessional { background: #f1ecfb; } .cal-day.k-holiday, .cal-day.k-other { background: #fdecec; }
.cal-tag { display: inline-block; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; background: #e5e7eb; color: #374151; }
.cal-tag.k-summer { background: #f9d9a5; color: #7a4a00; } .cal-tag.k-winter { background: #c9ddfa; color: #123e7a; }
.cal-tag.k-sessional { background: #ddd0f5; color: #46237a; } .cal-tag.k-holiday, .cal-tag.k-other { background: #f7c6c6; color: #8a1c1c; }
.cal-t { color: var(--text-2); font-size: 11px; }
.wk-days { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.alert.off-day { background: #fff4e0; border-color: #f2c37a; color: #6b4300; }
@media screen and (max-width: 860px) { .cal-day { min-height: 64px; font-size: 10px; padding: 4px; } .cal-t { display: none; } }
@media print { .cal-day { min-height: 70px; } .cal-day, .cal-tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------------- Responsive ---------------- */
@media screen and (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { display: none; }
}
@media screen and (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .brand { width: auto; }
  .modules { display: none; }
  :root { --topbar-h: 60px; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: auto; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 35; background: rgba(18, 26, 32, .4); }
  .form-grid.cols-3-form, .form-grid.cols-4-form { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .report-grid > div, .statement-grid > div:first-child { border-right: 0; }
  .receipt-sheet .r-grid { grid-template-columns: 1fr; }
  .extra-row { grid-template-columns: 1fr 110px auto; }
  .cash-flow { grid-template-columns: 1fr 1fr; }
  .cash-flow .cf { border-bottom: 1px solid var(--line); }
  .filters .or { display: none; }
  .mode-strip { grid-template-columns: 1fr 1fr; }
  .mode-strip > div { border-bottom: 1px solid var(--line); }
  .signatures { grid-template-columns: 1fr; gap: 36px; }
  .sidebar .mobile-modules { display: flex !important; }
  .page { padding: 16px; }
  .cols-3, .cols-2, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kv, .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .user-chip .who { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .voucher-sheet { grid-template-columns: 1fr; }
  .voucher { border-right: 0; border-bottom: 1px dashed #9aa5ad; }
}
@media screen and (max-width: 520px) {
  .cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 20px; }
  .filters .field, .filters .field.wide { width: 100%; }
}
.mobile-modules { display: none; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.mobile-modules a { padding: 6px 12px; border-radius: 999px; background: var(--slate-800); color: var(--slate-300); font-weight: 600; font-size: 12.5px; }
.mobile-modules a.active { background: var(--accent); color: var(--accent-ink); }

/* ---------------- Print ---------------- */
@media print {
  /* Compact print: ~0.4 inch margins, 10-11px text, tight rows, small header, smart page breaks. */
  @page { margin: 6mm; }
  body { background: #fff; font-size: 10.5px; }
  table.data { font-size: 10px; }
  table.data th, table.data td { padding: 2px 5px !important; line-height: 1.25; }
  table.data td .sub { font-size: 9px; }
  table.data thead { display: table-header-group; }
  table.data tfoot { display: table-row-group; }
  table.data tr { break-inside: avoid; page-break-inside: avoid; }
  .print-head { margin-bottom: 4px; }
  .print-head b { font-size: 13px; }
  .print-head h2 { font-size: 12px; margin: 1px 0 0; }
  .print-head div { font-size: 10px; }
  .card-head { padding: 4px 0 !important; break-after: avoid; page-break-after: avoid; }
  .card-head h2 { font-size: 12px; }
  .card-body { padding: 4px 0 !important; }
  .summary-strip > div { padding: 3px 6px; }
  .summary-strip span { font-size: 8.5px; }
  .summary-strip b { font-size: 12px; }
  .signatures { padding: 26px 8px 4px; gap: 16px; break-inside: avoid; }
  .signatures div { font-size: 10px; }
  .page-head { margin-bottom: 4px; }
  .badge { padding: 0 4px; font-size: 9px; border: 0; }
  /* Salary sheet: whole width, group subtotals kept with their rows. */
  .salary-sheet td, .salary-sheet th { padding: 2px 4px !important; font-size: 9.5px; }
  .salary-sheet .sign-cell { min-width: 22mm; }
  .salary-sheet tr.sub-total, .salary-sheet tr.grand { break-before: avoid; }
  /* Salary slips: two per A4 page. */
  .slips { display: block; max-width: none; }
  .slip { height: 136mm; overflow: hidden; margin-bottom: 5mm; break-inside: avoid; font-size: 10px; padding: 4mm 6mm; }
  .slip:nth-child(2n) { break-after: page; page-break-after: always; }
  .slip:last-child { break-after: auto; page-break-after: auto; }
  /* Certificate: one A4 page on the letterhead. */
  .certificate { border: 0; box-shadow: none; width: 210mm; height: 296mm; min-height: 0; overflow: hidden; margin: 0; }
  .cert-space { border: 0; } .cert-space span { display: none; }
  .certificate .editable { outline: 0; }
  .cert-preview { margin: 0; overflow: visible; }
  .topbar, .sidebar, .no-print, .toast-host, .preview-bar { display: none !important; }
  .app { display: block; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #999; }
  table.data th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block !important; }
  .filters, .row-actions, .seg { display: none !important; }
  .table-wrap { overflow: visible !important; max-height: none !important; }
  table.data th { position: static; }
  .card { border: 0; }
  /* Fee voucher: one A4 landscape page per student, three copies side by side. */
  .voucher-stack { gap: 0; }
  .voucher-sheet {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; border: 0;
    height: 194mm; overflow: hidden; break-inside: avoid; page-break-inside: avoid;
    break-after: page; page-break-after: always;
  }
  .voucher-sheet:last-child { break-after: auto; page-break-after: auto; }
  .voucher-sheet .voucher { font-size: 9.5pt; padding: 0 4mm; border-right: 1px dashed #555 !important; border-bottom: 0 !important; }
  .voucher-sheet .voucher:last-child { border-right: 0 !important; }
  /* Receipt: student copy in the top half of an A4 page. */
  .receipt-sheet { max-width: none; }
  .receipt-sheet .voucher { height: 132mm; overflow: hidden; border: 1px solid #333; padding: 4mm 6mm; font-size: 10pt; }
  .cut-line { display: block; text-align: center; font-size: 9pt; color: #666; border-top: 1px dashed #666; margin-top: 3mm; padding-top: 1mm; }
  .grid.cols-3, .grid.cols-2 { display: block; }
  a { color: inherit; }
}
.print-only { display: none; }
/* Absent calls: family groups */
table.absent-table tbody.fam-group { border-top: 2px solid var(--line); }
table.absent-table tr.sib-row td { background: var(--slate-50, #f7f9fa); color: var(--text-2); }
/* Books & Uniform: searchable item list */
.item-pick { position: relative; min-width: 240px; }
.item-list { position: static; margin-top: 3px; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); }
.item-opt { padding: 7px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--slate-100); }
.item-opt.active, .item-opt:hover { background: var(--lime-100, #eef9d6); }
.item-none { padding: 8px 10px; color: var(--muted); font-size: 13px; }
/* Funds overview: the total line */
table.funds-total { margin-top: 14px; border-top: 2px solid var(--line); }
table.funds-total tr.grand td { font-size: 17px; font-weight: 800; background: var(--lime-100, #eef9d6); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Sortable report headings */
table.data thead th { cursor: pointer; user-select: none; }
table.data thead th:empty { cursor: default; }
table.data thead th[data-sort="asc"]::after { content: ' ▲'; font-size: 9px; }
table.data thead th[data-sort="desc"]::after { content: ' ▼'; font-size: 9px; }
@media print { table.data thead th[data-sort]::after { content: ''; } }
.seg.att-count button .badge { margin-left: 4px; }
.summary-strip.funds-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------------- Timetable ---------------- */
.tt-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.tt-grid th, .tt-grid td { border: 1px solid var(--line); padding: 5px 6px; text-align: center; vertical-align: middle; }
.tt-grid tr:first-child th { background: var(--slate-100); font-weight: 700; font-size: 12px; }
.tt-grid th small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.tt-grid th.tt-day { width: 92px; text-align: left; background: var(--slate-100); }
.tt-grid .tt-brk { width: 52px; background: repeating-linear-gradient(45deg, #f6f7f9, #f6f7f9 6px, #eceef2 6px, #eceef2 12px); color: var(--muted); font-size: 11px; font-weight: 600; }
.tt-grid td.tt-off { background: #f1f2f4; }
.tt-cell { position: relative; height: 54px; line-height: 1.2; }
.tt-cell b { display: block; font-size: 12.5px; }
.tt-cell span { display: block; font-size: 11px; color: #374151; }
.tt-cell small { display: block; font-size: 10px; color: #6b7280; }
.tt-cell hr { border: 0; border-top: 1px dashed #b91c1c; margin: 3px 0; }
.tt-cell.tt-free { background: #fff; }
.tt-cell.tt-clash { outline: 3px solid var(--red-600); outline-offset: -3px; }
.tt-cell.tt-edit { cursor: pointer; }
.tt-cell.tt-edit:hover, .tt-cell.tt-edit:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.tt-cell.tt-picked { outline: 3px dashed var(--blue-600) !important; outline-offset: -3px; }
.tt-lock { position: absolute; top: 2px; right: 3px; font-style: normal; opacity: .6; }
.tt-lock .i { width: 11px; height: 11px; }
.tt-vline { align-self: end; padding-bottom: 8px; font-size: 13px; }
.tt-gen { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tt-gen-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tt-gen-actions select { height: 36px; }
.tt-problems { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.tt-problems li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.tt-problems li.err { background: var(--red-100); color: #8f2525; }
.tt-problems li.warn { background: var(--amber-100); color: #6b4300; }
.tt-problems .i { flex: none; margin-top: 1px; }
.tt-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 8px; }
.tt-toolbar select { height: 32px; min-width: 180px; }
.tt-split { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.tt-h3 { font-size: 14px; margin: 0 0 6px; }
.tt-log { max-height: 260px; overflow: auto; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; }
.tt-log > div { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tt-log small { display: block; color: var(--muted); }
tr.tt-miss td { background: #fff7ed; }
tr.tt-unused td { opacity: .6; }
tr.tt-active-row td { background: #f0fdf4; }
.tt-days { display: grid; gap: 6px; max-width: 360px; }
.tt-dayrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tt-dayrow input[type=number] { width: 110px; }
.tt-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.12); }
.tt-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; margin: 1px 0; border: 1px solid rgba(0,0,0,.08); }
.tt-pair { display: flex; gap: 6px; flex-wrap: wrap; }
.tt-pair select { min-width: 130px; }
.tt-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 6px; max-height: 190px; overflow: auto; }
.tt-avail { border-collapse: collapse; margin-top: 6px; font-size: 11px; }
.tt-avail th { padding: 2px 4px; font-weight: 600; color: var(--muted); }
.tt-avail td { width: 30px; height: 22px; border: 1px solid var(--line); cursor: pointer; background: #ecfdf5; }
.tt-avail td.na { background: var(--red-600); }
.tt-avail td.x { background: #f1f2f4; cursor: default; }
.tt-block + .tt-block { margin-top: 14px; }
@media (max-width: 760px) { .tt-split { grid-template-columns: 1fr; } .tt-grid { min-width: 720px; } }
@media print {
  .tt-block { break-after: page; page-break-after: always; border: 0; }
  .tt-block:last-child { break-after: auto; page-break-after: auto; }
  .tt-grid { font-size: 10px; }
  .tt-grid th, .tt-grid td { padding: 3px 3px; border-color: #777; }
  .tt-cell { height: 46px; }
  .tt-cell b { font-size: 10.5px; } .tt-cell span { font-size: 9.5px; } .tt-cell small { font-size: 8.5px; }
  .tt-grid td, .tt-grid th, .tt-brk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-lock { display: none; }
}
.filters .field:has(> #t), .filters .field:has(> #unit) { min-width: 280px; }
.filters #t, .filters #unit { width: 100%; }

/* ---------------- WhatsApp ---------------- */
.wa-grid { align-items: start; }
.wa-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px 0; }
.wa-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.wa-slider { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--slate-300); transition: background .15s; }
.wa-slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.wa-toggle input:checked + .wa-slider { background: #25a35a; }
.wa-toggle input:checked + .wa-slider::after { transform: translateX(20px); }
.wa-toggle input:focus-visible + .wa-slider { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.wa-toggle small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.wa-master { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--slate-100); }
.wa-subs { display: grid; gap: 2px; padding-left: 8px; }
.wa-subs.off { opacity: .55; }
.wa-qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.wa-qr img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; }
.wa-qr ol { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
.wa-days input { width: 74px; }
.wa-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.wa-tpls textarea { font-family: inherit; font-size: 13px; }
.wa-text { white-space: pre-wrap; font-size: 12px; max-height: 92px; overflow: auto; min-width: 220px; max-width: 420px; }
@media (max-width: 760px) { .wa-tpls { grid-template-columns: 1fr; } }

/* ---------------- Academics (AI) ---------------- */
.ai-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
  color: #5b21b6; background: linear-gradient(135deg, #ede9fe, #e0f2fe); border: 1px solid #ddd6fe; }
.ai-chip .i { width: 13px; height: 13px; }
.btn.ai-btn { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; box-shadow: 0 4px 14px rgba(99, 102, 241, .28); }
.btn.ai-btn:hover { filter: brightness(1.08); }
.btn.ai-btn:disabled { opacity: .5; box-shadow: none; }
.link-btn.ai-link { color: #6d28d9; display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; }
.link-btn.ai-link .i { width: 12px; height: 12px; }
.ai-missing { margin-bottom: 14px; }

.ac-hero { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: center; padding: 26px 28px; border-radius: 16px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(1200px 300px at 0% 0%, rgba(167, 139, 250, .35), transparent 60%), linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #1d4ed8 100%); box-shadow: 0 10px 30px rgba(30, 27, 75, .25); }
.ac-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #c4b5fd; }
.ac-hero h1 { font-size: 26px; margin: 6px 0 6px; letter-spacing: -.3px; }
.ac-hero p { margin: 0; color: #dbeafe; max-width: 620px; line-height: 1.5; }
.ac-ai-card { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(4px); }
.ac-ai-top { display: flex; align-items: center; gap: 8px; }
.ac-ai-top a { margin-left: auto; color: #e0e7ff; font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }
.ac-ai-card.on .ai-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.ac-meter { height: 7px; background: rgba(255, 255, 255, .18); border-radius: 99px; margin: 10px 0 6px; overflow: hidden; }
.ac-meter span { display: block; height: 100%; background: linear-gradient(90deg, #a78bfa, #60a5fa); border-radius: 99px; }
.ac-ai-card small { color: #c7d2fe; }
.ac-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ac-tool { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.ac-tool:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .1); border-color: #c4b5fd; text-decoration: none; }
.ac-tool-top { display: flex; justify-content: space-between; align-items: center; }
.ac-tool-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #4338ca; background: linear-gradient(135deg, #eef2ff, #e0f2fe); }
.ac-tool h3 { font-size: 16px; margin: 4px 0 0; }
.ac-tool p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.45; flex: 1; }
.ac-tool-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; }
.ac-go { color: #4f46e5; font-weight: 700; }
.ac-recent a { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.ac-recent a:hover { background: var(--slate-100); text-decoration: none; }
.ac-recent small { display: block; color: var(--muted); font-size: 12px; }
.ac-recent time { font-size: 12px; color: var(--muted); }
.ac-r-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--slate-100); color: var(--text-2); }
.ac-steps { margin: 0; padding-left: 20px; line-height: 1.8; }

.ac-make { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 16px 16px; }
.ac-make-opt { border: 1px solid #ddd6fe; border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, #faf5ff, #fff); }
.ac-make-opt.wide { grid-column: 1 / -1; }
.ac-make-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ac-make-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ac-make-row .field.grow { flex: 1; min-width: 180px; }
.ac-drop { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px dashed #c4b5fd; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 13px; background: #fff; flex: 1; min-width: 220px; }
.ac-drop.over { background: #f5f3ff; border-color: #7c3aed; }
.ac-drop .i { color: #7c3aed; width: 22px; height: 22px; }
.ac-thumbs { display: flex; gap: 6px; }
.ac-thumb { position: relative; }
.ac-thumb img { width: 46px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ac-thumb button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--red-600); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }
.ac-ed { padding: 0 16px 16px; }

.rte { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.rte-bar { display: flex; gap: 2px; flex-wrap: wrap; padding: 6px; background: var(--slate-100); border-bottom: 1px solid var(--line); }
.rte-bar button { min-width: 32px; height: 30px; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); padding: 0 8px; }
.rte-bar button:hover { background: #fff; box-shadow: var(--shadow); }
.rte-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.rte-body { min-height: 380px; padding: 18px 22px; outline: none; }
.doc-text { font-size: 14px; line-height: 1.6; color: #1f2937; }
.doc-text h2, .doc-text h3 { font-size: 15.5px; color: #312e81; margin: 16px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #e0e7ff; }
.doc-text h4 { font-size: 14px; margin: 12px 0 4px; }
.doc-text p { margin: 4px 0 8px; }
.doc-text ul, .doc-text ol { margin: 4px 0 8px; padding-left: 24px; }
.doc-text table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.doc-text th, .doc-text td { border: 1px solid #cbd5e1; padding: 5px 8px; text-align: left; vertical-align: top; }
.doc-text th { background: #f1f5f9; }
.doc-title, .rc-title { text-align: center; font-weight: 800; font-size: 17px; letter-spacing: .5px; text-transform: uppercase; margin: 6px 0 10px; }
table.doc-meta { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 12.5px; }
table.doc-meta th, table.doc-meta td { border: 1px solid #94a3b8; padding: 4px 8px; text-align: left; }
table.doc-meta th { background: #f1f5f9; width: 14%; white-space: nowrap; }

/* paper editor */
.ac-qtypes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ac-qtype { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 5px; font-size: 12.5px; }
.ac-qtype label { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--text-2); }
.ac-qtype input { width: 64px; height: 30px; }
.ac-instr { padding: 12px 16px 0; display: block; }
.pq-sec { margin: 14px 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pq-sec-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: linear-gradient(90deg, #eef2ff, #f8fafc); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pq-num { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #4f46e5; color: #fff; font-weight: 800; font-size: 13px; }
.pq-title { flex: 1; min-width: 180px; font-weight: 700; border: 1px solid transparent; background: transparent; height: 32px; }
.pq-title:focus { border-color: var(--line); background: #fff; }
.pq-sec-head label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.pq-sec-head label input { width: 62px; height: 30px; }
.pq-sec-tot { font-size: 12.5px; color: #4338ca; }
.pq-q { display: grid; grid-template-columns: 28px 1fr 104px; gap: 8px; padding: 10px 12px; border-bottom: 1px dashed var(--line); }
.pq-qn { font-weight: 700; color: var(--muted); padding-top: 7px; }
.pq-body { display: grid; gap: 6px; }
.pq-body textarea { resize: none; overflow: hidden; min-height: 34px; line-height: 1.45; font-family: inherit; }
.pq-text { font-weight: 600; }
.pq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pq-opts label { display: flex; align-items: center; gap: 6px; }
.pq-opts span { font-weight: 700; color: var(--muted); width: 18px; }
.pq-opts input { flex: 1; height: 32px; }
.pq-ans { display: flex; gap: 8px; align-items: flex-start; }
.pq-ans span { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: #15803d; padding-top: 9px; }
.pq-ans textarea { flex: 1; background: #f0fdf4; border-color: #bbf7d0; font-size: 13px; }
.pq-side { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; justify-content: flex-end; }
.pq-side input { width: 100%; height: 32px; }
.pq-add { margin: 10px 12px; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--slate-100); }
.icon-btn.danger { color: var(--red-600); }
.icon-btn.ai { color: #6d28d9; border-color: #ddd6fe; background: #faf5ff; }
.icon-btn .i { width: 15px; height: 15px; }

/* printed paper */
.exam-head h2 { text-align: center; font-size: 17px; margin: 4px 0 8px; text-transform: uppercase; letter-spacing: .4px; }
.exam-name { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 12.5px; }
.key-tag { text-align: center; font-weight: 800; color: #b91c1c; border: 2px solid #b91c1c; padding: 3px; margin: 6px 0; }
.exam-instr { font-size: 12.5px; margin: 6px 0 10px; }
.exam-sec { margin-top: 10px; break-inside: auto; }
.exam-sec-head { display: flex; justify-content: space-between; border-bottom: 1px solid #333; padding-bottom: 2px; margin-bottom: 6px; font-size: 13.5px; }
.exam-q { display: grid; grid-template-columns: 24px 1fr; gap: 4px; margin: 5px 0 8px; font-size: 13px; break-inside: avoid; }
.eq-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 10px; margin-top: 3px; }
.eq-ans { margin-top: 3px; color: #166534; font-style: italic; }
.eq-lines span { display: block; border-bottom: 1px solid #bbb; height: 20px; }
.exam-end { text-align: center; margin-top: 16px; font-size: 12px; }

/* exams & marks */
.ac-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.ac-subrows { display: grid; gap: 6px; }
.ac-subrow { display: grid; grid-template-columns: 1fr 110px 32px; gap: 6px; max-width: 460px; }
.marks-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.marks-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.marks-grid th { position: sticky; top: 0; background: var(--slate-100); z-index: 1; padding: 8px 6px; font-size: 12px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.marks-grid th small { display: block; font-weight: 500; color: var(--muted); }
.marks-grid td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.marks-grid .mg-name { text-align: left; min-width: 170px; position: sticky; left: 0; background: #fff; }
.marks-grid th.mg-name { background: var(--slate-100); z-index: 2; }
.mg-name small { display: block; color: var(--muted); font-size: 11px; }
.mg-cell { min-width: 92px; }
.mg-cell input[type=number] { width: 60px; height: 32px; text-align: center; padding: 0 4px; }
.mg-cell input.bad { border-color: var(--red-600); background: #fef2f2; }
.mg-cell label { display: block; font-size: 10px; color: var(--muted); }
.mg-cell label input { width: 12px; height: 12px; vertical-align: -2px; }
.mg-cell.abs { background: #fff7ed; }
.marks-grid tbody tr:hover td { background: #f8fafc; }
.ac-ai-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); background: linear-gradient(90deg, #faf5ff, #fff); }
.ac-ai-bar > span:nth-child(2) { flex: 1; min-width: 220px; font-size: 13px; color: var(--text-2); }
.rc-c { position: relative; }
.rc-c textarea { width: 100%; min-width: 300px; resize: vertical; font-family: inherit; font-size: 13px; line-height: 1.45; }
.rc-src { position: absolute; top: -7px; right: 6px; font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: #ede9fe; color: #6d28d9; }
.report-card { break-after: page; page-break-after: always; padding: 4mm 2mm; font-size: 12.5px; }
.report-card:last-child { break-after: auto; page-break-after: auto; }
.rc-marks { width: 100%; border-collapse: collapse; margin: 8px 0; }
.rc-marks th, .rc-marks td { border: 1px solid #64748b; padding: 5px 8px; text-align: center; }
.rc-marks td:first-child, .rc-marks th:first-child { text-align: left; }
.rc-marks thead th, .rc-marks tfoot td { background: #eef2ff; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rc-sum { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #64748b; margin: 8px 0; }
.rc-sum > div { padding: 6px 10px; border-right: 1px solid #64748b; }
.rc-sum > div:last-child { border-right: 0; }
.rc-sum span { display: block; font-size: 10.5px; text-transform: uppercase; color: #475569; }
.rc-sum b { font-size: 15px; }
.rc-comment { border: 1px solid #64748b; padding: 8px 10px; min-height: 70px; }
.rc-comment p { margin: 4px 0 0; line-height: 1.5; }
.rc-sign { display: flex; justify-content: space-between; margin-top: 46px; }
.rc-sign span { border-top: 1px solid #333; padding-top: 3px; min-width: 150px; text-align: center; }

/* weak students */
.ws-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.ws-card { border: 1px solid #fecaca; border-left: 4px solid var(--red-600); border-radius: 12px; padding: 12px 14px; background: #fff; }
.ws-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ws-head small { display: block; color: var(--muted); font-size: 12px; }
.ws-subs { display: grid; gap: 6px; margin-top: 10px; }
.ws-sub { display: grid; grid-template-columns: 120px auto 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.ws-sub > span:last-child { color: var(--text-2); }
.ws-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 34px; }
.ws-bars i { width: 9px; background: #94a3b8; border-radius: 2px 2px 0 0; }
.ws-bars i.low { background: var(--red-600); }
.ws-bars i.abs { background: #fdba74; }
em.up { color: var(--green-600); font-style: normal; font-weight: 700; }
em.down { color: var(--red-600); font-style: normal; font-weight: 700; }

/* assignments */
.ac-asg { align-items: start; }
.asg-list { max-height: 70vh; overflow: auto; }
.asg-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.asg-row small { display: block; color: var(--muted); font-size: 11px; }
.asg-row textarea { width: 100%; font-size: 13px; font-family: inherit; resize: vertical; }
.cp-pair { margin: 10px 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cp-head { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--slate-100); flex-wrap: wrap; }
.cp-score { margin-left: auto; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #fef3c7; color: #92400e; font-size: 12px; }
.cp-score.mid { background: #ffedd5; color: #9a3412; }
.cp-score.hi { background: var(--red-100); color: var(--red-600); }
.cp-texts { display: grid; grid-template-columns: 1fr 1fr; }
.cp-texts > div { padding: 10px 12px; font-size: 12.5px; line-height: 1.55; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.cp-texts > div + div { border-left: 1px solid var(--line); }
.cp-texts mark { background: #fde68a; padding: 0 1px; border-radius: 2px; }
.cp-ai .alert { margin: 0 12px 12px; }
.field.inline-field { flex-direction: row; align-items: center; gap: 6px; }

/* daily diary */
.dy-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.dy-form { position: sticky; top: calc(var(--topbar-h) + 12px); }
.dy-form textarea { width: 100%; font-family: inherit; }
.dy-feed { display: grid; gap: 14px; }
.dy-missing .badge { margin: 2px 2px 0 0; }
.dy-class .card-head { background: linear-gradient(90deg, #eef2ff, #fff); }
.dy-entries { display: grid; gap: 10px; }
.dy-entry { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; break-inside: avoid; }
.dy-top { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.dy-sub { font-weight: 800; color: #3730a3; }
.dy-act { margin-left: auto; display: flex; gap: 4px; }
.dy-line { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 3px 0; font-size: 13.5px; }
.dy-line b { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding-top: 2px; }
.dy-line p { margin: 0; }
.dy-line.hw b { color: #b45309; }
.dy-line.nt b { color: #be123c; }
.dy-day + .dy-day { margin-top: 18px; }
.dy-date { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.dy-date small { color: var(--muted); font-weight: 500; }
.dy-day .dy-class + .dy-class { margin-top: 10px; }

/* AI working cover */
.ai-busy { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); }
.ai-busy-card { display: grid; justify-items: center; gap: 6px; background: #fff; padding: 24px 34px; border-radius: 16px; box-shadow: var(--shadow-lg); text-align: center; }
.ai-busy-card span { color: var(--muted); font-size: 12.5px; }
.ai-orb { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: conic-gradient(from 0deg, #7c3aed, #2563eb, #06b6d4, #7c3aed); animation: ai-spin 1.4s linear infinite; }
.ai-orb .i { width: 26px; height: 26px; animation: ai-spin 1.4s linear infinite reverse; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { .ac-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ac-qtypes { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dy-layout { grid-template-columns: 1fr; } .dy-form { position: static; } }
@media (max-width: 760px) {
  .ac-hero { grid-template-columns: 1fr; padding: 20px; } .ac-tools, .ac-make, .ws-list, .cp-texts { grid-template-columns: 1fr; }
  .ac-qtypes { grid-template-columns: 1fr 1fr; } .pq-q { grid-template-columns: 22px 1fr; } .pq-side { grid-column: 2; justify-content: flex-start; } .pq-side input { width: 90px; }
  .asg-row { grid-template-columns: 1fr; } .ws-sub { grid-template-columns: 1fr; }
}
@media print {
  .ac-hero, .ai-busy { display: none !important; }
  .doc-text { font-size: 12px; } .doc-text h3 { color: #000; }
  .dy-layout { display: block; } .dy-entry { border-color: #999; } .dy-class .card-head { background: none; }
}
/* Academics: inputs outside the usual .field wrapper get the same look. */
.pq-sec input:not([type=checkbox]), .pq-sec textarea, .ac-qtype input, .ac-subrow input, .mg-cell input[type=number], .rc-c textarea, .asg-row textarea, #add-type {
  border: 1px solid var(--slate-300); border-radius: 8px; background: #fff; outline: none; padding: 0 9px; transition: border-color .12s, box-shadow .12s;
}
.pq-sec textarea, .rc-c textarea, .asg-row textarea { padding: 7px 9px; }
#add-type { height: 36px; }
.pq-sec input:focus, .pq-sec textarea:focus, .ac-qtype input:focus, .ac-subrow input:focus, .mg-cell input:focus, .rc-c textarea:focus, .asg-row textarea:focus {
  border-color: var(--lime-500); box-shadow: 0 0 0 3px rgba(140, 198, 63, .22);
}
.pq-sec .pq-title { border-color: transparent; background: transparent; }
.pq-ans textarea { background: #f0fdf4; border-color: #bbf7d0; }
.mg-cell input.bad { border-color: var(--red-600); background: #fef2f2; }
/* Diary attachments */
.dy-drop { min-width: 0; }
.dy-up { display: grid; gap: 6px; margin-top: 6px; }
.dy-chip { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12.5px; }
.dy-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.dy-chip > .i { width: 26px; height: 26px; color: #b91c1c; }
.dy-chip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dy-chip small { display: block; color: var(--muted); font-size: 11px; }
.dy-chip button { border: 0; background: var(--slate-100); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.dy-chip.busy { opacity: .6; }
.dy-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dy-pic img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.dy-pic:hover img { box-shadow: var(--shadow); }
.dy-doc { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #fecaca; background: #fef2f2; border-radius: 10px; color: var(--text); max-width: 260px; }
.dy-doc .i { color: #b91c1c; width: 22px; height: 22px; flex: none; }
.dy-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.dy-doc small { display: block; font-weight: 400; color: var(--muted); }
.dy-doc:hover { text-decoration: none; border-color: #f87171; }
@media print { .dy-pic img { width: 150px; height: auto; max-height: 200px; object-fit: contain; } }

/* New admission badge (lists, reports) and tag (challan / receipt print) */
.badge.adm-badge { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; white-space: nowrap; }
.adm-tag { text-align: center; font-weight: 800; letter-spacing: 1.5px; font-size: 11px; color: #5b21b6; border: 1.5px solid #5b21b6; border-radius: 4px; padding: 2px 6px; margin: 4px auto 6px; width: max-content;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.voucher table tr.minus td { color: #475569; font-style: italic; }
@media print { .badge.adm-badge { border: 1px solid #5b21b6; } }
/* New Student: family search */
.fam-search { border: 1px solid #c7d2fe; background: linear-gradient(180deg, #eef2ff, #fff); }
.fam-search .fs-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fam-search .fs-row .field { flex: 1; min-width: 260px; }
.fs-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin-top: 12px; }
.fs-fam { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; display: grid; gap: 8px; }
.fs-fam-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.fs-fam-head small { display: block; color: var(--muted); font-size: 12px; }
.fs-kids { display: grid; gap: 4px; font-size: 13px; }
.fs-kids div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; background: var(--slate-100); border-radius: 7px; }
.fs-kids span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fs-chosen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Searchable staff picker (Stationery Stock) */
.sp { position: relative; }
.sp-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 280px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; }
.sp-opt { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.sp-opt small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sp-opt.on, .sp-opt:hover { background: var(--slate-100); }
.sp-none { padding: 10px; color: var(--muted); font-size: 13px; }
.modal .sp-list { max-height: 200px; }
/* Several items in one Stock In / Out */
.il-table td, .il-table th { vertical-align: middle; }
.il-table td:first-child { width: 36px; color: var(--muted); }
.il-table select.input.sm { min-width: 260px; height: 34px; }
.il-table input.input.sm { height: 34px; }
.il-add { margin-top: 10px; }

/* ---------------- Events ---------------- */
.ev-h { font-size: 15px; margin: 4px 0 10px; display: flex; gap: 8px; align-items: baseline; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ev-card { display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s; }
.ev-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .1); text-decoration: none; }
.ev-card.on { border-left: 4px solid #22a55a; }
.ev-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ev-card h3 { margin: 0; font-size: 16px; }
.ev-card-top small { color: var(--muted); font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.ev-card-top small .i { width: 13px; height: 13px; }
.ev-card p { margin: 0; color: var(--text-2); font-size: 13px; }
.ev-nums { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px dashed var(--line); padding-top: 10px; gap: 6px; }
.ev-nums span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.ev-nums b { font-size: 14px; }
.ev-nums small { display: block; color: var(--muted); font-size: 11px; }
.summary-strip.ev-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.summary-strip small { display: block; color: var(--muted); font-size: 11px; }
.ev-report { padding: 18px 22px; }
.ev-rep-sum { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid #94a3b8; margin: 10px 0 14px; }
.ev-rep-sum > div { padding: 8px 10px; border-right: 1px solid #94a3b8; }
.ev-rep-sum > div:last-child { border-right: 0; }
.ev-rep-sum span { display: block; font-size: 10.5px; text-transform: uppercase; color: #475569; }
.ev-rep-sum b { font-size: 15px; }
.ev-rep-sum .net { background: #f0fdf4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ev-rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ev-report h3 { font-size: 14px; margin: 12px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #cbd5e1; }
.ev-report h4 { font-size: 12.5px; margin: 10px 0 4px; color: #475569; }
table.ev-rt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.ev-rt th, table.ev-rt td { border: 1px solid #cbd5e1; padding: 4px 8px; text-align: left; }
table.ev-rt .num { text-align: right; }
table.ev-rt thead th, table.ev-rt tfoot td { background: #f1f5f9; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ev-slip-name { text-align: center; font-weight: 800; font-size: 15px; letter-spacing: .3px; margin: 4px 0 6px; padding: 4px; border: 1.5px solid #333; border-radius: 4px; }
@media (max-width: 760px) { .ev-nums, .ev-rep-sum, .summary-strip.ev-strip { grid-template-columns: repeat(2, 1fr); } .ev-rep-grid { grid-template-columns: 1fr; } }
@media print { .ev-report { padding: 0; border: 0; box-shadow: none; } .ev-rep-grid { gap: 12px; } }

/* Module tabs in the header row's free space; the strip below only when needed */
.modules.modules-top { order: 0; flex: 1 1 0; height: 60px; border-top: 0; position: relative; min-width: 0; }
.modules { position: relative; }
.modules.empty { display: none; }
.ev-print-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ev-print-bar b { display: inline-flex; gap: 6px; align-items: center; margin-right: auto; }
.ev-print-bar select { height: 36px; border: 1px solid var(--slate-300); border-radius: 8px; padding: 0 8px; background: #fff; }
.ev-plist table.ev-rt { font-size: 11.5px; }
.ev-plist table.ev-rt tr { break-inside: avoid; }
.ev-disc { display: block; font-size: 11px; color: #7c3aed; font-weight: 600; }
/* Collections, one line per person: their receipts open under it */
tr.ev-sub > td { background: var(--surface-2, #f6f7f4); }
tr.ev-sub table.data { background: transparent; }
.ev-rep-sum small { display: block; font-size: 10.5px; color: #475569; }
table.ev-pay td { vertical-align: middle; }
/* Exams: subjects per class, class subjects setup, student result history */
.ex-class { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.ex-class-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.cs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
.cs-list { padding: 6px; max-height: 70vh; overflow: auto; }
.cs-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.cs-list button:hover { background: var(--slate-100); }
.cs-list button.on { background: #eef2ff; color: #3730a3; font-weight: 700; }
.ac-subrow.cs-row { grid-template-columns: 18px 1fr 110px 32px 32px; max-width: 560px; align-items: center; }
.cs-head { display: grid; grid-template-columns: 18px 1fr 110px 70px; gap: 6px; max-width: 560px; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.cs-grip { color: var(--muted); font-size: 12px; }
.ac-subrow input { height: 34px; border: 1px solid var(--slate-300); border-radius: 8px; padding: 0 9px; }
.sr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-matrix th small { display: block; font-weight: 500; color: var(--muted); }
.sr-matrix tr.sr-total td { background: var(--slate-100); font-weight: 700; }
.sr-sum { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
@media (max-width: 860px) { .cs-layout { grid-template-columns: 1fr; } }
@media print { .sr-exam { break-inside: avoid; } }
.sr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Student Result History: printing one exam's card hides the history; the plain Print shows only the history. */
@media print {
  .view:not(.print-one) #one-card { display: none !important; }
  .view.print-one #out, .view.print-one .page-head { display: none !important; }
}

/* Bulk waive / delete */
.bk-action button { display: inline-flex; gap: 6px; align-items: center; }
.bk-preview.delete { border-color: #fecaca; }
.bk-preview.waive { border-color: #fde68a; }

/* Fee posting: attach pending Annual / Stationery */
.attach-tick { display: flex; gap: 10px; align-items: flex-start; }
.attach-tick input { margin-top: 3px; }
.attach-tick > span { display: flex; flex-direction: column; gap: 2px; }
.hide-att .att-col { display: none; }
/* Voucher print: copy ticks; student copies two on a page */
.copy-ticks .card-body { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
/* Student copies: two students side by side on one A4 landscape page, cut from the middle */
.student-sheet { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); background: #fff; border: 1px solid var(--line); max-width: 1000px; }
.student-sheet .voucher { border-right: 0; }
.student-sheet .cut-line { display: flex; align-items: center; writing-mode: vertical-rl; font-size: 11px; color: #666; border-left: 1px dashed #666; padding: 0 3px; }
@media print {
  .student-sheet { border: 0; max-width: none; height: 194mm; overflow: hidden; break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always; }
  .student-sheet:last-child { break-after: auto; page-break-after: auto; }
  .voucher-sheet + .student-sheet { break-before: page; page-break-before: always; }
  .student-sheet .voucher { font-size: 9.5pt; padding: 0 6mm; border: 0 !important; }
  .student-sheet .cut-line { margin: 0; border-top: 0; padding: 0 1mm; }
}
/* Reports in print: use the whole page width and keep rows to one or two lines (fewer pages). */
@media print {
  .page:has(.print-head) > .page-head { display: none; }
  table.data th { width: auto !important; }
  table.data td.num, table.data th.num, table.data td:first-child { white-space: nowrap; }
  table.data td .sub { display: inline; margin-left: 4px; }
  table.data .ref { font-size: 9px; }
  table.data td .sub::before { content: "· "; }
  table.data td .name + .sub::before, table.data td a.name + .sub::before { content: "— "; }
  .cash-flow { display: flex; border: 1px solid #999; }
  .cash-flow .cf { flex: 1 1 0; padding: 3px 6px; }
  .cash-flow .cf span { font-size: 8px; letter-spacing: 0; }
  .cash-flow .cf b { font-size: 12px; margin: 0; }
  .cash-flow .cf small { font-size: 8.5px; }
}
/* Print: date / ref / amount columns only as wide as their text, the description gets the rest. */
@media print {
  table.data td:has(> .ref), table.data th.num, table.data td.num,
  .ledger-table th:nth-child(1), .ledger-table th:nth-child(2) { width: 1% !important; white-space: nowrap; }
  table.data td:has(> .ref) { padding-right: 3px !important; white-space: normal; }
  table.data td:has(> .ref) .adm-badge { display: block; width: max-content; font-size: 7px; padding: 0 2px; margin: 1px 0 0; }
  /* All Daily Report: compact top part; sections with no entries are left out. */
  .all-summary tr.zero-row { display: none; }
  .report-date { padding: 0 0 3px; font-size: 11px; border: 0; }
  tr.grand-total td { font-size: 11px; padding: 2px 5px !important; border-top-width: 1px; }
  .mode-strip { border: 1px solid #999; margin-top: 3px; }
  .mode-strip > div { padding: 2px 6px; }
  .mode-strip span { font-size: 8px; letter-spacing: 0; }
  .mode-strip b { font-size: 11px; }
  .mode-strip small { font-size: 8px; }
  .section-head { padding: 2px 0 !important; margin-top: 4px; }
  .section-head h2, .section-head b { font-size: 10.5px; }
  .signatures { padding-top: 18px; }
}

/* Exams: delete; marks: subject not taken (N/A) */
.ex-bulk { display: flex; align-items: center; gap: 12px; justify-content: space-between; border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
.mg-cell .mg-ticks { display: flex; gap: 6px; justify-content: center; }
.mg-cell.na { background: var(--slate-100, #eef1f4); }
.mg-cell.na input[type=number] { background: transparent; }

/* Exams: draft / result issued */
.ex-status { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ex-status > div { flex: 1; }
.ex-st { display: block; margin-top: 3px; font-size: 12px; }
.rc-draft { display: inline-block; margin-left: 8px; padding: 0 8px; border: 2px solid #b45309; color: #b45309; border-radius: 4px; font-size: .8em; letter-spacing: 1px; }

/* Homework status on the assignment page */
.asg-row select[data-hw] { margin-top: 4px; width: auto; padding: 2px 6px; font-size: 12px; }
.hw-submitted { color: var(--blue-600); } .hw-checked { color: var(--green-600); }
.pp-cmt { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; background: var(--slate-50); border-radius: 8px; padding: 8px 10px; }
.pl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
/* Teacher Portal */
.tp-links { display: flex; flex-wrap: wrap; gap: 8px; }
table.tp-tt th, table.tp-tt td { text-align: center; vertical-align: middle; min-width: 86px; }
table.tp-tt td.tp-on { background: var(--lime-100); }
table.tp-tt td.tp-on b { display: block; } table.tp-tt td.tp-on span { display: block; font-size: 12px; color: var(--text-2); } table.tp-tt td.tp-on small { color: var(--muted); }
table.tp-tt td.tp-free { color: var(--muted); font-size: 12px; } table.tp-tt td.tp-brk { background: var(--slate-100); color: var(--muted); font-size: 12px; } table.tp-tt td.tp-off { background: var(--slate-50); }
.tc-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media print { table.tp-tt td.tp-on { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Suspended school / subscription over */
.blocked-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }

/* Super Admin viewing a school (support access) */
#support-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; background: #c2410c; color: #fff; font-size: 13.5px; box-shadow: 0 -2px 10px rgba(0,0,0,.25); }
#support-banner button { border: 0; border-radius: 7px; padding: 6px 14px; background: #fff; color: #9a3412; font-weight: 700; cursor: pointer; }
body.support-mode { padding-bottom: 48px; }
body.support-mode .toast-host { bottom: 60px; }

/* School logo: app header / sign-in box, fee vouchers and receipts, report headings. */
.brand-mark.has-logo { background: #fff; padding: 2px; overflow: hidden; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.voucher .v-head .v-logo { display: block; max-height: 42px; max-width: 120px; margin: 0 auto 3px; object-fit: contain; }
.print-head .ph-logo { height: 36px; width: auto; vertical-align: middle; margin-right: 8px; }
.v-logo, .ph-logo, .brand-mark img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* "School Management System by Zaybrix Technologies" line at the bottom of challans / receipts: small and quiet. */
.v-ad { margin-top: 4px; padding-top: 3px; border-top: 1px dotted #999; text-align: center; font-size: 8px; line-height: 1.3; color: #555; }
@media print { .v-ad { white-space: nowrap; overflow: hidden; } }
.v-ad b { font-weight: 600; color: #333; }
/* Newsfeed admin: automatic birthday post */
.pp-bday { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; align-items: center; justify-content: center; background: #ffe3ef; vertical-align: middle; margin-right: 6px; font-size: 17px; }
.pp-bday img { width: 100%; height: 100%; object-fit: cover; }
/* Student photo (Edit Student) */
.st-photo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.st-photo .ph { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); background: var(--bg-2, #f2f4f6); display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--muted); }
/* Salary sheet: leave days + Paid / Unpaid */
.leave-cell { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.leave-cell input { width: 52px; } .leave-cell select { width: auto; padding-left: 4px; padding-right: 18px; }
/* Salary sheet: absent deduction changed by hand */
.salary-edit input.ded-custom { border-color: var(--amber-500, #d99a1b); background: #fff8e6; font-weight: 600; }
.salary-edit .sec-note { font-size: 10.5px; line-height: 1.3; white-space: nowrap; margin-top: 2px; }
.salary-sheet .sec-print { font-size: 8px; color: #555; }
/* Salary sheet on the whole screen (menus hidden) */
body.sheet-full .topbar, body.sheet-full .sidebar { display: none !important; }
body.sheet-full .app { display: block; }
body.sheet-full .page { max-width: none; padding: 10px 14px; }
body.sheet-full .salary-edit { font-size: 13px; }
.salary-edit td.center, .bl-table td.center { text-align: center; }
.adj-note { display: block; color: var(--accent, #2563eb); font-size: 11px; font-weight: 600; }
.adj-print { margin-top: 8px; font-size: 11px; }
.pay-split { margin: 10px 0 0; font-size: 12px; padding: 8px 10px; border: 1px solid #999; border-radius: 4px; }
/* Bank transfer letter: one A4 page on the letterhead */
.bank-letter { position: relative; font-size: 12pt; line-height: 1.6; }
.bl-mark { position: absolute; top: 1.15in; right: 22mm; font-size: 11pt; color: rgba(120, 130, 140, .55); border: 1px dashed rgba(120, 130, 140, .5); padding: 2px 8px; transform: rotate(-4deg); }
.bl-to { display: flex; gap: 14mm; margin-top: 10mm; } .bl-to b { min-width: 18mm; }
.bl-subject { margin-top: 6mm; } .bl-body { margin: 4mm 0 6mm 25mm; }
.bl-table { width: 100%; border-collapse: collapse; font-size: 11pt; line-height: 1.4; }
.bl-table th, .bl-table td { border: 1px solid #111; padding: 5px 8px; vertical-align: middle; }
.bl-table th { font-weight: 700; text-align: center; } .bl-table .num { text-align: right; }
.bl-sign { margin-top: 14mm; font-size: 13pt; }
/* Monthly cash report: each fund on its own */
.fund-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 12px 16px; }
.fund-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.fund-card h3 { margin: 0; font-size: 15px; }
.fund-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.fund-lines td { padding: 3px 0; }
.fund-lines tr.minus td.num { color: var(--danger, #c0392b); }
.fund-lines tr.plus td.num { color: var(--ok, #1e8e3e); }
.fund-lines tr.bal td { border-top: 1px solid var(--line); font-weight: 600; }
.fund-lines tr.hand td { border-top: 2px solid var(--line); font-weight: 700; font-size: 15px; }
.fund-card .btn { align-self: flex-start; margin-top: auto; }
@media print { .fund-card .btn { display: none; } }
