/* ===== SMS — Student Management System ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════
   DARK THEME (default)
══════════════════════════════════════ */
:root {
  --bg-deep:    #0a0e1a;
  --bg-base:    #0f1424;
  --bg-card:    #141929;
  --bg-hover:   #1a2035;
  --bg-border:  #1e2840;
  --bg-input:   #111827;

  --accent:      #3b82f6;
  --accent-dim:  rgba(59,130,246,0.15);
  --accent-glow: rgba(59,130,246,0.25);
  --teal:        #0ea5e9;
  --violet:      #8b5cf6;
  --rose:        #f43f5e;
  --amber:       #f59e0b;
  --emerald:     #10b981;
  --pink:        #ec4899;

  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;

  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font: 'Outfit', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ══════════════════════════════════════
   LIGHT THEME
══════════════════════════════════════ */
[data-theme="light"] {
  --bg-deep:   #f0f4ff;
  --bg-base:   #ffffff;
  --bg-card:   #ffffff;
  --bg-hover:  #f1f5f9;
  --bg-border: #e2e8f0;
  --bg-input:  #f8fafc;

  --accent:      #2563eb;
  --accent-dim:  rgba(37,99,235,0.1);
  --accent-glow: rgba(37,99,235,0.2);
  --violet:      #7c3aed;
  --rose:        #e11d48;
  --amber:       #d97706;
  --emerald:     #059669;
  --pink:        #db2777;

  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;

  --shadow:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

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

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-base);
  border-right: 1px solid var(--bg-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease, background 0.3s, border-color 0.3s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--bg-border);
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1.1rem; font-weight: 800; color: var(--text-1); letter-spacing: 0.05em; }
.brand-sub  { font-size: 0.7rem; color: var(--text-3); }

.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-label {
  display: block; font-size: 0.65rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.12em;
  padding: 12px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s; margin-bottom: 2px;
}
.nav-item i { width: 18px; text-align: center; font-size: 0.875rem; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(59,130,246,0.2);
}

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--bg-border);
  display: flex; align-items: center; gap: 6px;
}
.user-info { flex: 1; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.65rem; color: var(--text-3); text-transform: capitalize; }

.theme-toggle {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-2); font-size: 0.85rem;
  transition: all 0.2s; flex-shrink: 0;
}
.theme-toggle:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
[data-theme="light"] .theme-toggle { color: var(--amber); }

.logout-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: var(--radius-sm);
  text-decoration: none; transition: all 0.2s; flex-shrink: 0;
}
.logout-btn:hover { color: var(--rose); background: rgba(244,63,94,0.1); }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  height: var(--topbar-h); background: var(--bg-base);
  border-bottom: 1px solid var(--bg-border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  transition: background 0.3s, border-color 0.3s;
}
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 1rem; padding: 6px;
  border-radius: var(--radius-sm); transition: all 0.2s; display: none;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-1); }
.topbar-title { flex: 1; font-size: 0.85rem; font-weight: 500; color: var(--text-3); }
.topbar-date { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-3); }
.topbar-date i { color: var(--accent); }
.content-area { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* ══════════════════════════════════════
   ALERTS
══════════════════════════════════════ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: 0.875rem; font-weight: 500;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-10px);} to { opacity:1; transform:translateY(0);} }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #059669; }
.alert-error   { background: rgba(244,63,94,0.1);  border: 1px solid rgba(244,63,94,0.25);  color: #e11d48; }
.alert-info    { background: var(--accent-dim);     border: 1px solid rgba(59,130,246,0.25); color: var(--accent); font-size: 0.82rem; }
[data-theme="dark"] .alert-success { color: #6ee7b7; }
[data-theme="dark"] .alert-error   { color: #fca5a5; }
.alert-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: 0.6; }
.alert-close:hover { opacity: 1; }

/* ══════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 700; color: var(--text-1); }
.page-title i { color: var(--accent); font-size: 1.1rem; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-badge {
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.75rem; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; border: 1px solid rgba(59,130,246,0.2);
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn i { font-size: 0.8rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  color: #fff; box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-secondary { background: var(--bg-hover); color: var(--text-1); border: 1px solid var(--bg-border); }
.btn-secondary:hover { background: var(--bg-border); }
.btn-warning { background: linear-gradient(135deg, var(--amber), #d97706); color: #1a1a1a; font-weight: 700; }
.btn-warning:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--bg-border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-link { color: var(--accent); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }

.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--bg-border);
  background: var(--bg-hover); cursor: pointer;
  color: var(--text-2); font-size: 0.75rem;
  text-decoration: none; transition: all 0.2s;
}
.btn-view:hover   { background: var(--accent-dim);          color: var(--accent);   border-color: rgba(59,130,246,0.3); }
.btn-edit:hover   { background: rgba(16,185,129,0.1);       color: var(--emerald);  border-color: rgba(16,185,129,0.3); }
.btn-move:hover   { background: rgba(245,158,11,0.1);       color: var(--amber);    border-color: rgba(245,158,11,0.3); }
.btn-delete:hover { background: rgba(244,63,94,0.1);        color: var(--rose);     border-color: rgba(244,63,94,0.3);  }

/* ══════════════════════════════════════
   STATS GRID
══════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-total::before       { background: linear-gradient(90deg, var(--accent), var(--teal)); }
.stat-boys::before        { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-girls::before       { background: linear-gradient(90deg, var(--pink), #f472b6); }
.stat-completed::before   { background: linear-gradient(90deg, var(--emerald), #34d399); }
.stat-transferred::before { background: linear-gradient(90deg, var(--amber), #fcd34d); }

.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-total .stat-icon       { background: var(--accent-dim);            color: var(--accent); }
.stat-boys .stat-icon        { background: rgba(59,130,246,0.12);        color: #60a5fa; }
.stat-girls .stat-icon       { background: rgba(236,72,153,0.12);        color: var(--pink); }
.stat-completed .stat-icon   { background: rgba(16,185,129,0.12);        color: var(--emerald); }
.stat-transferred .stat-icon { background: rgba(245,158,11,0.12);        color: var(--amber); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.75rem; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--text-1); line-height: 1.1; }
.stat-sub   { font-size: 0.72rem; color: var(--text-3); }

/* ══════════════════════════════════════
   DASHBOARD GRID
══════════════════════════════════════ */
.dashboard-grid {
  display: grid; grid-template-columns: 1fr 380px;
  gap: 20px; margin-bottom: 24px;
}
.chart-card, .recent-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: background 0.3s;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--bg-border);
}
.card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-1); }
.badge {
  font-size: 0.7rem; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid rgba(59,130,246,0.2);
}
.chart-wrap { padding: 16px; height: 320px; }
.recent-list { padding: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); transition: background 0.2s; margin-bottom: 2px;
}
.recent-item:hover { background: var(--bg-hover); }

