/* =========================================================
   Hemdrix Smart Attendance - Full Design System
   Light Mode (Default) + Dark Mode + PWA + Projector
   ========================================================= */

/* ---- GOOGLE FONT PRELOAD FALLBACK ---- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =========================================================
   THEME TOKENS – LIGHT MODE (DEFAULT)
   ========================================================= */
:root,
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-solid: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-input: #ffffff;
  --border-subtle: #e2e8f0;
  --border-highlight: rgba(79, 70, 229, 0.4);

  --primary: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.2);
  --accent-emerald: #059669;
  --emerald-light: #ecfdf5;
  --emerald-glow: rgba(5, 150, 105, 0.2);
  --accent-rose: #e11d48;
  --rose-light: #fff1f2;
  --rose-glow: rgba(225, 29, 72, 0.15);
  --accent-amber: #d97706;
  --amber-light: #fffbeb;
  --amber-glow: rgba(217, 119, 6, 0.18);
  --accent-cyan: #0891b2;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-elevated: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);
  --shadow-deep: 0 25px 50px -12px rgba(0,0,0,0.18);

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  --header-bg: rgba(255,255,255,0.92);
  --nav-bg: rgba(248,250,252,0.95);
}

/* =========================================================
   THEME TOKENS – DARK MODE
   ========================================================= */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: rgba(19, 27, 46, 0.85);
  --bg-card-hover: rgba(30, 41, 69, 0.95);
  --bg-card-solid: #131b2e;
  --bg-secondary: #101726;
  --bg-input: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.4);

  --primary: #6366f1;
  --primary-light: rgba(99,102,241,0.12);
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent-emerald: #10b981;
  --emerald-light: rgba(16,185,129,0.12);
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --accent-rose: #f43f5e;
  --rose-light: rgba(244,63,94,0.12);
  --rose-glow: rgba(244, 63, 94, 0.25);
  --accent-amber: #f59e0b;
  --amber-light: rgba(245,158,11,0.12);
  --amber-glow: rgba(245, 158, 11, 0.25);
  --accent-cyan: #06b6d4;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-card: 0 10px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.5);
  --shadow-elevated: 0 20px 40px -10px rgba(0,0,0,0.7);
  --shadow-deep: 0 25px 60px rgba(0,0,0,0.8);

  --header-bg: rgba(9,13,22,0.92);
  --nav-bg: rgba(13,19,34,0.95);
}

/* =========================================================
   GLOBAL RESET — REMOVE ALL SCROLLBARS
   ========================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  /* Firefox */
  scrollbar-width: none;
  /* IE / Edge */
  -ms-overflow-style: none;
}

/* Chrome, Safari, Opera */
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-main);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* =========================================================
   MOBILE SHELL & VIEWPORT CONTAINER
   ========================================================= */
.mobile-app-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  background-color: var(--bg-main);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-deep);
  padding-bottom: 95px;
  transition: background-color var(--transition-smooth);
}

@media (min-width: 768px) {
  .mobile-app-shell {
    max-width: 840px;
    margin: 20px auto;
    border-radius: 28px;
    border: 1px solid var(--border-subtle);
    min-height: calc(100dvh - 40px);
    overflow: hidden;
  }
}

/* =========================================================
   APP TOP HEADER
   ========================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-left { display: flex; align-items: center; gap: 10px; }
.header-right { display: flex; align-items: center; gap: 8px; }

.app-brand-badge {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

/* =========================================================
   PULSE DOT ANIMATION
   ========================================================= */
.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  transition: all var(--transition-fast);
  font-family: inherit;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
}

.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-emerald {
  background: var(--accent-emerald);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--emerald-glow);
}
.btn-emerald:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-rose {
  background: var(--accent-rose);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--rose-glow);
}
.btn-rose:hover { filter: brightness(1.08); }

.btn-block { width: 100%; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-icon-round {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-muted);
}
.btn-icon-round:hover { color: var(--primary); border-color: var(--primary); }

.btn-theme-toggle { color: var(--text-muted); }

.btn-header-logout {
  color: var(--accent-rose) !important;
}
.btn-header-logout:hover {
  background: var(--rose-light) !important;
  border-color: var(--accent-rose) !important;
  color: var(--accent-rose) !important;
  transform: scale(1.05);
}

