@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #1E5A4A;
  --navy-deep: #123D31;
  --navy-light: #2C7A63;
  --gold: #D9A736;
  --gold-light: #E8C888;
  --bg: #F6F4EF;
  --panel: #FFFFFF;
  --border: #E6E1D6;
  --text: #22252B;
  --muted: #6C7280;
  --green: #3F7C56;
  --green-bg: #E8F3EC;
  --red: #B94A3C;
  --red-bg: #FBEAE7;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(18,61,49,0.06), 0 2px 6px rgba(18,61,49,0.05);
  --shadow-md: 0 4px 14px rgba(18,61,49,0.10), 0 2px 5px rgba(18,61,49,0.06);
  --shadow-accent: 0 3px 10px rgba(30,90,74,0.22);
  --focus-ring: 0 0 0 3px rgba(217,167,54,0.30);
  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #EDEBE3;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--gold);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 auto; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.2px; line-height: 1.3; }
.brand-sub { font-size: 11px; color: rgba(237,235,227,0.55); letter-spacing: 0.5px; text-transform: uppercase; }

.nav {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: rgba(237,235,227,0.75);
  padding: 11px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; color: var(--gold-light); }

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.nav-item.active {
  background: rgba(212,162,76,0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
  padding: 14px 20px;
  font-size: 12px;
  color: rgba(237,235,227,0.4);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------------- Main ---------------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin: 0;
  color: var(--navy);
}

.topbar-date { font-size: 13px; color: var(--muted); }

/* Sync status pill (Phase 3) — topbar indicator of Supabase sync state */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.sync-online  { background: #e8f5e9; color: #2e7d32; }
.sync-syncing { background: #fff8e1; color: #f57f17; }
.sync-offline { background: #fbe9e7; color: #c62828; }
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.sync-online  .sync-dot { background: #2e7d32; }
.sync-syncing .sync-dot { background: #f57f17; animation: sync-pulse 1s infinite; }
.sync-offline .sync-dot { background: #c62828; }
@keyframes sync-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 40px;
  position: relative;
}
.content::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 480px; height: 480px;
  background: url('assets/logo.png') center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
.content > * { position: relative; z-index: 1; }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Stat Cards ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-grid.small { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-top: 3px solid var(--navy);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--navy-light); }
.stat-card.accent-navy { border-top-color: var(--navy); }
.stat-card.accent-gold { border-top-color: var(--gold); }
.stat-card.accent-green { border-top-color: var(--green); }
.stat-card.accent-red { border-top-color: var(--red); }

.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--navy); }

/* ---------------- Dashboard Charts ---------------- */
.dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr) 1.4fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .dash-charts-grid { grid-template-columns: 1fr; }
}
.chart-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
  animation: dashPop 0.5s ease both;
}
.chart-card-wide { align-items: stretch; }

.donut-wrap { display: flex; justify-content: center; padding: 4px 0 2px; }
.donut-svg { width: 150px; height: 150px; }
.donut-track { fill: none; stroke: var(--bg); stroke-width: 14; }
.donut-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.donut-value { font-family: var(--font-display); font-size: 21px; font-weight: 700; fill: var(--navy); }
.donut-sub { font-size: 10px; fill: var(--muted); }