.student-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.mini-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-boy  { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.avatar-girl { background: linear-gradient(135deg, #ec4899, #db2777); }
.avatar-user { background: linear-gradient(135deg, var(--violet), #7c3aed); }

.student-info { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.student-name { font-size: 0.85rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-meta { font-size: 0.72rem; color: var(--text-3); }

/* ══════════════════════════════════════
   BULK / PROMOTE SECTION
══════════════════════════════════════ */
.bulk-section {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.bulk-form { padding: 16px 20px; }

/* Promote grid inside modal */
.promote-grid {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 16px; align-items: start; margin-bottom: 16px;
}
.promote-col { display: flex; flex-direction: column; gap: 12px; }
.promote-col-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 6px 10px; background: var(--bg-hover);
  border-radius: var(--radius-sm); border: 1px solid var(--bg-border);
}
.promote-col-label i { color: var(--accent); }
.promote-arrow {
  display: flex; align-items: center; justify-content: center;
  padding-top: 40px; font-size: 1.4rem; color: var(--accent);
}
.preview-box {
  background: var(--bg-hover); border: 1px dashed var(--bg-border);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 40px;
}
.preview-loading, .preview-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text-2);
}
.preview-label strong { color: var(--accent); }
.modal-box-wide { width: 640px; }

/* ══════════════════════════════════════
   FILTER BAR
══════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
  transition: background 0.3s;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group i { color: var(--text-3); font-size: 0.8rem; }
.filter-bar input, .filter-bar select {
  background: var(--bg-input); border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm); padding: 7px 10px;
  color: var(--text-1); font-family: var(--font); font-size: 0.85rem;
  transition: border-color 0.2s, background 0.3s;
}
.filter-bar input { min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--accent); }

/* ══════════════════════════════════════
   TABLE
══════════════════════════════════════ */
.table-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: background 0.3s;
}
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-base); }
.data-table th {
  padding: 12px 14px; font-size: 0.72rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em;
  text-align: left; white-space: nowrap; border-bottom: 1px solid var(--bg-border);
}
.data-table td {
  padding: 11px 14px; font-size: 0.85rem; color: var(--text-1);
  border-bottom: 1px solid var(--bg-border); vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-num { color: var(--text-3); font-family: var(--mono); font-size: 0.8rem; }
.actions-cell { display: flex; align-items: center; gap: 4px; }
.student-cell { display: flex; align-items: center; gap: 8px; }
.icon-cell { display: flex; align-items: center; gap: 8px; }
.icon-cell i { color: var(--text-3); }
.count-chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.75rem; font-weight: 700; min-width: 24px; height: 22px;
  padding: 0 6px; border-radius: 20px; border: 1px solid rgba(59,130,246,0.2);
}

/* ══════════════════════════════════════
   STATUS & BADGES
══════════════════════════════════════ */
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.status-ongoing     { background: rgba(16,185,129,0.12); color: var(--emerald);  border: 1px solid rgba(16,185,129,0.25); }
.status-completed   { background: rgba(59,130,246,0.12); color: var(--accent);   border: 1px solid rgba(59,130,246,0.25); }
.status-transferred { background: rgba(245,158,11,0.12); color: var(--amber);    border: 1px solid rgba(245,158,11,0.25); }

.gender-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.gender-m { background: rgba(59,130,246,0.12); color: #60a5fa; }
.gender-f { background: rgba(236,72,153,0.12); color: #f472b6; }

.role-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
}
.role-admin   { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.role-teacher { background: rgba(16,185,129,0.12); color: var(--emerald); border: 1px solid rgba(16,185,129,0.25); }
.role-viewer  { background: var(--bg-hover); color: var(--text-3); border: 1px solid var(--bg-border); }

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; padding: 16px;
}
.page-btn {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  color: var(--text-2); font-size: 0.8rem; font-weight: 500;
  text-decoration: none; border-radius: var(--radius-sm); transition: all 0.2s;
}
.page-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-ellipsis {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; color: var(--text-3); font-size: 0.85rem; user-select: none;
}
.pagination-info { text-align: center; font-size: 0.75rem; color: var(--text-3); padding: 8px 16px 16px; }

/* ══════════════════════════════════════
   FORM CARD
══════════════════════════════════════ */
.form-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: background 0.3s;
}
.form-sm { max-width: 600px; }
.styled-form { display: flex; flex-direction: column; }
.form-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--bg-border); }
.form-section:last-of-type { margin-bottom: 20px; padding-bottom: 0; border-bottom: none; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px;
}
.section-title i { color: var(--accent); }
.form-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.form-row:last-child { margin-bottom: 0; }
.col-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-2); }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input); border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text-1); font-family: var(--font); font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.3s; width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }
.form-group select option { background: var(--bg-card); color: var(--text-1); }
.form-group textarea { resize: vertical; min-height: 70px; }
.field-hint { font-size: 0.72rem; color: var(--text-3); }
.form-submit { align-self: end; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 40px; }
.toggle-pw {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px;
}
.toggle-pw:hover { color: var(--text-1); }
.toggle-wrap { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.toggle-label { font-size: 0.85rem; color: var(--text-2); cursor: pointer; }

/* ══════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 24px; gap: 12px; color: var(--text-3);
}
.empty-state i { font-size: 2.5rem; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-xl); width: 480px;
  max-width: calc(100vw - 32px); max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease;
}
.modal-box-wide { width: 640px; }
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--bg-border);
}
.modal-header h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; }
.modal-header h3 i { color: var(--accent); }
.modal-close {
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  color: var(--text-2); font-size: 1rem;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close:hover { background: rgba(244,63,94,0.1); color: var(--rose); }
.modal-body { padding: 20px; }
.modal-student-name { font-size: 0.9rem; font-weight: 600; color: var(--accent); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ══════════════════════════════════════
   PROFILE
══════════════════════════════════════ */
.profile-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-xl); overflow: hidden;
}
.profile-header {
  display: flex; align-items: center; gap: 20px; padding: 28px;
  background: linear-gradient(135deg, var(--bg-base), var(--bg-card));
  border-bottom: 1px solid var(--bg-border);
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2); flex-shrink: 0;
}
.profile-meta h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.profile-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.class-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(139,92,246,0.12); color: #a78bfa;
  font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; border: 1px solid rgba(139,92,246,0.25);
}
.profile-body { padding: 24px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.info-section { display: flex; flex-direction: column; gap: 2px; }
.info-section h3 {
  font-size: 0.75rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--bg-border);
}
.info-row {
  display: flex; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--bg-border);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-3); min-width: 130px; flex-shrink: 0;
}
.info-label i { width: 14px; text-align: center; color: var(--accent); }
.info-val { font-size: 0.85rem; color: var(--text-1); font-weight: 500; }
.info-val.link { color: var(--accent); text-decoration: none; }
.info-val.link:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.08) 0%, transparent 60%);
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-xl); padding: 40px;
  width: 420px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fff; margin: 0 auto 16px;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.login-title { font-size: 1.5rem; font-weight: 800; color: var(--text-1); margin-bottom: 4px; }