.btn-start-class-highlight {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  box-shadow: 0 6px 20px var(--primary-glow);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-start-class-highlight:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-student-mode {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}
.btn-student-mode:hover { background: var(--primary); color: #fff; }

/* =========================================================
   FORM ELEMENTS
   ========================================================= */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder { color: var(--text-dim); }

.range-slider {
  width: 100%;
  accent-color: var(--primary);
  height: 4px;
  cursor: pointer;
}

/* =========================================================
   CARDS
   ========================================================= */
.ui-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  transition: background-color var(--transition-smooth);
}

.ui-card.highlight {
  border-color: var(--border-highlight);
  box-shadow: 0 0 0 1px var(--border-highlight), var(--shadow-card);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon { color: var(--primary); }

/* =========================================================
   ACTIVE SESSION CARD
   ========================================================= */
.active-session-banner {
  background: linear-gradient(135deg, var(--primary-light), var(--bg-card));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-elevated);
}

[data-theme="dark"] .active-session-banner {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(19,27,46,0.9));
}

.session-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rose-light);
  color: var(--accent-rose);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-rose);
  width: fit-content;
}

.course-headline {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.venue-subheadline {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.makeshift-badge {
  background: var(--amber-light);
  color: var(--accent-amber);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-amber);
  text-transform: uppercase;
}

/* Session Duration & Timer */
.session-duration-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
}

.session-countdown-display {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.session-countdown-display.warning { color: var(--accent-amber); }
.session-countdown-display.critical { color: var(--accent-rose); }

/* =========================================================
   QR CONTAINER
   ========================================================= */
.qr-container-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#live-qr-canvas img,
#live-qr-canvas canvas {
  border-radius: var(--radius-md);
  display: block;
}

.qr-exp-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-emerald);
  background: var(--emerald-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
}

.qr-actions-row { width: 100%; display: flex; flex-direction: column; gap: 8px; }

/* Check-in Direct Link Row */
.checkin-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.checkin-link-row .form-input {
  flex: 1;
  font-size: 11px;
  padding: 7px 10px;
  background: var(--bg-input);
  color: var(--text-dim);
  cursor: text;
}

/* =========================================================
   STATS GRID
   ========================================================= */
.session-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================================
   RADIUS CONTROLLER
   ========================================================= */
.radius-controller {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.radius-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.radius-header .val { color: var(--primary); font-size: 14px; }

/* =========================================================
   LIVE STREAM SECTION
   ========================================================= */
.live-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  margin: 4px 0;
}

.live-stream-header h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-card-list {
  display: flex;
  flex-direction: column;
  padding: 0 18px;
  gap: 8px;
}

.student-live-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition-fast);
  animation: slideIn 0.25s ease-out;
}

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

.student-live-card.present { border-left: 3px solid var(--accent-emerald); }
.student-live-card.rejected { border-left: 3px solid var(--accent-rose); background: var(--rose-light); }

.student-info-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.student-meta { display: flex; flex-direction: column; min-width: 0; }
.student-name { font-size: 13px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-sub { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

.dist-tag {
  background: var(--emerald-light);
  color: var(--accent-emerald);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.btn-override-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.btn-override-icon:hover { color: var(--primary); border-color: var(--primary); }

/* =========================================================
   LOCKOUT SCREENS (DESKTOP RESTRICTION, INSTALL REQUIRED, GPS)
   ========================================================= */
.lockout-screen,
#location-lockout-overlay,
#desktop-lockout-overlay,
#pwa-install-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  overflow-y: auto;
}

.lockout-shield-icon {
  width: 80px;
  height: 80px;
  background: var(--rose-light);
  border: 2px solid var(--accent-rose);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-rose);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.lockout-shield-icon.lockout-primary {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.lockout-shield-icon.lockout-amber {
  background: var(--amber-light);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.lockout-shield-icon svg { width: 38px; height: 38px; }

.lockout-screen h2,
#location-lockout-overlay h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.lockout-screen p,
#location-lockout-overlay p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 360px;
  margin-bottom: 8px;
}

.lockout-detail {
  font-size: 12px !important;
  color: var(--text-dim) !important;
}

.lockout-device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rose-light);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin: 12px 0 16px;
}

.install-instructions-card,
.lockout-steps {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 14px 0;
  text-align: left;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.7;
}

.install-instructions-card strong,
.lockout-steps strong {
  color: var(--text-main);
}

.install-instructions-card p,
.lockout-steps p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.7;
}

