/* ===== ELIMU TRACK — Shared Layout CSS ===== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #f8fafc;       /* Body Background (Light Cream/White) */
  --navy2: #ffffff;      /* Sidebar Background */
  --navy3: #f1f5f9;      /* Section Background */
  --blue: #2563eb;
  --blue2: #3b82f6;
  --gold: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f97316;
  --purple: #8b5cf6;
  --white: #000000;      /* Inverted for light theme */
  --text: #1e293b;       /* Dark Text */
  --muted: #64748b;
  --border: #e2e8f0;     /* Visible Light Border */
  --card: #f8fafc;
  --sidebar-w: 260px;
  --topbar-bg: rgba(255, 255, 255, 0.8);
  
  /* Badge Colors (Light Theme High Contrast) */
  --badge-A-bg: rgba(34, 197, 94, 0.12);
  --badge-A-fg: #15803d;
  --badge-B-bg: rgba(59, 130, 246, 0.12);
  --badge-B-fg: #1d4ed8;
  --badge-C-bg: rgba(245, 158, 11, 0.12);
  --badge-C-fg: #b45309;
  --badge-D-bg: rgba(249, 115, 22, 0.12);
  --badge-D-fg: #c2410c;
  --badge-E-bg: rgba(239, 68, 68, 0.12);
  --badge-E-fg: #b91c1c;
}

/* THEMES */
html.theme-dark, body.theme-dark, html.theme-midnight, body.theme-midnight {
  --navy: #0b111a;
  --navy2: #101825;
  --navy3: #0e1e33;
  --white: #ffffff;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255,255,255,0.06);
  --card: rgba(255,255,255,0.03);
  --blue: #3b82f6;
  --blue2: #60a5fa;
  --topbar-bg: rgba(16, 24, 37, 0.8);
}

html.theme-emerald, body.theme-emerald {
  --navy: #062f21;
  --navy2: #093f2d;
  --navy3: #0b4f39;
  --white: #ffffff;
  --text: #ecfdf5;
  --muted: #a7f3d0;
  --border: rgba(167, 243, 208, 0.15);
  --card: rgba(167, 243, 208, 0.05);
  --blue: #10b981;
  --blue2: #34d399;
  --topbar-bg: rgba(9, 63, 45, 0.8);
}

html.theme-royal, body.theme-royal {
  --navy: #1e0b36;
  --navy2: #2a104b;
  --navy3: #371563;
  --white: #ffffff;
  --text: #f5f3ff;
  --muted: #ddd6fe;
  --border: rgba(221, 214, 254, 0.15);
  --card: rgba(221, 214, 254, 0.05);
  --blue: #8b5cf6;
  --blue2: #a78bfa;
  --topbar-bg: rgba(42, 16, 75, 0.8);
}

body.theme-dark, body.theme-midnight, body.theme-emerald, body.theme-royal {
  /* Badge Colors (Dark Themes High Vibrancy) */
  --badge-A-bg: rgba(34, 197, 94, 0.15);
  --badge-A-fg: #4ade80;
  --badge-B-bg: rgba(59, 130, 246, 0.15);
  --badge-B-fg: #60a5fa;
  --badge-C-bg: rgba(245, 158, 11, 0.15);
  --badge-C-fg: #fbbf24;
  --badge-D-bg: rgba(249, 115, 22, 0.15);
  --badge-D-fg: #fb923c;
  --badge-E-bg: rgba(239, 68, 68, 0.15);
  --badge-E-fg: #f87171;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.sidebar.open {
  transform: translateX(0) !important;
  box-shadow: 20px 0 50px rgba(0,0,0,0.5);
}

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}

.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar-brand {
  padding: 24px 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  height: 80px;
}

.sidebar-brand .icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(30,110,244,0.35);
  flex-shrink: 0;
}

.sidebar-brand .name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #000, var(--blue2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s;
}

