:root {
  /* ── Exact Figma colors ── */
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;
  --bg-surface: #f9fafb;
  --text: #101828;
  --text-muted: #4a5565;
  --text-light: #6a7282;
  --text-lighter: #9ca3af;
  /* Primary green — #00a63e */
  --accent: #00a63e;
  --accent-hover: #009135;
  --accent2: #00c950;
  --accent-light: #dcfce7;
  --accent-pale: #f0fdf4;
  /* Red — Figma #e7000b / badge #fb2c36 */
  --red: #e7000b;
  --red-badge: #fb2c36;
  --red-hover: #c50009;
  --red-light: #ffe2e2;
  /* Amber — #f59e0b / #e17100 */
  --amber: #f59e0b;
  --amber-dark: #e17100;
  --amber-light: #fef3c6;
  --amber-pale: #fffbeb;
  /* Blue — #3b82f6 / #2b7fff */
  --blue: #3b82f6;
  --blue-alt: #2b7fff;
  --blue-light: #dbeafe;
  /* Purple — #8b5cf6 */
  --purple: #8b5cf6;
  /* Teal/emerald — #10b981 */
  --teal: #10b981;
  /* Brand gradient */
  --brand-gradient: linear-gradient(135deg, #00a63e 0%, #6bc0f5 100%);
  /* CTA gradient */
  --cta-gradient: linear-gradient(90deg, #00a63e 0%, #6bc0f5 100%);
  /* Borders */
  --border: #d1d5dc;
  --border-light: rgba(0,0,0,0.1);
  /* Sidebar */
  --sidebar-w: 240px;
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.1);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
  /* Radius tokens */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  /* Typography scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 1.5rem;
  --text-2xl: 1.9rem;
}

/* ── DARK MODE ── */
html.dark {
  --bg: #0f1117;
  --bg-card: #181a20;
  --bg-hover: #1f2128;
  --bg-surface: #1a1c22;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --text-lighter: #4b5563;
  --accent-light: rgba(0,166,62,0.15);
  --accent-pale: rgba(0,166,62,0.08);
  --red-light: rgba(231,0,11,0.15);
  --amber-light: rgba(245,158,11,0.15);
  --amber-pale: rgba(245,158,11,0.08);
  --blue-light: rgba(59,130,246,0.15);
  --border: #2d3039;
  --border-light: rgba(255,255,255,0.07);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
}

/* Dark mode overrides for hardcoded colors */
html.dark .hero { background: linear-gradient(144.53deg, #0f1117 0%, #181a20 50%, #1a1625 100%); }
html.dark .topnav { background: rgba(15,17,23,0.85); }
html.dark .input-wrap input:focus { background: var(--bg-card); }
html.dark .btn-outline:hover { background: var(--bg-hover); }
html.dark .btn-ghost:hover { background: var(--bg-hover); }
html.dark .nav-link:hover { background: var(--bg-hover); }
html.dark .user-card:hover { background: var(--bg-hover); }
html.dark .dropdown-item:hover { background: var(--bg-hover); }
html.dark .stat-more:hover { background: var(--bg-hover); }
html.dark .schedule-time { background: var(--bg-hover); }
html.dark .tt-grid thead th { background: var(--bg-surface); }
html.dark .tt-time { background: var(--bg-surface); }
html.dark .tt-day-label { background: var(--bg-surface); }
html.dark .tt-row-even td { background: var(--bg-card); }
html.dark .tt-row-odd  td { background: var(--bg-surface); }
html.dark .tt-row-even .tt-day-label { background: var(--bg-card); }
html.dark .tt-row-odd  .tt-day-label { background: var(--bg-surface); }
html.dark .tt-legend { background: var(--bg-surface); border-color: var(--border); }
html.dark .tt-legend-item { color: var(--text-muted); }
html.dark .clash-table th { background: var(--bg-surface); }
html.dark .modal-box { background: var(--bg-card); }
html.dark .btn-white { background: var(--bg-card); color: var(--accent); }
html.dark .btn-white:hover { background: var(--bg-hover); }
html.dark .feat-icon.green { background: rgba(0,166,62,0.15); }
html.dark .feat-icon.red { background: rgba(231,0,11,0.15); }
html.dark .feat-icon.amber { background: rgba(225,113,0,0.15); }
html.dark .tag.pending { background: rgba(245,158,11,0.15); color: #fbbf24; }
html.dark .tag.resolved { background: rgba(0,166,62,0.15); color: #4ade80; }
html.dark .tag.student { background: rgba(59,130,246,0.15); color: #60a5fa; }
html.dark .tag.lecturer { background: rgba(0,166,62,0.15); color: #4ade80; }
html.dark .tt-event.green { background: rgba(0,166,62,0.12); color: #4ade80; }
html.dark .tt-event.blue { background: rgba(59,130,246,0.12); color: #60a5fa; }
html.dark .tt-event.amber { background: rgba(245,158,11,0.12); color: #fbbf24; }
html.dark .tt-event.red { color: #f87171; }
html.dark .tt-event.purple { background: rgba(139,92,246,0.12); color: #a78bfa; }
html.dark .tt-event.teal { background: rgba(6,182,212,0.12); color: #22d3ee; }
html.dark .tt-event.pink { background: rgba(236,72,153,0.12); color: #f472b6; }
html.dark .main { background: var(--bg-card); }
html.dark .attend-track { background: var(--bg-hover); }
html.dark .notif-item.unread { background: rgba(0,166,62,0.05); }
html.dark .stat-icon.green { background: rgba(0,166,62,0.15); }
html.dark .stat-icon.yellow { background: rgba(225,113,0,0.15); }
html.dark .stat-icon.teal { background: rgba(16,185,129,0.15); }
html.dark .stat-icon.red { background: rgba(231,0,11,0.15); }
html.dark .notif-icon.red { background: rgba(231,0,11,0.15); }
html.dark .notif-icon.green { background: rgba(0,166,62,0.15); }
html.dark .notif-icon.blue { background: rgba(59,130,246,0.15); }
html.dark .notif-icon.amber { background: rgba(245,158,11,0.15); }
html.dark .clash-badge { background: rgba(231,0,11,0.15); color: #f87171; }
html.dark .resolved-badge { background: rgba(0,166,62,0.15); color: #4ade80; }
html.dark .qa-btn.green-bg { background: rgba(0,166,62,0.08); }
html.dark .qa-btn.amber-bg { background: rgba(245,158,11,0.08); }

/* Dark mode toggle button */
.dark-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.dark-toggle:hover { background: var(--accent-pale); color: var(--accent); }
.dark-toggle .icon-sun { display: none; }
.dark-toggle .icon-moon { display: block; }
html.dark .dark-toggle .icon-sun { display: block; }
html.dark .dark-toggle .icon-moon { display: none; }

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

h1,h2,h3,h4,h5 { font-family: 'Inter', sans-serif; font-weight: 700; }

/* ── PAGE SYSTEM ── */
.page { display: none; min-height: 100vh; }
.page.active { display: flex; flex-direction: column; }
.app-layout { display: flex; min-height: 100vh; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: 15px;
  cursor: pointer; border: none; transition: all .18s ease;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--text-muted); border: 2px solid var(--border); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-hover); }
.btn-restore-class {
  background: var(--teal);
  color: #fff;
  border: 1px solid transparent;
}
.btn-restore-class:hover {
  background: #0d9668;
  color: #fff;
}
html.dark .btn-restore-class:hover {
  background: #14b8a6;
}
.btn-sm { padding: 7px 17px; font-size: 14px; border-radius: var(--radius-sm); }

/* ── NAV BAR (landing) ── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 32px; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 40px; height: 40px;
  background: var(--brand-gradient);
  border-radius: 10px; display: grid; place-items: center;
}
.brand-icon svg { color: #fff; }
.brand-info h1 { font-size: 16px; color: var(--text); font-weight: 600; }
.brand-info p { font-size: 12px; color: var(--text-light); font-weight: 400; }
.nav-actions { display: flex; gap: 8px; }

/* ── LANDING ── */
.hero {
  min-height: calc(100vh - 72px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 80px 40px 60px;
  background: linear-gradient(144.53deg, #eff6ff 0%, #ffffff 50%, #faf5ff 100%);
  position: relative; overflow: hidden;
}
.hero::before { display: none; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent);
  padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  margin-bottom: 28px; position: relative;
}
.hero h2 { font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1.15; margin-bottom: 16px; position: relative; color: var(--text); }
.hero h2 .green { color: var(--accent); }
.hero h2 .green::after { display: none; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 640px; margin-bottom: 40px; position: relative; font-weight: 400; }
.hero-btns { display: flex; gap: 14px; justify-content: center; position: relative; }

.features { padding: 80px 40px; max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 56px; }
.section-title h3 { font-size: 1.9rem; margin-bottom: 10px; color: var(--text); }
.section-title p { color: var(--text-muted); font-size: 17px; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feat-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 32px;
  transition: all .2s; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.feat-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-3px); }
.feat-card:active { transform: scale(0.97); }
.feat-icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 20px;
  background: var(--accent-light); color: var(--accent);
}
.feat-icon.green { background: var(--accent-light); color: var(--accent); }
.feat-icon.red   { background: var(--red-light); color: var(--red); }
.feat-icon.amber { background: var(--amber-light); color: var(--amber-dark); }
.feat-card h4 { font-size: 16px; margin-bottom: 8px; font-weight: 600; color: var(--text); }
.feat-card p { font-size: 15px; color: var(--text-muted); line-height: 1.6; }
.feat-modal-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-light); color: var(--accent);
}

/* CTA */
.cta-section {
  background: var(--cta-gradient); color: #fff;
  padding: 72px 40px; text-align: center;
  border-radius: 16px; margin: 0 40px 40px;
}
.cta-section h3 { font-size: 1.9rem; margin-bottom: 12px; }
.cta-section p { color: #dcfce7; margin-bottom: 32px; font-size: 18px; font-weight: 400; }
.btn-white { background: #fff; color: var(--accent); font-weight: 500; }
.btn-white:hover { background: var(--accent-light); }

/* Footer */
.site-footer {
  background: var(--bg-card); border-top: 1px solid var(--border-light);
  padding: 28px 40px; display: flex; justify-content: space-between; align-items: center;
}
.site-footer .brand { opacity: 1; }
.site-footer p { font-size: 13px; color: var(--text-light); }

/* ── AUTH PAGES ── */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; padding: 40px 20px;
  background: var(--bg);
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 480px; box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}
.auth-header { text-align: center; margin-bottom: 36px; }
.auth-icon {
  width: 64px; height: 64px;
  background: var(--brand-gradient);
  border-radius: 18px; display: grid; place-items: center;
  margin: 0 auto 20px; color: #fff;
}
.auth-header h1 { font-size: 1.8rem; margin-bottom: 6px; color: var(--text); }
.auth-header p { color: var(--text-muted); font-size: 15px; font-weight: 400; }

.role-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 10px; }
.role-btn {
  padding: 13px; text-align: center; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: 15px;
  border: 1.5px solid var(--border); background: var(--bg);
  transition: all .15s; color: var(--text-muted);
}
.role-btn:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.role-btn:last-child { border-radius: 0 8px 8px 0; }
.role-btn.active { background: var(--accent-pale); color: var(--accent); border-color: var(--accent); font-weight: 600; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: var(--text); }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-lighter); }
.input-wrap input {
  width: 100%; padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font-size: 15px; color: var(--text);
  font-family: 'Inter', sans-serif; transition: border-color .15s;
  outline: none;
}
.input-wrap input:focus { border-color: var(--accent); background: var(--bg-card); }
/* edit-field inside input-wrap (select/input in edit form) */
.input-wrap .edit-field {
  padding: 11px 14px 11px 40px;
  font-size: 14px;
}
.input-wrap:has(.eye-btn) input {
  padding-right: 48px;
}
/* Edge/Chromium: native password-reveal only appears after typing — hide it; we use .eye-btn */
.input-wrap:has(.eye-btn) input[type="password"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}
.input-wrap .eye-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  z-index: 2;
  background: var(--bg-card); border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  line-height: 0;
  flex-shrink: 0;
}
.input-wrap .eye-btn:hover { color: var(--text); background: var(--bg-hover); }
.input-wrap .eye-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input-wrap .eye-btn svg { display: block; position: static; transform: none; }
html.dark .input-wrap .eye-btn { background: var(--bg-card); color: var(--text-muted); }
html.dark .input-wrap .eye-btn:hover { color: var(--text); background: var(--bg-hover); }
.form-row { display: flex; justify-content: space-between; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; color: var(--text-muted); }
.checkbox-label input { accent-color: var(--accent); }
.link-btn { background: none; border: none; color: var(--accent); font-size: 14px; cursor: pointer; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; }

/* Demo credentials box */
.demo-credentials {
  border: 1px dashed var(--border-light); border-radius: var(--radius);
  margin-bottom: 20px; overflow: hidden;
  background: var(--bg-surface, var(--bg));
}
.demo-credentials-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--accent);
  background: var(--accent-light); cursor: pointer; -webkit-user-select: none; user-select: none;
}
.demo-credentials:not(.collapsed) .demo-credentials-header { border-bottom: 1px dashed var(--border-light); }
.demo-chevron { margin-left: auto; transition: transform 0.25s ease; }
.demo-credentials.collapsed .demo-chevron { transform: rotate(-90deg); }
.demo-credentials-body {
  padding: 12px 14px;
  max-height: 300px; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.25s ease;
  opacity: 1;
}
.demo-credentials.collapsed .demo-credentials-body {
  max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0;
}
.demo-role-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-lighter); margin-bottom: 6px;
}
.demo-role-label + .demo-role-label,
.demo-emails + .demo-role-label { margin-top: 10px; }
.demo-emails { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.demo-email {
  display: inline-block; font-size: 12.5px; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; color: var(--text); transition: all 0.15s;
}
.demo-email:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.demo-password {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-light);
  font-size: 12.5px; color: var(--text-muted);
}
.demo-password code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 4px;
  padding: 2px 7px; font-size: 12px; font-weight: 600; color: var(--text);
}
.back-home { text-align: center; margin-top: 20px; }
.back-home a { color: var(--text-muted); font-size: 14px; cursor: pointer; }
.back-home a:hover { color: var(--accent); }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--bg-card); border-right: 1px solid var(--border-light);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: width 0.25s ease, min-width 0.25s ease;
}
.sidebar.collapsed {
  width: 64px; min-width: 64px; overflow: hidden;
}
/* Collapsed rail: app icon only (no title), then menu control */
.sidebar.collapsed .brand > :not(.brand-icon) {
  display: none;
}
.sidebar.collapsed .brand {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}
.sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  padding: 12px 8px 14px;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  min-height: auto;
}
.sidebar.collapsed .sidebar-collapse-btn {
  position: static;
  transform: none;
  margin: 0;
}
.sidebar.collapsed .sidebar-nav { padding: 12px 8px; }
.sidebar.collapsed .nav-link {
  padding: 10px; justify-content: center; gap: 0; font-size: 0;
  overflow: hidden; white-space: nowrap;
}
.sidebar.collapsed .nav-link svg { flex-shrink: 0; width: 18px; height: 18px; }
.sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .user-card { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer { padding: 10px; }
.sidebar.collapsed .sidebar-footer .btn { display: none; }
.sidebar.collapsed .sidebar-user-menu { display: none; }
.sidebar-brand {
  position: relative;
  padding: 14px 48px 14px 16px;
  min-height: 56px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
.sidebar-brand .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.sidebar-brand .brand-icon { width: 34px; height: 34px; border-radius: 8px; }
.sidebar-brand h1 { font-size: 15px; font-weight: 600; }
.sidebar-brand p { font-size: 11px; }

.sidebar-collapse-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 0;
  padding: 0;
}
.sidebar-collapse-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.sidebar-collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}
.sidebar-collapse-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Mobile drawer: close (X) top-right; in-sidebar hamburger hidden (use overlay + floating open) */
.sidebar-close-btn {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-close-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.sidebar-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.sidebar-close-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Desktop (≥769px): X when rail is expanded; hamburger only when collapsed to icons */
@media (min-width: 769px) {
  .sidebar:not(.collapsed) .sidebar-close-btn {
    display: inline-flex;
  }
  .sidebar:not(.collapsed) .sidebar-collapse-btn {
    display: none;
  }
}

.sidebar-expand-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  margin: 8px;
  line-height: 0;
  padding: 0;
  box-shadow: var(--shadow-sm);
}
.sidebar-expand-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.sidebar-expand-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.sidebar-expand-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
}
.sidebar-backdrop.active { display: block; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all .15s; margin-bottom: 2px;
  text-decoration: none; white-space: nowrap;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--accent-pale); color: var(--accent); font-weight: 600; }