.bar-chart { display: flex; flex-direction: column; gap: 11px; padding: 4px 2px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 32px; align-items: center; gap: 10px; }
.bar-label { font-size: 12.5px; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; height: 14px; overflow: hidden; }
.bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--gold) 100%);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-count { font-size: 12.5px; font-weight: 700; color: var(--navy); text-align: right; }
.trend-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.trend-heading h3 { margin:0; }
.trend-bars { min-height:175px; display:flex; align-items:flex-end; gap:14px; padding:8px 6px 0; border-bottom:1px solid var(--border); }
.trend-month { flex:1; min-width:76px; text-align:center; display:flex; flex-direction:column; gap:5px; color:var(--muted); font-size:11px; }
.trend-columns { height:138px; display:flex; justify-content:center; align-items:flex-end; gap:6px; }
.trend-fee,.trend-expense { width:18px; min-height:3px; border-radius:6px 6px 0 0; transition:height .5s ease; }
.trend-fee { background:var(--green); }.trend-expense { background:var(--gold); }.trend-month b { color:var(--text); }.trend-month small { font-size:9px; white-space:nowrap; }
.attendance-summary { display:flex; gap:8px; margin:0 0 12px; }
.staff-attendance-panel .table-panel { margin-bottom:0; }
.diary-group-label { display:block; max-width:650px; margin:8px 0 16px; font-weight:600; font-size:12px; color:var(--muted); }.diary-group-label .input { margin-top:5px; }
.diary-sheet { max-width:840px; margin:0 auto; background:#fff; border:2px solid var(--navy); padding:18px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.diary-sheet-title { border-bottom:4px solid var(--navy); padding:6px 0 12px; margin-bottom:14px; display:flex; justify-content:space-between; color:var(--navy); font-family:var(--font-display); font-size:16px; }.diary-sheet-title span { font-size:13px; }
.diary-sheet .table thead { background:var(--navy); }.diary-sheet .input { width:100%; border:0; background:transparent; padding:3px; }.diary-note { margin:18px 0 0; font-weight:600; font-size:12px; text-decoration:underline; }
.diary-entry { display:flex; align-items:center; gap:8px; }.diary-entry .diary-text { flex:1; }.diary-remove { white-space:nowrap; }
.print-sheet { background:#fff; color:#111; padding:12px; }.print-header { display:flex; align-items:center; justify-content:center; gap:16px; border-bottom:3px solid var(--navy); padding-bottom:12px; margin-bottom:15px; text-align:center; }.print-header img { width:64px; height:64px; object-fit:contain; }.print-header h1 { margin:0; color:var(--navy); font-size:21px; }.print-header h2 { margin:7px 0 0; font-size:15px; }.print-header p { margin:3px 0; font-size:12px; }.print-table { width:100%; border-collapse:collapse; }.print-table th { background:var(--navy); color:#fff; text-align:left; }.print-table th,.print-table td { border:1px solid #555; padding:8px; }.print-date { font-size:11px; color:#555; margin-top:20px; }
@media (max-width:700px) { .trend-heading { align-items:flex-start; flex-direction:column; }.trend-bars { overflow-x:auto; }.trend-month { min-width:68px; } }

@keyframes dashPop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Panels & Tables ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel h3 { font-family: var(--font-display); font-size: 15px; margin: 0 0 10px; color: var(--navy); }
.muted { color: var(--muted); font-size: 13px; }

.table-panel { padding: 0; overflow-x: auto; overflow-y: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead { background: var(--navy); color: #F1EFE8; }
/* The subject-remove "✕" in the marks-entry grid header sits on the same
   dark thead background as --navy, and .btn-link's default text color is
   also var(--navy) — so it was rendering nearly invisible. Force it white
   with a clear hover state instead. */
.subject-remove-btn {
  color: #fff !important;
  opacity: 0.85;
  font-size: 12px;
  text-decoration: none;
}
.subject-remove-btn:hover { opacity: 1; color: #FBEAE7 !important; text-decoration: underline; }
.table th { text-align: left; padding: 12px 16px; font-weight: 600; font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: #E9EFEB; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: #F4F8F5; }
.table tbody tr:last-child td { border-bottom: none; }
.table-panel h3 { padding: 18px 22px 0; position: sticky; left: 0; z-index: 2; background: var(--panel); }

/* Compact inline controls inside table rows (Class Management, Sessions,
   Class Settings, etc.) — keep rows tidy instead of stretched full-size inputs. */
.table .input {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: none;
}
.table .input:focus { box-shadow: var(--focus-ring); }
.table .input.select { min-width: 0; }
.table .row-actions .btn-link,
.table .row-actions .btn-danger-text { white-space: nowrap; }

/* ---------------- Toolbar / Inputs ---------------- */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.input {
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input:focus { border-color: var(--navy-light); box-shadow: var(--focus-ring); }
.input[readonly] { background: #F7F5EF; color: var(--text); }
.select { min-width: 150px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--navy); cursor: pointer; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: var(--shadow-accent); }
.btn-primary:hover { background: var(--navy-light); border-color: var(--navy-light); box-shadow: 0 5px 14px rgba(30,90,74,0.28); }
.btn-gold { background: var(--gold); color: var(--navy-deep); border-color: var(--gold); }
.btn-gold:hover { background: #E4B84B; border-color: #E4B84B; }
.btn-ghost { background: var(--panel); color: var(--navy); border-color: var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--bg); border-color: var(--navy-light); color: var(--navy); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #C85A4B; border-color: #C85A4B; }
.btn-danger-text { background: transparent; color: var(--red); border: none; cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 0; box-shadow: none; border-radius: 0; }
.btn-danger-text:hover { color: #C85A4B; text-decoration: underline; }
.btn-link { background: transparent; color: var(--navy); border: none; cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 0; box-shadow: none; border-radius: 0; text-decoration: underline; }
.btn-link:hover { color: var(--navy-light); }
.btn-sm { font-size: 12px; padding: 6px 12px; border-radius: 7px; }
.btn-xs { font-size: 11px; padding: 4px 9px; border-radius: 6px; }
.btn-whatsapp {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  background: #25D366;
  color: #fff;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.16s ease, opacity 0.15s ease;
}
.btn-whatsapp:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 3px 9px rgba(37,211,102,0.35); }
.btn-whatsapp:active { transform: scale(0.97); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.pill-paid { background: var(--green-bg); color: var(--green); }
.pill-unpaid { background: var(--red-bg); color: var(--red); }
.pill-partial { background: #FCF3DF; color: #9C6F1B; }

.row-actions { white-space: nowrap; }
.row-actions .btn-link, .row-actions .btn-danger-text { display: inline-block; margin: 1px 2px; }
.row-actions .btn-link, .row-actions .btn-danger-text {
  border: 1px solid transparent;
  padding: 2px 6px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
  box-shadow: none;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.row-actions .btn-link { background: var(--green-bg); color: var(--navy); }
.row-actions .btn-link:hover { background: #DCEBE1; border-color: var(--navy-light); color: var(--navy); text-decoration: none; }
.row-actions .btn-danger-text { background: var(--red-bg); color: var(--red); }
.row-actions .btn-danger-text:hover { background: #F5DAD6; border-color: var(--red); color: var(--red); text-decoration: none; }

/* ---------------- Modals ---------------- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,24,48,0.45);
  align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.active { display: flex; }

.modal {
  display: none;
  background: var(--panel);
  border-radius: 12px;
  padding: 28px 30px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal.active { display: block; }
.modal-wide { width: 640px; }
.modal-ledger { width: 860px; max-width: 96vw; }
.modal-cert { width: 980px; max-width: 94vw; }
/* Used for report/preview-style modals (ID cards, defaulters, attendance
   report, receipts, result cards, admission form) — these show tables or
   card grids that need real room, unlike the small data-entry forms which
   keep the narrower .modal / .modal-wide sizing. */
.modal-print { width: 1100px; max-width: 95vw; max-height: 92vh; }
.modal-print > div { overflow-x: auto; }

/* ---------------- Modal titlebar (minimize / maximize / close) ---------------- */
.modal-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  margin: -28px -30px 18px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.modal-titlebar-title { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--navy); }
.modal-titlebar-controls { display: flex; gap: 8px; }
.mdl-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.mdl-btn:hover { background: var(--bg); color: var(--navy); }
.mdl-btn.mdl-max:hover { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.mdl-btn.mdl-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.modal.modal-maximized { width: 96vw; max-width: 96vw; height: 92vh; max-height: 92vh; }
.modal.modal-minimized { max-height: 54px; overflow: hidden; cursor: pointer; }
.modal.modal-minimized .modal-titlebar { margin-bottom: 0; border-radius: 12px; border-bottom: none; }
.modal.modal-minimized > *:not(.modal-titlebar) { display: none; }
.modal h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 18px; color: var(--navy); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-grid label.full { grid-column: 1 / -1; }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.photo-upload-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.photo-preview {
  width: 64px; height: 64px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; color: var(--muted); text-align: center;
  overflow: hidden; flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.form-row .input { flex: 1; min-width: 140px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------------- Sectioned large forms (admission, leaving) ---------------- */
.modal-form { width: 900px; max-width: 94vw; max-height: 90vh; }
.form-section { margin-bottom: 20px; }
.form-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.form-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 16px;
}
.doc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.doc-check input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--navy); }
.fee-total-label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fee-total-label strong { font-family: var(--font-display); font-size: 17px; color: var(--navy); }
.lv-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 18px;
  font-size: 13px;
}
.lv-summary b { color: var(--navy); }

/* Enroll confirmation summary (Admissions → Enroll) */
.enroll-summary {
  background: linear-gradient(180deg, #F1F7F3 0%, #F7FAF8 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 20px;
  font-size: 13.5px;
  line-height: 1.7;
  box-shadow: var(--shadow-sm);
}
.enroll-summary b { color: var(--navy); }
.enroll-roll-note { font-size: 12px; display: block; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.tab-btn:hover { background: var(--bg); color: var(--navy); border-color: var(--navy-light); transform: translateY(-1px); }
.tab-btn:active { transform: none; }
.tab-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: var(--shadow-accent); }
.tab-btn.active:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
/* Fees V2 module tabs */
.fee-tab-content { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
#page-fees .tabs { margin-bottom: 12px; }
.ledger-pay-row.reversed { opacity: 0.55; }
.ledger-pay-row.reversed::after { content: ' — REVERSED'; color: var(--red); font-weight: 700; font-size: 11px; }
.allo-chip { display: inline-block; background: var(--bg, #f2f2ef); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 11px; margin-right: 4px; }
#report-content { padding: 16px 18px; }

/* Staff attendance quick status buttons */
.stf-qbtn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.stf-qbtn:hover { border-color: var(--navy-light); color: var(--navy); }
.stf-qbtn.stf-qbtn-active { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--shadow-accent); }

/* ---------------- Dashboard operations ---------------- */
.dash-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .dash-ops-grid { grid-template-columns: 1fr; } }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-detail { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.activity-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-list li:last-child { border-bottom: none; }
.activity-date { color: var(--muted); font-size: 11.5px; white-space: nowrap; min-width: 96px; }
.activity-summary { flex: 1; }
.activity-actor { color: var(--muted); font-size: 11.5px; }
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.alert-row:hover { background: var(--bg); border-color: var(--navy-light); }
.alert-row .alert-count { font-weight: 700; font-size: 13px; }
.alert-row.alert-urgent .alert-count { color: var(--red); }
.alert-row.alert-warn .alert-count { color: #9C6F1B; }
.dash-stat-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--navy); }
.dash-fee-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dash-fee-row:last-child { border-bottom: none; }
.dash-fee-row b { color: var(--navy); }
.timeline-empty { padding: 16px 0; color: var(--muted); font-size: 13px; }

/* ---------------- Fee modal: searchable picker + student summary ---------------- */
.fee-student-summary {
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.fee-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.fee-summary-total b { color: var(--navy); }

/* ---------------- Report Card (legacy hook kept for other doc logos) ---------------- */
.doc-logo {
  display: block;
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  margin: 0 auto 6px;
}
.receipt-header-brand { display: flex; align-items: center; gap: 12px; }
.receipt-header-brand .doc-logo { margin: 0; }

/* ---------------- Result Card (black & white printable format) ---------------- */
.result-card {
  background: #fff;
  color: #000;
  border: 2.5px solid #000;
  padding: 22px 26px;
  font-family: var(--font-body);
}
.result-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 2px solid #000;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.result-logo {
  width: 70px; height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
  flex-shrink: 0;
  filter: grayscale(1) contrast(1.15);
}
.result-header-text { flex: 1; text-align: center; }
.result-header-text h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.5px;
  color: #000;
}
.result-header-text p { margin: 0; font-size: 13px; color: #000; }
.result-card-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1.5px solid #000;
  padding: 6px 10px;
  margin-bottom: 14px;
}
.result-info-table, .result-marks-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.result-info-table td, .result-marks-table th, .result-marks-table td {
  border: 1.5px solid #000;
  padding: 7px 12px;
  color: #000;
}
.result-info-table td.label { font-weight: 700; width: 1%; white-space: nowrap; }
.result-marks-table th { font-weight: 700; text-align: left; background: #fff; }
.result-marks-table td:first-child, .result-marks-table th:first-child { text-align: center; width: 60px; }
.result-marks-table td:nth-child(3), .result-marks-table td:nth-child(4),
.result-marks-table th:nth-child(3), .result-marks-table th:nth-child(4) { text-align: center; }
.result-total-row td { font-weight: 700; text-align: center; }
.result-total-row td:first-child { text-align: left; }
.result-remarks {
  border: 1.5px solid #000;
  padding: 10px 12px;
  margin-bottom: 30px;
  font-size: 13.5px;
  min-height: 50px;
}
.result-remarks .label { font-weight: 700; margin-bottom: 4px; }
.result-remarks p { margin: 0; }
.result-signatures { display: flex; justify-content: space-between; padding: 0 20px; }
.result-signatures .sig { text-align: center; font-size: 13px; font-weight: 600; color: #000; }
.result-signatures .sig .line { width: 160px; border-top: 1.5px solid #000; margin-bottom: 6px; }

/* ---------------- Certificate (A4 landscape) ---------------- */
.certificate {
  position: relative;
  width: 100%;
  aspect-ratio: 297 / 210;
  background: #F6F4EC;
  border: 10px solid var(--navy-deep);
  box-shadow: inset 0 0 0 3px var(--gold);
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--navy-deep);
  box-sizing: border-box;
}
.cert-corner {
  position: absolute;
  width: 19%;
  aspect-ratio: 1 / 1;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(135deg, var(--navy-deep) 0 58%, var(--gold) 58% 63%, transparent 63%);
  opacity: 0.85;
}
.cert-corner-tl { top: -3%; left: -3%; clip-path: polygon(0 0, 100% 0, 0 100%); }
.cert-corner-br {
  bottom: -3%; right: -3%;
  clip-path: polygon(100% 100%, 0 100%, 100% 0);
  background: linear-gradient(-45deg, var(--navy-deep) 0 58%, var(--gold) 58% 63%, transparent 63%);
}
.cert-frame { position: relative; z-index: 1; height: 100%; padding: 3.2% 6.5% 3.6% 4.5%; display: flex; flex-direction: column; box-sizing: border-box; }
.cert-no { position: absolute; top: 2%; right: 3%; font-size: 0.7em; color: var(--muted); text-align: right; z-index: 2; }
.cert-no b { color: var(--navy-deep); }

.cert-header { display: flex; align-items: center; gap: 22px; margin-bottom: 6px; }
.cert-seal {
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: 50%;
  background: #F6F4EC;
  border: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--navy-deep);
}
.cert-seal img { width: 100%; height: 100%; object-fit: cover; }
.cert-brand { flex: 1; text-align: center; }
.cert-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: 10px;
  color: var(--navy-deep);
  line-height: 1;
}
.cert-brand-line {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 4px;
  color: var(--navy-deep);
  margin: 6px 0 8px;
}
.cert-brand-line span { flex: 0 0 90px; border-top: 1.5px solid var(--gold); }
.cert-badge {
  display: inline-block;
  background: var(--navy-deep);
  color: #F6F4EC;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 4px 18px;
  border-radius: 2px;
  margin-bottom: 6px;
}
.cert-tagline { font-size: 12px; font-style: italic; color: var(--navy-light); }

.cert-title-row { text-align: center; margin: 8px 0 16px; }
.cert-title {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 4px;
  color: var(--navy-deep);
  position: relative;
  padding-bottom: 8px;
}
.cert-title::after {
  content: '';
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 90px; height: 3px;
  background: var(--gold);
}

.cert-body-wrap { flex: 1; display: grid; grid-template-columns: 110px 1fr; gap: 22px; min-height: 0; }
.cert-sidebar { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cert-sidebar-shield { width: 46px; height: 46px; color: var(--gold); margin-bottom: 2px; }
.cert-sidebar-shield svg { width: 100%; height: 100%; }
.cert-feature { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.cert-feature-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  padding: 9px; box-sizing: border-box;
}
.cert-feature-icon svg { width: 100%; height: 100%; }
.cert-feature-text { font-size: 9px; font-weight: 700; letter-spacing: 0.4px; color: var(--navy-deep); text-transform: uppercase; line-height: 1.3; opacity: 0.9; }

.cert-main { display: flex; flex-direction: column; min-width: 0; }
.cert-intro { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--navy-deep); }
.cert-fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; margin-bottom: 16px; }
.cert-field { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid rgba(29, 33, 66, 0.16); min-width: 0; }
.cert-field--wide { grid-column: 1 / -1; }
.cert-field-label { font-weight: 700; color: var(--navy-deep); flex: 0 0 116px; font-size: 10.5px; letter-spacing: 0.4px; text-transform: uppercase; opacity: 0.62; }
.cert-field-colon { flex: 0 0 6px; color: var(--navy-deep); opacity: 0.4; }
.cert-field-value { flex: 1; color: var(--navy-deep); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-field-value--upper { text-transform: uppercase; font-weight: 700; }
.cert-field-split { display: contents; }
.cert-field-split .cert-field-half { display: contents; }
.cert-closing { font-size: 12.5px; line-height: 1.7; margin: 0 0 auto; color: var(--navy-deep); }
.cert-closing b { color: var(--navy-deep); }

.cert-signatures { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 20px; padding: 0 60px 4px 4px; }
.cert-sig { text-align: center; font-size: 12px; font-weight: 700; color: var(--navy-deep); }
.cert-sig-line { width: 130px; border-top: 1.3px solid var(--navy-deep); margin-bottom: 6px; }
.cert-sig-sub { display: block; font-size: 9px; font-weight: 500; color: var(--muted); margin-top: 3px; }

/* ---------------- Admission Form ---------------- */
.admission-form {
  border: 2px solid var(--navy);
  border-radius: 10px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.admission-form::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 320px; height: 320px;
  background: url('assets/logo.png') center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.admission-form > * { position: relative; }
.admission-form-header { text-align: center; border-bottom: 2px solid var(--gold); padding-bottom: 14px; margin-bottom: 18px; }
.admission-form-header img { display: block; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--gold); margin: 0 auto 6px; }
.admission-form-header h2 { font-family: var(--font-display); color: var(--navy); margin: 0 0 4px; }
.admission-form-header p { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.admission-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; font-size: 13.5px; margin-bottom: 20px; }
.admission-form-grid .full { grid-column: 1 / -1; }
.admission-form-grid b { color: var(--navy); display: inline-block; min-width: 130px; }
.admission-form-signatures { display: flex; justify-content: space-between; margin-top: 40px; }
.admission-form-signatures .sig { text-align: center; font-size: 11.5px; color: var(--muted); }
.admission-form-signatures .sig .line { width: 150px; border-top: 1px solid var(--border); margin-bottom: 4px; }
.admission-form-section {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin: 18px 0 10px;
}
.admission-form-section:first-of-type { margin-top: 4px; }
.admission-form-fees { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 12px; }
.admission-form-fees th { text-align: left; font-family: var(--font-head); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.5px; color: var(--muted); border-bottom: 2px solid var(--gold); padding: 5px 8px; }
.admission-form-fees td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.admission-form-fees tr:last-child td { border-bottom: none; }
.admission-form-fees td:nth-child(2), .admission-form-fees th:nth-child(2) { text-align: right; width: 110px; }
.admission-form-fees td:nth-child(3), .admission-form-fees th:nth-child(3) { width: 140px; text-align: left; }
.admission-form-grid.fee-totals { background: var(--green-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.admission-form-grid.fee-totals b { min-width: 110px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8D3C6; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- ID Cards ---------------- */
.idcards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}
.id-card {
  width: 3.375in;
  height: 2.125in;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #F1EFE8;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}
.id-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 90px;
  background: radial-gradient(circle at top right, rgba(212,162,76,0.35), transparent 70%);
}
.id-card::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 140px; height: 140px;
  background: url('assets/logo.png') center / contain no-repeat;
  opacity: 0.09;
  pointer-events: none;
}
.id-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid var(--gold);
  padding-bottom: 8px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.id-card-header .brand-mark { width: 26px; height: 26px; font-size: 13px; }
.id-card-school { font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.id-card-school small { display: block; font-weight: 400; font-size: 9px; color: var(--gold-light); text-transform: uppercase; letter-spacing: 0.5px; }
.id-card-body { display: flex; gap: 12px; flex: 1; align-items: center; position: relative; z-index: 1; }
.id-card-photo {
  width: 62px; height: 74px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: rgba(241,239,232,0.6);
  overflow: hidden; flex-shrink: 0;
}
.id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card-info { font-size: 11px; line-height: 1.55; }
.id-card-info .id-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 2px; color: #fff; }
.id-card-info b { color: var(--gold-light); font-weight: 600; }
.id-card-footer { font-size: 8.5px; color: rgba(241,239,232,0.45); text-align: center; margin-top: 8px; letter-spacing: 0.4px; position: relative; z-index: 1; }

@media print {
  .idcards-grid { gap: 10px; }
  /* Without print-color-adjust, browsers drop background graphics by
     default when printing/saving to PDF — that's why the card's navy
     background, gold accents and logo watermark were disappearing. */
  .id-card, .id-card * {
    box-shadow: none;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------------- Fee Receipt ---------------- */
.receipt {
  border: 2px solid var(--navy);
  border-radius: 10px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.receipt::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  background: url('assets/logo.png') center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}
.receipt > * { position: relative; }
.receipt-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 14px; margin-bottom: 16px;
}
.receipt-header h2 { font-family: var(--font-display); color: var(--navy); margin: 0 0 2px; }
.receipt-header p { margin: 0; color: var(--muted); font-size: 12.5px; }
.receipt-no { text-align: right; font-size: 12.5px; color: var(--muted); }
.receipt-no b { color: var(--navy); font-family: var(--font-display); }
.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 18px; font-size: 13.5px; }
.receipt-meta b { color: var(--navy); }
.receipt-amount-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.receipt-amount-table th { background: var(--navy); color: #fff; padding: 9px 12px; font-size: 12.5px; text-align: left; }
.receipt-amount-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.receipt-amount-table tr.total-row td { font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); border-bottom: none; }
.receipt-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 30px; }
.receipt-footer .stamp { text-align: center; font-size: 11px; color: var(--muted); }
.receipt-footer .stamp .line { width: 140px; border-top: 1px solid var(--border); margin-bottom: 4px; }

/* Named pages: result card prints A4 portrait, certificate prints A4 landscape */
@page result-portrait { size: A4 portrait; margin: 10mm; }
@page cert-landscape { size: A4 landscape; margin: 8mm; }
.result-card { page: result-portrait; }
.certificate { page: cert-landscape; }

@media print {
  html, body { height: auto !important; overflow: visible !important; }
  .app, .modal-actions { display: none !important; }
  /* The titlebar (minimize/maximize/close) is on-screen chrome for the
     modal only — it was leaking into printed output and its negative
     margin (meant to offset the modal's screen padding) was pushing
     everything down once print padding was reset to 0, producing a
     blank leading page before the real content. Drop it entirely. */
  .modal-titlebar { display: none !important; }
  .modal-overlay {
    position: static !important;
    background: none;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  .modal-wide, .modal, .modal-cert {
    box-shadow: none; width: 100%; max-width: none; padding: 0;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Force the result card to print strictly in black & white, regardless of screen theme */
  .result-card, .result-card * {
    color: #000 !important;
    background: #fff !important;
    border-color: #000 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .result-logo { filter: grayscale(1) contrast(1.15) !important; }
  .result-card { aspect-ratio: auto; width: 100%; }
  .btn-whatsapp, #btn-wa-send-all { display: none !important; }
  #defaulters-content table th:last-child, #defaulters-content table td:last-child { display: none; }

  /* Certificate: fill the full landscape A4 printable area and keep the
     gold/navy design in print output. */
  .certificate {
    aspect-ratio: auto;
    width: 100%;
    height: 100vh;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------------- Settings Page ---------------- */
.settings-swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.settings-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--navy); }
.settings-mode-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------------- Developer Page ---------------- */
.developer-card { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.developer-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; flex-shrink: 0; }
.developer-photo { width: 130px; height: 130px; border-radius: 50%; font-size: 12px; border: 2px dashed var(--border); }
.developer-info { flex: 1; min-width: 260px; }
.developer-name { font-family: var(--font-display); font-size: 22px; color: var(--navy); margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
.verified-badge { display: inline-flex; align-items: center; }
.verified-badge svg { display: block; }
.developer-role {
  display: inline-block;
  background: var(--gold-light);
  color: var(--navy-deep);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 14px;
}
.developer-intro { color: var(--text); font-size: 14px; line-height: 1.65; max-width: 640px; margin: 0 0 20px; }
.developer-contact { display: flex; gap: 14px; flex-wrap: wrap; }
.developer-contact-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.developer-contact-item:hover { background: var(--green-bg); border-color: var(--navy-light); }
.developer-contact-icon { font-size: 18px; color: var(--navy); }
.developer-contact-label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.developer-contact-value { display: block; font-size: 13.5px; font-weight: 600; }

/* ---------------- Dark Mode ---------------- */
body.theme-dark {
  --bg: #14181C;
  --panel: #1C2126;
  --border: #2A3138;
  --text: #E8E9EA;
  --muted: #9BA3AC;
  --green-bg: #16281F;
  --red-bg: #2E1917;
}
body.theme-dark .stat-card,
body.theme-dark .developer-contact-item:hover,
body.theme-dark .enroll-summary { background: var(--green-bg); }
body.theme-dark .enroll-summary { border-color: var(--border); }
body.theme-dark .input[readonly] { background: #232A2E; }
body.theme-dark .stf-qbtn { background: var(--panel); }
body.theme-dark .row-actions .btn-link { background: var(--green-bg); }
body.theme-dark .settings-swatch.active { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold); }

/* ---------------- App Lock Overlay ---------------- */
.lock-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 55%, #0B211B 100%);
  background-size: 220% 220%;
  overflow: hidden;
}
.lock-overlay.active { display: flex; animation: lockBgShift 14s ease infinite; }

/* Animated ambient glow blobs */
.lock-overlay::before,
.lock-overlay::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(70px); pointer-events: none;
}
.lock-overlay::before {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(217,167,54,0.35) 0%, rgba(217,167,54,0) 70%);
  top: -120px; left: -100px;
  animation: lockFloat1 9s ease-in-out infinite;
}
.lock-overlay::after {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(44,122,99,0.55) 0%, rgba(44,122,99,0) 70%);
  bottom: -140px; right: -100px;
  animation: lockFloat2 11s ease-in-out infinite;
}

/* Floating particles layer */
.lock-particles {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.lock-particles span {
  position: absolute; bottom: -20px;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(232,200,136,0.55);
  animation: lockParticleUp linear infinite;
}

@keyframes lockBgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes lockFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.15); }
}
@keyframes lockFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -40px) scale(1.1); }
}
@keyframes lockParticleUp {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

.lock-box {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px; padding: 42px 36px;
  width: 100%; max-width: 380px;
  box-shadow: 0 25px 70px rgba(0,0,0,0.45), 0 0 0 1px rgba(217,167,54,0.08);
  text-align: center;
  animation: lockBoxIn 0.65s cubic-bezier(.2,.9,.25,1.15);
}
body.theme-dark .lock-box { background: rgba(30,42,36,0.92); color: var(--text); }

@keyframes lockBoxIn {
  0% { opacity: 0; transform: translateY(28px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.lock-box.shake { animation: lockShake 0.45s ease; }
@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.lock-logo img {
  width: 78px; height: 78px; border-radius: 50%; object-fit: cover;
  margin-bottom: 14px; border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(217,167,54,0.15), 0 8px 24px rgba(30,90,74,0.25);
  animation: lockLogoPulse 2.6s ease-in-out infinite;
}
@keyframes lockLogoPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(217,167,54,0.15), 0 8px 24px rgba(30,90,74,0.25); }
  50% { box-shadow: 0 0 0 12px rgba(217,167,54,0.06), 0 8px 24px rgba(30,90,74,0.25); }
}
.lock-box h2 {
  margin: 0 0 6px; font-family: var(--font-display); font-size: 19px;
  color: var(--navy); letter-spacing: 0.3px;
}
body.theme-dark .lock-box h2 { color: var(--gold-light); }
.lock-box .muted { font-size: 12.5px; margin: 0 0 20px; color: var(--muted); line-height: 1.5; }

.lock-box .input {
  width: 100%; box-sizing: border-box; margin-bottom: 4px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}
.lock-box .input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217,167,54,0.22);
  transform: translateY(-1px);
}

.lock-error {
  color: #c0392b; font-size: 12px; min-height: 16px; margin: 6px 0 8px; font-weight: 600;
  opacity: 0; transform: translateY(-4px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.lock-error.show { opacity: 1; transform: translateY(0); }

.lock-box .btn-primary {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 6px 18px rgba(30,90,74,0.35);
}
.lock-box .btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 10px 24px rgba(30,90,74,0.4); }
.lock-box .btn-primary:active { transform: translateY(0); }
.lock-box .btn-primary::after {
  content: ''; position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  animation: lockBtnSheen 3.2s ease-in-out infinite;
}
@keyframes lockBtnSheen {
  0% { left: -60%; }
  40% { left: 130%; }
  100% { left: 130%; }
}