.sidebar-brand .chevron {
  display: none;
  font-size: 16px;
  color: var(--blue2);
  font-weight: 800;
  cursor: pointer;
  margin-left: auto;
  transition: transform 0.3s;
}

.sidebar-brand {
  cursor: default;
}

.sidebar-brand .sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.5px;
  -webkit-text-fill-color: var(--muted);
  white-space: nowrap;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
}

.sidebar-close:hover { color: var(--white); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 18px 15px 8px;
}

/* Collapsible section headers (styled as elegant dropdown buttons) */
.nav-section.collapsible-section {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  background: var(--navy3);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.nav-section.collapsible-section:hover {
  background: var(--border);
  color: var(--text);
  border-color: var(--muted);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.nav-section.collapsible-section.section-open {
  color: var(--blue2);
  background: rgba(30, 110, 244, 0.08);
  border-color: rgba(30, 110, 244, 0.2);
  font-weight: 800;
}
body.theme-dark .nav-section.collapsible-section.section-open,
body.theme-midnight .nav-section.collapsible-section.section-open,
body.theme-emerald .nav-section.collapsible-section.section-open,
body.theme-royal .nav-section.collapsible-section.section-open {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Rotating chevron with smooth hover circle */
.section-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, color 0.2s;
  color: var(--blue);
  font-weight: 800;
}
.nav-section.collapsible-section:hover .section-chevron {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}
body.theme-dark .nav-section.collapsible-section:hover .section-chevron,
body.theme-midnight .nav-section.collapsible-section:hover .section-chevron,
body.theme-emerald .nav-section.collapsible-section:hover .section-chevron,
body.theme-royal .nav-section.collapsible-section:hover .section-chevron {
  background: rgba(255, 255, 255, 0.08);
}
.section-chevron.open {
  transform: rotate(0deg);
  color: var(--blue2);
}
.section-chevron:not(.open) {
  transform: rotate(-90deg);
}

/* Indented sub-navigation with nested tree track lines */
.sidebar-collapse-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-left: 24px;
  padding-left: 8px;
  border-left: 1.5px solid var(--border);
}

/* Make nested sublinks slightly tighter/smaller to establish hierarchy */
.sidebar-collapse-body .nav-link {
  font-size: 13.5px;
  padding: 9px 12px;
  margin-top: 2px;
  margin-bottom: 2px;
}

/* Special styling for Parents Portal dropdown toggle button */
.parents-portal-btn {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-top: 6px;
  margin-bottom: 2px;
  background: linear-gradient(135deg, rgba(16, 124, 65, 0.08), rgba(34, 197, 94, 0.04)) !important;
  border: 1px solid rgba(16, 124, 65, 0.2) !important;
  color: #107c41 !important;
  cursor: pointer;
}
.parents-portal-btn:hover {
  background: rgba(16, 124, 65, 0.14) !important;
  border-color: rgba(16, 124, 65, 0.3) !important;
}
.parents-portal-btn.section-open {
  background: rgba(16, 124, 65, 0.14) !important;
  border-color: rgba(16, 124, 65, 0.35) !important;
}
.parents-portal-btn.section-open .section-chevron {
  color: #107c41 !important;
}

/* Sub-links nested specifically inside Parents Portal */
.portal-submenu .nav-link.nav-sub {
  font-size: 13px;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: 0;
  border-radius: 0 10px 10px 0;
  background: transparent !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  color: var(--muted) !important;
}
.portal-submenu .nav-link.nav-sub:hover {
  border-left-color: #107c41 !important;
  background: rgba(16, 124, 65, 0.06) !important;
  color: #107c41 !important;
}
.portal-submenu .nav-link.nav-sub.active {
  background: rgba(16, 124, 65, 0.1) !important;
  color: #107c41 !important;
  border-left-color: #107c41 !important;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--card);
  color: var(--text);
}

.nav-link.active {
  background: rgba(30,110,244,0.15);
  color: var(--blue2);
  border: 1px solid rgba(30,110,244,0.2);
}

.nav-link .nav-icon { font-size: 18px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-card:hover { background: rgba(255,255,255,0.07); }

.admin-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.admin-info { flex: 1; overflow: hidden; }
.admin-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: 11px; color: var(--muted); }

/* ── Main Content ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.menu-btn {
  display: none;
  width: 40px; height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px;
  margin-right: 12px;
}

.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

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

.content {
  padding: 32px;
  flex: 1;
}

/* ── Cards ── */
.card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.card-sm { padding: 16px 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.stat-card:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.12);
  border-color: var(--blue2);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 48px; height: 48px;
  border-radius: 0 14px 0 50%;
  opacity: 0.12;
}