.nav-link svg { flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red-badge); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 99px;
}

.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--border-light); }
.sidebar-user-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  animation: slideDown .15s ease;
}
.sidebar-user-menu.visible { display: flex; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.sidebar-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
  transition: background .15s;
  text-decoration: none;
}
.sidebar-menu-link.profile-link {
  background: var(--bg);
  color: var(--text);
}
.sidebar-menu-link.profile-link:hover { background: var(--accent-pale); color: var(--accent); }
.sidebar-menu-link.logout-link {
  background: var(--red);
  color: #fff;
  justify-content: center;
}
.sidebar-menu-link.logout-link:hover { background: var(--red-hover); }
html.dark .sidebar-menu-link.profile-link { background: var(--bg-hover); }
html.dark .sidebar-menu-link.profile-link:hover { background: rgba(0,166,62,0.15); color: var(--accent); }
.user-card-toggle { position: relative; }
.user-card-toggle::after {
  content: '';
  width: 18px; height: 18px;
  margin-left: auto;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .2s ease;
}
.user-card-toggle.expanded::after { transform: rotate(180deg); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background .15s;
}
.user-card:hover { background: var(--bg); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-gradient); color: #fff;
  display: grid; place-items: center; font-family: 'Inter', sans-serif;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info p:first-child { font-size: 14px; font-weight: 600; color: var(--text); }