.login-subtitle { font-size: 0.85rem; color: var(--text-3); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-group label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text-2); }
.login-form .form-group label i { color: var(--accent); font-size: 0.75rem; }
.login-footer { text-align: center; margin-top: 24px; }
.login-footer p { font-size: 0.75rem; color: var(--text-3); }

/* ══════════════════════════════════════
   MISC
══════════════════════════════════════ */
.contact-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--bg-hover); color: var(--text-3);
  text-decoration: none; font-size: 0.72rem; margin-right: 2px; transition: all 0.2s;
}
.contact-link:hover { background: var(--accent-dim); color: var(--accent); }
code.mono { font-family: var(--mono); font-size: 0.8rem; color: var(--teal); }

/* Light mode tweaks */
[data-theme="light"] .nav-item.active { border-color: rgba(37,99,235,0.2); }
[data-theme="light"] .data-table thead { background: #f8fafc; }
[data-theme="light"] .topbar { box-shadow: 0 1px 0 var(--bg-border); }
[data-theme="light"] .sidebar { box-shadow: 1px 0 0 var(--bg-border); }
[data-theme="light"] .login-page { background-image: radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.05) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(124,58,237,0.05) 0%, transparent 60%); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .modal-box-wide { width: 95vw; }
  .promote-grid { grid-template-columns: 1fr; }
  .promote-arrow { display: none; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .col-2 { grid-column: span 1; }
  .content-area { padding: 16px; }
  .page-actions { gap: 6px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input { min-width: 0; width: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════
   PROMOTE CLASS MODAL
══════════════════════════════════════ */
.promote-modal-box { width: 680px; }

.promote-info-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-dim); border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.82rem; color: var(--accent); margin-bottom: 20px;
}
.promote-info-bar i { flex-shrink: 0; }

/* Two-column step layout */
.promote-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}
.promote-step { display: flex; flex-direction: column; gap: 12px; }

.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 12px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em;
  width: fit-content;
}
.step-from { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.step-to   { background: rgba(16,185,129,0.12); color: var(--emerald); border: 1px solid rgba(16,185,129,0.3); }

.promote-divider {
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 52px;
}
.promote-arrow-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Student preview inside modal */
.promote-preview {
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.preview-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-2);
  margin-bottom: 8px;
}
.preview-header i { color: var(--amber); }
.preview-names { display: flex; flex-wrap: wrap; gap: 5px; }
.preview-name-chip {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: 20px; padding: 2px 9px;
  font-size: 0.72rem; font-weight: 500; color: var(--text-1);
}
.preview-more {
  background: var(--accent-dim); color: var(--accent);
  border-color: rgba(59,130,246,0.2);
}
.preview-empty      { font-size: 0.78rem; color: var(--text-3); font-style: italic; }
.preview-loading-txt{ font-size: 0.78rem; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

/* Summary bar */
.promote-summary {
  display: flex; align-items: center; gap: 10px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.85rem; font-weight: 600; color: var(--emerald);
  margin-bottom: 4px;
}
.promote-summary i { flex-shrink: 0; }
.promote-summary-warn {
  background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3);
  color: var(--amber);
}

/* Responsive */
@media (max-width: 640px) {
  .promote-modal-box { width: 95vw; }
  .promote-steps { grid-template-columns: 1fr; }
  .promote-divider { padding-top: 0; justify-content: flex-start; }
  .promote-arrow-circle { transform: rotate(90deg); }
}

/* ══════════════════════════════════════
   ADMISSION NUMBER BLOCK
══════════════════════════════════════ */
.adm-number-block {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.adm-display {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-input);
  border: 2px dashed var(--bg-border);
  border-radius: var(--radius);
  padding: 14px 18px; flex: 1;
  transition: border-color 0.3s;
}
.adm-display:hover { border-color: var(--accent); }

.adm-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(59,130,246,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--accent);
}
.adm-info {
  display: flex; flex-direction: column; gap: 2px;
}
.adm-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3);
}
.adm-value {
  font-family: var(--mono);
  font-size: 1.25rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.05em;
}
.adm-hint {
  font-size: 0.72rem; color: var(--text-3); font-style: italic;
}

.adm-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--emerald); white-space: nowrap;
}
.adm-badge i { font-size: 0.8rem; }