.stat-card.blue::before  { background: var(--blue); }
.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green); }
.stat-card.purple::before{ background: var(--purple); }
.stat-card.orange::before{ background: var(--orange); }

.stat-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  background: rgba(0,0,0,0.02);
}

.stat-value {
  grid-column: 2;
  grid-row: 1;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0;
}

.stat-label {
  grid-column: 2;
  grid-row: 2;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.1;
}

.stat-card.blue .stat-value  { color: var(--blue2); }
.stat-card.gold .stat-value  { color: var(--gold); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.purple .stat-value{ color: var(--purple); }
.stat-card.orange .stat-value{ color: var(--orange); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: none; border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: white;
  box-shadow: 0 4px 14px rgba(30,110,244,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30,110,244,0.5); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #e8950f);
  color: #1a0f00;
  box-shadow: 0 4px 14px rgba(245,166,35,0.35);
}
.btn-gold:hover { transform: translateY(-2px); }

.btn-green {
  background: linear-gradient(135deg, var(--green), #16a34a);
  color: white;
}
.btn-green:hover { transform: translateY(-2px); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #f1f5f9;
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
}

.badge-A      { background: var(--badge-A-bg); color: var(--badge-A-fg); }
.badge-B      { background: var(--badge-B-bg); color: var(--badge-B-fg); }
.badge-C      { background: var(--badge-C-bg); color: var(--badge-C-fg); }
.badge-D      { background: var(--badge-D-bg); color: var(--badge-D-fg); }
.badge-E      { background: var(--badge-E-bg); color: var(--badge-E-fg); }
.badge-blue   { background: var(--badge-B-bg); color: var(--badge-B-fg); }
.badge-gold   { background: var(--badge-C-bg); color: var(--badge-C-fg); }
.badge-green  { background: var(--badge-A-bg); color: var(--badge-A-fg); }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}

.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: calc(100% - 32px);
  max-width: 520px;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.25s;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-backdrop.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title { font-size: 18px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
}
.modal-close:hover { background: rgba(239,68,68,0.1); color: var(--red); }

/* ── Form Elements ── */
.form-group { margin-bottom: 18px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea,
.modal input,
.modal select,
.modal textarea,
.input-icon-wrap input,
.input-icon-wrap select {
  width: 100%;
  background: var(--navy3) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text) !important;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  color-scheme: dark light;
}

.form-group select,
.modal select,
.input-icon-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
  appearance: none;
  -webkit-appearance: none;
}

.form-group select option,
.modal select option,
select option {
  background: var(--navy2) !important;
  color: var(--text) !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.modal input::placeholder,
.modal textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--muted) !important;
  opacity: 0.75;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--blue2) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

html.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
html.theme-midnight input[type="date"]::-webkit-calendar-picker-indicator,
html.theme-emerald input[type="date"]::-webkit-calendar-picker-indicator,
html.theme-royal input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-midnight input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-emerald input[type="date"]::-webkit-calendar-picker-indicator,
body.theme-royal input[type="date"]::-webkit-calendar-picker-indicator,
html.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.theme-midnight input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.theme-emerald input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.theme-royal input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.theme-midnight input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.theme-emerald input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.theme-royal input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

