/* School Management System - stylesheet
 * Palette: Indigo (primary) + Teal (accent) + semantic status colours.
 * Text colours are chosen for WCAG AA contrast on their backgrounds.
 */
:root {
  /* Brand */
  --primary: #4338ca;        /* indigo-700: links, active states (AA on white) */
  --primary-2: #4f46e5;      /* indigo-600: buttons */
  --primary-3: #6366f1;      /* indigo-500: decorative */
  --primary-soft: #eef2ff;   /* indigo-50 */
  --primary-dark: #1e1b4b;   /* indigo-950: sidebar, headings accents */
  --accent: #0f766e;         /* teal-700: positive/accent text (AA) */
  --accent-2: #14b8a6;       /* teal-500: decorative */
  --accent-soft: #ccfbf1;    /* teal-100 */

  /* Surfaces */
  --bg: #f4f6fb;
  --card: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text (high contrast) */
  --text: #0f172a;          /* slate-900: primary text */
  --text-2: #1e293b;        /* slate-800: labels */
  --muted: #475569;         /* slate-600: secondary text (7:1 on white) */
  --muted-2: #64748b;       /* slate-500: tertiary, placeholders */

  /* Status */
  --ok: #047857;  --ok-soft: #d1fae5;  --ok-border: #6ee7b7;
  --warn: #92400e; --warn-soft: #fef3c7; --warn-border: #fcd34d;
  --bad: #be123c;  --bad-soft: #ffe4e6;  --bad-border: #fda4af;
  --blue: #1d4ed8; --blue-soft: #dbeafe;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 44px rgba(30, 27, 75, .18);
  --focus: 0 0 0 4px rgba(99, 102, 241, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans Bengali", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.lang-bn { line-height: 1.8; }
::selection { background: #c7d2fe; color: var(--text); }

a { color: var(--primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--primary-2); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
h2 { font-size: 18px; margin: 0 0 10px; font-weight: 700; color: var(--text); }
h3 { font-size: 15px; margin: 0 0 12px; font-weight: 700; color: var(--text); }
h4 { font-size: 12px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
small, .muted { color: var(--muted); font-size: 12.5px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 268px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #c7d2fe;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(20, 184, 166, .18), transparent 60%),
    linear-gradient(180deg, #1e1b4b 0%, #172033 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 210, 254, .25) transparent;
}
.brand {
  position: sticky; top: 0; z-index: 1;
  padding: 18px 18px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(30, 27, 75, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 55%, #4f46e5 100%);
  box-shadow: 0 6px 16px rgba(20, 184, 166, .35);
}
.brand-name { font-weight: 800; font-size: 14.5px; color: #fff; line-height: 1.3; }

/* Sidebar navigation: icon tiles for each module, a live count of visible links,
   a rail for sub-menus and a highlighted active state. Markup is built in app/layout.php. */
.nav { padding: 8px 10px 28px; display: grid; gap: 4px; }
.nav-icon {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.nav-tile {
  width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 11px; color: #e0e7ff;
  background: linear-gradient(135deg, rgba(129, 140, 248, .3), rgba(45, 212, 191, .16));
  border: 1px solid rgba(165, 180, 252, .22);
  transition: background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
}
.nav-group, .nav-single { border-radius: 14px; }
.nav-group[open] { background: rgba(255, 255, 255, .035); }
.nav-title, .nav-single {
  list-style: none; display: flex; align-items: center; gap: 11px;
  padding: 7px 10px 7px 7px; border-radius: 14px;
  color: #c7d2fe; font-size: 13.5px; font-weight: 700; line-height: 1.25;
  cursor: pointer; user-select: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-title::-webkit-details-marker { display: none; }
.nav-title:hover, .nav-single:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-title:focus-visible, .nav-single:focus-visible, .nav-link:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }
.nav-title:hover .nav-tile, .nav-single:hover .nav-tile { background: linear-gradient(135deg, #818cf8, #2dd4bf); color: #fff; }
.nav-group[open] > .nav-title .nav-tile,
.nav-single.active .nav-tile {
  background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 60%, #4f46e5 100%);
  color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(20, 184, 166, .35);
}
.nav-single.active { background: rgba(79, 70, 229, .32); color: #fff; box-shadow: inset 0 0 0 1px rgba(165, 180, 252, .25); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  flex-shrink: 0; min-width: 22px; padding: 2px 7px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 800; color: #a5b4fc; background: rgba(255, 255, 255, .08);
}
.nav-title::after {
  content: ""; width: 6px; height: 6px; flex-shrink: 0; margin-right: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .22s var(--ease);
  opacity: .75;
}
.nav-group[open] > .nav-title::after { transform: rotate(45deg); }
.nav-items {
  display: grid; gap: 2px; margin: 2px 6px 8px 24px; padding: 2px 0 2px 8px;
  border-left: 1px solid rgba(165, 180, 252, .2);
}
.nav-link {
  display: block; position: relative; padding: 7px 10px; border-radius: 9px;
  color: #c7d2fe; font-size: 13px; font-weight: 500; line-height: 1.35;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.nav-link:hover { background: rgba(129, 140, 248, .14); color: #fff; text-decoration: none; transform: translateX(2px); }
.nav-link.active { background: rgba(94, 234, 212, .14); color: #ccfbf1; font-weight: 700; }
.nav-link.active::before {
  content: ""; position: absolute; left: -9px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px;
  background: #5eead4; box-shadow: 0 0 8px rgba(94, 234, 212, .6);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.topbar-title { min-width: 0; }
.eyebrow {
  display: block; font-size: 11.5px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.user { color: var(--muted); font-size: 13px; }

.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, #6366f1, #0d9488);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 13px; color: var(--text); font-weight: 700; }
.user-meta small { font-size: 11.5px; color: var(--muted); }

.lang-switch {
  display: inline-flex; background: #eef2f7; border-radius: 10px; padding: 3px; gap: 2px;
}
.lang-switch a {
  padding: 5px 11px; color: var(--muted); font-size: 12.5px; font-weight: 700; border-radius: 8px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.lang-switch a:hover { color: var(--text); text-decoration: none; background: rgba(255, 255, 255, .6); }
.lang-switch a.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.content {
  padding: 26px 28px 56px;
  max-width: 1440px; width: 100%;
  animation: page-in .35s var(--ease) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff; color: var(--text-2);
  cursor: pointer; font-size: 13.5px; font-family: inherit; font-weight: 600; line-height: 1.2;
  box-shadow: var(--shadow-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease), color .15s var(--ease);
}
.btn:hover { text-decoration: none; background: #f1f5f9; border-color: #94a3b8; color: var(--text); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, .08); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .32);
}
.btn-primary:hover { background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%); color: #fff; box-shadow: 0 10px 22px rgba(79, 70, 229, .38); }
.btn-accent {
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(13, 148, 136, .3);
}
.btn-accent:hover { color: #fff; box-shadow: 0 10px 22px rgba(13, 148, 136, .36); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: #f1f5f9; box-shadow: none; }
.btn-danger { background: var(--bad-soft); border-color: var(--bad-border); color: var(--bad); box-shadow: none; }
.btn-danger:hover { background: #ffd5dc; color: #9f1239; }
.btn-small { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 18px; font-size: 15px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; margin-top: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline { display: inline; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards, tables, forms ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.student-photo { width: 76px; height: 76px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); background: #eef2ff; }
.student-photo.placeholder { display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 800; font-size: 26px; }
.profile-completion { margin-top: 16px; padding: 14px; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 12px; }
.profile-completion p { margin: 4px 0 10px; color: #475569; }
.portal-login-card { margin-top: 16px; padding: 14px; border: 1px solid var(--border); background: #f8fafc; border-radius: 12px; }
.portal-login-card label { margin-top: 8px; }
.admission-fee-heading { margin: 10px 0 -8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 16px; border-bottom: 1px solid #edf2f7; text-align: left; vertical-align: middle; }
th {
  background: var(--surface-2);
  font-weight: 700; font-size: 12px; color: var(--muted);
  white-space: nowrap; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover td { background: #f5f7ff; }
tbody tr:last-child td { border-bottom: none; }
td { color: var(--text-2); }
tr.total td { font-weight: 800; border-top: 2px solid var(--border-strong); background: var(--surface-2); color: var(--text); }
td.empty { text-align: center; color: var(--muted); padding: 34px; font-size: 14px; }
table.compact td { border-bottom: 1px dashed var(--border); padding: 9px 4px; }
table.compact td:first-child { color: var(--muted); width: 50%; font-weight: 600; }

/* Locked fields (for example the student ID) look locked, not editable. */
input[readonly] { background: #f1f5f9; color: #475569; border-style: dashed; cursor: not-allowed; }

input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; color: var(--text);
  background: #fff; max-width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-3); box-shadow: var(--focus); }
input:disabled, select:disabled, textarea:disabled { background: #f1f5f9; color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
.small-input { width: 110px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 20px; align-items: end; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Guided student admission ---------- */
.admission-wizard { display: block; max-width: 980px; margin-inline: auto; padding: 26px; }
.wizard-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; }
.wizard-progress > i { height: 2px; flex: 1; background: var(--border); }
.wizard-dot { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; padding: 0; white-space: nowrap; }
.wizard-dot span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); }
.wizard-dot.active { color: var(--primary); }
.wizard-dot.active span, .wizard-dot.done span { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .25); }
.wizard-dot.done { color: var(--accent); }
.wizard-step { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; animation: page-in .25s var(--ease) both; }
.wizard-step[hidden] { display: none; }
.wizard-heading { grid-column: 1 / -1; padding: 4px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.wizard-heading h2 { margin: 2px 0 2px; }
.wizard-heading p { margin: 0; }
.wizard-nav { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }
.check-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.check-row input { width: auto; }
.file-drop { padding: 14px; border: 1px dashed var(--border-strong); background: var(--surface-2); border-radius: 12px; }
.file-drop small { font-weight: 500; }

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 12px; margin-bottom: 18px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
  animation: page-in .3s var(--ease) both;
}
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.flash-success { background: var(--ok-soft); color: #065f46; border-color: var(--ok-border); }
.flash-danger { background: var(--bad-soft); color: #9f1239; border-color: var(--bad-border); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.5;
  background: #eef2f7; color: var(--text-2);
  border: 1px solid transparent;
}
.badge-ok { background: var(--ok-soft); color: #065f46; border-color: var(--ok-border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-bad { background: var(--bad-soft); color: #9f1239; border-color: var(--bad-border); }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 28px 32px; margin-bottom: 22px;
  color: #fff;
  background:
    radial-gradient(ellipse at 95% 0%, rgba(94, 234, 212, .35), transparent 42%),
    radial-gradient(ellipse at 0% 120%, rgba(129, 140, 248, .45), transparent 45%),
    linear-gradient(120deg, #1e1b4b 0%, #3730a3 55%, #4f46e5 100%);
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.hero::before {
  content: ""; position: absolute; right: 150px; bottom: -120px; width: 220px; height: 220px; border-radius: 50%;
  background: rgba(94, 234, 212, .12);
}
.hero h2 { font-size: 26px; margin: 6px 0 6px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.hero-date { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #a5f3fc; font-weight: 700; }
.hero-sub { margin: 0; color: #e0e7ff; font-size: 14.5px; }
.section-title { margin: 8px 0 12px; font-size: 16px; font-weight: 800; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  color: var(--text); font-weight: 700; font-size: 13.5px;
  box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.quick::before {
  content: ""; width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  box-shadow: 0 4px 10px rgba(79, 70, 229, .25);
}
.quick:nth-child(4n+2)::before { background: linear-gradient(135deg, #5eead4, #0d9488); box-shadow: 0 4px 10px rgba(13, 148, 136, .25); }
.quick:nth-child(4n+3)::before { background: linear-gradient(135deg, #6ee7b7, #059669); box-shadow: 0 4px 10px rgba(5, 150, 105, .25); }
.quick:nth-child(4n+4)::before { background: linear-gradient(135deg, #fcd34d, #d97706); box-shadow: 0 4px 10px rgba(217, 119, 6, .25); }
.quick:hover { text-decoration: none; color: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 14px 28px rgba(30, 27, 75, .12); border-color: #c7d2fe; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 17px; box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15, 23, 42, .1); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, #6366f1, #818cf8); }
.kpi-grid > .kpi:nth-child(7n+2)::before, .kpi-grid > .kpi:nth-child(7n+6)::before { background: linear-gradient(90deg, #14b8a6, #5eead4); }
.kpi-grid > .kpi:nth-child(7n+3)::before { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.kpi-grid > .kpi:nth-child(7n+4)::before { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.kpi-grid > .kpi:nth-child(7n+5)::before { background: linear-gradient(90deg, #f43f5e, #fda4af); }
.kpi-grid > .kpi:nth-child(7n+7)::before { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-money b { font-size: 20px; }
.kpi-net::before { background: linear-gradient(90deg, #0d9488, #2dd4bf) !important; }
.kpi-net b { color: var(--accent); }

.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mini-grid > div {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px;
  transition: background .15s var(--ease);
}
.mini-grid > div:hover { background: #fff; }
.mini-grid span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.mini-grid b { font-size: 18px; font-weight: 800; color: var(--text); }
.mini-grid .due { background: var(--bad-soft); border-color: var(--bad-border); }
.mini-grid .due b { color: var(--bad); }

.seg { display: inline-flex; background: #eef2f7; border-radius: 11px; padding: 3px; gap: 2px; }
.seg a { padding: 7px 14px; color: var(--muted); font-size: 12.5px; font-weight: 700; border-radius: 8px; transition: all .15s var(--ease); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .14); }
.seg-wide { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg-wide a {
  padding: 8px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--border-strong);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: all .15s var(--ease);
}
.seg-wide a:hover { text-decoration: none; border-color: var(--primary-3); color: var(--primary); }
.seg-wide a.on { background: linear-gradient(135deg, #4f46e5, #4338ca); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(79, 70, 229, .3); }

.bar-row { display: grid; grid-template-columns: 110px 1fr 150px; align-items: center; gap: 14px; margin-bottom: 14px; }
.bar { height: 12px; background: #e9eef6; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .6s var(--ease); }
.bar-green { background: linear-gradient(90deg, #5eead4, #0d9488); }
.bar-red { background: linear-gradient(90deg, #fb7185, #e11d48); }
.bar-amber { background: linear-gradient(90deg, #fcd34d, #d97706); }
.bar-blue { background: linear-gradient(90deg, #a5b4fc, #4f46e5); }
.bar-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.bar-value { font-size: 13px; color: var(--text); font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.dashboard-filter { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 15px 18px; }
.dashboard-filter label { min-width: 170px; }
.dashboard-filter select, .dashboard-filter input { min-width: 160px; }
.dashboard-filter > .muted { margin: 0 0 10px auto; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(45, 212, 191, .35), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(129, 140, 248, .45), transparent 40%),
    linear-gradient(135deg, #1e1b4b 0%, #172033 100%);
}
.login-card {
  width: 420px; max-width: 100%;
  background: #fff; border-radius: 22px; padding: 34px 34px 30px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
  animation: page-in .5s var(--ease) both;
}
.login-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.login-mark {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 50%, #4f46e5 100%);
  box-shadow: 0 8px 20px rgba(20, 184, 166, .35);
}
.login-title { font-size: 21px; margin-bottom: 4px; line-height: 1.35; }
.login-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; font-weight: 600; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.login-card input { width: 100%; padding: 12px 14px; }
.login-lang { text-align: right; }

/* ---------- Receipt and marksheet (print) ---------- */
.receipt-page { background: #eef2f7; padding: 24px; }
.receipt { max-width: 780px; margin: 0 auto; background: #fff; padding: 30px 34px; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.receipt-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--primary-dark); padding-bottom: 14px; }
.receipt-head h2 { margin: 0; }
.logo { max-height: 70px; max-width: 90px; }
.receipt-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin: 14px 0; font-size: 13.5px; }
.receipt-status { text-align: center; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); margin: 10px 0; font-weight: 800; }
.receipt-status.bad { color: var(--bad); }
.receipt-table { width: 100%; margin-bottom: 10px; font-size: 13.5px; }
.receipt-table td { padding: 6px 6px; border: none; }
.receipt-table.bordered th, .receipt-table.bordered td { border: 1px solid var(--border); }
.receipt-table.summary { width: 60%; margin-left: auto; }
.receipt-table.summary td { border-bottom: 1px dashed var(--border); }

/* ---------- Print ---------- */
@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  body, .receipt-page { background: #fff; }
  .receipt { border: none; box-shadow: none; max-width: 100%; }
  .layout { display: block; }
  .card, .table-wrap, .kpi { box-shadow: none; }
  .content { animation: none; padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .sidebar { width: 232px; }
}
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: relative; overflow: visible;
  }
  .brand { position: relative; }
  .nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .nav-group, .nav-single { flex: 1 1 200px; background: rgba(255, 255, 255, .04); }
  .nav-group[open] { background: rgba(255, 255, 255, .06); }
  .nav-items { margin-left: 14px; }
  .topbar { padding: 12px 16px; position: sticky; }
  .content { padding: 18px 16px 40px; }
  .hero { padding: 22px 20px; }
  .hero h2 { font-size: 21px; }
  .bar-row { grid-template-columns: 90px 1fr 100px; }
  .dashboard-filter > .muted { margin: 0; width: 100%; }
}
@media (max-width: 560px) {
  .user-chip .user-meta { display: none; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-value { text-align: left; }
  .login-card { padding: 26px 22px; }
  .admission-wizard { padding: 18px; }
  .wizard-step { grid-template-columns: 1fr; }
  .wizard-step .span-2, .wizard-heading, .wizard-nav { grid-column: 1; }
  .wizard-progress { gap: 5px; }
  .wizard-dot { font-size: 0; }
  .wizard-dot span { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
