/* Academic theme refresh: keeps the school app visually separate from jewellery. */
:root {
  --brand: #0b6bcb;
  --navy: #12355f;
  --green: #159a7a;
  --ink: #172033;
  --muted: #65758b;
  --line: #d7e5f3;
  --page: #eef7fb;
  --panel: #fff;
}

body {
  background: linear-gradient(180deg, #eef8ff 0, #f7fbff 260px, #eef7fb 100%);
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  background: #fff;
  color: #172033;
  border-right: 1px solid #d7e5f3;
  box-shadow: 12px 0 30px rgba(18, 53, 95, .08);
}

.brand {
  height: 94px;
  border-bottom: 1px solid #e4edf7;
  background: linear-gradient(135deg, #f8fcff, #e9f7ff);
}

.schoolMark {
  border-radius: 14px;
  background: linear-gradient(135deg, #0b6bcb, #12b886);
  color: #fff;
  box-shadow: 0 10px 22px rgba(11, 107, 203, .22);
}

.brand b { color: #12355f; }
.brand small { color: #64748b; }
.sidebar nav { padding: 14px; gap: 9px; }

.sidebar a {
  background: #f3f8fc;
  color: #26364a;
  border: 1px solid #e2edf7;
  border-radius: 10px;
}

.sideNav {
  align-content: start;
  grid-auto-rows: max-content;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar > .brand,
.sidebar > .sidebarThemeSwitch { flex-shrink: 0; }

.navGroup {
  display: grid;
  gap: 6px;
}

.navGroup summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 32px 8px 10px;
  border: 1px solid #dce9f6;
  border-radius: 9px;
  background: #fff;
  color: #12355f;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.navGroup summary::-webkit-details-marker {
  display: none;
}

.navGroup summary::after {
  content: "+";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0b6bcb;
  transform: translateY(-50%);
  font-weight: 950;
}

.navGroup[open] summary {
  border-color: #b9d8f4;
  background: linear-gradient(90deg, #e8f4ff, #f4fffb);
}

.navGroup[open] summary::after {
  content: "-";
  background: #0b6bcb;
  color: #fff;
}

.navChildren {
  display: grid;
  gap: 5px;
  padding-left: 10px;
  border-left: 2px solid #d7e5f3;
}

.navChildren a {
  min-height: 31px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 11px;
}

.sidebar a:hover,
.sidebar a.active {
  background: linear-gradient(90deg, #e8f4ff, #e7fff7);
  color: #0b4e91;
  box-shadow: inset 4px 0 0 #0b6bcb;
  border-color: #b9d8f4;
}

.main { padding: 22px 24px 34px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -22px -24px 22px;
  padding: 18px 26px;
  background: linear-gradient(110deg, #173f68, #0d8d7c);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 12px 30px rgba(18, 53, 95, .16);
}

.topbar h1 { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.topbar span { color: #e4f5ff; }
.topbar .portalTitle span { color: #e4f5ff; }

.topActions {
  align-items: center;
  flex-wrap: wrap;
}

.quickPageJump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #12355f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.quickPageJump select {
  min-width: 150px;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border: 1px solid #b9d8f4;
  border-radius: 10px;
  background: #fff;
  color: #12355f;
  font: inherit;
}

.branchSwitch select,
.branchBadge {
  min-height: 38px;
  border: 1px solid #b9d8f4;
  border-radius: 10px;
  background: #fff;
  color: #12355f;
  font: inherit;
  font-weight: 800;
}

.branchSwitch select {
  min-width: 180px;
  padding: 0 34px 0 12px;
}

.branchBadge {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

.btn {
  border-radius: 10px;
  border-color: #b9d8f4;
  color: #0b5eb0;
  background: #fff;
}

.btn.primary {
  background: #0b6bcb;
  border-color: #0b6bcb;
  color: #fff;
}

.hero {
  border: 0;
  background: linear-gradient(135deg, #0b6bcb, #159a7a);
  color: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 18px 44px rgba(11, 107, 203, .22);
}

.hero h2 { color: #fff; font-size: 30px; }
.hero p { color: #e7f8ff; }

.dashboardHero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 30px;
  margin-bottom: 14px;
  color: #fff;
  border-radius: 18px;
  background: radial-gradient(circle at 92% 8%, rgba(255,255,255,.22), transparent 23%), linear-gradient(120deg, #12355f, #0b6bcb 54%, #159a7a);
  box-shadow: 0 20px 45px rgba(11, 82, 160, .22);
}

.dashEyebrow { display: flex; align-items: center; gap: 7px; color: #dff4ff; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.dashEyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #7dffbe; box-shadow: 0 0 0 4px rgba(125,255,190,.18); }
.dashboardHero h2 { margin: 9px 0 5px; color: #fff; font-size: clamp(24px, 3vw, 34px); }
.dashboardHero p { margin: 0; color: #dff4ff; }
.dashHeroActions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.dashHeroActions .btn:not(.primary) { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.12); color: #fff; }
.dashDateCard { min-width: 92px; padding: 13px; border: 1px solid rgba(255,255,255,.28); border-radius: 16px; background: rgba(255,255,255,.13); text-align: center; backdrop-filter: blur(8px); }
.dashDateCard span,.dashDateCard small,.dashDateCard b { display: block; }.dashDateCard span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }.dashDateCard b { margin: 3px 0; font-size: 36px; line-height: 1; }.dashDateCard small { color: #dff4ff; }
.dashboardMetrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.dashMetric { display: flex; align-items: center; gap: 12px; min-height: 110px; padding: 15px; overflow: hidden; border: 1px solid #dce9f6; border-radius: 15px; background: #fff; box-shadow: 0 12px 28px rgba(18,53,95,.07); }.dashMetric:hover { transform: translateY(-2px); box-shadow: 0 17px 32px rgba(18,53,95,.12); }
.metricIcon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; font-size: 19px; font-weight: 900; }.dashMetric span:not(.metricIcon),.dashMetric small { display: block; color: #64748b; font-size: 11px; }.dashMetric b { display: block; margin: 3px 0; color: #12355f; font-size: 21px; }.dashMetric.blue .metricIcon { background:#e0f2fe; color:#0369a1; }.dashMetric.violet .metricIcon { background:#ede9fe; color:#6d28d9; }.dashMetric.amber .metricIcon { background:#fef3c7; color:#b45309; }.dashMetric.green .metricIcon { background:#d1fae5; color:#047857; }
.dashboardGrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }.dashboardPanel { padding: 18px; border: 1px solid #dce9f6; border-radius: 15px; background: #fff; box-shadow: 0 12px 28px rgba(18,53,95,.07); }.dashPanelHead { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }.dashPanelHead span { color:#64748b; font-size:11px; font-weight:750; }.dashPanelHead h2 { margin:3px 0 0; color:#12355f; font-size:18px; }.dashPanelHead > b { color:#0b6bcb; font-size:26px; }.dashPanelHead > a,.attendanceMeta a { color:#0b6bcb; font-size:12px; font-weight:800; }.progressTrack { height:10px; margin:22px 0 13px; overflow:hidden; border-radius:999px; background:#e4eef8; }.progressTrack i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#0b6bcb,#12b886); }.attendanceMeta { display:flex; align-items:center; gap:12px; flex-wrap:wrap; color:#64748b; font-size:12px; }.attendanceMeta b { color:#12355f; }.attendanceMeta a { margin-left:auto; }.glanceGrid { display:grid; grid-template-columns:repeat(3,1fr); margin-top:23px; }.glanceGrid div { padding:0 12px; border-right:1px solid #e5eef8; text-align:center; }.glanceGrid div:last-child { border:0; }.glanceGrid b,.glanceGrid span { display:block; }.glanceGrid b { color:#12355f; font-size:25px; }.glanceGrid span { margin-top:3px; color:#64748b; font-size:11px; }
.admissionPulseGrid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.admissionPulseMetric { display:flex; min-height:66px; flex-direction:column; justify-content:center; gap:4px; padding:10px 12px; border:1px solid #e2ebf5; border-radius:11px; background:linear-gradient(145deg,#f8fbff,#edf6ff); }
.admissionPulseMetric span { color:#64748b; font-size:11px; font-weight:750; }
.admissionPulseMetric b { color:#0b6bcb; font-size:23px; line-height:1.1; }
.admissionPulseMetric small { color:#64748b; font-size:10px; line-height:1.25; }
.admissionPulseMetric.isUntracked b { color:#64748b; }
.dashList > div { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #edf2f7; }.dashList > div:last-child { border:0; }.studentAvatar { display:grid; width:31px; height:31px; flex:0 0 31px; place-items:center; border-radius:10px; background:#e0f2fe; color:#0369a1; font-size:12px; font-weight:900; }.dashList p { margin:0; }.dashList b,.dashList small { display:block; }.dashList b { color:#12355f; font-size:13px; }.dashList small { margin-top:2px; color:#64748b; font-size:11px; }.dashboardActions { display:grid; grid-template-columns:repeat(2,1fr); gap:9px; margin-top:15px; }.dashboardActions a { display:flex; align-items:center; gap:8px; min-height:43px; padding:8px 10px; border:1px solid #e2ebf5; border-radius:10px; color:#12355f; font-size:12px; font-weight:800; }.dashboardActions a:hover { border-color:#84c5ff; background:#f5fbff; }.dashboardActions span { display:grid; width:25px; height:25px; place-items:center; border-radius:8px; background:#e0f2fe; color:#0b6bcb; }.dashboardActions i { margin-left:auto; color:#0b6bcb; font-style:normal; }

.dashboardMetrics,.dashboardGrid { perspective: 1100px; }
.dashMetric,.dashboardPanel { position: relative; transform-style: preserve-3d; transition: transform .24s ease, box-shadow .24s ease; }
.dashMetric { border-color: rgba(195,218,239,.95); background: linear-gradient(145deg, #fff 0%, #f5faff 100%); box-shadow: 0 4px 0 rgba(151,185,218,.44), 0 15px 24px rgba(18,53,95,.12), inset 0 1px 0 rgba(255,255,255,.95); }
.dashMetric::before,.dashboardPanel::before { content:""; position:absolute; inset:1px 1px auto; height:42%; border-radius:14px 14px 45% 45%; background:linear-gradient(180deg,rgba(255,255,255,.82),rgba(255,255,255,0)); pointer-events:none; }
.dashMetric:hover { transform: translateY(-6px) rotateX(2deg) rotateY(-1deg); box-shadow: 0 8px 0 rgba(128,172,213,.48), 0 25px 34px rgba(18,53,95,.19), inset 0 1px 0 #fff; }
.metricIcon { position:relative; z-index:1; box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 5px 0 rgba(18,53,95,.11), 0 9px 15px rgba(18,53,95,.12); transform: translateZ(15px); }.dashMetric > div { position:relative; z-index:1; transform:translateZ(9px); }
.dashboardPanel { border-color: rgba(195,218,239,.95); background: linear-gradient(145deg, #fff 0%, #f7fbff 100%); box-shadow: 0 4px 0 rgba(151,185,218,.36), 0 15px 27px rgba(18,53,95,.1), inset 0 1px 0 rgba(255,255,255,.95); }.dashboardPanel:hover { transform: translateY(-4px) rotateX(1deg); box-shadow: 0 8px 0 rgba(128,172,213,.4), 0 23px 34px rgba(18,53,95,.16), inset 0 1px 0 #fff; }.dashboardPanel > * { position:relative; z-index:1; }
.dashboardActions a { box-shadow: 0 3px 0 #c8ddeb, 0 7px 12px rgba(18,53,95,.08); transition: transform .18s ease, box-shadow .18s ease; }.dashboardActions a:hover { transform: translateY(-3px); box-shadow: 0 5px 0 #b4d4e9, 0 12px 17px rgba(18,53,95,.13); }

@media (prefers-reduced-motion: reduce) {
  .dashMetric,.dashboardPanel,.dashboardActions a { transition: none; }
  .dashMetric:hover,.dashboardPanel:hover,.dashboardActions a:hover { transform: none; }
}

@media (max-width: 980px) {
  .dashboardMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .dashboardHero { display: block; padding: 20px; }
  .dashDateCard { display: none; }
  .dashboardMetrics,.dashboardGrid { grid-template-columns: 1fr; }
  .dashMetric { min-height: 82px; }
  .dashboardActions { grid-template-columns: 1fr; }
  .admissionPulseGrid { gap:8px; }
  .admissionPulseMetric { min-height:62px; padding:9px; }
  .admissionPulseMetric span { font-size:10px; }
}

.panel,
.stats article,
.quickTile {
  border-radius: 14px;
  border-color: #dce9f6;
  box-shadow: 0 14px 34px rgba(18, 53, 95, .08);
}

.stats article { border-top: 4px solid #12b886; }
.stats span { color: #64748b; }
.stats b { color: #0b6bcb; }
.quickGrid { gap: 12px; }

.quickTile {
  min-height: 86px;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.quickTile:hover {
  transform: translateY(-1px);
  border-color: #84c5ff;
  box-shadow: 0 16px 34px rgba(11, 107, 203, .15);
}

.quickTile b,
.panelHead h2,
.panel h2 { color: #12355f; }

.panelHead { border-bottom: 1px solid #e5eef8; }

.miniFilter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.miniFilter select,
.miniFilter input {
  min-height: 32px;
  border: 1px solid #bfd5ea;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}

.formGrid {
  background: linear-gradient(135deg, #e8f6ff, #eafff6);
  border: 1px solid #cce7f5;
  border-radius: 14px;
}

.formGrid input,
.formGrid select,
.formGrid textarea,
td input,
td select {
  border-radius: 9px;
  border-color: #bfd5ea;
}

.tableWrap {
  border-radius: 12px;
  border-color: #d7e5f3;
}

th {
  background: #eaf4ff;
  color: #36536f;
}

.tag {
  background: #e6f7ff;
  color: #0b6bcb;
  border-radius: 10px;
}

.permissionTable th:nth-child(n+2),
.permissionTable td:nth-child(n+2) {
  text-align: center;
  width: 72px;
}

.permissionTable input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
  accent-color: #0b6bcb;
}

.moduleControlTable input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  vertical-align: middle;
  accent-color: #0b6bcb;
}

.resetPanel {
  border-color: #f3b8b8;
  background: #fff8f8;
}

.resetPanel p {
  color: #8a1c1c;
  font-weight: 700;
}

.resetButton {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}

body {
  --theme-primary: #0b6bcb;
  --theme-secondary: #159a7a;
  --theme-sidebar: #12355f;
}

body[data-color-scheme="emerald"] { --theme-primary: #087f5b; --theme-secondary: #12a577; --theme-sidebar: #084c3b; }
body[data-color-scheme="violet"] { --theme-primary: #6d3cc7; --theme-secondary: #9b5de5; --theme-sidebar: #35216b; }
body[data-color-scheme="sunset"] { --theme-primary: #d95d16; --theme-secondary: #ea8a27; --theme-sidebar: #712d13; }
body[data-color-scheme] .sidebar { background: linear-gradient(180deg, var(--theme-sidebar), color-mix(in srgb, var(--theme-sidebar), #000 18%)); }
body[data-color-scheme] .topbar { background: linear-gradient(115deg, var(--theme-sidebar), var(--theme-secondary)); }
body[data-color-scheme] .btn.primary { background: var(--theme-primary); border-color: var(--theme-primary); }
body[data-color-scheme] .dashboardHero { background: radial-gradient(circle at 92% 8%, rgba(255,255,255,.22), transparent 23%), linear-gradient(120deg, var(--theme-sidebar), var(--theme-primary) 54%, var(--theme-secondary)); }
body[data-color-scheme] .dashMetric b,body[data-color-scheme] .dashPanelHead > b,body[data-color-scheme] .glanceGrid b { color: var(--theme-primary); }
body[data-color-scheme] .progressTrack i { background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary)); }

.sideNav { flex: 1; }
.sidebarThemeSwitch { padding: 12px; border-top: 1px solid rgba(255,255,255,.14); }
.sidebarThemeSwitch button { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-size: 12px; font-weight: 850; cursor: pointer; }
.sidebarThemeSwitch button:hover { background: rgba(255,255,255,.18); }.sidebarThemeSwitch span { font-size: 17px; }

body[data-theme="dark"] { --page: #0d1625; --panel: #162234; --ink: #e8f0f8; --muted: #aab8c8; background: #0d1625; color: #e8f0f8; }
body[data-theme="dark"] .main { background: radial-gradient(circle at 90% 0, rgba(19,110,180,.17), transparent 28%), #0d1625; }
body[data-theme="dark"] .panel,body[data-theme="dark"] .dashboardPanel,body[data-theme="dark"] .dashMetric,body[data-theme="dark"] .quickTile,body[data-theme="dark"] table,body[data-theme="dark"] .moduleBand { border-color: #2b3d53; background: linear-gradient(145deg, #18263a, #121e2f); color: #e8f0f8; }
body[data-theme="dark"] .panelHead,body[data-theme="dark"] .dashList > div { border-color: #2b3d53; } body[data-theme="dark"] .panel h2,body[data-theme="dark"] .panelHead h2,body[data-theme="dark"] .dashMetric b,body[data-theme="dark"] .dashList b,body[data-theme="dark"] .dashPanelHead h2,body[data-theme="dark"] .glanceGrid b { color: #f3f8ff; } body[data-theme="dark"] th { background: #1d3047; color: #cbd9e9; } body[data-theme="dark"] td { border-color: #2b3d53; } body[data-theme="dark"] .formGrid,body[data-theme="dark"] .dashboardActions a { border-color: #30445c; background: #152438; color: #e8f0f8; } body[data-theme="dark"] input,body[data-theme="dark"] select,body[data-theme="dark"] textarea { border-color: #3b526d; background: #0f1b2c; color: #e8f0f8; } body[data-theme="dark"] .tag { background: #173d64; color: #b9ddff; } body[data-theme="dark"] .tableWrap { border-color: #2b3d53; }

.receipt { border-radius: 14px; }

.loginPage {
  background: linear-gradient(135deg, #e6f7ff, #eafff6) !important;
}

.loginBox {
  border: 1px solid #d7e5f3;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(18, 53, 95, .18);
}

.logoMark {
  background: #fff;
  overflow: hidden;
}

.logoMark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.portalTitle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.langSwitch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid #d7e5f3;
  border-radius: 999px;
  background: #fff;
  color: #5f6f86;
  font-size: 12px;
  font-weight: 750;
}

.langPill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #0a67c7;
}

.langPill.active {
  background: #0a67c7;
  color: #fff;
}

/* Mobile-first compact refresh */
:root {
  --brand: #0a67c7;
  --accent: #16a085;
  --warning: #f59e0b;
  --rose: #e11d48;
  --ink: #142033;
  --muted: #5f6f86;
  --line: #d9e6f2;
  --page: #f4f8fb;
}

html { font-size: 14px; }

body {
  font-size: 13px;
  line-height: 1.42;
  background: #f4f8fb;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  box-shadow: 8px 0 22px rgba(18, 53, 95, .06);
}

.brand {
  height: 74px;
  gap: 9px;
  padding: 11px;
}

.schoolMark {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
}

.brand b {
  font-size: 13px;
  line-height: 1.2;
}

.brand small { font-size: 10px; }

.sidebar nav {
  padding: 10px;
  gap: 6px;
}

.sidebar a {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.navGroup summary {
  min-height: 32px;
  padding: 7px 30px 7px 9px;
  font-size: 11px;
}

.navChildren a {
  min-height: 29px;
  font-size: 11px;
}

.main { padding: 14px 16px 24px; }

.topbar {
  margin: -14px -16px 14px;
  padding: 12px 16px;
}

.portalTitle { gap: 9px; }
.portalTitle .schoolMark {
  width: 38px;
  height: 38px;
  min-width: 38px;
}

.topbar h1 {
  font-size: 19px;
  line-height: 1.15;
}

.topbar span { font-size: 11px; }

.topActions { gap: 6px; }

.btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.btn.small {
  min-height: 26px;
  font-size: 11px;
}

.hero {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0a67c7 0%, #16886f 100%);
  box-shadow: 0 12px 28px rgba(10, 103, 199, .18);
}

.hero h2 {
  font-size: 21px;
  line-height: 1.16;
}

.hero p { font-size: 12px; }

.stats {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 9px;
}

.stats article {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  padding: 12px;
  border: 1px solid #dbe8f4;
  border-top: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 10px 24px rgba(18, 53, 95, .07);
}

.stats article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.stats article:nth-child(2)::before { background: var(--brand); }
.stats article:nth-child(3)::before { background: var(--warning); }
.stats article:nth-child(4)::before { background: var(--rose); }
.stats article:nth-child(5)::before { background: #7c3aed; }
.stats article:nth-child(6)::before { background: #0891b2; }

.stats span {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.stats b {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.12;
  color: #12355f;
  overflow-wrap: anywhere;
}

.quickGrid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 9px;
}

.quickTile {
  min-height: 70px;
  gap: 4px;
  padding: 11px;
  border-radius: 10px;
}

.quickTile b { font-size: 13px; }
.quickTile span { font-size: 11px; }
.quickTile.miniForm {
  align-content: start;
}

.quickTile.miniForm input,
.quickTile.miniForm select {
  width: 100%;
  min-height: 30px;
  border: 1px solid #cbd7e8;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
}

.panel {
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 12px;
}

.panelHead {
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.panel h2,
.panelHead h2 {
  font-size: 16px;
  line-height: 1.2;
}

.panelHead span,
.muted { font-size: 12px; }

.formGrid {
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
}

.formGrid label {
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
}

.formSection {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  color: #12355f;
  font-size: 13px;
  font-weight: 850;
  box-shadow: inset 4px 0 0 #0a67c7;
}

.studentPreview {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #cbd7e8;
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 750;
}

.studentPreview img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.formGrid input,
.formGrid select,
.formGrid textarea,
td input,
td select {
  height: 34px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
}

.formGrid textarea { height: 64px; }

.tableSearch {
  height: 34px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 12px;
}

.tableWrap { border-radius: 9px; }

th,
td {
  padding: 8px;
  font-size: 12px;
}

th { font-size: 10px; }

.tag {
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
}

.portalApp {
  background: linear-gradient(180deg, #e9f5ff 0, #f5f9fc 260px), #f5f9fc;
}

.portalApp .main {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.portalHero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  margin-bottom: 12px;
}

.portalStudent,
.portalDueCard {
  border: 1px solid #dbe8f4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(18, 53, 95, .09);
}

.portalStudent {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.portalAvatar {
  width: 62px;
  height: 62px;
  min-width: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #0a67c7, #16a085);
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}

.portalStudent h2 {
  margin: 0 0 5px;
  color: #12355f;
  font-size: 22px;
  line-height: 1.1;
}

.portalStudent p {
  margin: 0;
  color: #5f6f86;
  font-weight: 750;
}

.portalDueCard {
  padding: 16px;
}

.portalDueCard span,
.portalDueCard small {
  display: block;
  color: #5f6f86;
  font-weight: 750;
}

.portalDueCard b {
  display: block;
  margin: 8px 0;
  color: #0b6bcb;
  font-size: 28px;
  line-height: 1.05;
}

.portalApp .panel {
  border-radius: 16px;
}

.portalApp td .miniForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
  min-width: 330px;
}

.portalApp td .miniForm .btn {
  grid-column: 1 / -1;
}

.portalLogin.loginPage {
  background: radial-gradient(circle at 20% 12%, rgba(22, 160, 133, .22), transparent 28%), radial-gradient(circle at 80% 0, rgba(10, 103, 199, .24), transparent 26%), linear-gradient(135deg, #e8f4ff, #f7fbff);
}

.portalLogin .loginBox {
  border: 1px solid #dbe8f4;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(18, 53, 95, .16);
}

.portalLogin .loginForm {
  padding: 12px;
  border: 1px solid #e4edf7;
  border-radius: 14px;
  background: #f8fbff;
}

.notifyBtn {
  position: relative;
}

.notifyBadge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
}

.notifyBadge.inline {
  position: static;
  display: inline-grid;
  margin-left: 6px;
  vertical-align: middle;
  border: 0;
}

@media (max-width: 980px) {
  body {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #d7e5f3;
  }

  .brand {
    height: 58px;
  }

  .sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 10px 10px;
    scrollbar-width: thin;
    align-items: flex-start;
    max-height: min(55vh, 360px);
    overflow-y: auto;
  }

  .navGroup {
    min-width: 190px;
    flex: 0 0 auto;
  }

  .navChildren {
    max-height: none;
    overflow: visible;
  }

  .sidebar a {
    flex: 0 0 auto;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .main { padding: 12px; }

  .topbar {
    position: relative;
    top: auto;
    margin: -12px -12px 12px;
    padding: 10px 12px;
    align-items: flex-start;
  }

  .grid.three,
  .grid.two { grid-template-columns: 1fr; }
  .formGrid,
  .formGrid.compact { grid-template-columns: 1fr 1fr; }

  .panel.wide {
    overflow: visible;
  }

  .tableWrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 720px;
  }

  .receipt {
    width: 100%;
    min-height: auto;
  }

  .portalHero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  html { font-size: 13px; }

  .brand {
    height: 54px;
    padding: 8px 10px;
  }

  .brand b { font-size: 12px; }
  .brand small { font-size: 9px; }

  .topbar {
    display: grid;
    gap: 10px;
  }

  .topActions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .branchSwitch,
  .branchSwitch select {
    width: 100%;
  }

  .topActions .btn { width: 100%; }

  .quickPageJump,
  .quickPageJump select { width: 100%; }

  .quickPageJump { justify-content: space-between; }

  .hero h2 { font-size: 18px; }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats article {
    min-height: 82px;
    padding: 10px 10px 10px 12px;
  }

  .stats b { font-size: 17px; }

  .quickGrid { grid-template-columns: 1fr 1fr; }

  .panelHead {
    display: grid;
    justify-content: stretch;
  }

  .formGrid,
  .formGrid.compact {
    grid-template-columns: 1fr;
  }

  .main {
    padding-bottom: 82px;
  }

  .navGroup {
    min-width: 160px;
  }

  .portalStudent {
    align-items: flex-start;
    padding: 13px;
  }

  .portalAvatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 14px;
    font-size: 21px;
  }

  .portalStudent h2 {
    font-size: 18px;
  }

  .portalDueCard b {
    font-size: 23px;
  }

  .portalApp td .miniForm {
    min-width: 260px;
    grid-template-columns: 1fr;
  }

  .portalLogin .loginBox {
    width: min(440px, 96vw);
    padding: 18px;
  }

  .span2,
  .span3 { grid-column: 1; }
}

@media (max-width: 380px) {
  .stats,
  .quickGrid {
    grid-template-columns: 1fr;
  }
}

/* Keep text readable when a legacy component supplies a fixed light-theme colour. */
body[data-theme="dark"] .main,
body[data-theme="dark"] .main p,
body[data-theme="dark"] .main small,
body[data-theme="dark"] .main .muted,
body[data-theme="dark"] .main .subtle {
  color: #b9c7d8;
}

body[data-theme="dark"] .main h1,
body[data-theme="dark"] .main h2,
body[data-theme="dark"] .main h3,
body[data-theme="dark"] .main h4,
body[data-theme="dark"] .main b,
body[data-theme="dark"] .main strong,
body[data-theme="dark"] .main label,
body[data-theme="dark"] .main td,
body[data-theme="dark"] .main .panelHead,
body[data-theme="dark"] .main .quickTile,
body[data-theme="dark"] .main .moduleBand {
  color: #edf5ff;
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .dashboardPanel,
body[data-theme="dark"] .dashMetric,
body[data-theme="dark"] .quickTile,
body[data-theme="dark"] .moduleBand,
body[data-theme="dark"] .stats article,
body[data-theme="dark"] .formGrid,
body[data-theme="dark"] .miniForm,
body[data-theme="dark"] .receipt,
body[data-theme="dark"] .loginBox,
body[data-theme="dark"] table {
  background: #142235;
  border-color: #34506e;
}

body[data-theme="dark"] .panelHead,
body[data-theme="dark"] .dashList li,
body[data-theme="dark"] .moduleBandHead,
body[data-theme="dark"] table th {
  background: #1b2d43;
  color: #d8e8f8;
  border-color: #34506e;
}

body[data-theme="dark"] .main a:not(.btn),
body[data-theme="dark"] .main .linkButton {
  color: #83c9ff;
}

body[data-theme="dark"] .quickPageJump { color: #edf5ff; }

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .tableSearch {
  background: #0d1725;
  color: #edf5ff;
  border-color: #4b6886;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #93a9c0;
  opacity: 1;
}

body[data-theme="dark"] select option {
  background: #0d1725;
  color: #edf5ff;
}

body[data-theme="dark"] .btn:not(.primary),
body[data-theme="dark"] button:not(.primary) {
  background: #20364e;
  color: #edf5ff;
  border-color: #4b6886;
}

body[data-theme="dark"] .topbar h1,
body[data-theme="dark"] .topbar .topTitle,
body[data-theme="dark"] .brand b {
  color: #f5f9ff;
}

body[data-theme="dark"] .topbar small,
body[data-theme="dark"] .brand small {
  color: #c1d0e0;
}

body[data-theme="dark"] .brand {
  background: rgba(8, 19, 33, .58);
  border-color: rgba(176, 212, 245, .26);
}

body[data-theme="dark"] .tag,
body[data-theme="dark"] .statusTag {
  color: #e6f2ff;
  border-color: #4b6886;
}

/* Keep dashboard depth without the light-theme white gloss. */
body[data-theme="dark"] .dashMetric,
body[data-theme="dark"] .dashboardPanel {
  background: linear-gradient(145deg, #1b2d43, #142235);
  box-shadow: 0 4px 0 #0b1726, 0 15px 24px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(164, 204, 240, .12);
}
body[data-theme="dark"] .dashMetric::before,
body[data-theme="dark"] .dashboardPanel::before { background: none; }
body[data-theme="dark"] .dashMetric:hover,
body[data-theme="dark"] .dashboardPanel:hover {
  box-shadow: 0 7px 0 #0b1726, 0 23px 34px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(164, 204, 240, .18);
}
body[data-theme="dark"] .dashMetric span:not(.metricIcon),
body[data-theme="dark"] .dashMetric small,
body[data-theme="dark"] .dashPanelHead span,
body[data-theme="dark"] .attendanceMeta,
body[data-theme="dark"] .glanceGrid span,
body[data-theme="dark"] .dashList small { color: #bdcde0; }
body[data-theme="dark"] .progressTrack { background: #324b65; }
body[data-theme="dark"] .glanceGrid div,
body[data-theme="dark"] .dashList > div,
body[data-theme="dark"] .admissionPulseMetric { border-color: #34506e; }
body[data-theme="dark"] .admissionPulseMetric { background: linear-gradient(145deg,#1b2d43,#17263a); }
body[data-theme="dark"] .admissionPulseMetric span,
body[data-theme="dark"] .admissionPulseMetric small { color:#bdcde0; }
body[data-theme="dark"] .admissionPulseMetric b { color:#8ecaff; }
body[data-theme="dark"] .transportRegistration { color:#cfe5ff; }
body[data-theme="dark"] .transportVehicleRow:hover { background:#1b2d43; }
body[data-theme="dark"] .vehicleExpiryList span { background:#21344a; color:#d3dfed; }
body[data-theme="dark"] .vehicleExpiryList b { color:#eff6ff; }
body[data-theme="dark"] .vehicleExpiryList .vehicleExpiryExpired { background:#4a2028; border-color:#9e3a48; color:#ffd5d9; }
body[data-theme="dark"] .vehicleExpiryList .vehicleExpiryExpired b,body[data-theme="dark"] .vehicleExpiryList .vehicleExpiryExpired small { color:#ffd5d9; }
body[data-theme="dark"] .vehicleExpiryList .vehicleExpirySoon { background:#49391d; border-color:#96712e; color:#ffe5ad; }
body[data-theme="dark"] .vehicleExpiryList .vehicleExpirySoon b,body[data-theme="dark"] .vehicleExpiryList .vehicleExpirySoon small { color:#ffe5ad; }
body[data-theme="dark"] .dashboardActions a {
  background: #1b2d43;
  border-color: #34506e;
  box-shadow: 0 3px 0 #0b1726, 0 7px 12px rgba(0, 0, 0, .2);
}
body[data-theme="dark"] .dashboardActions a:hover {
  background: #243c56;
  box-shadow: 0 5px 0 #0b1726, 0 12px 17px rgba(0, 0, 0, .3);
}
body[data-theme="dark"] .navGroup summary,
body[data-theme="dark"] .sidebar a {
  background: #1b2d43;
  color: #e0ecfa;
  border-color: #34506e;
}
body[data-theme="dark"] .navGroup[open] summary,
body[data-theme="dark"] .sidebar a:hover,
body[data-theme="dark"] .sidebar a.active { background: #243c56; color: #f5f9ff; border-color: #527699; }
body[data-theme="dark"] .navGroup summary::after { background: #324b65; color: #e0ecfa; }
body[data-theme="dark"] .navChildren { border-color: #527699; }
.panel#dress-prices td .miniForm{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-end;gap:10px;min-width:240px}
.panel#dress-prices td .miniForm>label{flex:1 1 130px;min-width:0;margin:0}
.panel#dress-prices td .miniForm>label input[name="amount"]{width:100%;min-width:0;box-sizing:border-box}
.panel#dress-prices td .miniForm>.btn{flex:0 0 auto;width:auto;margin:0;white-space:nowrap;align-self:flex-end;min-height:36px}
.attendancePanel .attendanceCategory{padding-top:12px}
.attendancePanel .attendanceCategory+.attendanceCategory{margin-top:16px;border-top:1px solid #dce9f6}
.attendancePanel .attendanceCategory .progressTrack{margin:12px 0}
.attendancePanel .attendanceCategory .attendanceMeta+.attendanceMeta{margin-top:10px}
.schoolDashboardLink{display:inline-flex;flex:0 0 auto;text-decoration:none;border-radius:10px}
.schoolDashboardLink:focus-visible{outline:3px solid #ffcb57;outline-offset:4px}
body[data-color-scheme] .schoolTopbar .portalTitle h1,
body[data-color-scheme] .schoolTopbar .portalTitle > div > span{color:#fff}

.adminDailyOverlay { position:fixed; z-index:12000; inset:0; display:grid; place-items:center; padding:22px; overflow-y:auto; background:rgba(7,19,36,.68); backdrop-filter:blur(5px); }
.adminDailyOverlay[hidden] { display:none; }
.adminDailyDialog { width:min(100%,980px); max-height:min(90vh,900px); overflow:auto; padding:22px; border:1px solid #c8d9e9; border-radius:20px; color:#183653; background:linear-gradient(145deg,#f8fbff,#eaf3fc); box-shadow:0 26px 90px rgba(0,0,0,.38); }
.adminDailyHeader,.adminDailyFooter { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.adminDailyHeader { padding-bottom:15px; border-bottom:1px solid #d6e3ef; }
.adminDailyHeader span { color:#53718d; font-size:12px; font-weight:750; letter-spacing:.04em; text-transform:uppercase; }
.adminDailyHeader h2 { margin:4px 0 0; color:#12355f; font-size:24px; }
.adminDailyClose { width:38px; height:38px; border:1px solid #cbd9e7; border-radius:12px; color:#244360; background:#fff; font-size:25px; line-height:1; cursor:pointer; }
.adminDailyGrid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; padding:17px 0; }
.adminDailyMetric { min-width:0; padding:13px 14px; border:1px solid #d4e2ef; border-radius:14px; color:inherit; text-decoration:none; background:linear-gradient(145deg,#fff,#f0f7fd); box-shadow:0 3px 0 rgba(112,153,191,.19),0 8px 16px rgba(18,53,95,.06); transition:transform .18s ease,box-shadow .18s ease; }
.adminDailyMetric:hover { transform:translateY(-2px); box-shadow:0 5px 0 rgba(112,153,191,.2),0 12px 20px rgba(18,53,95,.11); }
.adminDailyMetric span,.adminDailyMetric b { display:block; }
.adminDailyMetric span { min-height:32px; color:#5d7186; font-size:12px; font-weight:700; }
.adminDailyMetric b { overflow-wrap:anywhere; color:#1267ac; font-size:20px; line-height:1.25; }
.adminDailyNote { margin:0 0 16px; color:#5b7085; font-size:12px; line-height:1.55; }
.adminDailyFooter { padding-top:13px; border-top:1px solid #d6e3ef; color:#5b7085; font-size:12px; }
body.adminDailyOpen { overflow:hidden; }
body[data-theme="dark"] .adminDailyDialog { border-color:#344b66; color:#e7f0f8; background:linear-gradient(145deg,#1b2c42,#122034); }
body[data-theme="dark"] .adminDailyHeader,body[data-theme="dark"] .adminDailyFooter { border-color:#344b66; }
body[data-theme="dark"] .adminDailyHeader h2,body[data-theme="dark"] .adminDailyClose { color:#e7f0f8; }
body[data-theme="dark"] .adminDailyHeader span,body[data-theme="dark"] .adminDailyMetric span,body[data-theme="dark"] .adminDailyNote,body[data-theme="dark"] .adminDailyFooter { color:#afc0d2; }
body[data-theme="dark"] .adminDailyClose,body[data-theme="dark"] .adminDailyMetric { border-color:#344b66; background:linear-gradient(145deg,#213750,#17283c); }
body[data-theme="dark"] .adminDailyMetric b { color:#77c4ff; }
@media(max-width:720px) { .adminDailyOverlay { padding:10px; align-items:start; }.adminDailyDialog { max-height:calc(100vh - 20px); padding:16px; border-radius:16px; }.adminDailyGrid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:12px 0; }.adminDailyMetric { padding:11px; }.adminDailyMetric b { font-size:17px; }.adminDailyFooter { align-items:stretch; flex-direction:column; }.adminDailyFooter .btn { width:100%; } }