/* Light theme adjustments */
[data-theme="light"] .adm-display { background: #f8fafc; }
[data-theme="light"] .adm-value   { color: #1d4ed8; }

/* ══════════════════════════════════════
   BACKUP PAGE
══════════════════════════════════════ */
.backup-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.backup-config-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.backup-config-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bcc-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid rgba(59,130,246,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--accent);
}
.bcc-body { display: flex; flex-direction: column; min-width: 0; }
.bcc-label { font-size: 0.7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.bcc-value { font-size: 0.92rem; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcc-sub   { font-size: 0.72rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Setup alert */
.setup-alert {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.setup-alert-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  background: rgba(245,158,11,0.12);
  border-bottom: 1px solid rgba(245,158,11,0.2);
  font-size: 0.85rem; font-weight: 600; color: var(--amber);
}
.setup-steps { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.setup-step { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--amber); color: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800;
}
.step-body { font-size: 0.82rem; color: var(--text-2); line-height: 1.6; }
.step-body strong { color: var(--text-1); }
.step-body p { margin-top: 4px; color: var(--text-3); font-size: 0.78rem; }
.step-body pre {
  background: var(--bg-input); border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--teal);
  margin-top: 6px; overflow-x: auto; white-space: pre;
}
.step-body code {
  font-family: var(--mono); font-size: 0.78rem; color: var(--teal);
  background: var(--bg-input); padding: 2px 6px; border-radius: 4px;
}

/* Section heading */
.section-heading {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 700; color: var(--text-1);
  margin: 24px 0 12px;
}
.section-heading i { color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }

/* File name monospace */
.file-name-mono { font-family: var(--mono); font-size: 0.8rem; color: var(--text-1); }

/* Log block */
.log-block {
  background: #0a0e18;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  line-height: 1.7;
}
[data-theme="light"] .log-block { background: #1e293b; }
.log-line       { color: #94a3b8; padding: 1px 0; white-space: pre-wrap; word-break: break-all; }
.log-success    { color: #34d399; }
.log-error      { color: #f87171; }
.log-warn       { color: #fbbf24; }
.log-empty      { color: #475569; font-style: italic; }

/* trash-clock icon fallback */
.fa-trash-clock::before { content: '\f2ed'; }

/* Setup alert info variant */
.setup-alert-info .setup-alert-header {
  background: var(--accent-dim);
  border-bottom-color: rgba(59,130,246,0.2);
  color: var(--accent);
}
.setup-alert-info {
  border-color: rgba(59,130,246,0.2);
  background: rgba(59,130,246,0.04);
  margin-bottom: 16px;
}
.setup-alert-info .step-num {
  background: var(--accent-dim);
  color: var(--accent);
  width: 28px; height: 28px;
  font-size: 0.8rem;
}

/* ══════════════════════════════════════
   CLASS & DEPARTMENT VIEW PAGES
══════════════════════════════════════ */

/* Dept tag in page title */
.dept-tag {
  font-size: 0.78rem; font-weight: 600;
  background: rgba(139,92,246,0.12); color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 20px; padding: 3px 12px;
  margin-left: 4px;
}

/* Class name link in table */
.class-name-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--text-1); text-decoration: none; font-weight: 600;
  transition: color 0.2s;
}
.class-name-link i { color: var(--text-3); font-size: 0.85rem; }
.class-name-link:hover { color: var(--accent); }
.class-name-link:hover i { color: var(--accent); }

/* Gender chips in table */
.gender-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
}
.chip-boy  { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.chip-girl { background: rgba(236,72,153,0.12);  color: #f472b6; border: 1px solid rgba(236,72,153,0.2); }

/* Centered table headers/cells */
.th-center { text-align: center !important; }
.td-center  { text-align: center; }

/* ── Class stats grid ── */
.class-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.cstat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cstat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cstat-card::before { content:''; position:absolute; top:0;left:0;right:0;height:3px; }
.cstat-total::before    { background: linear-gradient(90deg, var(--accent), var(--teal)); }
.cstat-boys::before     { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.cstat-girls::before    { background: linear-gradient(90deg, var(--pink), #f472b6); }
.cstat-ongoing::before  { background: linear-gradient(90deg, var(--emerald), #34d399); }
.cstat-done::before     { background: linear-gradient(90deg, var(--violet), #a78bfa); }
.cstat-transfer::before { background: linear-gradient(90deg, var(--amber), #fcd34d); }

.cstat-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.cstat-total .cstat-icon    { background: var(--accent-dim);            color: var(--accent); }
.cstat-boys .cstat-icon     { background: rgba(59,130,246,0.12);        color: #60a5fa; }
.cstat-girls .cstat-icon    { background: rgba(236,72,153,0.12);        color: var(--pink); }
.cstat-ongoing .cstat-icon  { background: rgba(16,185,129,0.12);        color: var(--emerald); }
.cstat-done .cstat-icon     { background: rgba(139,92,246,0.12);        color: #a78bfa; }
.cstat-transfer .cstat-icon { background: rgba(245,158,11,0.12);        color: var(--amber); }

.cstat-body { display: flex; flex-direction: column; }
.cstat-label { font-size: 0.68rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.cstat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-1); line-height: 1.1; }
.cstat-pct   { font-size: 0.72rem; color: var(--text-3); }

/* ── Gender progress bar ── */
.gender-bar-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  margin-bottom: 20px;
}
.gender-bar-label {
  display: flex; gap: 24px; margin-bottom: 10px; flex-wrap: wrap;
}
.gbl-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-2);
}
.gbl-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.gbl-dot-boy  { background: #3b82f6; }
.gbl-dot-girl { background: #ec4899; }
.gender-bar-track {
  height: 12px; border-radius: 20px;
  background: var(--bg-hover); overflow: hidden;
  display: flex;
}
.gender-bar-fill { height: 100%; transition: width 0.5s ease; }
.gender-bar-boy  { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.gender-bar-girl { background: linear-gradient(90deg, #ec4899, #f472b6); }

/* ── Class meta row ── */
.class-meta-row {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius); padding: 12px 18px;
  margin-bottom: 20px; font-size: 0.85rem;
}
.class-meta-item {
  display: flex; align-items: center; gap: 6px; color: var(--text-2);
}
.class-meta-item i { color: var(--accent); font-size: 0.82rem; }
.class-meta-item strong { color: var(--text-1); }
.stream-list { color: var(--text-3); font-size: 0.8rem; }

/* ── Table card inner header ── */
.table-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--bg-border);
  font-size: 0.85rem; font-weight: 700; color: var(--text-2);
}
.table-card-header i { color: var(--accent); }
.filtered-label { color: var(--text-3); font-weight: 400; }

/* ── Department description ── */
.dept-description {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius); padding: 12px 18px;
  font-size: 0.85rem; color: var(--text-2);
  margin-bottom: 20px;
}
.dept-description i { color: var(--accent); margin-top: 2px; flex-shrink: 0; }

/* ── Department classes grid ── */
.dept-classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.dept-class-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.dept-class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.dcc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--bg-border);
}
.dcc-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.95rem;
}
.dcc-title i { color: var(--text-3); font-size: 0.9rem; }
.dcc-link {
  font-weight: 700; color: var(--text-1); text-decoration: none;
  transition: color 0.2s;
}
.dcc-link:hover { color: var(--accent); }
.dcc-total {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: var(--text-3);
}

/* mini gender bar inside card */
.dcc-gender-bar {
  height: 8px; display: flex; overflow: hidden;
  background: var(--bg-hover);
}
.dcc-bar-boy  { height: 100%; background: linear-gradient(90deg,#3b82f6,#60a5fa); transition: width 0.4s; }
.dcc-bar-girl { height: 100%; background: linear-gradient(90deg,#ec4899,#f472b6); transition: width 0.4s; }
.dcc-bar-empty { font-size: 0.65rem; color: var(--text-3); padding: 0 8px; line-height: 8px; }

.dcc-stats {
  display: flex; gap: 0; padding: 12px 16px;
  border-bottom: 1px solid var(--bg-border);
}
.dcc-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dcc-stat:not(:last-child) { border-right: 1px solid var(--bg-border); }
.dcc-stat-icon { font-size: 0.85rem; }
.stat-boy  i { color: #60a5fa; }
.stat-girl i { color: var(--pink); }
.stat-stream i { color: var(--accent); }
.dcc-stat-val   { font-size: 1.1rem; font-weight: 800; color: var(--text-1); }
.dcc-stat-label { font-size: 0.65rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }

.dcc-status-row {
  display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 14px;
  border-bottom: 1px solid var(--bg-border);
}

.dcc-footer {
  display: flex; gap: 8px; padding: 12px 14px;
}
.dcc-footer .btn { flex: 1; justify-content: center; }

/* ── Section heading ── */
.section-heading {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 700; color: var(--text-1);
  margin: 20px 0 14px;
}
.section-heading i { color: var(--accent); }

/* Responsive */
@media (max-width: 640px) {
  .class-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .dept-classes-grid { grid-template-columns: 1fr; }
  .class-meta-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ══════════════════════════════════════
   STUDENT PROFILE VIEW ADDITIONS
══════════════════════════════════════ */
.adm-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(14,165,233,0.12); color: var(--teal);
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid rgba(14,165,233,0.25);
  font-family: var(--mono);
}
.info-section h3 {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-border);
}
.info-section h3 i { color: var(--accent); }
.mono-val {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--accent); font-weight: 600;
}

/* ══════════════════════════════════════
   GRADUATED PAGE
══════════════════════════════════════ */
.empty-sub { font-size: 0.78rem; color: var(--text-3); margin-top: 4px; }

/* Status-change radio buttons */
.status-change-block {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.status-option { flex: 1; min-width: 160px; }
.status-option input[type="radio"] { display: none; }
.status-option label {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius);
  border: 2px solid var(--bg-border);
  background: var(--bg-hover); cursor: pointer;
  transition: all 0.2s;
}
.status-option input:checked + label {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.so-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.so-completed  { background: rgba(139,92,246,0.15); color: #a78bfa; }
.so-transferred{ background: rgba(245,158,11,0.12); color: var(--amber); }
.so-ongoing    { background: rgba(16,185,129,0.12); color: var(--emerald); }
.so-label { display: flex; flex-direction: column; }
.so-label strong { font-size: 0.85rem; font-weight: 700; color: var(--text-1); }
.so-label span   { font-size: 0.72rem; color: var(--text-3); }

.status-warn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.82rem; color: var(--amber);
}
.status-warn i { flex-shrink: 0; }
.status-warn strong { color: var(--text-1); }

/* Graduated identity bar in form */
.grad-identity-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 20px;
}
.grad-id-info { display: flex; flex-direction: column; }
.grad-id-name { font-size: 0.95rem; font-weight: 700; color: var(--text-1); }
.grad-id-meta { font-size: 0.78rem; color: var(--text-3); }

.stat-link {
  font-size: 0.72rem; color: var(--accent);
  text-decoration: none; font-weight: 600;
  transition: opacity 0.2s;
}
.stat-link:hover { opacity: 0.7; text-decoration: underline; }

/* stat card link */
.stat-link {
  font-size: 0.72rem; color: var(--accent);
  text-decoration: none; font-weight: 600;
  margin-top: 2px; display: inline-block;
}
.stat-link:hover { text-decoration: underline; }

/* ── Quick links grid on dashboard ── */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.quick-link-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 18px 12px;
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); text-decoration: none;
  color: var(--text-2); font-size: 0.82rem; font-weight: 600;
  transition: all 0.2s;
}
.quick-link-card i { font-size: 1.3rem; color: var(--accent); }
.quick-link-card:hover {
  background: var(--accent-dim); color: var(--accent);
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-2px); box-shadow: var(--shadow);
}

/* ══════════════════════════════════════
   SCHOOL INFORMATION PAGE
══════════════════════════════════════ */

/* ── School identity card ── */
.school-identity-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 24px;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.school-identity-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--emerald));
}
.sic-left { display: flex; align-items: center; gap: 20px; flex: 1; }
.sic-logo-wrap {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--bg-border);
  background: var(--bg-hover);
}
.sic-logo { width: 100%; height: 100%; object-fit: contain; }
.sic-logo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--text-3);
}
.sic-name-block { display: flex; flex-direction: column; gap: 6px; }
.sic-name {
  font-size: 1.5rem; font-weight: 800; color: var(--text-1);
  line-height: 1.2;
}
.sic-address {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-3);
}
.sic-address i { color: var(--accent); font-size: 0.78rem; }
.sic-right {
  display: flex; flex-direction: column; gap: 8px;
  flex-shrink: 0;
}
.sic-contact-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-2);
}
.sic-contact-item i { color: var(--accent); width: 14px; text-align: center; }
.sic-contact-item a { color: var(--accent); text-decoration: none; }
.sic-contact-item a:hover { text-decoration: underline; }

/* ── Info grid (two columns) ── */
.school-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 20px;
}
.school-info-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.sic-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--bg-border);
  font-size: 0.82rem; font-weight: 700; color: var(--text-2);
  background: var(--bg-base);
}
.sic-card-header i { color: var(--accent); }
.sic-rows { padding: 8px 0; }
.sic-row {
  display: flex; align-items: flex-start;
  padding: 9px 18px; gap: 12px;
  border-bottom: 1px solid var(--bg-border);
}
.sic-row:last-child { border-bottom: none; }
.sic-row-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-3);
  min-width: 180px; flex-shrink: 0;
}
.sic-row-label i { color: var(--accent); width: 14px; text-align: center; font-size: 0.75rem; }
.sic-row-val { font-size: 0.85rem; font-weight: 600; color: var(--text-1); }