/* ── Section Header ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}

.section-title { font-size: 17px; font-weight: 700; }
.section-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 14px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── Toast ── */
.et-toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(34,197,94,0.9);
  backdrop-filter: blur(8px);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  white-space: nowrap;
}
.et-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.et-toast.error { background: rgba(239,68,68,0.9); }
.et-toast.info { background: rgba(30,110,244,0.9); }

/* ── Search bar ── */
.search-bar { position: relative; }
.search-bar input {
  padding-left: 38px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  padding: 10px 12px 10px 38px;
  width: 260px;
}
.search-bar input:focus { border-color: var(--blue); }
.search-bar .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 16px; pointer-events: none;
}

/* ── Global Footer ── */
.system-footer {
  position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
  padding: 8px 30px; text-align: center; font-size: 10px; color: var(--muted);
  border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px); z-index: 1000; display: flex; justify-content: center;
  gap: 15px; letter-spacing: 0.5px; transition: left 0.3s;
}
.system-footer .rights { font-weight: 700; color: var(--text); }
.system-footer .powered { opacity: 0.6; }

@media (max-width: 1024px) {
  :root { --sidebar-w: 70px; }
  .sidebar { width: var(--sidebar-w); }
  .sidebar.open { width: 260px; }

  /* Show chevron so users know clicking brand expands the sidebar */
  .sidebar-brand { cursor: pointer; }
  .sidebar-brand .chevron { display: block; }
  .sidebar.open .sidebar-brand .chevron { transform: rotate(90deg); }
  
  .sidebar:not(.open) .sidebar-brand .name,
  .sidebar:not(.open) .sidebar-brand .sub,
  .sidebar:not(.open) .link-text,
  .sidebar:not(.open) .nav-section,
  .sidebar:not(.open) .admin-info {
    display: none;
  }
  
  .sidebar:not(.open) .nav-link {
    justify-content: center;
    padding: 11px 0;
  }
  
  .sidebar:not(.open) .nav-link .nav-icon {
    margin: 0;
    font-size: 20px;
  }

  .main { margin-left: var(--sidebar-w); }
  .system-footer { left: var(--sidebar-w); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 280px !important;
    transform: translateX(-100%);
    z-index: 1001;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    width: 280px !important;
    box-shadow: 8px 0 30px rgba(0,0,0,0.4);
  }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .menu-btn { display: flex; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 24px; }
  .system-footer { left: 0; padding: 8px 16px; font-size: 9px; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-actions { flex-wrap: wrap; gap: 8px; }
  .topbar-actions .btn { flex: 1; justify-content: center; min-width: 120px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .page-title { font-size: 17px; }
}

/* ── Custom Rubric Modal (Enhanced) ── */
.rubric-modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 22, 36, 0.85);
  backdrop-filter: blur(8px); z-index: 2500; display: none;
  align-items: center; justify-content: center; padding: 20px; transition: opacity 0.3s ease;
}
.rubric-modal-overlay.open { display: flex; opacity: 1; }

.rubric-modal {
  background: var(--navy2); border: 1px solid var(--border); border-radius: 24px;
  padding: 24px; width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; flex-direction: column;
}
.rubric-modal-overlay.open .rubric-modal { transform: translateY(0); }

.rubric-row-item {
  display: grid; grid-template-columns: 80px 1fr 70px 70px 40px;
  gap: 12px; align-items: center; margin-bottom: 12px;
}

.rubric-input {
  background: var(--navy3); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 8px; color: var(--text); text-align: center;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  outline: none; width: 100%; transition: all 0.2s;
}
.rubric-input:focus { border-color: var(--blue); background: var(--navy2); }
.rubric-input.r-desc { text-align: left; font-weight: 400; font-size: 12px; }
.rubric-input[readonly] { opacity: 0.5; cursor: default; background: rgba(0,0,0,0.1); }

