@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Ultra-Clean Modern Color Palette */
  --bg-main: #090d16;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: rgba(15, 23, 42, 0.6);
  --bg-glass: rgba(15, 23, 42, 0.8);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: #6366f1;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

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

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

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

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

/* Base Reset & Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.4) 0px, transparent 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   APP HEADER & NAVIGATION BAR
   ========================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 8px;
}

/* Main Navigation Pills */
.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

/* Header Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 14px 4px 6px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius-full);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  display: block;
  line-height: 1.2;
}

.user-role-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

.logout-btn {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fb7185;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
}

.logout-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
  color: #fff;
}

/* ==========================================================
   MAIN LAYOUT & VIEWS
   ========================================================== */
.app-container {
  flex: 1;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.75rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================
   CLASSROOM VIEW (STAGE & SIDEBAR)
   ========================================================== */
.classroom-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  height: calc(100vh - 120px);
  min-height: 600px;
}

.classroom-main-stage {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.classroom-top-bar {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.4);
}

.class-info-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.classroom-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mode-tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.stage-content-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #060911;
}

/* Multi-Video Grid */
.video-grid-view {
  width: 100%;
  height: 100%;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  align-content: center;
  overflow-y: auto;
}

.video-tile {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.video-tile:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.video-tile.malpractice-active {
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.4) !important;
  animation: borderAlert 1.2s infinite alternate;
}

@keyframes borderAlert {
  from { border-color: rgba(244, 63, 94, 0.4); }
  to { border-color: rgba(244, 63, 94, 1); }
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transform: scaleX(-1);
}

.video-tile canvas.ai-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent !important;
  z-index: 5;
}

/* Video Overlay HUD */
.video-overlay-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.participant-tag {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-focused {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.status-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.status-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.video-overlay-bottom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
}

.focus-meter-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meter-bar {
  width: 55px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: var(--radius-full);
}

/* Floating Bottom Control Dock */
.classroom-controls-bar {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.ctrl-btn, .btn-primary, .btn-secondary {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.btn-secondary, .ctrl-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover, .ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
}

.ctrl-btn.btn-active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
}

/* ==========================================================
   SIDEBAR (CHAT & STUDENTS ROSTER)
   ========================================================= */
.classroom-sidebar {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
}

.sidebar-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 12px 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.sidebar-tab-btn.active {
  color: #fff;
  border-bottom-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-content-area {
  flex: 1;
  overflow: hidden;
}

.chat-messages-box {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
}

.chat-bubble.teacher {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  align-self: flex-start;
}

.chat-bubble.self {
  background: var(--accent-primary);
  color: #fff;
  align-self: flex-end;
}

.chat-sender {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  font-weight: 600;
}

.chat-input-bar {
  padding: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
}

.chat-input-bar input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
}

.chat-input-bar input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ==========================================================
   ACADEMIC MODULES (HOMEWORK, KANBAN, STATS, REPORTS)
   ========================================================== */
.assignment-hub-container, .proctoring-dashboard, .report-view-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hub-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
}

.assignment-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.assignment-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.assignment-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
}

