/* SchoolDesk — Main Stylesheet v2 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #141414;
  --navy-mid:   #1c1c1c;
  --navy-card:  #222222;
  --navy-light: #2a2a2a;
  --blue:       #4f8ef7;
  --blue-dark:  #3a78e8;
  --blue-glow:  rgba(79,142,247,0.25);
  --blue-pale:  rgba(79,142,247,0.1);
  --white:      #f0f0f0;
  --text:       #d4d4d4;
  --text-mid:   rgba(212,212,212,0.75);
  --text-muted: rgba(212,212,212,0.42);
  --border:     rgba(255,255,255,0.07);
  --border-mid: rgba(255,255,255,0.11);
  --border-hi:  rgba(255,255,255,0.18);
  --sidebar-w:  250px;
  --header-h:   62px;
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --gold:       #f59e0b;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
}

/* Smooth font rendering */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  height: 100vh;
}

/* Subtle mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(79,142,247,0.04) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(79,142,247,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; position: relative; z-index: 1; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #1c1c1c 0%, #181818 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 100;
  box-shadow: 2px 0 20px rgba(0,0,0,0.2);
}

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: rgba(79,142,247,0.03);
}

.school-badge {
  margin: 14px 14px 0;
  padding: 10px 13px;
  background: linear-gradient(135deg, rgba(79,142,247,0.08) 0%, rgba(79,142,247,0.04) 100%);
  border: 1px solid rgba(79,142,247,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #7eb5fd;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-section { padding: 18px 0 0; }
.nav-label {
  padding: 0 18px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-mid);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(79,142,247,0.18) 0%, rgba(79,142,247,0.08) 100%);
  color: #7eb5fd;
  box-shadow: 0 2px 12px rgba(79,142,247,0.1);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 6px; bottom: 6px;
  width: 3px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.user-pill:hover { background: rgba(255,255,255,0.04); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,142,247,0.3);
}
.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 11px; color: var(--text-muted); }
.logout-btn { font-size: 15px; color: var(--text-muted); cursor: pointer; padding: 5px; border-radius: 5px; transition: all 0.15s; }
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ============================================================
   MAIN
   ============================================================ */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.header {
  height: var(--header-h);
  min-height: var(--header-h);
  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  flex: 1;
  letter-spacing: -0.3px;
}
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, #5a96f9 0%, var(--blue-dark) 100%);
  color: var(--white);
  box-shadow: 0 2px 12px rgba(79,142,247,0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #6ba3ff 0%, #4a88f0 100%);
  box-shadow: 0 4px 18px rgba(79,142,247,0.5);
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-mid);
  border: 1px solid var(--border-mid);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-hi);
  color: var(--white);
}
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.22);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }

.btn-sm { padding: 5px 12px; font-size: 11.5px; border-radius: 6px; }
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-mid);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: linear-gradient(135deg, rgba(36,36,36,0.95) 0%, rgba(26,26,26,0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(255,255,255,0.09); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--white);
  letter-spacing: -0.2px;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(135deg, rgba(34,34,34,0.85) 0%, rgba(22,22,22,0.92) 100%);
  border: 1px solid var(--border);
  border-top: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(79,142,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(79,142,247,0.3); box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.stat-icon { font-size: 24px; margin-bottom: 6px; }
.stat-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 32px; color: var(--white); line-height: 1.1; letter-spacing: -1px; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(16,16,16,0.6);
}
table { width: 100%; border-collapse: collapse; }
thead tr {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--border);
}
th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: rgba(79,142,247,0.04); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
}
.badge-blue   { background: rgba(79,142,247,0.15); color: #7eb5fd; }
.badge-green  { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-orange { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.badge-red    { background: rgba(239,68,68,0.15);   color: #f87171; }
.badge-purple { background: rgba(139,92,246,0.15);  color: #c4b5fd; }

/* CAPS badges — distinct color per level */
.caps-7 { background: rgba(16,185,129,0.18); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.caps-6 { background: rgba(59,130,246,0.18); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.caps-5 { background: rgba(99,102,241,0.18); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.caps-4 { background: rgba(245,158,11,0.18); color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.caps-3 { background: rgba(249,115,22,0.18); color: #fb923c; border: 1px solid rgba(249,115,22,0.2); }
.caps-2 { background: rgba(239,68,68,0.18);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.caps-1 { background: rgba(220,38,38,0.18);  color: #fca5a5; border: 1px solid rgba(220,38,38,0.2); }

/* ============================================================
   FORMS
   ============================================================ */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 7px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  outline: none;
}
.form-field input:hover,
.form-field select:hover { border-color: var(--border-hi); }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  background: rgba(79,142,247,0.06);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.12);
}
select { color-scheme: dark; }
select option { background: #0d1b2e; color: #e2e8f0; }
.form-field select option { background: #0d1b2e; }
.form-field textarea { resize: vertical; min-height: 84px; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap { position: relative; }
.search-wrap input {
  padding-left: 36px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding-right: 12px;
  height: 38px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
  transition: all 0.18s;
}
.search-wrap input:focus {
  border-color: var(--blue);
  background: rgba(79,142,247,0.05);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.1);
}
.search-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,12,25,0.75);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease;
}
.modal {
  background: linear-gradient(135deg, #252525 0%, #1c1c1c 100%);
  border: 1px solid var(--border-mid);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(79,142,247,0.08);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--white);
  letter-spacing: -0.3px;
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 7px;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 13px 18px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--white);
  box-shadow: 0 6px 30px rgba(0,0,0,0.45);
  animation: slideInRight 0.25s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 240px;
  max-width: 360px;
  backdrop-filter: blur(12px);
  border: 1px solid;
}
.toast-success { background: rgba(6,78,59,0.95); border-color: rgba(16,185,129,0.4); }
.toast-error   { background: rgba(127,29,29,0.95); border-color: rgba(239,68,68,0.4); }
.toast-info    { background: rgba(15,35,65,0.95); border-color: rgba(79,142,247,0.4); }
@keyframes slideInRight {
  from { transform: translateX(50px) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ============================================================
   MARKS GRID
   ============================================================ */
.marks-grid-wrap { overflow-x: auto; }
.marks-grid { border-collapse: collapse; width: 100%; min-width: 600px; }
.marks-grid th {
  background: rgba(255,255,255,0.025);
  padding: 9px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: normal;
}
/* Sticky learner column — header */
.marks-grid .learner-col,
.marks-grid th.learner-name-sticky,
.marks-grid th.learner-col-hdr {
  width: 175px; min-width: 155px;
  position: sticky; left: 0;
  background: #1a1a1a;
  z-index: 3;
  border-right: 2px solid var(--border-mid);
  white-space: nowrap;
}
/* Sticky learner column — data cells */
.marks-grid td.learner-name-sticky {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  position: sticky; left: 0;
  background: #1a1a1a;
  z-index: 2;
  border-right: 2px solid var(--border-mid);
  cursor: pointer;
  transition: background 0.12s;
  min-width: 155px;
}
.marks-grid tr:hover td.learner-name-sticky { background: #242424; }
/* Subject column header */
.mark-subject-th { vertical-align: bottom !important; }
/* Mark data cells */
.marks-grid td { border: 1px solid var(--border); padding: 0; vertical-align: middle; }
.mark-cell { padding: 0 !important; border: 1px solid var(--border); }
/* Average cells */
.mark-avg-cell {
  text-align: center; padding: 6px !important;
  border: 1px solid var(--border); min-width: 62px;
}
/* Average footer row */
.mark-avg-row { background: rgba(79,142,247,0.06); font-weight: 700; }
/* Keyboard hint bar */
.marks-keyboard-hint {
  margin-bottom: 10px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--text-muted);
}
/* Mark input */
.mark-input {
  width: 100%;
  min-width: 62px;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 4px;
  height: 46px;
  cursor: text;
  font-family: 'Inter', sans-serif;
  display: block;
  transition: background 0.12s, box-shadow 0.12s;
}
.mark-input:focus {
  background: rgba(79,142,247,0.1);
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px var(--blue);
  position: relative; z-index: 1;
}
.mark-input:hover:not(:focus) { background: rgba(255,255,255,0.05); border-radius: 4px; }
.mark-input::placeholder { color: rgba(255,255,255,0.15); font-weight: 400; font-size: 13px; }
.mark-input::-webkit-outer-spin-button,
.mark-input::-webkit-inner-spin-button { -webkit-appearance: none; }
/* Keep old class for backwards compat */
.marks-grid td.learner-name {
  padding: 8px 12px; font-size: 13px; color: var(--text); font-weight: 500;
  position: sticky; left: 0; background: #1a1a1a; z-index: 1; transition: background 0.12s;
}
.marks-grid tr:hover td.learner-name { background: #242424; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}
.tab-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.18s;
  letter-spacing: 0.1px;
}
.tab-btn.active {
  background: linear-gradient(135deg, #5a96f9 0%, var(--blue-dark) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(79,142,247,0.35);
}
.tab-btn:hover:not(.active) { background: rgba(255,255,255,0.06); color: var(--text); }
tr.drag-over td { background: rgba(79,142,247,0.08) !important; outline: 2px solid var(--blue); }

/* ============================================================
   GRADE FILTER PILLS
   ============================================================ */
.grade-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.grade-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.18s;
  letter-spacing: 0.1px;
}
.grade-pill.active {
  background: linear-gradient(135deg, rgba(79,142,247,0.2) 0%, rgba(79,142,247,0.1) 100%);
  color: #7eb5fd;
  border-color: rgba(79,142,247,0.35);
  box-shadow: 0 2px 8px rgba(79,142,247,0.1);
}
.grade-pill:hover:not(.active) { border-color: var(--border-hi); color: var(--text-mid); background: rgba(255,255,255,0.03); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 44px; margin-bottom: 14px; filter: grayscale(0.3); }
.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}
.empty-state p { font-size: 13px; max-width: 300px; margin: 0 auto; line-height: 1.6; }

/* ============================================================
   LEARNER PICK LIST (Per-learner marks mode)
   ============================================================ */
.learner-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.learner-pick-item:hover { background: rgba(255,255,255,0.03); }
.learner-pick-item.sel {
  background: rgba(79,142,247,0.1);
  border-left: 3px solid var(--blue);
  padding-left: 11px;
}
.learner-pick-item.sel:hover { background: rgba(79,142,247,0.14); }
.learner-pick-item.done { opacity: 0.6; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,0.5);
  }
  #sidebarToggle { display: inline-flex !important; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .header { padding: 0 16px; }
}

/* ============================================================
   PAGE ENTER ANIMATION
   ============================================================ */
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#pageContent > * { animation: pageEnter 0.22s ease forwards; }

/* ============================================================
   THEME: LIGHT
   ============================================================ */
body.theme-light {
  --navy:       #f2f2f2;
  --navy-mid:   #f7f7f7;
  --navy-card:  #ffffff;
  --navy-light: #ebebeb;
  --white:      #111111;
  --text:       #1f1f1f;
  --text-mid:   rgba(31,31,31,0.75);
  --text-muted: rgba(31,31,31,0.48);
  --border:     rgba(0,0,0,0.07);
  --border-mid: rgba(0,0,0,0.11);
  --border-hi:  rgba(0,0,0,0.2);
  --shadow:     0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.12);
}
body.theme-light .sidebar {
  background: linear-gradient(180deg, #f5f5f5 0%, #f0f0f0 100%);
  border-right-color: rgba(0,0,0,0.09);
}
body.theme-light .header {
  background: rgba(242,242,242,0.97);
  border-bottom-color: rgba(0,0,0,0.08);
}
body.theme-light body::before { opacity: 0.15; }
body.theme-light .card { background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%); border-color: rgba(0,0,0,0.08); }
body.theme-light .stat-card { background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%); border-color: rgba(0,0,0,0.08); }
body.theme-light .table-wrap { background: rgba(255,255,255,0.85); border-color: rgba(0,0,0,0.08); }
body.theme-light thead tr { background: rgba(0,0,0,0.02); border-bottom-color: rgba(0,0,0,0.07); }
body.theme-light td { border-bottom-color: rgba(0,0,0,0.05); }
body.theme-light tbody tr:hover td { background: rgba(79,142,247,0.04); }
body.theme-light .modal { background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%); }
body.theme-light .modal-overlay { background: rgba(180,180,180,0.45); }
body.theme-light .marks-grid .learner-col,
body.theme-light .marks-grid th.learner-name-sticky,
body.theme-light .marks-grid th.learner-col-hdr,
body.theme-light .marks-grid td.learner-name,
body.theme-light .marks-grid td.learner-name-sticky { background: #f5f5f5; }
body.theme-light .marks-grid tr:hover td.learner-name,
body.theme-light .marks-grid tr:hover td.learner-name-sticky { background: #ebebeb; }
body.theme-light .marks-keyboard-hint { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
body.theme-light .sidebar-brand { background: rgba(79,142,247,0.04); }
body.theme-light .school-badge { background: rgba(79,142,247,0.07); color: #3a78e8; border-color: rgba(79,142,247,0.18); }
body.theme-light .nav-item { color: rgba(31,31,31,0.55); }
body.theme-light .nav-item:hover { background: rgba(0,0,0,0.04); color: rgba(31,31,31,0.8); }
body.theme-light .nav-item.active { background: rgba(79,142,247,0.1); color: #3a78e8; }
body.theme-light .nav-item.active::before { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%); }
body.theme-light .nav-label { color: rgba(31,31,31,0.38); }
body.theme-light .sidebar-footer { border-top-color: rgba(0,0,0,0.08); background: rgba(0,0,0,0.02); }
body.theme-light .user-pill:hover { background: rgba(0,0,0,0.04); }
body.theme-light .user-info .name { color: #1f1f1f; }
body.theme-light .logout-btn { color: rgba(31,31,31,0.4); }
body.theme-light .logout-btn:hover { color: var(--danger); background: rgba(239,68,68,0.08); }
body.theme-light .btn-secondary { background: rgba(0,0,0,0.05); color: #1f1f1f; border-color: rgba(0,0,0,0.12); }
body.theme-light .btn-secondary:hover { background: rgba(0,0,0,0.09); border-color: rgba(0,0,0,0.18); }
body.theme-light .btn-icon { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); color: rgba(31,31,31,0.55); }
body.theme-light .btn-icon:hover { background: rgba(0,0,0,0.09); color: #1f1f1f; }
body.theme-light .form-field input,
body.theme-light .form-field select,
body.theme-light .form-field textarea { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #1f1f1f; }
body.theme-light .form-field input:focus,
body.theme-light .form-field select:focus,
body.theme-light .form-field textarea:focus { background: rgba(79,142,247,0.04); }
body.theme-light select option { background: #ffffff; color: #1f1f1f; }
body.theme-light .search-wrap input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.1); color: #1f1f1f; }
body.theme-light .tabs { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
body.theme-light .tab-btn { color: rgba(31,31,31,0.55); }
body.theme-light .tab-btn:hover:not(.active) { background: rgba(0,0,0,0.05); color: #1f1f1f; }
body.theme-light .grade-pill { border-color: rgba(0,0,0,0.12); color: rgba(31,31,31,0.55); }
body.theme-light .grade-pill:hover:not(.active) { background: rgba(0,0,0,0.04); color: #1f1f1f; }
body.theme-light .mark-input { color: #1f1f1f; }
body.theme-light .mark-input::placeholder { color: rgba(0,0,0,0.2); }
body.theme-light .mark-input:hover:not(:focus) { background: rgba(0,0,0,0.04); }
body.theme-light .mark-input:focus { background: rgba(79,142,247,0.08); }
body.theme-light .learner-pick-item:hover { background: rgba(0,0,0,0.03); }
body.theme-light .empty-state h3 { color: #1f1f1f; }
body.theme-light .toast-success { background: rgba(240,255,250,0.98); border-color: rgba(16,185,129,0.3); color: #1f1f1f; }
body.theme-light .toast-error   { background: rgba(255,240,240,0.98); border-color: rgba(239,68,68,0.3); color: #1f1f1f; }
body.theme-light .toast-info    { background: rgba(245,248,255,0.98); border-color: rgba(79,142,247,0.3); color: #1f1f1f; }