@media (max-width: 600px) {
  .rubric-row-item { grid-template-columns: 60px 1fr 60px 60px 30px; gap: 8px; }
  .rubric-modal { padding: 16px; }
  .rubric-input { padding: 8px 4px; font-size: 12px; }
}

/* ── Premium Concentric Arc Loader ── */
.dots-loader {
  position: relative; width: 1.5em; height: 1.5em; display: inline-block; vertical-align: middle;
}
.dots-loader div {
  position: absolute; border: 0.15em solid transparent; border-radius: 50%;
  animation: lottie-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.dots-loader div:nth-child(1) {
  width: 100%; height: 100%; border-top-color: var(--blue2); border-bottom-color: var(--blue2);
  animation-duration: 1.8s; filter: drop-shadow(0 0 2px var(--blue2));
}
.dots-loader div:nth-child(2) {
  width: 70%; height: 70%; top: 15%; left: 15%; border-top-color: var(--gold);
  border-right-color: var(--gold); animation-duration: 1.2s; animation-direction: reverse;
}
.dots-loader div:nth-child(3) {
  width: 40%; height: 40%; top: 30%; left: 30%; border-top-color: var(--green);
  animation-duration: 0.8s;
}
@keyframes lottie-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ── Notification Bell ── */
.notification-bell {
  position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: all 0.2s; font-size: 18px;
}
.notification-bell:hover { transform: translateY(-2px); background: rgba(30,110,244,0.05); }
.notification-badge {
  position: absolute; top: -5px; right: -5px; background: var(--red); color: white;
  font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--navy2);
}
.notif-dropdown {
  position: absolute; top: 100%; right: 0; width: 320px; background: var(--navy2);
  border: 1px solid var(--border); border-radius: 12px; margin-top: 10px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.25); display: none; flex-direction: column; z-index: 1001;
  overflow: hidden; animation: fadeIn 0.3s ease;
}
.notif-dropdown.show { display: flex; }
.notif-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--card); }
.notif-header span { font-size: 13px; font-weight: 700; }
.notif-list { max-height: 350px; overflow-y: auto; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; display: flex; gap: 12px; }
.notif-item:hover { background: rgba(30,110,244,0.05); }
.notif-item.unread { background: rgba(30,110,244,0.03); border-left: 3px solid var(--blue); }
.notif-item .n-icon { font-size: 20px; margin-top: 2px; }
.notif-item .n-body { flex: 1; }
.notif-item .n-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.notif-item .n-msg { font-size: 12px; color: var(--muted); line-height: 1.4; }
.notif-item .n-time { font-size: 10px; color: var(--muted); margin-top: 5px; }
.notif-footer { padding: 10px; text-align: center; border-top: 1px solid var(--border); }
.notif-footer a { font-size: 12px; color: var(--blue); font-weight: 600; text-decoration: none; }

/* ── Report Loader ── */
.report-loader-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px;
  background: var(--navy2); border-radius: 20px; border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1); max-width: 400px; margin: 100px auto; text-align: center;
}
.loader-wave { display: flex; justify-content: center; align-items: center; gap: 6px; margin-bottom: 20px; }
.loader-wave div { width: 8px; height: 32px; background: var(--blue); border-radius: 4px; animation: loader-wave 1.2s infinite ease-in-out; }
.loader-wave div:nth-child(2) { animation-delay: 0.1s; background: var(--blue2); }
.loader-wave div:nth-child(3) { animation-delay: 0.2s; background: var(--purple); }
.loader-wave div:nth-child(4) { animation-delay: 0.3s; background: var(--green); }
.loader-wave div:nth-child(5) { animation-delay: 0.4s; background: var(--gold); }
@keyframes loader-wave { 0%, 40%, 100% { transform: scaleY(0.4); } 20% { transform: scaleY(1); } }