.user-info p:last-child { font-size: 12px; color: var(--text-muted); }

/* ── MAIN CONTENT ── */
.main { flex: 1; overflow-y: auto; background: var(--bg); }
.main-header {
  padding: 28px 32px 0; display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--border-light); padding-bottom: 24px;
  background: var(--bg-card);
}
.breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.main-header h1 { font-size: 1.7rem; color: var(--text); }
.main-header p { font-size: 15px; color: var(--text-muted); margin-top: 4px; font-weight: 400; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.main-content { padding: 28px 32px; }

/* ── PAGE HEADERS (all main views except dashboard hero) ── */
.main-header:not(.dashboard-hero) {
  position: relative;
  padding: 28px 32px 24px;
  align-items: flex-start;
  gap: 20px;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 166, 62, 0.11);
  background:
    linear-gradient(168deg,
      #ecfdf5 0%,
      var(--bg-card) 28%,
      #f8fafc 65%,
      #ffffff 100%);
}
.main-header:not(.dashboard-hero)::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 78% at 100% -18%, rgba(0, 166, 62, 0.16), transparent 58%),
    radial-gradient(ellipse 78% 68% at 0% 102%, rgba(59, 130, 246, 0.11), transparent 52%),
    radial-gradient(ellipse 45% 38% at 78% 88%, rgba(139, 92, 246, 0.06), transparent 48%);
}
.main-header:not(.dashboard-hero)::after {
  content: '';
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 48%, var(--blue-alt) 100%);
  opacity: 0.72;
  box-shadow: 0 0 14px rgba(0, 166, 62, 0.14);
}
html.dark .main-header:not(.dashboard-hero) {
  background: linear-gradient(168deg,
    #0e1218 0%,
    var(--bg-card) 40%,
    #111820 100%);
  border-bottom-color: rgba(0, 166, 62, 0.16);
}
html.dark .main-header:not(.dashboard-hero)::before {
  background:
    radial-gradient(ellipse 100% 78% at 100% -18%, rgba(0, 166, 62, 0.26), transparent 58%),
    radial-gradient(ellipse 78% 68% at 0% 102%, rgba(59, 130, 246, 0.18), transparent 52%),
    radial-gradient(ellipse 45% 38% at 78% 88%, rgba(139, 92, 246, 0.1), transparent 48%);
}
html.dark .main-header:not(.dashboard-hero)::after {
  opacity: 0.88;
  box-shadow: 0 0 18px rgba(0, 166, 62, 0.28);
}

.main-header:not(.dashboard-hero) > div:first-child {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.main-header:not(.dashboard-hero) .header-actions {
  position: relative;
  z-index: 1;
}

.main-header:not(.dashboard-hero) .breadcrumb {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 166, 62, 0.09);
  border: 1px solid rgba(0, 166, 62, 0.17);
  border-radius: 7px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}
html.dark .main-header:not(.dashboard-hero) .breadcrumb {
  color: #6ee7a8;
  background: rgba(0, 166, 62, 0.12);
  border-color: rgba(0, 166, 62, 0.26);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.main-header:not(.dashboard-hero) h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.42rem, 2.35vw, 1.82rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.16;
  margin: 0;
  color: #0f172a;
}
html.dark .main-header:not(.dashboard-hero) h1 {
  color: #f1f5f9;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .main-header:not(.dashboard-hero) h1 {
    background: linear-gradient(118deg, #047857 0%, #0d9488 40%, #1d4ed8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  html.dark .main-header:not(.dashboard-hero) h1 {
    background: linear-gradient(118deg, #5eead4 0%, #6ee7a8 45%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.main-header:not(.dashboard-hero) p {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: #475569;
  max-width: min(560px, 100%);
}
html.dark .main-header:not(.dashboard-hero) p {
  color: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
  .main-header:not(.dashboard-hero)::before {
    opacity: 0.45;
  }
  html.dark .main-header:not(.dashboard-hero)::before {
    opacity: 0.48;
  }
}

/* ── DASHBOARD HERO (welcome header — lecturer & student dashboards only) ── */
.main-header.dashboard-hero {
  position: relative;
  padding: 32px 32px 28px;
  align-items: flex-start;
  gap: 24px;
  /* Tinted wash: mint → neutral → soft sky (brand green + blue) */
  background:
    linear-gradient(165deg,
      #ecfdf5 0%,
      #f0fdf4 12%,
      var(--bg-surface) 38%,
      #eff6ff 68%,
      #ffffff 100%);
  border-bottom: 1px solid rgba(0, 166, 62, 0.14);
  overflow: hidden;
}
.main-header.dashboard-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 85% at 100% -25%, rgba(0, 166, 62, 0.22), transparent 58%),
    radial-gradient(ellipse 85% 75% at 0% 105%, rgba(59, 130, 246, 0.18), transparent 54%),
    radial-gradient(ellipse 55% 45% at 72% 92%, rgba(139, 92, 246, 0.1), transparent 48%),
    radial-gradient(ellipse 40% 35% at 12% 8%, rgba(16, 185, 129, 0.12), transparent 50%);
}
.main-header.dashboard-hero::after {
  content: '';
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 38%, var(--blue-alt) 72%, var(--purple) 100%);
  opacity: 0.92;
  box-shadow: 0 0 20px rgba(0, 166, 62, 0.2);
}
html.dark .main-header.dashboard-hero {
  background: linear-gradient(165deg,
    #10141c 0%,
    var(--bg-card) 28%,
    #121a28 58%,
    #0f141d 100%);
  border-bottom-color: rgba(0, 166, 62, 0.22);
}
html.dark .main-header.dashboard-hero::before {
  background:
    radial-gradient(ellipse 110% 85% at 100% -25%, rgba(0, 166, 62, 0.35), transparent 58%),
    radial-gradient(ellipse 85% 75% at 0% 105%, rgba(59, 130, 246, 0.28), transparent 54%),
    radial-gradient(ellipse 55% 45% at 72% 92%, rgba(139, 92, 246, 0.18), transparent 48%),
    radial-gradient(ellipse 45% 38% at 15% 12%, rgba(16, 185, 129, 0.2), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(43, 127, 255, 0.12), transparent 55%);
}
html.dark .main-header.dashboard-hero::after {
  box-shadow: 0 0 28px rgba(0, 166, 62, 0.35);
}

.dashboard-hero-text {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  max-width: min(720px, 100%);
}
.main-header.dashboard-hero .breadcrumb {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 166, 62, 0.1);
  border: 1px solid rgba(0, 166, 62, 0.2);
  border-radius: 7px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}
html.dark .main-header.dashboard-hero .breadcrumb {
  color: #6ee7a8;
  background: rgba(0, 166, 62, 0.14);
  border-color: rgba(0, 166, 62, 0.32);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.main-header.dashboard-hero .welcome-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.55rem, 2.9vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.038em;
  line-height: 1.14;
  margin: 0;
  /* Fallback when gradient text is unsupported */
  color: #0f172a;
}
html.dark .main-header.dashboard-hero .welcome-text {
  color: #f1f5f9;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .main-header.dashboard-hero .welcome-text {
    background: linear-gradient(118deg, #047857 0%, #0d9488 38%, #1d4ed8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  html.dark .main-header.dashboard-hero .welcome-text {
    background: linear-gradient(118deg, #6ee7a8 0%, #5eead4 40%, #7dd3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.main-header.dashboard-hero .dashboard-date {
  margin: 16px 0 0;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-feature-settings: 'tnum' 1;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 166, 62, 0.2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  max-width: 100%;
}
html.dark .main-header.dashboard-hero .dashboard-date {
  color: #cbd5e1;
  background: rgba(12, 16, 24, 0.55);
  border-color: rgba(0, 166, 62, 0.28);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-hero-actions {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .main-header.dashboard-hero::before {
    opacity: 0.42;
  }
  html.dark .main-header.dashboard-hero::before {
    opacity: 0.45;
  }
}

/* ── STATS CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 24px;
}
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius); display: grid; place-items: center; }
.stat-icon.green { background: var(--accent-light); color: var(--accent); }
.stat-icon.yellow { background: var(--amber-light); color: var(--amber-dark); }
.stat-icon.teal  { background: var(--accent-light); color: var(--teal); }
.stat-icon.red   { background: var(--red-light); color: var(--red); }
.stat-more { background: none; border: none; cursor: pointer; color: var(--text-lighter); padding: 4px; border-radius: 6px; }
.stat-more:hover { background: var(--bg); }
.stat-value { font-family: 'Inter', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; margin-top: 4px; }
.stat-badge.up { color: var(--accent); }
.stat-badge.down { color: var(--red); }

/* ── GRID LAYOUT ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.three-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 24px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h3 { font-size: 17px; font-weight: 600; color: var(--text); }
.card-header p { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.view-all { font-size: 13px; color: var(--accent); background: none; border: none; cursor: pointer; font-weight: 500; display: flex; align-items: center; gap: 4px; }

/* Chart bars */
.bar-chart-wrap { display: flex; gap: 0; width: 100%; margin-top: 8px; }
.bar-chart-yaxis { display: flex; flex-direction: column-reverse; justify-content: space-between; padding-bottom: 24px; padding-right: 10px; min-width: 20px; }
.bar-chart-yaxis span { font-size: 11px; color: #9ca3af; line-height: 1; text-align: right; }
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 180px; flex: 1; padding: 0 4px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar {
  width: 100%; border-radius: 6px 6px 0 0;
  background: var(--accent); transition: all .25s;
  cursor: pointer; min-height: 4px;
}
.bar:hover { background: var(--accent-hover); opacity: 0.9; }
.bar-label { font-size: 11px; color: #9ca3af; font-weight: 400; }

/* Donut chart */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-chart { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.donut-chart svg { transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Inter', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Today schedule */
.schedule-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.schedule-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.schedule-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
.schedule-bar { width: 4px; height: 64px; border-radius: 99px; flex-shrink: 0; margin-top: 2px; }
.schedule-bar.blue { background: var(--blue); }
.schedule-bar.teal { background: var(--teal); }
.schedule-bar.amber { background: var(--amber); }
.schedule-info { flex: 1; }
.schedule-info h4 { font-size: 17px; font-weight: 600; color: var(--text); }
.schedule-time { display: inline-flex; align-items: center; background: var(--bg-hover); padding: 4px 12px; border-radius: 99px; font-size: var(--text-sm); color: var(--text-muted); font-weight: 500; }
.schedule-meta { font-size: 13px; color: var(--text-muted); margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.schedule-meta-row { display: flex; align-items: center; gap: 6px; }

/* ── SCHEDULE ITEM CLICKABLE ── */
.schedule-item--clickable { cursor: pointer; }
.schedule-item--clickable:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.10); transform: translateY(-2px); }

/* ── STUDENT TODAY SLOT ── */
.today-schedule-slot {
  border-radius: 8px; padding: 12px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.today-schedule-slot:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.10); transform: translateY(-1px); }

.schedule-time-badge {
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}

/* Quick actions */
.quick-actions { display: flex; flex-direction: column; gap: 12px; }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qa-btn-row { flex-direction: row; align-items: center; }
.schedule-loading { padding: 12px 0; color: var(--text-muted); font-size: 13px; }
.qa-btn {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--radius-sm);
  cursor: pointer; border: none; background: transparent; text-align: left;
  width: 100%; transition: all .15s;
}
.qa-btn.green-bg { background: var(--accent-pale); }
.qa-btn.amber-bg { background: var(--amber-pale); }
.qa-btn:hover { filter: brightness(0.97); }
.qa-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; flex-shrink: 0; }
.qa-icon.green { background: var(--accent); color: #fff; }
.qa-icon.amber { background: var(--amber-dark); color: #fff; }
.qa-text h4 { font-size: 15px; font-weight: 500; color: var(--text); }
.qa-text p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: 14px; padding: 24px;
  border-bottom: 1px solid var(--border-light); align-items: flex-start;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.activity-dot.green  { background: var(--accent2); }
.activity-dot.amber  { background: #fe9a00; }
.activity-dot.blue   { background: var(--blue-alt); }
.activity-body h4 { font-size: 13px; font-weight: 500; color: var(--text); }
.activity-body p { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-lighter); white-space: nowrap; margin-left: auto; }

/* Attendance */
.attend-bars { display: flex; flex-direction: column; gap: 10px; }
.attend-row { display: flex; align-items: center; gap: 10px; }
.attend-label { font-size: 12px; width: 28px; color: var(--text-lighter); text-align: right; }
.attend-track { flex: 1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.attend-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.attend-pct { font-size: 12px; width: 36px; color: var(--text-muted); }

/* ── TIMETABLE ── */
.tt-grid-wrap { overflow-x: auto; }
.tt-grid {
  width: 100%; border-collapse: collapse; min-width: 700px;
  font-family: 'Inter', sans-serif;
}
.tt-grid thead th {
  background: var(--bg-surface); font-weight: 600; font-size: 14px; color: var(--text);
  padding: 14px 12px; text-align: center;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.tt-grid thead th:first-child { color: var(--text-muted); font-weight: 500; width: 100px; text-align: left; padding-left: 16px; }
.tt-grid tbody tr { border-bottom: 1px solid var(--border-light); }
.tt-grid tbody td { padding: 6px 8px; vertical-align: top; min-height: 60px; height: 60px; }
.tt-head {
  background: var(--accent); color: #fff;
  padding: 12px; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px;
  text-align: center; border-right: 1px solid rgba(255,255,255,0.15);
}
.tt-head:last-child { border-right: none; }
.tt-day-label {
  padding: 14px 12px 14px 16px; font-size: 14px; font-weight: 600; color: var(--text);
  text-align: left; border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface); white-space: nowrap; width: 100px;
}
.tt-time {
  padding: 14px 12px 14px 16px; font-size: var(--text-sm); font-weight: 500; color: var(--text-muted);
  text-align: left; border-bottom: 1px solid var(--border-light);
  background: var(--bg-surface); white-space: nowrap; width: 100px;
}
/* Alternating row stripes */
.tt-row-even td { background: var(--bg-card); }
.tt-row-odd  td { background: var(--bg-surface); }
.tt-row-even .tt-day-label { background: var(--bg-card); border-right: 3px solid var(--accent); }
.tt-row-odd  .tt-day-label { background: var(--bg-surface); border-right: 3px solid var(--accent); }

.tt-cell { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); min-height: 52px; position: relative; min-width: 130px; }
.tt-cell:last-child { border-right: none; }
.tt-event {
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; cursor: pointer; transition: transform .15s, box-shadow .15s;
  display: block; width: 100%;
  border-left: 4px solid transparent;
}
.tt-event:hover { transform: scale(1.02); z-index: 2; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.tt-event.green  { background: rgba(0,166,62,0.10); border-left-color: var(--accent); color: #166534; }
.tt-event.blue   { background: rgba(59,130,246,0.10); border-left-color: var(--blue); color: #1e40af; }
.tt-event.amber  { background: rgba(245,158,11,0.10); border-left-color: var(--amber); color: #92400e; }
.tt-event.red    { background: var(--red-light); border-left-color: var(--red); color: var(--red); }
.tt-event.purple { background: rgba(139,92,246,0.10); border-left-color: var(--purple); color: #5b21b6; }
.tt-event.teal   { background: rgba(6,182,212,0.10); border-left-color: #06b6d4; color: #0e7490; }
.tt-event.pink   { background: rgba(236,72,153,0.10); border-left-color: #ec4899; color: #9d174d; }
.tt-event h4 { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; }
.tt-event p { font-size: 11px; opacity: .85; margin-top: 2px; }
.tt-event strong { display:block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.tt-event span { display:block; font-size: 11px; opacity: .85; margin-top: 2px; }

/* Color legend under timetable grid */
.tt-legend {
  display: flex; flex-wrap: wrap; gap: 12px 20px;
  padding: 14px 16px; margin-top: 12px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-muted);
}
.tt-legend-item { display: flex; align-items: center; gap: 8px; }
.tt-legend-dot {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}
.tt-legend-dot.green  { background: var(--accent); }
.tt-legend-dot.blue   { background: var(--blue); }
.tt-legend-dot.amber  { background: var(--amber); }
.tt-legend-dot.red    { background: var(--red); }
.tt-legend-dot.purple { background: var(--purple); }
.tt-legend-dot.teal   { background: #06b6d4; }
.tt-legend-dot.pink   { background: #ec4899; }

/* Day-view color-coded left border */
.day-entry-color-green  { border-left: 4px solid var(--accent); }
.day-entry-color-blue   { border-left: 4px solid var(--blue); }
.day-entry-color-amber  { border-left: 4px solid var(--amber); }
.day-entry-color-red    { border-left: 4px solid var(--red); }
.day-entry-color-purple { border-left: 4px solid var(--purple); }
.day-entry-color-teal   { border-left: 4px solid #06b6d4; }
.day-entry-color-pink   { border-left: 4px solid #ec4899; }
.conflict-warn {
  background: var(--red-light); border: 1px solid rgba(231,0,11,0.2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--red); display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}

/* ── CLASH REPORTS ── */
.filter-tabs { display: flex; gap: 0; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.filter-tab { padding: 9px 18px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; background: var(--bg-card); color: var(--text-muted); font-family: 'Inter', sans-serif; border-right: 1px solid var(--border); }
.filter-tab:last-child { border-right: none; }
.filter-tab.active { background: var(--accent); color: #fff; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 14px; margin-bottom: 20px;
}
.search-bar input { background: none; border: none; padding: 12px 0; flex: 1; font-size: 14px; font-family: 'Inter', sans-serif; outline: none; color: var(--text); }
.search-bar input::placeholder { color: var(--text-lighter); }
.clash-table { width: 100%; border-collapse: collapse; }
.clash-table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border-light); background: var(--bg); }
.clash-table td { padding: 14px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.clash-table tr:last-child td { border-bottom: none; }
.clash-courses { font-weight: 600; font-size: 14px; color: var(--text); }
.clash-courses span { color: var(--text-muted); font-weight: 400; font-size: 13px; display: block; margin-top: 2px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag.pending  { background: var(--amber-light); color: #92400e; }
.tag.resolved { background: var(--accent-light); color: #166534; }
.tag.student  { background: var(--blue-light); color: #1e40af; }
.tag.lecturer { background: var(--accent-light); color: #166534; }
.action-btns { display: flex; gap: 6px; }

/* ── PROFILE ── */
.profile-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.profile-side { display: flex; flex-direction: column; gap: 16px; }
.profile-pic-card { text-align: center; padding: 32px 24px; }
.big-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--brand-gradient); color: #fff;
  display: grid; place-items: center;
  font-family: 'Inter', sans-serif; font-size: 28px; font-weight: 700;
  margin: 0 auto 14px;
}
.profile-photo-tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.profile-photo-tappable:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
html.dark .profile-photo-tappable:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}
.profile-photo-tappable:active {
  transform: scale(0.97);
}
.profile-photo-tappable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.modal-profile-photo-viewer .modal-body {
  padding-top: 8px;
}
.profile-photo-viewer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
}
.profile-photo-viewer-img {
  max-width: 100%;
  max-height: min(70vh, 420px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.profile-photo-viewer-placeholder {
  width: min(200px, 70vw);
  height: min(200px, 70vw);
  max-height: min(70vh, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow);
}
.profile-photo-viewer-hint {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.profile-pic-card h3 { font-size: 18px; color: var(--text); }
.profile-pic-card p { font-size: 13px; color: var(--text-muted); }
.change-pic-btn { margin-top: 16px; }

/* ── SETTINGS ── */
.settings-section { margin-bottom: 28px; }
.settings-section h3 { font-size: 16px; margin-bottom: 16px; color: var(--text); }
.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-info h4 { font-size: 14px; font-weight: 600; color: var(--text); }
.setting-info p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 99px;
  cursor: pointer; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.select-input {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); font-family: 'Inter', sans-serif; font-size: 14px;
  outline: none; cursor: pointer; color: var(--text);
}

/* ── NOTIFICATIONS ── */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
  display: flex; gap: 14px; padding: 18px 0;
  border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background .1s;
  align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--accent-pale); margin: 0 -24px; padding: 18px 24px; }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.notif-icon.red   { background: var(--red-light); color: var(--red); }
.notif-icon.green { background: var(--accent-light); color: var(--accent); }
.notif-icon.blue  { background: var(--blue-light); color: var(--blue); }
.notif-icon.amber { background: var(--amber-light); color: var(--amber-dark); }
.notif-body h4 { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-body p { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.notif-time { margin-left: auto; font-size: 12px; color: var(--text-lighter); white-space: nowrap; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 8px; }
.notif-clickable { display: flex; gap: 14px; flex: 1; min-width: 0; cursor: pointer; align-items: flex-start; }
.notif-delete-btn {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--text-lighter); border-radius: 6px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
  align-self: center;
}
.notif-item:hover .notif-delete-btn { opacity: 1; }
.notif-delete-btn:hover { color: var(--red); background: var(--red-light); }
.btn-danger-outline { color: var(--red); border-color: var(--red); }
.btn-danger-outline:hover { background: var(--red); color: #fff; }

/* ── SEARCH OVERLAY ── */

/* ── MODALS ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; padding: 32px;
  border: 1px solid var(--border-light);
}
.modal-box {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  margin: 20px; animation: modalIn .18s ease;
}
@keyframes modalIn { from { transform: translateY(16px); opacity:0; } to { transform: translateY(0); opacity:1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border-light);
}
.modal-header h2 { font-size: 1.2rem; color: var(--text); }
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-light); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; gap: 10px; justify-content: flex-end; }
.detail-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 14px; }
.detail-row .detail-label { font-weight: 600; color: var(--text); min-width: 110px; }
.detail-row .detail-val { color: var(--text-muted); }
.clash-badge { display: inline-block; background: var(--red-light); color: var(--red); border-radius: 99px; padding: 3px 12px; font-size: 12px; font-weight: 600; margin-bottom: 16px; }
.resolved-badge { display: inline-block; background: var(--accent-light); color: #166534; border-radius: 99px; padding: 3px 12px; font-size: 12px; font-weight: 600; margin-bottom: 16px; }

/* ── ACTIVE COURSES MODAL ── */
.active-courses-count {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  padding: 10px 0 6px; border-bottom: 1px solid var(--border-light); margin-bottom: 4px;
}
.active-courses-list { display: flex; flex-direction: column; gap: 0; }
.active-course-item {
  display: flex; align-items: stretch; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.active-course-item:last-child { border-bottom: none; }
.active-course-color {
  width: 4px; min-height: 100%; border-radius: 4px; flex-shrink: 0;
}
.active-course-info { flex: 1; min-width: 0; }
.active-course-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  line-height: 1.35; margin-bottom: 2px;
}
.active-course-code {
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: 0.3px; margin-bottom: 8px;
  background: var(--accent-light); padding: 2px 8px; border-radius: 6px;
  display: inline-block;
}
.active-course-meta {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px;
}
.active-course-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text-muted); line-height: 1;
}
.active-course-tag svg { flex-shrink: 0; opacity: 0.55; }
.active-courses-empty {
  text-align: center; padding: 32px 16px;
}
.active-course-classes {
  display: flex; flex-direction: column; gap: 6px; margin-top: 10px;
  background: var(--bg-surface, #f8f9fa); border-radius: 8px; padding: 8px 10px;
}
html.dark .active-course-classes { background: rgba(255,255,255,0.04); }
.active-course-class {
  display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-muted);
  padding: 5px 0;
}
.active-course-class + .active-course-class { border-top: 1px solid var(--border-light); padding-top: 8px; }
.active-course-class.cancelled { opacity: 0.5; }
.active-course-class-day {
  font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text); min-width: 32px;
}
.active-course-class-detail {
  display: inline-flex; align-items: center; gap: 4px;
}
.active-course-class-detail svg { opacity: 0.5; }
.active-course-class-badge.cancelled {
  font-size: 10px; font-weight: 600; color: var(--red); background: var(--red-light);
  padding: 1px 7px; border-radius: 6px; margin-left: auto;
}

/* ── DROPDOWN ── */
.dropdown-menu {
  display: none; position: absolute; background: var(--bg-card);
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); z-index: 200; min-width: 180px; padding: 6px 0;
  right: 0; bottom: 100%; margin-bottom: 6px;
}
.dropdown-menu.active { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--text-muted); }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item svg { color: var(--text-lighter); }
.dropdown-item.danger svg { color: var(--red); }
.dropdown-wrap { position: relative; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page.active { animation: fadeIn .25s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.stat-card { animation: slideUp .3s ease both; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }

.no-select { user-select: none; }
/* ➕ ADD SCHEDULE BUTTON */
.btn-add {
  background: linear-gradient(135deg, #61c468, #0f9649);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  height: 33px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add:hover {
  background: linear-gradient(135deg, #0f9649);
  /* transform: translateY(-1px); */
  /* box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3); */
}


/* 🗑 DELETE SCHEDULE BUTTON */
.btn-delete {
  background: linear-gradient(135deg, #e7000b, #b91c1c);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(231, 0, 11, 0.3);
}

/* Buttons layout (delete modal) */
.modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Cancel button */
.btn-cancel {
  background: var(--bg-hover);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
}

.btn-cancel:hover {
  background: var(--border);
}

/* Disabled buttons — unified */
button:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── DAY VIEW ── */
.day-section { margin-bottom: 24px; }
.day-header { font-weight: 600; font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.day-entry { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--card, var(--bg-card)); border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.15s; }
.day-entry:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.day-entry.cancelled { opacity: 0.6; }
.day-entry-time { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 90px; padding-top: 2px; }
.day-entry-info { flex: 1; }
.day-entry-course { font-weight: 600; font-size: 14px; color: var(--text); }
.day-entry-code { font-size: 12px; color: var(--accent); font-weight: 500; margin-top: 2px; }
.day-entry-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.day-entry-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* ── GROUP BADGES ── */
.tt-group-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #3b82f6; color: #fff; letter-spacing: 0.03em; }
.tt-group-badge.grp2 { background: #8b5cf6; }
.tt-group-badge.both { background: #6b7280; }

/* ── CANCELLED BADGE ── */
.tt-cancelled-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #ef4444; color: #fff; }
.tt-event.cancelled { opacity: 0.55; text-decoration: line-through; }

/* ── ACTIVITY ITEMS (dashboard) ── */
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* ── CLASH ERROR ── */
.clash-error { background: #fef2f2; border: 1px solid rgba(231,0,11,0.2); color: #dc2626; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ── TIMETABLE VIEW TOGGLE ── */
.tt-view-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.tt-view-toggle .btn-outline.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── STAT ICON BLUE ── */
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
html.dark .stat-icon.blue { background: rgba(59,130,246,0.15); }

/* ── STUDENT STATS ROW ── */
#page-student-dashboard .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 28px; }

/* ── SCHEDULE DOT ── */
.schedule-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.schedule-dot.green  { background: var(--accent); }
.schedule-dot.blue   { background: var(--blue); }
.schedule-dot.amber  { background: var(--amber); }
.schedule-dot.red    { background: var(--red); }
.schedule-dot.teal   { background: var(--teal); }

/* ── TIMETABLE PAGE SUB-TABS ── */
.tt-page-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
}
.tt-page-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.tt-page-tab:hover { color: var(--text); }
.tt-page-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── EVENT MODAL BANNER ── */
.event-modal-banner {
  position: relative;
  padding: 28px 24px 22px;
  background: linear-gradient(135deg, #00a63e, #22c55e);
  color: #fff;
}
.event-modal-close {
  position: absolute; top: 12px; right: 14px;
  background: rgba(255,255,255,0.2); border: none;
  border-radius: 50%; width: 28px; height: 28px;
  font-size: 18px; line-height: 1; cursor: pointer;
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.event-modal-close:hover { background: rgba(255,255,255,0.35); }
.event-modal-day {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; opacity: 0.85;
  background: rgba(255,255,255,0.2); display: inline-block;
  padding: 3px 10px; border-radius: 99px; margin-bottom: 10px;
}
.event-modal-title {
  font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.3;
}
.event-modal-meta { font-size: 13px; opacity: 0.88; }

/* ── NOTIFICATION NEW BADGE ── */
.notif-unread-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.notif-new-badge {
  background: var(--accent-pale); color: var(--accent);
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 99px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.notif-new-badge:hover { background: var(--accent); color: #fff; }

/* ── CLICKABLE STAT CARDS ── */
.stat-card-link {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}
html.dark .stat-card-link:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── Medium: small desktop / tablet landscape (≤ 1100px) ── */
@media (max-width: 1100px) {
  .stats-row,
  #page-student-dashboard .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .three-col { grid-template-columns: 1fr; }
  .profile-wrap { grid-template-columns: 1fr; }
}

/* ── Tablet: portrait (≤ 768px) ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  /* Sidebar off-canvas */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease, width 0.25s ease;
    width: 240px;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-expand-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 190;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
  }
  .sidebar.mobile-open .sidebar-close-btn {
    display: inline-flex;
  }
  .sidebar .sidebar-collapse-btn {
    display: none;
  }

  /* Main header */
  .main-header {
    padding: 56px 20px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .main-header.dashboard-hero::after,
  .main-header:not(.dashboard-hero)::after {
    left: 20px;
    right: 20px;
  }
  .main-header:not(.dashboard-hero) h1 { font-size: 1.38rem; }
  .main-header:not(.dashboard-hero) p { font-size: 13px; }
  .main-header.dashboard-hero .welcome-text { font-size: 1.4rem; }
  .main-header.dashboard-hero .dashboard-date {
    padding: 10px 14px;
    font-size: 14px;
  }
  .main-header h1 { font-size: 1.35rem; }
  .header-actions { flex-wrap: wrap; gap: 8px; }
  .main-content { padding: 16px 16px; }

  /* Stats — 2-col with compact card layout */
  .stats-row,
  #page-student-dashboard .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 16px;
    border-radius: var(--radius-sm);
  }
  .stat-top { margin-bottom: 10px; }
  .stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
  }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-more { display: none; }
  .stat-value { font-size: 1.5rem; }
  .stat-label { font-size: 12px; }
  .stat-badge { font-size: 11px; }

  /* General cards — subtle lift & tighter radius */
  .card {
    padding: 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  .card-header { margin-bottom: 14px; }
  .card-header h3 { font-size: 15px; }

  /* Grid layouts */
  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .three-col { grid-template-columns: 1fr; gap: 16px; }
  .schedule-list { grid-template-columns: 1fr; gap: 10px; }
  .qa-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; gap: 16px; }
  .profile-wrap { grid-template-columns: 1fr; }
  .edit-form-grid { grid-template-columns: 1fr; }
  .edit-form-grid .span-2 { grid-column: auto; }

  /* Today's schedule items — compact horizontal cards */
  .schedule-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    gap: 10px;
  }
  .schedule-bar { width: 4px; height: 48px; }
  .schedule-info h4 { font-size: 14px; }
  .schedule-meta { font-size: 12px; gap: 2px; }

  /* Student today slots — tighter */
  .today-schedule-slot { padding: 10px 14px; border-radius: var(--radius-sm); }

  /* Quick actions — horizontal scroll on tight screens */
  .qa-btn {
    padding: 14px;
    border-radius: var(--radius-sm);
    gap: 12px;
  }
  .qa-icon { width: 36px; height: 36px; }
  .qa-text h4 { font-size: 14px; }
  .qa-text p { font-size: 12px; }

  /* Feature cards on landing */
  .feat-card {
    padding: 22px;
    border-radius: var(--radius-sm);
  }
  .feat-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  .feat-card:active { transform: scale(0.98); }
  .feat-icon { width: 42px; height: 42px; margin-bottom: 14px; }
  .feat-card h4 { font-size: 15px; }
  .feat-card p { font-size: 14px; line-height: 1.55; }

  /* Activity items — compact */
  .activity-item { padding: 12px 0; gap: 10px; }
  .activity-avatar { width: 28px; height: 28px; font-size: 10px; }
  .activity-time { margin-left: 0; margin-top: 4px; }

  /* Notifications — stack-friendly */
  .notif-item { gap: 10px; padding: 14px 0; }
  .notif-icon { width: 36px; height: 36px; flex-shrink: 0; }
  .notif-body h4 { font-size: 13px; }
  .notif-body p { font-size: 12px; }
  .notif-time { font-size: 11px; }
  .notif-delete-btn { opacity: 0.5; }

  /* Landing: topnav */
  .topnav { padding: 0 16px; height: 60px; }
  .brand-info p { display: none; }
  .nav-actions .btn { padding: 8px 14px; font-size: 13px; }

  /* Landing: hero */
  .hero { padding: 48px 20px 40px; }
  .hero h2 { font-size: 2rem; line-height: 1.18; }
  .hero p { font-size: 16px; padding: 0 8px; line-height: 1.65; }
  .hero-btns { flex-direction: column; width: 100%; max-width: 320px; }
  .hero-btns .btn { width: 100%; justify-content: center; }

  /* Landing: CTA */
  .cta-section { margin: 0 16px 24px; padding: 40px 20px; border-radius: var(--radius); }
  .cta-section h3 { font-size: 1.5rem; }
  .cta-section p { font-size: 16px; }

  /* Landing: footer */
  .site-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 20px;
  }

  /* Profile page inline form grids */
  .profile-info-grid { grid-template-columns: 1fr !important; }

  /* Student profile avatar card */
  .student-avatar-row { flex-direction: column; text-align: center; gap: 16px !important; }

  /* Timetable page tabs */
  .tt-page-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
  .tt-page-tab { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; font-size: 13px; }
  .tt-view-toggle { flex-wrap: wrap; }

  /* Filter tabs (clash reports) */
  .filter-tabs { flex-wrap: wrap; width: 100%; }
  .filter-tab { flex: 1; min-width: 0; text-align: center; padding: 9px 12px; }

  /* Edit schedule banner */
  .edit-course-banner { flex-direction: column; align-items: flex-start; padding: 16px; border-radius: var(--radius-sm); }
  .edit-banner-left { flex-wrap: wrap; }
  .edit-actions { flex-direction: column; width: 100%; }
  .edit-actions .btn { width: 100%; justify-content: center; }
  .edit-time-row { flex-direction: column; gap: 8px; }

  /* Edit class picker cards */
  .edit-class-list { grid-template-columns: 1fr; gap: 10px; }
  .edit-class-card { padding: 14px 16px; border-radius: var(--radius-sm); }

  /* Clash table responsive */
  .clash-table { font-size: 13px; }
  .clash-table th,
  .clash-table td { padding: 10px 8px; }
  .action-btns { flex-wrap: wrap; }

  /* Modals — full-width friendly */
  .modal-box { width: calc(100% - 32px); min-width: 0; max-width: 480px; margin: 16px; }
  .modal { max-width: calc(100% - 32px); margin: 16px; border-radius: var(--radius-sm); }
  .modal-header { padding: 16px 18px 14px; }
  .modal-body { padding: 16px 18px; }
  .modal-footer { padding: 14px 18px; flex-wrap: wrap; }

  /* Settings */
  .setting-row { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Student settings cards */
  .settings-card-header { margin-bottom: 16px; gap: 10px; }
  .settings-card-header h3 { font-size: 15px; }
  .settings-toggle-row { flex-wrap: wrap; gap: 8px; }

  /* Bar chart */
  .bar-chart { gap: 8px; }

  /* Donut chart */
  .donut-wrap { flex-direction: column; align-items: flex-start; }

  /* Day view entries */
  .day-entry { flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius-sm); }
  .day-entry-badges { align-items: flex-start; }

  /* Detail rows in modals */
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-row .detail-label { min-width: 0; }

  /* Clickable stat cards — disable hover transform on touch */
  .stat-card-link:hover { transform: none; box-shadow: none; }
  .stat-card-link:active { transform: scale(0.98); }
}

/* ── Mobile: small phone (≤ 480px) ── */
@media (max-width: 480px) {
  .main-content { padding: 12px 12px; }

  /* Stats — single column, compact horizontal layout */
  .stats-row,
  #page-student-dashboard .stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-direction: row;
  }
  .stat-top {
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .stat-icon {
    width: 44px; height: 44px;
  }
  .stat-value { font-size: 1.35rem; }
  .stat-label { font-size: 11px; margin-top: 2px; }
  .stat-badge { margin-top: 2px; font-size: 10px; }
  .stat-card .stat-top + * { flex: 1; }

  .main-header { padding: 52px 12px 12px; }
  .main-header.dashboard-hero::after,
  .main-header:not(.dashboard-hero)::after {
    left: 12px;
    right: 12px;
  }
  .main-header:not(.dashboard-hero) .breadcrumb {
    font-size: 9px;
    padding: 5px 10px;
    letter-spacing: 0.1em;
  }
  .main-header:not(.dashboard-hero) h1 { font-size: 1.25rem; }
  .main-header:not(.dashboard-hero) p { font-size: 13px; margin-top: 6px; }
  .main-header.dashboard-hero .breadcrumb {
    font-size: 9px;
    padding: 5px 10px;
    margin-bottom: 8px;
    letter-spacing: 0.12em;
  }
  .main-header.dashboard-hero .welcome-text { font-size: 1.2rem; }
  .main-header.dashboard-hero .dashboard-date {
    padding: 10px 12px;
    font-size: 13px;
    margin-top: 10px;
  }
  .main-header h1 { font-size: 1.15rem; }
  .main-header p  { font-size: 12px; }

  /* Landing topnav tighter */
  .topnav { padding: 0 12px; height: 56px; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-info h1 { font-size: 14px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 6px 10px; font-size: 12px; }
  .dark-toggle { width: 32px; height: 32px; }

  /* Hero tighter */
  .hero { padding: 36px 16px 32px; }
  .hero h2 { font-size: 1.7rem; line-height: 1.2; }
  .hero p { font-size: 15px; margin-bottom: 28px; line-height: 1.6; }
  .hero-badge { font-size: 12px; padding: 5px 12px; margin-bottom: 20px; }

  /* Feature cards — stacked & tappable */
  .features { padding: 32px 16px; }
  .features-grid { gap: 12px; }
  .section-title { margin-bottom: 24px; }
  .section-title h3 { font-size: 1.35rem; }
  .section-title p { font-size: 14px; }
  .feat-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }
  .feat-card:active { transform: scale(0.97); }
  .feat-icon { margin-bottom: 0; flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-sm); }
  .feat-card h4 { font-size: 14.5px; margin-bottom: 3px; }
  .feat-card p { font-size: 13.5px; line-height: 1.5; }

  /* CTA */
  .cta-section { margin: 0 16px 20px; padding: 32px 18px; border-radius: var(--radius-sm); }
  .cta-section h3 { font-size: 1.3rem; }
  .cta-section p { font-size: 14.5px; margin-bottom: 22px; line-height: 1.55; }

  /* Footer */
  .site-footer { padding: 16px 12px; }

  /* Auth pages — tighter card */
  .auth-card { padding: 28px 18px; border-radius: var(--radius-sm); }
  .auth-header h1 { font-size: 1.4rem; }
  .auth-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); }

  /* Cards — edge-to-edge feel */
  .card {
    padding: 16px;
    border-radius: var(--radius-sm);
  }
  .card-header { margin-bottom: 12px; }
  .card-header h3 { font-size: 14px; }

  /* Schedule items — minimal */
  .schedule-item {
    padding: 10px 12px;
    gap: 8px;
    border-radius: var(--radius-sm);
  }
  .schedule-bar { width: 3px; height: 40px; }
  .schedule-info h4 { font-size: 13px; }
  .schedule-meta { font-size: 11px; }

  /* Student today slots */
  .today-schedule-slot { padding: 10px 12px; }

  /* Notifications — tighter */
  .notif-item { padding: 12px 0; }
  .notif-item.unread { margin: 0 -16px; padding: 12px 16px; border-radius: var(--radius-sm); }
  .notif-icon { width: 32px; height: 32px; }
  .notif-delete-btn { opacity: 0.6; }
  .notif-dot { width: 6px; height: 6px; }

  /* Activity feed */
  .activity-item { padding: 10px 0; gap: 8px; }

  /* Modals — near full screen */
  .modal-box { width: calc(100% - 20px); margin: 10px; padding: 16px; border-radius: var(--radius-sm); }
  .modal { border-radius: var(--radius-sm); }
  .event-modal-banner { padding: 18px 16px 16px; }
  .event-modal-title { font-size: 15px; }

  /* Buttons — full-width in tight contexts */
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* Sidebar expand btn — align with compact header padding */
  .sidebar-expand-btn {
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    width: 38px;
    height: 38px;
  }

  /* Settings items */
  .settings-section h3 { font-size: 14px; }
  .settings-card-header { gap: 10px; }
  .settings-icon-badge { width: 36px; height: 36px; }
  .settings-toggle-row p:first-child { font-size: 14px; }
  .settings-sec-item { padding: 14px 16px; }

  /* Edit schedule cards */
  .edit-class-card { padding: 12px 14px; }
  .edit-course-banner { padding: 14px; }

  /* Day view — tight cards */
  .day-entry { padding: 10px 12px; border-radius: var(--radius-sm); }
  .day-entry-time { font-size: 11px; min-width: 70px; }
  .day-entry-course { font-size: 13px; }

  /* Toast position on small screens */
  #toast-container { bottom: 16px; right: 16px; left: 16px; max-width: none; }
  .toast-item { font-size: 13px; padding: 12px 16px; }

  /* Quick actions */
  .qa-btn { padding: 12px; gap: 10px; }
  .qa-icon { width: 32px; height: 32px; }
  .qa-text h4 { font-size: 13px; }
  .qa-text p { font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════
   EDIT SCHEDULE — banner card & form
══════════════════════════════════════════════════════════ */

.edit-course-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.edit-banner-left { display: flex; align-items: center; gap: 16px; }

.edit-banner-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-pale);
  display: grid; place-items: center;
  flex-shrink: 0; color: var(--accent);
}

.edit-banner-code {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-pale);
  padding: 2px 10px; border-radius: 99px;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 5px;
}

.edit-banner-title {
  font-size: 17px; font-weight: 700;
  color: var(--text); margin-bottom: 5px; line-height: 1.3;
}

.edit-banner-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}

/* Edit form internals */
.edit-form-card { padding: 28px; }

.edit-section-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.edit-section-label::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border-light);
}

.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.edit-form-grid .form-group { margin-bottom: 0; }
.edit-form-grid .span-2 { grid-column: 1 / -1; }

/* Styled select/input for edit form */
.edit-field {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px; color: var(--text);
  font-family: 'Inter', sans-serif;
  outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  transition: border-color .15s, background .15s;
}
.edit-field:focus { border-color: var(--accent); }
.edit-field:disabled { opacity: 0.6; cursor: default; background: var(--bg); }
html.dark .edit-field { background: var(--bg-card); }
html.dark .edit-field:disabled { background: var(--bg-card); }
html.dark .edit-field:focus { background: var(--bg-card); }

.edit-time-row { display: flex; align-items: center; gap: 10px; }
.edit-time-row .input-wrap { flex: 1; }
.edit-time-sep { color: var(--text-muted); font-size: 13px; font-weight: 500; flex-shrink: 0; }

.edit-form-divider { border: none; border-top: 1px solid var(--border-light); margin: 4px 0 20px; }

.edit-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Dark mode: clash error banner */
html.dark .clash-error {
  background: rgba(231,0,11,0.10);
  border-color: rgba(231,0,11,0.3);
  color: #f87171;
}

/* Dark mode: settings page icon badges */
html.dark .settings-icon-green { background: var(--accent-light) !important; }
html.dark .settings-icon-red   { background: var(--red-light) !important; }
html.dark .settings-sec-item   { background: var(--bg-hover) !important; }

/* Edit schedule class picker */
.edit-class-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 4px; }
.edit-class-card { border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.edit-class-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.edit-class-card.cancelled { opacity: 0.6; }
.edit-class-card-code { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 5px; }
.edit-class-card-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.35; }
.edit-class-card-meta { font-size: 12px; color: var(--text-muted); }
.edit-class-card-badge { display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(231,0,11,0.1); color: #e7000b; border-radius: 99px; padding: 2px 8px; }
html.dark .edit-class-card-badge { background: rgba(231,0,11,0.18); color: #f87171; }

/* ── PROFILE PICTURE UPLOAD ── */
.pic-upload-area {
  cursor: pointer;
  position: relative;
}
.pic-upload-preview {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  transition: border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pic-upload-preview:hover {
  border-color: var(--accent);
  background: var(--accent-pale);
}
.pic-upload-preview svg { color: var(--text-lighter); }
.pic-upload-preview p { font-size: 15px; font-weight: 500; margin: 0; }
.pic-upload-preview span { font-size: 12px; color: var(--text-lighter); }
.pic-preview-img {
  display: none;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.pic-preview-img.active { display: block; }
.pic-upload-preview.hidden { display: none; }

/* ── LOADING SPINNER ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 32px auto;
}
.content-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── TOAST STACK ── */
#toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.toast-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 14px;
  color: #fff;
  animation: toastIn .25s ease;
  pointer-events: auto;
}
.toast-item.removing {
  animation: toastOut .2s ease forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* ── FOCUS-VISIBLE ── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.modal-close:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.toggle input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── STUDENT SETTINGS CLASSES ── */
.settings-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.settings-card-header h3 { font-size: var(--text-md); font-weight: 600; }
.settings-card-header p { font-size: var(--text-sm); color: var(--text-muted); }

.settings-icon-badge {
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.settings-icon-badge.green { background: var(--accent-light); }
.settings-icon-badge.red   { background: var(--red-light); }

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.settings-toggle-row p:first-child { font-weight: 500; font-size: var(--text-base); color: var(--text); }
.settings-toggle-row p:last-child  { font-size: var(--text-sm); color: var(--text-muted); }

.settings-sec-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.settings-sec-item p:first-child { font-weight: 500; font-size: var(--text-base); color: var(--text); }
.settings-sec-item p:last-child  { font-size: var(--text-sm); color: var(--text-muted); }

/* ── CONFIRM MODAL CONTENT ── */
.confirm-modal-body {
  text-align: center;
  padding: 24px;
}
.confirm-modal-body p {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.6;
}
.confirm-modal-body h3 {
  font-size: var(--text-lg);
  color: var(--text);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}