/* =========================================================
   TAB SECTIONS
   ========================================================= */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.tab-section { display: none; flex-direction: column; gap: 0; }
.tab-section.active { display: flex; }

.section-heading {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding: 4px 0;
}

/* Scheduled Banner Pill */
.now-scheduled-pill {
  background: var(--amber-light);
  border: 1px solid var(--accent-amber);
  border-radius: var(--radius-xl);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

[data-theme="dark"] .now-scheduled-pill {
  background: rgba(245,158,11,0.12);
}

.scheduled-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.scheduled-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Duration Selector Row */
.duration-selector-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.duration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.duration-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-family: inherit;
  transition: var(--transition-fast);
}

.duration-chip.selected,
.duration-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* =========================================================
   TIMETABLE / SCHEDULE
   ========================================================= */
.timetable-day-group { margin-bottom: 16px; }
.day-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  padding: 2px 0;
}

.timetable-slot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition-fast);
}

.slot-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.slot-course-code {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.slot-venue {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* =========================================================
   STUDENT ROSTER TABLE
   ========================================================= */
.roster-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.roster-filter-row .form-select { flex: 1; }

.student-roster-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-fast);
}

.student-roster-card:hover { background: var(--bg-card-hover); }

.student-course-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.course-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--border-highlight);
  text-transform: uppercase;
}

.import-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.import-zone:hover { border-color: var(--primary); background: var(--primary-light); }

/* =========================================================
   BOTTOM NAVIGATION BAR
   ========================================================= */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.06);
  transition: background-color var(--transition-smooth);
}

@media (min-width: 500px) {
  .bottom-nav-bar {
    border-bottom-left-radius: 36px;
    border-bottom-right-radius: 36px;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  border-radius: var(--radius-md);
  min-width: 54px;
  border: none;
  background: none;
  font-family: inherit;
}

.nav-item .nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { transform: translateY(-2px); }

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* =========================================================
   MODAL BOTTOM SHEETS & INDEPENDENT SCROLL LOCK
   ========================================================= */
body.modal-open {
  overflow: hidden !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.modal-overlay.active { display: flex; }

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-elevated);
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: background-color var(--transition-smooth);
}

/* Independent Scroll Modal Structure */
.modal-sheet-fixed-header {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.modal-independent-scroll-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.modal-independent-scroll-body::-webkit-scrollbar {
  width: 5px;
}

.modal-independent-scroll-body::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 999px;
}

.modal-independent-scroll-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-subtle);
  margin: 0 auto 18px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* =========================================================
   RELOCATION DECISION MODAL
   ========================================================= */
.relocation-option-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.relocation-option-card:hover,
.relocation-option-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.relocation-option-card.makeshift:hover,
.relocation-option-card.makeshift.selected {
  border-color: var(--accent-amber);
  background: var(--amber-light);
}

.relocation-radio { margin-top: 3px; accent-color: var(--primary); }
.relocation-text h5 { font-size: 14px; font-weight: 700; color: var(--text-main); }
.relocation-text p { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

/* =========================================================
   AUDIT TRAIL RECORDS
   ========================================================= */
.audit-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.filter-chip {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: var(--transition-fast);
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.audit-entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.audit-entry-card.rejected { border-left: 3px solid var(--accent-rose); background: var(--rose-light); }
.audit-entry-card.present { border-left: 3px solid var(--accent-emerald); }

.audit-row-top { display: flex; justify-content: space-between; align-items: center; }
.audit-matric { font-size: 12px; font-weight: 700; color: var(--text-main); }
.audit-reason { font-size: 11px; color: var(--accent-rose); margin-top: 4px; font-weight: 500; }
.audit-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

/* Status Badges */
.audit-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-present { background: var(--emerald-light); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.badge-rejected { background: var(--rose-light); color: var(--accent-rose); border: 1px solid var(--accent-rose); }
.badge-override { background: var(--amber-light); color: var(--accent-amber); border: 1px solid var(--accent-amber); }

/* =========================================================
   PROFILE SECTION
   ========================================================= */
.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-fast);
}

.profile-avatar-large:hover { transform: scale(1.05); }
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.lecturer-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-fast);
}