/* ── Push Notifications ── */
#push-notifications {
  position: fixed; top: 20px; right: 20px; z-index: 10001;
  display: flex; flex-direction: column; gap: 12px; width: 320px; pointer-events: none;
}
.push-toast {
  background: var(--navy2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); display: flex; gap: 12px;
  transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto; position: relative;
}
.push-toast.show { transform: translateX(0); }
.push-icon { font-size: 20px; flex-shrink: 0; }
.push-content h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); }
.push-content p { margin: 4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }
.push-close {
  position: absolute; top: 10px; right: 10px; background: none; border: none;
  color: var(--muted); cursor: pointer; font-size: 16px; padding: 0; line-height: 1;
}
.push-close:hover { color: var(--text); }

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

/* ── Notification Dropdown Toggle Switch ── */
.notif-settings-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.02);
  font-size: 11.5px;
}
.notif-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  margin: 0;
}
.notif-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.notif-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .2s;
  border-radius: 18px;
}
.notif-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
.notif-switch input:checked + .notif-slider {
  background-color: var(--blue2);
}
.notif-switch input:checked + .notif-slider:before {
  transform: translateX(14px);
}.btn-danger-solid {
  background: linear-gradient(135deg, var(--red), #dc2626) !important;
  color: white !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  border: none !important;
}
.btn-danger-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}

/* Force pointer cursor on all buttons, custom dropdowns, links, and delete/remove components */
button, 
.btn, 
a,
.tab-btn, 
.picker-btn, 
.btn-danger, 
.btn-danger *, 
.btn-ghost, 
.btn-ghost *, 
.custom-select-trigger, 
[data-action="delete"], 
[data-action="delete"] *, 
[onclick*="delete"], 
[onclick*="delete"] *, 
[onclick*="del"], 
[onclick*="del"] *,
[class*="delete"],
[class*="delete"] *,
[id*="delete"],
[id*="delete"] *,
[class*="remove"],
[class*="remove"] *,
[id*="remove"],
[id*="remove"] * {
  cursor: pointer !important;
}

/* ── ELIMU TRACK REPORT CARD CHART STYLES ── */
.analysis-section {
  margin-top: 12px;
  margin-bottom: 12px;
  text-align: center;
  page-break-inside: avoid;
}

.svg-chart {
  width: 100%;
  height: auto;
  display: block;
  max-height: 250px;
}

.axis-label {
  font-size: 11px;
  fill: #334155;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

.tick text {
  font-size: 10px;
  fill: #475569;
  font-family: 'Inter', sans-serif;
}

.term-label text {
  font-size: 9.5px;
  fill: #334155;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.form-label text {
  font-size: 9px;
  font-weight: 700;
  fill: #1e293b;
  font-family: 'Inter', sans-serif;
}

.grid-line {
  stroke: #cbd5e1;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.axis-line {
  stroke: #475569;
  stroke-width: 1.25;
}

.bracket {
  stroke: #475569;
  stroke-width: 1;
  fill: none;
}

.line-a1 { stroke: #1f77b4; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.line-a2 { stroke: #ff7f0e; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.line-a3 { stroke: #2ca02c; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.line-avg { stroke: #9467bd; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.dot-a1 { fill: #1f77b4; stroke: #ffffff; stroke-width: 1.5; }
.dot-a2 { fill: #ff7f0e; stroke: #ffffff; stroke-width: 1.5; }
.dot-a3 { fill: #2ca02c; stroke: #ffffff; stroke-width: 1.5; }
.dot-avg { fill: #9467bd; stroke: #ffffff; stroke-width: 1.5; }

.legend text {
  font-size: 9px;
  fill: #1e293b;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.legend-line {
  stroke-width: 2.5;
}

@media print {
  .analysis-section {
    page-break-inside: avoid !important;
  }
  .svg-chart {
    max-height: 200px !important;
    display: block !important;
    visibility: visible !important;
  }
}