/* Registration number badges */
.reg-badge {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
}
.reg-tz       { background: rgba(16,185,129,0.12); color: var(--emerald); border: 1px solid rgba(16,185,129,0.25); }
.reg-pearson  { background: rgba(59,130,246,0.12); color: var(--accent);  border: 1px solid rgba(59,130,246,0.25); }
.reg-cambridge{ background: rgba(139,92,246,0.12); color: #a78bfa;        border: 1px solid rgba(139,92,246,0.25); }

/* Registration dot labels */
.reg-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px;
}
.reg-dot-tz        { background: var(--emerald); }
.reg-dot-pearson   { background: var(--accent); }
.reg-dot-cambridge { background: #a78bfa; }

/* Quick stats inside school card */
.school-quick-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
}
.sqs-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 18px 12px;
  text-decoration: none; color: var(--text-2);
  font-size: 0.78rem; font-weight: 600;
  border-right: 1px solid var(--bg-border);
  border-bottom: 1px solid var(--bg-border);
  transition: all 0.2s;
}
.sqs-item:nth-child(even) { border-right: none; }
.sqs-item:nth-last-child(-n+2) { border-bottom: none; }
.sqs-item i { font-size: 1.2rem; color: var(--accent); }
.sqs-item:hover { background: var(--accent-dim); color: var(--accent); }