.lecturer-avatar-mini:hover { border-color: var(--primary); }
.lecturer-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: 90%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.25s ease-out;
  transition: background-color var(--transition-smooth);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-icon { display: flex; align-items: center; flex-shrink: 0; }
.toast.success { border-color: var(--accent-emerald); }
.toast.success .toast-icon { color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-rose); }
.toast.error .toast-icon { color: var(--accent-rose); }
.toast.warning { border-color: var(--accent-amber); }
.toast.warning .toast-icon { color: var(--accent-amber); }
.toast.info .toast-icon { color: var(--primary); }

/* =========================================================
   ICON UTILITIES
   ========================================================= */
.icon-inline { display: inline-flex; align-items: center; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

/* =========================================================
   PROJECTOR PAGE STYLES
   ========================================================= */
.projector-body {
  display: block;
  background: var(--bg-main);
  min-height: 100dvh;
  max-width: none;
}

.projector-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.projector-main {
  padding: 24px;
  min-height: calc(100dvh - 66px);
  display: flex;
  flex-direction: column;
}

/* Standby Card */
.projector-standby-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 32px;
  gap: 16px;
}

.standby-beacon {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 8px;
}

.beacon-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--border-highlight);
  animation: beaconPulse 2s ease-in-out infinite;
}

.beacon-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.beacon-icon svg { width: 40px; height: 40px; }

@keyframes beaconPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.projector-standby-card h2 { font-size: 28px; font-weight: 800; color: var(--text-main); }
.projector-standby-card p { font-size: 16px; color: var(--text-muted); max-width: 480px; line-height: 1.6; }

.standby-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Projector Active 2-Column Grid */
.projector-active-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .projector-active-grid {
    grid-template-columns: 1fr;
  }
}

/* Projector Left: QR Column */
.proj-left-col { display: flex; flex-direction: column; gap: 16px; min-width: 380px; }

.proj-qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-elevated);
  flex: 1;
}

.qr-heading { text-align: center; }
.qr-heading h3 { font-size: 18px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.qr-heading p { font-size: 12px; color: var(--text-muted); }

.qr-stage {
  background: #ffffff;
  padding: 20px;
  border-radius: var(--radius-lg);
  display: inline-block;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

.proj-direct-link-box {
  width: 100%;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--border-subtle);
}

.link-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 6px; }

.link-input-row { display: flex; gap: 8px; }
.link-input-row .form-input { flex: 1; font-size: 11px; padding: 7px 10px; }

.geofence-status-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--accent-emerald);
  background: var(--emerald-light);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  width: 100%;
  justify-content: center;
}

/* Projector Right: Stats + Stream */
.proj-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

.proj-stats-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: space-around;
  box-shadow: var(--shadow-card);
}

.proj-stat-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.stat-big-num {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.5s;
}

.stat-sub-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.proj-stat-divider { width: 1px; height: 60px; background: var(--border-subtle); }

.proj-progress-track {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.proj-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Projector Live Stream List */
.proj-stream-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 16px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.stream-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stream-header-row h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stream-badge-counter {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.proj-stream-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.proj-stream-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.proj-stream-card.animate-in { animation: slideIn 0.3s ease-out; }
.proj-stream-card.present { border-left: 3px solid var(--accent-emerald); }
.proj-stream-card.rejected { border-left: 3px solid var(--accent-rose); }

.student-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.student-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-green { background: var(--emerald-light); color: var(--accent-emerald); border: 2px solid var(--accent-emerald); }
.avatar-red { background: var(--rose-light); color: var(--accent-rose); border: 2px solid var(--accent-rose); }

.student-stream-info { flex: 1; min-width: 0; }
.student-stream-name { font-size: 14px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-stream-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stream-rejection-reason { font-size: 10px; color: var(--accent-rose); margin-top: 3px; }

.stream-status-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stream-status-badge.badge-present { background: var(--emerald-light); color: var(--accent-emerald); }
.stream-status-badge.badge-rejected { background: var(--rose-light); color: var(--accent-rose); }

.stream-empty-message {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

/* Projector Live Header Elements */
.live-course-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  animation: pulseDot 1.5s ease-in-out infinite;
}

.course-code-highlight { font-weight: 800; font-size: 15px; }
.divider { color: var(--text-dim); }

.countdown-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* =========================================================
   SPIN ANIMATION (LOADING)
   ========================================================= */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* =========================================================
   EXPORT TAB
   ========================================================= */
.export-option-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.export-option-card:hover { background: var(--bg-card-hover); border-color: var(--border-highlight); }

.export-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

/* =========================================================
   RADAR / ELIGIBILITY SECTION
   ========================================================= */
.radar-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  gap: 10px;
}

.radar-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.radar-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* =========================================================
   CUSTOM COURSE FILTER & ROSTER STYLING
   ========================================================= */
.custom-course-filter {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  padding: 12px 16px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  cursor: pointer;
}

.custom-course-filter:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

.custom-course-filter option {
  background: #0f172a !important;
  color: #f8fafc !important;
  padding: 10px;
  font-weight: 600;
}

.student-live-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.student-live-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  border-color: var(--primary);
}

.student-live-card:active {
  transform: translateY(0);
}

/* =========================================================
   STUDENT DETAIL MODAL & TABS
   ========================================================= */
.student-tabs-header {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}

.student-tab-btn {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.student-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Schedule Section Segmented Tabs (Courses vs Venues) */
.schedule-tabs-header {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  gap: 6px;
  border: 1px solid var(--border-subtle);
}

.schedule-tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.schedule-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.schedule-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.schedule-tab-btn.active.venue-tab {
  background: var(--accent-cyan);
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.35);
}

.schedule-subtab-content {
  animation: fadeIn 0.25s ease;
}

.student-tab-content {
  display: none;
}

.student-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* Profile Tab */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.profile-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 8px 25px var(--primary-glow);
  object-fit: cover;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}