/* Tasks Kanban Board */
.tasks-board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.kanban-column {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.column-header {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.task-item-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* AI Proctoring Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  display: block;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.proctor-main-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}

.live-ai-inspect-card, .incident-gallery-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.inspect-video-container {
  position: relative;
  width: 100%;
  height: 340px;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 10px;
}

.hud-telemetry-box {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* AI Reports View */
.report-hero-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  box-shadow: var(--shadow-md);
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.report-meta-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.report-meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.report-meta-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.report-score-donut {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-value {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--accent-emerald);
  line-height: 1;
  margin: 8px 0;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.chart-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.chart-canvas-wrapper {
  height: 280px;
  position: relative;
  margin-top: 10px;
}

.audit-table-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.custom-table th {
  text-align: left;
  padding: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================
   AUTHENTICATION OVERLAY PORTAL (CLEAN & PROFESSIONAL)
   ========================================================== */
.auth-overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 16, 0.94);
  backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-overlay-screen.hidden {
  display: none !important;
}

.auth-card-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  max-width: 450px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-header {
  text-align: center;
}

.auth-brand-logo {
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 10px auto;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-role-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.auth-role-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.auth-role-tab.active {
  background: var(--accent-primary);
  color: #fff;
}

.biometric-scanner-banner {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: #22d3ee;
}

.biometric-scanner-ring {
  width: 20px;
  height: 20px;
  border: 2px solid #22d3ee;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinRing 1s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  transition: var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle .form-input {
  padding-right: 40px;
}

.pwd-toggle-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.pwd-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.pwd-strength-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pwd-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 0.7rem;
  margin-top: 4px;
}

.pwd-check-item {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}

.pwd-check-item.valid {
  color: #34d399;
  font-weight: 600;
}

.pwd-check-item.invalid {
  color: #fb7185;
}

.field-error-msg {
  font-size: 0.72rem;
  color: #fb7185;
  display: none;
}

.field-error-msg.visible {
  display: block;
}

.auth-toggle-prompt {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-toggle-link {
  color: #a5b4fc;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}

/* ==========================================================
   MODALS & DIALOGS
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(5, 8, 16, 0.88);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.modal-dialog {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.25s ease-out;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================
   FLOATING ADMISSION KNOCKS & TOASTS
   ========================================================== */
.admission-requests-tray {
  position: fixed;
  top: 75px;
  right: 20px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: 90vw;
}

.admission-knock-card {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-md), 0 0 15px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.waiting-lobby-screen {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.94);
  backdrop-filter: blur(20px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.waiting-lobby-card {
  background: var(--bg-glass);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-lg), 0 0 25px rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast-danger { border-color: rgba(244, 63, 94, 0.4); }
.toast-warning { border-color: rgba(245, 158, 11, 0.4); }
.toast-info { border-color: rgba(99, 102, 241, 0.4); }

/* Global Alert Ticker */
.alert-ticker-container {
  background: rgba(244, 63, 94, 0.15);
  border-bottom: 1px solid rgba(244, 63, 94, 0.3);
  padding: 8px 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #fecdd3;
  z-index: 99;
}

.alert-ticker-container.hidden {
  display: none;
}

/* ==========================================================
   RESPONSIVE DESIGN SYSTEM
   ========================================================== */
@media (max-width: 1200px) {
  .classroom-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .classroom-sidebar {
    height: 540px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .proctor-main-grid, .charts-row, .report-hero-card {
    grid-template-columns: 1fr;
  }
  .tasks-board-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .app-header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .report-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 0.75rem 0.5rem;
  }
  .classroom-controls-bar {
    flex-direction: column;
  }
  .controls-group {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-input, .form-textarea, .form-select, .chat-input-bar input {
    font-size: 16px;
  }
  .auth-card-container {
    padding: 1.5rem;
    max-width: 95vw;
  }
}

/* ==========================================================
   HIGH-FIDELITY PRINT & PDF FORM EXPORT STYLES
   ========================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #0f172a !important;
  }

  .app-header,
  .app-rules-footer,
  .classroom-controls-bar,
  .sidebar-tabs,
  .nav-tabs,
  .role-switch-pills,
  .modal-backdrop,
  #toastContainer,
  #generateReportBtn,
  #downloadPdfReportBtn,
  #refreshPdfArchiveBtn {
    display: none !important;
  }

  .view-section {
    display: none !important;
  }

  #view-reports {
    display: block !important;
  }

  .report-hero-card,
  .audit-table-card,
  .chart-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .report-main-title {
    color: #0f172a !important;
  }

  .report-meta-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  .report-meta-label {
    color: #64748b !important;
  }

  .report-meta-val {
    color: #0f172a !important;
  }

  .custom-table th {
    color: #475569 !important;
    border-bottom: 2px solid #cbd5e1 !important;
  }

  .custom-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .table-snapshot-thumb {
    width: 90px !important;
    height: 65px !important;
    object-fit: cover !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 4px !important;
    display: block !important;
  }

  .status-pill {
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
    background: #f1f5f9 !important;
  }

  .status-danger {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
  }
}