/* ── Documents grid ── */
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.doc-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.doc-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--bg-border);
  background: var(--bg-base);
}
.doc-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.doc-map      { background: rgba(16,185,129,0.12); color: var(--emerald); }
.doc-pearson  { background: rgba(59,130,246,0.12); color: var(--accent); }
.doc-cambridge{ background: rgba(139,92,246,0.12); color: #a78bfa; }

.doc-title { display: flex; flex-direction: column; }
.doc-title span:first-child { font-size: 0.88rem; font-weight: 700; color: var(--text-1); }
.doc-sub { font-size: 0.72rem; color: var(--text-3); }
.doc-card-body { padding: 14px 16px; }

.doc-preview { margin-bottom: 10px; }
.doc-preview-img {
  width: 100%; max-height: 160px; object-fit: contain;
  border-radius: var(--radius-sm); border: 1px solid var(--bg-border);
  background: var(--bg-hover); cursor: pointer;
  transition: opacity 0.2s;
}
.doc-preview-img:hover { opacity: 0.85; }
.doc-file-icon {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 0.82rem; color: var(--text-1);
}
.doc-file-icon i { font-size: 1.4rem; }
.doc-file-icon i.fa-file-pdf { color: #ef4444; }
.doc-file-icon i.fa-file-image { color: var(--accent); }
.doc-actions { display: flex; gap: 8px; align-items: center; }
.doc-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 24px;
  color: var(--text-3); font-size: 0.82rem;
  border: 2px dashed var(--bg-border); border-radius: var(--radius-sm);
}
.doc-empty i { font-size: 1.6rem; opacity: 0.4; }
.text-danger { color: var(--rose) !important; }

/* ── Upload fields on edit form ── */
.upload-field-row {
  display: flex; align-items: flex-start; gap: 20px; margin-bottom: 8px;
}
.upload-preview-wrap {
  width: 90px; height: 90px; flex-shrink: 0;
  border-radius: var(--radius); overflow: hidden;
  border: 2px dashed var(--bg-border); background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
}
.upload-preview-img { width: 100%; height: 100%; object-fit: contain; }
.upload-preview-placeholder { font-size: 1.8rem; color: var(--text-3); }
.upload-field-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.upload-current { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.upload-current-name { color: var(--emerald); display: flex; align-items: center; gap: 5px; }
.upload-current-name i { font-size: 0.85rem; }
.upload-no-file { color: var(--text-3); font-style: italic; font-size: 0.8rem; }

.upload-input { display: none; }
.upload-label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  color: var(--text-1); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.upload-label:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* Upload block per document */
.doc-upload-block {
  background: var(--bg-hover); border: 1px solid var(--bg-border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 14px;
}
.doc-upload-block:last-child { margin-bottom: 0; }
.dub-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--bg-border);
  background: var(--bg-base);
}
.dub-title { display: flex; flex-direction: column; }
.dub-title span:first-child { font-size: 0.85rem; font-weight: 700; color: var(--text-1); }
.dub-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.dub-current {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.dub-current-file {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-1); font-weight: 500;
}
.dub-current-file i { font-size: 1.2rem; }
.dub-current-file .doc-pdf   { color: #ef4444; }
.dub-current-file .doc-img   { color: var(--accent); }

/* Light theme tweaks */
[data-theme="light"] .school-identity-card { background: #fff; }
[data-theme="light"] .doc-card             { background: #fff; }
[data-theme="light"] .doc-upload-block     { background: #f8fafc; }

/* Responsive */
@media (max-width: 768px) {
  .school-identity-card { flex-direction: column; }
  .sic-left             { flex-wrap: wrap; }
  .school-info-grid     { grid-template-columns: 1fr; }
  .docs-grid            { grid-template-columns: 1fr; }
}

/* ── Department overview table inside school card ── */
.dept-overview-table { overflow-x: auto; }
.dept-ov-tbl { width: 100%; border-collapse: collapse; }
.dept-ov-tbl thead tr { background: var(--bg-base); }
.dept-ov-tbl th {
  padding: 8px 12px; font-size: 0.68rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em;
  text-align: left; border-bottom: 1px solid var(--bg-border);
}
.dept-ov-tbl td {
  padding: 8px 12px; font-size: 0.82rem; color: var(--text-1);
  border-bottom: 1px solid var(--bg-border); vertical-align: middle;
}
.dept-ov-tbl tbody tr:last-child td { border-bottom: none; }
.dept-ov-tbl tbody tr:hover { background: var(--bg-hover); }
.dept-ov-link { color: var(--text-1); text-decoration: none; font-weight: 600; }
.dept-ov-link:hover { color: var(--accent); }

/* ── Pie / Doughnut chart sizing ── */
.pie-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 20px 16px;
  height: 300px;
}
.chart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; height: 100%;
  color: var(--text-3);
}
.chart-empty i { font-size: 2.5rem; opacity: 0.3; }
.chart-empty p { font-size: 0.85rem; }


/* ══════════════════════════════════════
   CSV IMPORT PAGE
══════════════════════════════════════ */

/* ── Instructions card ── */
.import-instructions-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
}
.iic-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-bottom: 1px solid var(--bg-border);
  font-size: .85rem; font-weight: 700; color: var(--text-1);
  background: var(--bg-base);
}
.iic-header i { color: var(--accent); }
.iic-body { padding: 20px; }

.iic-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.iic-step { display: flex; align-items: flex-start; gap: 12px; }
.iic-step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}
.iic-step-body { font-size: .82rem; color: var(--text-2); line-height: 1.5; }
.iic-step-body strong { color: var(--text-1); font-weight: 700; display: block; margin-bottom: 2px; }