.profile-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profile-matric {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-info-card {
  background: var(--bg-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.profile-info-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 2px;
}

.profile-info-val {
  font-size: 13px;
  color: var(--text-main);
  font-weight: 700;
}

.profile-course-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* Attendance Tab */
.attendance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.attendance-kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
}

.attendance-kpi-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.attendance-kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.attendance-radar-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.attendance-radar-banner.eligible {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.attendance-radar-banner.barred {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.attendance-history-list {
  max-height: 280px;
  overflow-y: auto;
  margin-top: 10px;
}

.attendance-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

/* ==========================================
   PRINTABLE REPORT MODAL & PRINT MEDIA
   ========================================== */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-report-container, #printable-report-container * {
    visibility: visible;
  }
  #printable-report-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #fff;
    color: #000;
  }
  .no-print {
    display: none !important;
  }
}

/* ==========================================
   NODE-BRANCH INTERACTIVE TIMETABLE SCHEDULER
   ========================================== */
.tree-root-node {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(6, 182, 212, 0.15));
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px var(--primary-glow);
  animation: nodePopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto;
  max-width: 96%;
}

.tree-root-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tree-root-code {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.tree-root-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tree-trunk-line {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary), var(--accent-cyan));
  margin: 0 auto;
  border-radius: 2px;
}

.branch-slot-set {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: var(--shadow-card);
  animation: branchGrow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--accent-cyan);
}

.branch-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.branch-slot-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.branch-nodes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .branch-nodes-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tree-node {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tree-node:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.tree-node .node-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tree-node .node-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
}

.btn-add-branch-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px dashed var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
}

.btn-add-branch-slot:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-remove-branch-slot {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all var(--transition-fast);
}

.btn-remove-branch-slot:hover {
  background: var(--rose-light);
  color: var(--accent-rose);
}

@keyframes nodePopIn {
  from { opacity: 0; transform: scale(0.92) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

/* =========================================================
   SECURITY & AUTHENTICATION LOCKOUT GATE
   ========================================================= */
body.app-locked .mobile-app-shell {
  pointer-events: none !important;
  user-select: none !important;
  filter: blur(12px) grayscale(40%) !important;
  transition: filter 0.3s ease;
}

#modal-lecturer-login {
  z-index: 999999 !important;
  background: rgba(15, 23, 42, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

#modal-lecturer-login .modal-sheet {
  border-radius: var(--radius-xl) !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
  max-width: 420px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
  animation: modalGatePop 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes modalGatePop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}


/* ========== VENUE REGISTRY - Icon Action Buttons ========== */
.btn-override-icon {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
  font-size: 16px;
  line-height: 1;
}
.btn-override-icon:hover {
  background: rgba(255,255,255,0.07);
  transform: scale(1.12);
}
.btn-override-icon:active {
  transform: scale(0.95);
}
