/* ==========================================================================
   ThermoOlyMaster: Science Olympiad Thermodynamics 2027 Design System
   Aesthetic: Dark Thermal Cyber-Laboratory with Glowing Infrared Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #060913;
  --bg-card: rgba(13, 20, 36, 0.85);
  --bg-card-hover: rgba(20, 32, 56, 0.95);
  --bg-surface: #0a0f1d;
  --bg-input: rgba(18, 27, 48, 0.9);
  
  /* Thermal Infrared & Flame Accents */
  --thermal-primary: #ff5722;
  --thermal-hover: #ff7043;
  --thermal-gradient: linear-gradient(135deg, #ff3d00 0%, #ff9100 100%);
  --thermal-glow: 0 0 25px rgba(255, 87, 34, 0.4);
  
  /* Cryogenic Cyan & Cooling Accents */
  --cryo-cyan: #00e5ff;
  --cryo-gradient: linear-gradient(135deg, #00b0ff 0%, #00e5ff 100%);
  --cryo-glow: 0 0 25px rgba(0, 229, 255, 0.35);

  /* Gold & Success Accents */
  --gold-accent: #ffd700;
  --gold-gradient: linear-gradient(135deg, #ffb300 0%, #ffd700 100%);
  --success: #00e676;
  --warning: #ffab00;
  --danger: #ff1744;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(255, 87, 34, 0.3);

  /* Fonts */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Elevation */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.8);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   SELECTABLE THEMES
   ========================================================================== */

/* 1. Thermal Obsidian (Default - Fiery Infrared & Cryo Cyan) */
html[data-theme="thermal"] {
  --bg-dark: #060913;
  --bg-card: rgba(13, 20, 36, 0.85);
  --bg-card-hover: rgba(20, 32, 56, 0.95);
  --bg-surface: #0a0f1d;
  --bg-input: rgba(18, 27, 48, 0.9);
  --thermal-primary: #ff5722;
  --thermal-hover: #ff7043;
  --thermal-gradient: linear-gradient(135deg, #ff3d00 0%, #ff9100 100%);
  --thermal-glow: 0 0 25px rgba(255, 87, 34, 0.4);
  --cryo-cyan: #00e5ff;
  --cryo-gradient: linear-gradient(135deg, #00b0ff 0%, #00e5ff 100%);
  --cryo-glow: 0 0 25px rgba(0, 229, 255, 0.35);
  --gold-accent: #ffd700;
  --gold-gradient: linear-gradient(135deg, #ffb300 0%, #ffd700 100%);
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(255, 87, 34, 0.3);
}

/* 2. Cryo Arctic (Cool, calm glacier blues - significantly reduced contrast/fire) */
html[data-theme="cryo"] {
  --bg-dark: #07111e;
  --bg-card: rgba(11, 23, 42, 0.88);
  --bg-card-hover: rgba(16, 32, 59, 0.95);
  --bg-surface: #0d1b30;
  --bg-input: rgba(15, 30, 56, 0.9);
  --thermal-primary: #38bdf8;
  --thermal-hover: #7dd3fc;
  --thermal-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  --thermal-glow: 0 0 20px rgba(56, 189, 248, 0.28);
  --cryo-cyan: #22d3ee;
  --cryo-gradient: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
  --cryo-glow: 0 0 20px rgba(34, 211, 238, 0.25);
  --gold-accent: #67e8f9;
  --gold-gradient: linear-gradient(135deg, #0284c7 0%, #67e8f9 100%);
  --text-main: #f0f9ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(56, 189, 248, 0.28);
}
html[data-theme="cryo"] body {
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(34, 211, 238, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #07111e 0%, #0c1a2e 100%);
}

/* 3. Academic Slate (Muted indigo & deep slate, low eye-strain for long study) */
html[data-theme="academic"] {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.95);
  --bg-surface: #1e293b;
  --bg-input: rgba(30, 41, 59, 0.95);
  --thermal-primary: #6366f1;
  --thermal-hover: #818cf8;
  --thermal-gradient: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
  --thermal-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --cryo-cyan: #38bdf8;
  --cryo-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  --cryo-glow: 0 0 20px rgba(56, 189, 248, 0.25);
  --gold-accent: #a5b4fc;
  --gold-gradient: linear-gradient(135deg, #6366f1 0%, #c7d2fe 100%);
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-accent: rgba(99, 102, 241, 0.32);
}
html[data-theme="academic"] body {
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(56, 189, 248, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

/* 4. Emerald Lab (Deep spruce & soothing mint, restful natural tones) */
html[data-theme="forest"] {
  --bg-dark: #061412;
  --bg-card: rgba(10, 31, 28, 0.85);
  --bg-card-hover: rgba(15, 45, 40, 0.95);
  --bg-surface: #0a221f;
  --bg-input: rgba(13, 38, 34, 0.9);
  --thermal-primary: #10b981;
  --thermal-hover: #34d399;
  --thermal-gradient: linear-gradient(135deg, #059669 0%, #34d399 100%);
  --thermal-glow: 0 0 20px rgba(16, 185, 129, 0.25);
  --cryo-cyan: #2dd4bf;
  --cryo-gradient: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
  --cryo-glow: 0 0 20px rgba(45, 212, 191, 0.25);
  --gold-accent: #6ee7b7;
  --gold-gradient: linear-gradient(135deg, #10b981 0%, #a7f3d0 100%);
  --text-main: #f0fdf4;
  --text-secondary: #99f6e4;
  --text-muted: #5eead4;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.28);
}
html[data-theme="forest"] body {
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(45, 212, 191, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #061412 0%, #0a221f 100%);
}

/* 5. Daylight Classroom (High-readability crisp light mode for projectors & day study) */
html[data-theme="daylight"] {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-input: #f1f5f9;
  --thermal-primary: #d97706;
  --thermal-hover: #b45309;
  --thermal-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  --thermal-glow: 0 4px 14px rgba(217, 119, 6, 0.2);
  --cryo-cyan: #0284c7;
  --cryo-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  --cryo-glow: 0 4px 14px rgba(2, 132, 199, 0.2);
  --gold-accent: #d97706;
  --gold-gradient: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(217, 119, 6, 0.35);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
}
html[data-theme="daylight"] body {
  background-color: #f8fafc;
  color: #0f172a;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(217, 119, 6, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(2, 132, 199, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
html[data-theme="daylight"] .app-topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="daylight"] .app-sidebar {
  background: #ffffff;
  border-right-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="daylight"] .sidebar-header,
html[data-theme="daylight"] .sidebar-footer {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="daylight"] .text-input,
html[data-theme="daylight"] .select-input {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
html[data-theme="daylight"] .otp-input-field {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}
html[data-theme="daylight"] .nav-tab-btn {
  color: #475569;
}
html[data-theme="daylight"] .nav-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
html[data-theme="daylight"] .nav-tab-btn.active {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}
html[data-theme="daylight"] .quick-switch-grid .user-switch-chip {
  background: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme="daylight"] .quick-switch-grid .user-switch-chip:hover {
  background: #f8fafc;
}
html[data-theme="daylight"] .stat-chip {
  background: #ffffff;
  border-color: #e2e8f0;
}
html[data-theme="daylight"] .stat-chip-highlight {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.3);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(255, 87, 34, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(0, 229, 255, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #060913 0%, #0a0e1c 100%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--thermal-primary);
}

/* ==========================================================================
   App Shell & Left Sidebar Navigation Layout
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-dark);
  position: relative;
}

/* Left Sidebar Navigation */
.app-sidebar {
  width: 275px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(8, 13, 27, 0.98) 0%, rgba(5, 8, 17, 0.99) 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

/* Sidebar Brand Header */
.sidebar-brand {
  padding: 1.25rem 1.15rem 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(18, 27, 48, 0.25);
  position: relative;
}

.brand-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--thermal-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: var(--thermal-glow);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 14px rgba(255, 87, 34, 0.3); }
  100% { box-shadow: 0 0 26px rgba(255, 87, 34, 0.6); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.15;
  background: linear-gradient(120deg, #ffffff 40%, var(--thermal-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.brand-text .rules-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.12);
  color: var(--cryo-cyan);
  border: 1px solid rgba(0, 229, 255, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

/* Close button for mobile drawer */
.btn-close-sidebar {
  display: none;
  position: absolute;
  right: 0.85rem;
  top: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-close-sidebar:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Navigation Items */
.sidebar-nav {
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.sidebar-group-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 0.85rem 0.5rem 0.35rem 0.5rem;
  text-transform: uppercase;
  user-select: none;
}

.sidebar-group-label:first-of-type {
  padding-top: 0.2rem;
}

.nav-tab-btn {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(3px);
}

.nav-tab-btn.active {
  background: var(--thermal-gradient);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(255, 87, 34, 0.4);
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.35);
  transform: translateX(4px);
}

.nav-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
}

.badge-ts {
  background: rgba(255, 87, 34, 0.18);
  color: #ffab91;
  border: 1px solid rgba(255, 87, 34, 0.35);
}

.badge-ps {
  background: rgba(0, 229, 255, 0.15);
  color: #80deea;
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.badge-es {
  background: rgba(255, 171, 0, 0.18);
  color: #ffe082;
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.badge-curriculum {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-coach {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-tab-btn.active .nav-badge {
  background: rgba(0, 0, 0, 0.25) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-footer .user-badge-container {
  width: 100%;
}

.sidebar-footer .user-badge-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(18, 27, 48, 0.85);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.sidebar-footer .user-badge-btn:hover {
  background: rgba(28, 42, 74, 0.95);
  border-color: var(--thermal-primary);
  box-shadow: 0 0 15px rgba(255, 87, 34, 0.3);
}

.sidebar-footer .user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
}

.sidebar-footer .user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-footer .user-role {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--cryo-cyan);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.15;
}

.sidebar-footer .dropdown-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-subtext {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
  padding: 0.15rem 0;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  display: none;
}

/* Main Content Wrapper & Topbar */
.app-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 9, 19, 0.88);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: rgba(18, 27, 48, 0.8);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 7px;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: rgba(28, 42, 74, 0.95);
  border-color: var(--thermal-primary);
}

.menu-icon-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
}

.breadcrumb-prefix {
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--border-accent);
  font-size: 0.8rem;
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Quick Stats */
.quick-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-chip {
  background: rgba(18, 27, 48, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-chip .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.stat-chip .value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--thermal-primary);
}

.stat-chip-highlight {
  border-color: var(--border-accent);
  background: rgba(255, 87, 34, 0.08);
}

.stat-chip-highlight .label {
  color: var(--thermal-primary);
}

.stat-chip-highlight .value {
  color: var(--thermal-primary);
}

/* Topbar Right Controls & Theme Selector */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.theme-selector-container {
  position: relative;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.75rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--thermal-primary);
  transform: translateY(-1px);
}

.theme-toggle-btn .theme-icon {
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle-btn .theme-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 255px;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--thermal-glow);
  padding: 0.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  animation: modalScaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dropdown-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.2rem;
}

.theme-option-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  width: 100%;
}

.theme-option-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
}

.theme-option-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--thermal-primary);
}

.theme-opt-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.theme-opt-info {
  flex: 1;
  overflow: hidden;
}

.theme-opt-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.theme-opt-desc {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-check {
  font-size: 0.85rem;
  color: var(--thermal-primary);
  opacity: 0;
  font-weight: 700;
}

.theme-option-btn.active .theme-check {
  opacity: 1;
}

/* Main Container */
.app-container {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem;
  box-sizing: border-box;
}

/* Section Shell */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

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

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

/* Section Header */
.section-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 750px;
  margin-top: 0.25rem;
}

.badge-official {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 87, 34, 0.15);
  color: #ff7043;
  border: 1px solid rgba(255, 87, 34, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.grid-aside-main {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

/* Cards & Surfaces */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.card-glowing-thermal {
  border-color: var(--border-accent);
  box-shadow: 0 4px 20px rgba(255, 87, 34, 0.12);
}

.card-glowing-cryo {
  border-color: rgba(0, 229, 255, 0.25);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.1);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Form Controls & Inputs */
.control-group {
  margin-bottom: 1.15rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.control-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--thermal-primary);
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 4px;
  outline: none;
  transition: var(--transition);
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--thermal-gradient);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
  transition: transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

select.select-box, input.text-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: var(--transition);
}

select.select-box:focus, input.text-input:focus {
  border-color: var(--thermal-primary);
  box-shadow: 0 0 0 2px rgba(255, 87, 34, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--thermal-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.6);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-cyan {
  background: var(--cryo-gradient);
  color: #060913;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.35);
}

.btn-cyan:hover {
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.55);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

/* Simulation Canvas & Visual Rig */
.sim-viewport {
  width: 100%;
  height: 480px;
  background: #040711;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

canvas#collectorCanvas, canvas#pvCanvas, canvas#chartCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-stats {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 10;
}

.overlay-metric {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.8rem;
}

.overlay-metric .k {
  color: var(--text-muted);
}
.overlay-metric .v {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--thermal-primary);
}

/* Big Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.metric-card {
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-card .title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.metric-card .number {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
}

.metric-card .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Exam & Quiz Specifics */
.exam-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.question-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.question-grid-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.q-pill {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.q-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.q-pill.active {
  border-color: var(--thermal-primary);
  color: var(--thermal-primary);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}

.q-pill.answered {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cryo-cyan);
  border-color: rgba(0, 229, 255, 0.4);
}

.q-pill.correct {
  background: rgba(0, 230, 118, 0.2);
  color: var(--success);
  border-color: var(--success);
}

.q-pill.incorrect {
  background: rgba(255, 23, 68, 0.2);
  color: var(--danger);
  border-color: var(--danger);
}

.question-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.q-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.q-text {
  font-size: 1.15rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.6;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-btn {
  background: rgba(18, 27, 48, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  color: var(--text-main);
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.option-btn.selected {
  border-color: var(--thermal-primary);
  background: rgba(255, 87, 34, 0.15);
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(0, 230, 118, 0.15);
  color: #ffffff;
}

.option-btn.wrong {
  border-color: var(--danger);
  background: rgba(255, 23, 68, 0.15);
  color: #ffffff;
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.explanation-card {
  background: rgba(10, 20, 38, 0.9);
  border-left: 4px solid var(--cryo-cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
}

.explanation-card.show {
  display: block;
}

/* Binder Reference Tables */
.reference-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

table.reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

table.reference-table th {
  background: #0f172a;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

table.reference-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

table.reference-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

table.reference-table .mono {
  font-family: var(--font-mono);
  color: var(--cryo-cyan);
}

/* Toast Notifications */
#toastContainer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-accent);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInRight 0.3s ease-out;
}

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

/* Exam Sub-Navigation Segmented Controls */
.sub-nav-tabs {
  display: inline-flex;
  background: rgba(18, 27, 48, 0.7);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  gap: 0.4rem;
}

.sub-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sub-nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.sub-nav-btn.active {
  background: var(--thermal-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.4);
}

/* OMR Scanner Drop Zone & Camera View */
.scanner-drop-zone {
  border: 2px dashed rgba(255, 87, 34, 0.35);
  background: rgba(18, 27, 48, 0.5);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1rem;
}

.scanner-drop-zone:hover, .scanner-drop-zone.drag-over {
  border-color: var(--thermal-primary);
  background: rgba(255, 87, 34, 0.08);
}

.cam-preview-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--cryo-cyan);
  background: #000;
  display: none;
}

.cam-preview-box video {
  width: 100%;
  display: block;
}

.cam-reticle {
  position: absolute;
  top: 10%;
  left: 10%;
  right: 10%;
  bottom: 10%;
  border: 2px dashed rgba(0, 229, 255, 0.6);
  pointer-events: none;
}

.scanner-canvas-viewport {
  width: 100%;
  background: #040711;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: center;
  padding: 0.5rem;
}

.scanner-canvas-viewport canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  border-radius: 4px;
}

/* Media Queries */
@media (max-width: 1024px) {
  .grid-2col, .grid-aside-main, .exam-layout {
    grid-template-columns: 1fr;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .btn-close-sidebar {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 1200;
    transform: translateX(-100%);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.75);
  }

  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1100;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .app-topbar {
    padding: 0.65rem 1.15rem;
  }

  .app-container {
    padding: 1.15rem 1rem;
  }
}

@media (max-width: 768px) {
  .quick-stats {
    display: none;
  }
}

/* User Profile Badge & Account Switcher */
.user-badge-container {
  display: flex;
  align-items: center;
}

.user-badge-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(18, 27, 48, 0.85);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.user-badge-btn:hover {
  background: rgba(28, 42, 74, 0.95);
  border-color: var(--thermal-primary);
  box-shadow: 0 0 15px rgba(255, 87, 34, 0.3);
}

.user-avatar {
  font-size: 1.25rem;
  line-height: 1;
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.user-role {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--cryo-cyan);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dropdown-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), var(--thermal-glow);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.modal-lg {
  max-width: 850px;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(13, 20, 36, 0.6);
}

/* Quick User Switcher Chips */
.quick-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.user-switch-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18, 27, 48, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.user-switch-chip:hover {
  background: rgba(255, 87, 34, 0.12);
  border-color: var(--thermal-primary);
  transform: translateY(-1px);
}

.user-switch-chip.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--cryo-cyan);
}

.switch-chip-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.switch-chip-role {
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
}

.switch-chip-email {
  font-size: 0.62rem;
  color: var(--cryo-cyan);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Google Authentication & Social Login Styles */
.google-auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: rgba(18, 27, 48, 0.45);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

#googleSignInButtonDiv {
  display: flex;
  justify-content: center;
  min-height: 40px;
}

.btn-google-instant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-full);
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-google-instant:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
  color: #111827;
}

.btn-google-instant:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.user-avatar-img, .nav-avatar-img {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-accent);
}

.google-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(66, 133, 244, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(66, 133, 244, 0.35);
}

/* Email OTP Authentication Styles */
.otp-auth-card {
  background: rgba(18, 27, 48, 0.6);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  margin-bottom: 1.25rem;
}

.otp-input-field {
  width: 100%;
  max-width: 260px;
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
  padding: 0.65rem 1rem;
  border: 2px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: rgba(5, 8, 16, 0.95);
  color: var(--cryo-cyan);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  margin: 0 auto;
  display: block;
}

.otp-input-field:focus {
  border-color: var(--thermal-primary);
  box-shadow: 0 0 16px rgba(255, 87, 34, 0.4), inset 0 2px 6px rgba(0, 0, 0, 0.5);
  outline: none;
}

.test-mode-banner {
  background: rgba(0, 229, 255, 0.08);
  border: 1px dashed rgba(0, 229, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  color: var(--cryo-cyan);
  margin: 0.85rem 0;
  text-align: center;
  line-height: 1.4;
}

.test-mode-code {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(0, 229, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: #ffffff;
}

/* Admin Metrics Grid */
.admin-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.admin-metric-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.admin-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--thermal-gradient);
}

.admin-metric-card.cyan::before {
  background: var(--cryo-gradient);
}

.admin-metric-card.gold::before {
  background: var(--gold-gradient);
}

.admin-metric-card.green::before {
  background: linear-gradient(135deg, #00c853 0%, #69f0ae 100%);
}

.admin-metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.admin-metric-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.admin-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}

/* Lessons & Curriculum Hub Styles */
.lessons-progress-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--cryo-gradient);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--cryo-glow);
}

.lessons-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.lesson-filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.lesson-filter-btn {
  background: rgba(18, 27, 48, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.lesson-filter-btn:hover {
  color: var(--text-main);
  border-color: var(--cryo-cyan);
}

.lesson-filter-btn.active {
  background: rgba(0, 229, 255, 0.18);
  color: var(--cryo-cyan);
  border-color: var(--cryo-cyan);
}

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

.lesson-card {
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.lesson-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.lesson-card.lesson-completed {
  border-left: 4px solid var(--success);
}

.lesson-reader-view {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.lesson-reader-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.formula-callout {
  background: rgba(10, 16, 32, 0.95);
  border: 1px solid var(--border-accent);
  border-left: 4px solid var(--thermal-primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  overflow-x: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.math-var {
  font-family: var(--font-mono);
  color: var(--cryo-cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  white-space: nowrap;
}

.lesson-section-block ul {
  padding-left: 1.5rem;
  margin: 0.75rem 0 1rem 0;
}

.lesson-section-block li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.lesson-section-block table.reference-table {
  margin: 1.25rem 0;
  width: 100%;
}

/* Lesson Figures & Historical Illustrations */
.lesson-figure {
  margin: 1.5rem 0;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-md);
}

.lesson-illustration {
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: inline-block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lesson-illustration:hover {
  transform: scale(1.015);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), var(--thermal-glow);
}

.lesson-figure figcaption {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  font-style: italic;
  line-height: 1.4;
}

/* Print Styles for Binder Hub and Admin Reports */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-sidebar, .app-topbar, .sidebar-backdrop, .btn, .quick-stats, #toastContainer, .admin-actions-bar, .modal-overlay {
    display: none !important;
  }
  .app-main-wrapper, .app-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .view-section {
    display: none !important;
  }
  .view-section.active, #view-binder, #view-admin {
    display: block !important;
  }
  .card, .admin-metric-card {
    border: 1px solid #ccc !important;
    background: none !important;
    color: #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  table.reference-table th {
    background: #f1f5f9 !important;
    color: #000 !important;
  }
  table.reference-table td {
    color: #000 !important;
  }
  table.reference-table .mono {
    color: #000 !important;
    font-weight: bold;
  }
}