.iic-rules { border-top: 1px solid var(--bg-border); padding-top: 14px; padding-left: 1em; }
.iic-rules h4 { font-size: .75rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-chip {
  padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
  background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--bg-border);
  font-family: var(--mono);
}
.rule-chip.rule-required {
  background: rgba(59,130,246,.12); color: var(--accent); border-color: rgba(59,130,246,.25);
}
.rule-note {
  margin-top: 10px; font-size: .78rem; color: var(--text-3);
  display: flex; align-items: center; gap: 5px;
}
.rule-note i { color: var(--text-3); }

/* ── Upload card ── */
.import-upload-card {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
}
.iuc-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-bottom: 1px solid var(--bg-border);
  font-size: .85rem; font-weight: 700; color: var(--text-1);
  background: var(--bg-base);
}
.iuc-header i { color: var(--emerald); }
.iuc-body { padding: 20px; }

.csv-drop-zone {
  border: 2px dashed var(--bg-border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: all .2s; background: var(--bg-hover);
  margin-bottom: 14px;
}
.csv-drop-zone:hover, .csv-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.drop-icon { font-size: 2.4rem; color: var(--accent); margin-bottom: 4px; }
.drop-text { display: flex; flex-direction: column; gap: 2px; }
.drop-text strong { font-size: .95rem; font-weight: 700; color: var(--text-1); }
.drop-text span   { font-size: .82rem; color: var(--text-3); }
.drop-hint { font-size: .72rem; color: var(--text-3); }

.csv-selected {
  display: flex; align-items: center; gap: 10px;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px;
  font-size: .85rem; font-weight: 600; color: var(--emerald);
}
.csv-selected i { font-size: 1rem; }
.csv-selected span { flex: 1; }
.btn-clear-file {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  font-size: 1rem; padding: 2px 6px; border-radius: 4px; transition: all .2s;
}
.btn-clear-file:hover { color: var(--rose); background: rgba(244,63,94,.1); }
.import-form-actions { display: flex; gap: 10px; align-items: center; }

/* ── Result card ── */
.import-result-card {
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
  border: 1px solid var(--bg-border);
}
.result-success .irc-header { background: rgba(16,185,129,.12); border-bottom: 1px solid rgba(16,185,129,.2); color: var(--emerald); }
.result-partial .irc-header { background: rgba(245,158,11,.1);  border-bottom: 1px solid rgba(245,158,11,.2);  color: var(--amber);   }
.result-error   .irc-header { background: rgba(244,63,94,.1);   border-bottom: 1px solid rgba(244,63,94,.2);   color: var(--rose);    }

.irc-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; font-size: .9rem; font-weight: 700;
}
.irc-stats {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--bg-border);
}
.irc-stat {
  flex: 1; text-align: center; padding: 16px 12px;
  border-right: 1px solid var(--bg-border); display: flex; flex-direction: column; gap: 4px;
}
.irc-stat:last-child { border-right: none; }
.irc-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-1); }
.irc-stat-label { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.stat-ok   .irc-stat-value { color: var(--emerald); }
.stat-skip .irc-stat-value { color: var(--rose); }

.irc-section { padding: 16px 20px; border-top: 1px solid var(--bg-border); }
.irc-section h4 {
  font-size: .8rem; font-weight: 700; color: var(--text-2);
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.irc-section h4 i { font-size: .85rem; }
.irc-table-wrap { overflow-x: auto; max-height: 280px; overflow-y: auto; }
.irc-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.irc-table th {
  padding: 8px 12px; font-size: .7rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .07em;
  text-align: left; border-bottom: 1px solid var(--bg-border);
  background: var(--bg-base); position: sticky; top: 0;
}
.irc-table td { padding: 7px 12px; border-bottom: 1px solid var(--bg-border); color: var(--text-1); vertical-align: middle; }
.irc-table .row-ok:hover  { background: rgba(16,185,129,.05); }
.irc-table .row-err:hover { background: rgba(244,63,94,.05); }
.err-reason { color: var(--rose); font-size: .78rem; }
.result-error .irc-body { padding: 16px 20px; font-size: .85rem; color: var(--rose); }
.irc-footer { padding: 14px 20px; border-top: 1px solid var(--bg-border); text-align: right; }

/* ── Classes reference ── */
.import-classes-ref {
  background: var(--bg-card); border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.icr-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-bottom: 1px solid var(--bg-border);
  font-size: .85rem; font-weight: 700; color: var(--text-1);
  background: var(--bg-base);
}
.icr-header i { color: var(--accent); }
.icr-sub { font-size: .72rem; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.icr-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0; padding: 0;
}
.icr-class-item {
  padding: 12px 16px; border-right: 1px solid var(--bg-border);
  border-bottom: 1px solid var(--bg-border);
}
.icr-class-name {
  display: flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 700; color: var(--text-1);
  margin-bottom: 6px;
}
.icr-class-name i { color: var(--text-3); font-size: .8rem; }
.icr-streams { display: flex; flex-wrap: wrap; gap: 4px; }
.icr-stream-chip {
  font-size: .72rem; font-weight: 600;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(59,130,246,.2);
  padding: 2px 8px; border-radius: 20px;
  font-family: var(--mono);
}
.icr-no-streams { font-size: .72rem; color: var(--text-3); font-style: italic; }


/* ══════════════════════════════════════
   ROLE MANAGEMENT PAGE
══════════════════════════════════════ */

/* ── Role overview cards ── */
.roles-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.role-overview-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.role-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Coloured top stripe per role */
.role-card-admin::before,
.role-card-teacher::before,
.role-card-viewer::before {
  content: '';
  display: block;
  height: 4px;
}
.role-card-admin::before   { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.role-card-teacher::before { background: linear-gradient(90deg, #059669, #34d399); }
.role-card-viewer::before  { background: linear-gradient(90deg, #2563eb, #60a5fa); }

.roc-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px 0;
}
.roc-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.roc-icon-admin   { background: rgba(124,58,237,.15); color: #a78bfa; }
.roc-icon-teacher { background: rgba(5,150,105,.12);  color: #34d399; }
.roc-icon-viewer  { background: rgba(37,99,235,.12);  color: #60a5fa; }

.roc-meta { display: flex; flex-direction: column; }
.roc-name  { font-size: .95rem; font-weight: 800; color: var(--text-1); }
.roc-count {
  font-size: .72rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
}

.roc-desc {
  padding: 8px 18px 10px;
  font-size: .8rem; color: var(--text-3);
}

.roc-caps {
  padding: 0 18px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.roc-cap {
  display: flex; align-items: center; gap: 7px;
  font-size: .78rem; color: var(--text-2);
}
.roc-cap i { font-size: .65rem; color: var(--emerald); }

.roc-locked {
  display: flex; align-items: center; gap: 6px;
  margin: 0 18px 14px;
  padding: 8px 12px;
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: var(--radius-sm);
  font-size: .75rem; color: #a78bfa;
}
.roc-locked i { font-size: .8rem; }

/* ── Roles table card ── */
.roles-table-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rtc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bg-border);
  background: var(--bg-base);
  flex-wrap: wrap; gap: 12px;
}
.rtc-header-left {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 700; color: var(--text-1);
}
.rtc-header-left i { color: var(--accent); }

.rtc-body { overflow-x: auto; }

/* Bulk controls */
.bulk-controls {
  display: flex; align-items: center; gap: 8px;
}
.bulk-label { font-size: .78rem; color: var(--text-3); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm); font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.btn-emerald:hover:not(:disabled)  { filter: brightness(1.1); }
.btn-emerald:disabled { opacity: .4; cursor: not-allowed; }
.btn-blue {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm); font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.btn-blue:hover:not(:disabled) { filter: brightness(1.1); }
.btn-blue:disabled { opacity: .4; cursor: not-allowed; }

/* Table columns */
.select-col { width: 44px; text-align: center; }
.roles-col  { width: 260px; }

/* User cell */
.user-cell-role {
  display: flex; align-items: center; gap: 10px;
}
.user-cell-info { display: flex; flex-direction: column; }
.ucell-name {
  font-size: .85rem; font-weight: 600; color: var(--text-1);
  display: flex; align-items: center; gap: 6px;
}
.ucell-email { font-size: .72rem; color: var(--text-3); }

/* YOU badge */
.you-badge {
  font-size: .62rem; font-weight: 800;
  background: rgba(59,130,246,.15); color: var(--accent);
  border: 1px solid rgba(59,130,246,.25);
  padding: 1px 6px; border-radius: 20px;
  letter-spacing: .06em;
}

/* Mini avatar colours */
.mini-avatar.avatar-admin   { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.mini-avatar.avatar-teacher { background: linear-gradient(135deg, #059669, #047857); }
.mini-avatar.avatar-viewer  { background: linear-gradient(135deg, #2563eb, #1d4ed8); }

/* Role pill in table */
.role-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: .75rem; font-weight: 700;
  transition: all .3s ease;
}
.role-pill-admin   { background: rgba(124,58,237,.15); color: #a78bfa; border: 1px solid rgba(124,58,237,.25); }
.role-pill-teacher { background: rgba(5,150,105,.12);  color: #34d399; border: 1px solid rgba(5,150,105,.25); }
.role-pill-viewer  { background: rgba(37,99,235,.12);  color: #60a5fa; border: 1px solid rgba(37,99,235,.25); }

/* Role toggle group */
.role-toggle-group {
  display: flex; gap: 6px;
}
.role-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--bg-border);
  background: var(--bg-hover);
  font-size: .78rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all .2s; user-select: none;
}
.role-toggle-btn input[type="radio"] { display: none; }
.role-toggle-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* Active toggle state */
.rtb-teacher.rtb-active {
  background: rgba(5,150,105,.12);
  border-color: rgba(5,150,105,.4);
  color: #34d399;
}
.rtb-viewer.rtb-active {
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.4);
  color: #60a5fa;
}

/* Locked cell */
.role-locked-msg {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; color: var(--text-3); font-style: italic;
}
.role-locked-msg i { font-size: .8rem; }

/* Loading state */
.row-loading { opacity: .5; pointer-events: none; }
.row-loading .role-toggle-group::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--bg-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Current user row highlight */
.current-user-row td { background: rgba(59,130,246,.04); }

/* Select all checkbox */
.select-col input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent); }
.select-disabled { color: var(--text-3); font-size: .8rem; }

/* Update time cell */
.update-time { font-size: .75rem; color: var(--text-3); }

/* ── Toast notifications ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: .85rem; font-weight: 500;
  min-width: 280px; max-width: 420px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn .3s ease;
}
.toast-success {
  background: var(--bg-card);
  border: 1px solid rgba(5,150,105,.3);
  color: #34d399;
}
.toast-error {
  background: var(--bg-card);
  border: 1px solid rgba(244,63,94,.3);
  color: #f87171;
}
.toast span { flex: 1; color: var(--text-1); }
.toast button {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 1.1rem; padding: 0 4px;
}
.toast button:hover { color: var(--text-1); }
@keyframes toastIn {
  from { opacity:0; transform: translateX(20px); }
  to   { opacity:1; transform: translateX(0); }
}
.toast-out {
  animation: toastOut .3s ease forwards;
}
@keyframes toastOut {
  to { opacity:0; transform: translateX(20px); }
}

/* Responsive */
@media (max-width: 768px) {
  .roles-overview-grid { grid-template-columns: 1fr; }
  .rtc-header { flex-direction: column; align-items: flex-start; }
  .role-toggle-group { flex-wrap: wrap; }
  .roles-col { width: auto; }
  .bulk-controls { flex-wrap: wrap; }
}
