/* ============================================
   Bindi - Premium Design System
   Elegant, Warm, Professional
   ============================================ */

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

:root {
  /* ============================================
     Bindi Brand Color Palette - 2026
     ============================================ */

  /* Brand Colors */
  --bindi-turquoise: #4FD1C5;
  --bindi-blue: #5B7FBF;
  --bindi-purple: #6B46C1;
  --bindi-yellow: #F6E05E;
  --bindi-pink: #ED8DC7;
  --bindi-cyan: #4DD4D4;

  /* Neutral Colors */
  --background: #FDFEFF;
  --background-subtle: #F7FAFC;
  --card: #FFFFFF;
  --foreground: #1A202C;
  --foreground-muted: #4A5568;

  /* Muted tones */
  --muted: #F7FAFC;
  --muted-foreground: #718096;
  --muted-hover: #EDF2F7;

  /* Borders - subtle definition */
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.12);
  --border-focus: var(--bindi-blue);

  /* Primary - Bindi Blue for CTAs */
  --primary: var(--bindi-blue);
  --primary-hover: #4A6CA8;
  --primary-foreground: #FFFFFF;

  /* Accent - Bindi Purple for premium features */
  --accent: var(--bindi-blue);
  --accent-light: var(--bindi-turquoise);
  --accent-lighter: #EBF4FF;
  --accent-foreground: #ffffff;

  /* Secondary */
  --secondary: var(--muted);
  --secondary-hover: var(--muted-hover);
  --secondary-foreground: var(--foreground);

  /* Semantic colors */
  --success: #48BB78;
  --success-light: #C6F6D5;
  --warning: var(--bindi-yellow);
  --warning-light: #FEFCBF;
  --destructive: #F56565;
  --destructive-light: #FED7D7;
  --info: var(--bindi-blue);
  --info-light: #BEE3F8;
  
  /* Minimal shadows - zero in most cases, subtle on interactive */
  --shadow-xs: none;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 12px rgba(91, 127, 191, 0.15);
  --shadow-card: none;
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* Spacing & Sizing - Consistent 8px radius */
  --radius: 8px;
  --radius-sm: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ============================================
   Accessibility - Skip Link & Utilities
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background-subtle);
  color: var(--foreground);
  overflow-x: hidden;
  max-width: 100vw;
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================
   Header - Premium with Backdrop Blur
   ============================================ */
.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo a {
  color: var(--foreground);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition-fast);
}

.logo a:hover {
  opacity: 0.8;
}

.logo a::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 2px;
  transform: rotate(45deg);
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--muted);
  padding: 4px;
  border-radius: var(--radius-lg);
}

.nav-link {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--foreground);
}

.nav-link.active {
  color: var(--foreground);
  background: var(--background);
  box-shadow: var(--shadow-sm);
}

/* External link styling */
.nav-link[target="_blank"] {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--accent-foreground);
}

.nav-link[target="_blank"]:hover {
  color: var(--accent-foreground);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   Main Content
   ============================================ */
.main {
  padding: 48px 0 64px;
  min-height: calc(100vh - 140px);
}

/* ============================================
   Page Header - Refined Typography
   ============================================ */
.page-header {
  margin-bottom: 36px;
}

.page-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  color: var(--foreground);
  line-height: 1.2;
}

.subtitle {
  color: var(--muted-foreground);
  font-size: 15px;
  font-weight: 400;
}

.breadcrumb {
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* ============================================
   Cards - Elevated with Depth
   ============================================ */
.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  overflow: hidden;
}

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

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--background) 0%, var(--background-subtle) 100%);
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.card-body {
  padding: 24px;
}

/* Accent card variant */
.card[style*="background: #fafafa"],
.card[style*="background:#fafafa"] {
  background: linear-gradient(135deg, var(--accent-lighter) 0%, var(--background) 100%) !important;
  border-color: rgba(13, 148, 136, 0.2) !important;
}

/* ============================================
   Grid Layout
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

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

/* ============================================
   Forms - Refined & Premium
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label,
.form-group > div:first-child {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.form-select,
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--background);
  color: var(--foreground);
  transition: all var(--transition-fast);
  outline: none;
  box-shadow: var(--shadow-xs);
}

.form-select:hover,
.form-input:hover {
  border-color: var(--border-hover);
}

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

.form-textarea {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  background: var(--background);
  color: var(--foreground);
  transition: all var(--transition-fast);
  outline: none;
  box-shadow: var(--shadow-xs);
  line-height: 1.6;
}

.form-textarea:hover {
  border-color: var(--border-hover);
}

.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lighter), var(--shadow-xs);
}

.form-textarea::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

.form-help {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 8px;
  line-height: 1.5;
}

/* Form validation states */
.form-input:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown),
.form-textarea:invalid:not(:placeholder-shown) {
  border-color: var(--destructive);
  background: var(--destructive-light);
}

.form-input:invalid:not(:placeholder-shown):focus,
.form-select:invalid:not(:placeholder-shown):focus,
.form-textarea:invalid:not(:placeholder-shown):focus {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), var(--shadow-xs);
}

.form-input:valid:not(:placeholder-shown),
.form-textarea:valid:not(:placeholder-shown) {
  border-color: var(--success);
}

.form-error {
  color: var(--destructive);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--destructive);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

/* Selector Grid */
.selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}

@media (max-width: 768px) {
  .selector-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   Buttons - Premium & Tactile
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
  position: relative;
  letter-spacing: -0.01em;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-fast);
  background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, transparent 100%);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(to bottom, var(--primary-hover) 0%, var(--primary) 100%);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-secondary {
  background: var(--background);
  color: var(--foreground);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--muted);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
  transform: translateY(0);
  background: var(--muted-hover);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--accent-foreground);
  box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-large {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--background);
  color: var(--foreground);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-sm:hover {
  background: var(--muted);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(to bottom, #f87171 0%, var(--destructive) 100%);
  color: white;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-danger:hover {
  background: linear-gradient(to bottom, var(--destructive) 0%, #dc2626 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* Loading button states */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading.is-loading {
  color: transparent;
}

.btn-loading.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spinner 0.75s linear infinite;
}

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

/* ============================================
   Alerts - Refined & Beautiful
   ============================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
  box-shadow: var(--shadow-sm);
  animation: slideIn var(--transition-slow) ease-out;
}

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

.alert-success {
  background: linear-gradient(to right, var(--success-light) 0%, #ecfdf5 100%);
  color: #065f46;
  border-color: #a7f3d0;
}

.alert-warning {
  background: linear-gradient(to right, var(--warning-light) 0%, #fffbeb 100%);
  color: #92400e;
  border-color: #fcd34d;
}

.alert-error {
  background: linear-gradient(to right, var(--destructive-light) 0%, #fef2f2 100%);
  color: #991b1b;
  border-color: #fca5a5;
}

.alert-info {
  background: linear-gradient(to right, var(--info-light) 0%, #eff6ff 100%);
  color: #1e40af;
  border-color: #93c5fd;
}

.alert-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.5;
  padding: 0 4px;
  line-height: 1;
  transition: opacity var(--transition-fast);
}

.alert-close:hover {
  opacity: 1;
}

/* ============================================
   Tables - Polished & Readable
   ============================================ */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table th {
  font-weight: 600;
  color: var(--muted-foreground);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--background-subtle);
}

.table tbody tr {
  transition: all var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--muted);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Badges - Premium Pills
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all var(--transition-fast);
}

.badge-success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.badge-pending {
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge-info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.badge-accent {
  background: linear-gradient(135deg, var(--accent-lighter) 0%, #99f6e4 100%);
  color: #0f766e;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ============================================
   Student Cards - Interactive
   ============================================ */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.student-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.student-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.student-card:hover::before {
  opacity: 1;
}

.student-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--foreground);
}

.student-meta {
  color: var(--muted-foreground);
  font-size: 13px;
  margin-bottom: 12px;
}

.student-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ============================================
   Observation Timeline - Beautiful
   ============================================ */
.observation-list {
  list-style: none;
}

.observation-item {
  padding: 18px 20px;
  border-left: 4px solid var(--border);
  margin-bottom: 16px;
  background: var(--background);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.observation-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.observation-item.academic {
  border-left-color: var(--info);
  background: linear-gradient(to right, var(--info-light) 0%, var(--background) 20%);
}

.observation-item.behavior {
  border-left-color: var(--warning);
  background: linear-gradient(to right, var(--warning-light) 0%, var(--background) 20%);
}

.observation-item.social {
  border-left-color: var(--success);
  background: linear-gradient(to right, var(--success-light) 0%, var(--background) 20%);
}

.observation-item.wellbeing {
  border-left-color: #ec4899;
  background: linear-gradient(to right, #fce7f3 0%, var(--background) 20%);
}

.observation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.observation-student {
  font-weight: 600;
  font-size: 15px;
  color: var(--foreground);
}

.observation-date {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

.observation-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--foreground-muted);
}

.observation-badges {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================
   Report Cards - Dashboard Style
   ============================================ */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.report-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.report-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.report-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--foreground);
}

.report-progress {
  margin-top: 18px;
}

.progress-bar {
  height: 10px;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
  border-radius: 9999px;
  transition: width var(--transition-slow);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

/* WCAG AA compliant tier bar colors (4.5:1 contrast on white) */
.progress-fill.low {
  background: linear-gradient(90deg, #b91c1c 0%, #dc2626 100%);
}

.progress-fill.medium {
  background: linear-gradient(90deg, #b45309 0%, #d97706 100%);
}

.progress-label {
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* ============================================
   Empty State - Friendly
   ============================================ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--muted-foreground);
}

.empty-state.empty-state-lg {
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 15px;
  margin-bottom: 28px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.empty-state p.empty-state-text {
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

/* ============================================
   Quick Log Box - Inviting
   ============================================ */
.quick-log-box {
  background: linear-gradient(135deg, var(--accent-lighter) 0%, var(--background) 100%);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: var(--radius-xl);
  padding: 26px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.quick-log-box h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--foreground);
}

.quick-log-input {
  display: flex;
  gap: 14px;
}

.quick-log-input textarea {
  flex: 1;
  min-height: 80px;
}

/* ============================================
   Feature List - Checkmarks
   ============================================ */
.feature-list {
  list-style: none;
  margin: 20px 0;
}

.feature-list li {
  padding: 10px 0;
  padding-left: 32px;
  position: relative;
  font-size: 14px;
  color: var(--foreground-muted);
  line-height: 1.5;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
}

.feature-list li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 17px;
  width: 6px;
  height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}

/* ============================================
   Download Grid - Card Style
   ============================================ */
.download-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.download-card {
  background: var(--background);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 18px;
  text-align: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

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

.download-card.available {
  border-color: var(--success);
  background: linear-gradient(to bottom, var(--success-light) 0%, var(--background) 100%);
}

.download-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-card.special-class {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07) 0%, rgba(5, 150, 105, 0.07) 100%);
}

.download-card.special-interactive {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.07) 0%, rgba(118, 75, 162, 0.07) 100%);
}

.download-icon {
  font-size: 32px;
  margin-bottom: 14px;
}

.download-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--foreground);
}

.download-card p {
  color: var(--muted-foreground);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.4;
}

.download-status {
  font-size: 13px;
  color: var(--muted-foreground);
}

.download-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ============================================
   Quick Stats - Dashboard Feel
   ============================================ */
.quick-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 16px;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--foreground) 0%, var(--foreground-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ============================================
   Lesson Sections
   ============================================ */
.lesson-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.lesson-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.lesson-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lesson-section p {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--foreground-muted);
  line-height: 1.7;
}

.lesson-section .section-subsection {
  margin-top: 12px;
}

.lesson-section .section-subsection-sm {
  margin-top: 8px;
}

.lesson-section ul {
  margin-left: 24px;
}

.lesson-section li {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--foreground-muted);
  line-height: 1.6;
}

/* ============================================
   Diff Grid & Codes Grid
   ============================================ */
.diff-grid,
.codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 768px) {
  .diff-grid,
  .codes-grid {
    grid-template-columns: 1fr;
  }
}

.diff-grid .diff-label,
.codes-label {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-bottom: 8px;
  display: block;
}

.codes-value {
  font-weight: 500;
  font-size: 14px;
  color: var(--foreground);
}

.codes-grid h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.codes-grid ul {
  list-style: none;
}

.codes-grid li {
  margin-bottom: 8px;
  font-size: 14px;
  padding: 6px 10px;
  background: var(--muted);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-right: 6px;
  font-weight: 500;
}

.codes-flex {
  display: flex;
  gap: 32px;
}

/* ============================================
   JSON Display - Dark Theme
   ============================================ */
.json-display {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #94a3b8;
  padding: 20px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.05);
}

/* ============================================
   Navigation Buttons
   ============================================ */
.nav-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .nav-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* ============================================
   Footer - Refined
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  background: var(--background);
}

.footer p {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

/* ============================================
   Utilities
   ============================================ */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted-foreground);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ============================================
   Details/Summary - Collapsible
   ============================================ */
details.card summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details.card summary::-webkit-details-marker {
  display: none;
}

details.card summary::after {
  content: "";
  float: right;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted-foreground);
  border-bottom: 2px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform var(--transition-fast);
  margin-top: 4px;
}

details.card[open] summary::after {
  transform: rotate(45deg);
  margin-top: 0;
}

/* ============================================
   Separator
   ============================================ */
.separator {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 20px 0;
}

/* ============================================
   Focus States - Accessible & Beautiful
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Scrollbar - Refined
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--muted);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 5px;
  border: 2px solid var(--muted);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}

/* ============================================
   Selection - Branded
   ============================================ */
::selection {
  background: var(--accent-lighter);
  color: var(--foreground);
}

/* ============================================
   File Upload Area - Refined
   ============================================ */
[style*="border: 2px dashed"] {
  border: 2px dashed var(--border) !important;
  background: var(--background-subtle) !important;
  transition: all var(--transition-fast);
}

[style*="border: 2px dashed"]:hover {
  border-color: var(--accent) !important;
  background: var(--accent-lighter) !important;
}

/* ============================================
   Lesson Preview Box - Polished
   ============================================ */
[style*="background: var(--muted)"][style*="border-radius"] {
  box-shadow: var(--shadow-xs);
}

/* ============================================
   Info Boxes - Gradient Enhancement
   ============================================ */
[style*="background: linear-gradient(135deg, #f0f9ff"] {
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg) !important;
}

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

.card {
  animation: fadeIn var(--transition-slow) ease-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Loading state */
.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   Responsive Refinements
   ============================================ */
@media (max-width: 768px) {
  .header {
    padding: 12px 0;
  }

  .header .container {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav {
    gap: 2px;
    padding: 3px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .main {
    padding: 32px 0 48px;
  }

  .page-header h2 {
    font-size: 24px;
  }

  .container {
    padding: 0 20px;
  }

  .quick-stats {
    gap: 24px;
  }

  .stat-number {
    font-size: 28px;
  }
}

/* Very small screens - horizontal scroll for nav */
@media (max-width: 480px) {
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
    justify-content: flex-start;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex-shrink: 0;
  }
}

/* ============================================
   Inline Form Helper
   ============================================ */
.inline-form {
  display: inline;
}

/* ============================================
   Dashboard - Progress Tracking
   ============================================ */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  color: var(--primary-foreground);
  padding: 25px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 6px;
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-section {
  background: var(--background);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.dashboard-section.full-width {
  grid-column: 1 / -1;
}

.dashboard-section h2 {
  margin-top: 0;
  color: var(--foreground);
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

.tier-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-bar {
  padding: 15px;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 600;
  min-width: 100px;
  box-shadow: var(--shadow-xs);
}

.tier-bar.support {
  background: var(--warning);
}

.tier-bar.core {
  background: var(--success);
}

.tier-bar.extend {
  background: var(--info);
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
}

.activity-list li:last-child {
  border-bottom: none;
}

.activity-date {
  float: right;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
}

.progress-table th,
.progress-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.progress-table th {
  background: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-foreground);
}

.progress-table tbody tr:hover {
  background: var(--muted);
}

.tier-badge {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  display: inline-block;
}

.tier-badge.support {
  background: var(--warning);
}

.tier-badge.core {
  background: var(--success);
}

.tier-badge.extend {
  background: var(--info);
}

.score {
  font-weight: 600;
}

.score.good {
  color: var(--success);
}

.score.ok {
  color: var(--warning);
}

.score.needs-help {
  color: var(--destructive);
}

.no-data {
  color: var(--muted-foreground);
}

.progress-bar-container {
  background: var(--muted);
  border-radius: var(--radius-lg);
  height: 10px;
  width: 100px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--success) 0%, var(--info) 100%);
  height: 100%;
  border-radius: var(--radius-lg);
  transition: width var(--transition-slow);
}

.btn-small {
  padding: 6px 12px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-block;
}

.btn-small:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.attention-card {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  padding: 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-xs);
}

.attention-card h3 {
  margin: 0 0 10px 0;
  color: #856404;
  font-size: 15px;
  font-weight: 600;
}

.attention-reason {
  color: var(--foreground-muted);
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Assessment Marking - Interactive
   ============================================ */
.scan-iframe {
  width: 100%;
  height: 700px;
  border: none;
  border-radius: var(--radius-lg);
}

.teacher-override-notice {
  font-size: 13px;
  font-weight: 500;
}

.mc-option:hover {
  border-color: var(--accent) !important;
  background: var(--accent-lighter) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.no-answer-option {
  transition: all var(--transition-fast);
}

.no-answer-option:hover {
  background: var(--muted-hover);
  transform: translateX(2px);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .header,
  .footer,
  .nav,
  .btn,
  .alert {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* ============================================
   Bootstrap Overrides - Premium Styling
   ============================================ */

.container-fluid {
  max-width: 100%;
  padding: 0 20px;
}

.row {
  --bs-gutter-x: 24px;
  --bs-gutter-y: 24px;
}

.lead {
  font-size: 15px;
  color: var(--muted-foreground);
  font-weight: 400;
}

.breadcrumb {
  background: none;
  padding: 0;
  margin-bottom: 16px;
  font-size: 13px;
}

.breadcrumb-item a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--accent);
}

.breadcrumb-item.active {
  color: var(--foreground);
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--border);
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--foreground);
  margin-bottom: 8px;
}

.display-4 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(135deg, var(--foreground) 0%, var(--foreground-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-control,
.form-select {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--background);
  color: var(--foreground);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--border-hover);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lighter), var(--shadow-xs);
  outline: none;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 8px;
}

.text-muted {
  color: var(--muted-foreground) !important;
}

.small, small {
  font-size: 13px;
}

.bg-primary {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%) !important;
}

.bg-success {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%) !important;
}

.bg-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%) !important;
  color: #92400e !important;
}

.bg-info {
  background: linear-gradient(135deg, var(--info) 0%, #60a5fa 100%) !important;
}

.bg-danger {
  background: linear-gradient(135deg, var(--destructive) 0%, #f87171 100%) !important;
}

.bg-secondary {
  background: var(--muted) !important;
  color: var(--foreground) !important;
}

.bg-light {
  background: var(--background) !important;
}

.text-white {
  color: white !important;
}

.text-dark {
  color: var(--foreground) !important;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  border: none;
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, var(--success) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-outline-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border: 1.5px solid var(--border);
  color: var(--foreground);
  background: var(--background);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-outline-secondary:hover {
  background: var(--muted);
  border-color: var(--border-hover);
  color: var(--foreground);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--radius-lg);
}

.btn-check:checked + .btn-outline-secondary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-group {
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius);
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
}

.list-group {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-group-item {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  transition: all var(--transition-fast);
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item-action:hover {
  background: var(--muted);
  transform: translateX(4px);
}

.table {
  margin-bottom: 0;
}

.table-hover tbody tr:hover {
  background: var(--muted);
}

.table-responsive {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.badge {
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
}

.badge.bg-success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
  color: #166534 !important;
}

.badge.bg-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e !important;
}

.badge.bg-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  color: #991b1b !important;
}

.badge.bg-secondary {
  background: var(--muted) !important;
  color: var(--muted-foreground) !important;
}

.badge.bg-light {
  background: var(--background) !important;
  color: var(--foreground) !important;
  border: 1px solid var(--border);
}

.d-flex {
  display: flex !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.gap-2 {
  gap: 12px !important;
}

.d-grid {
  display: grid !important;
}

.w-100 {
  width: 100% !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 24px !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 16px !important; }
.p-5 { padding: 48px !important; }
.py-4 { padding-top: 24px !important; padding-bottom: 24px !important; }

.spec-info {
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.text-center {
  text-align: center !important;
}

.iframe-container iframe {
  border-radius: var(--radius-lg);
}

.card .card-header.bg-primary,
.card .card-header.bg-success,
.card .card-header.bg-info {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card.text-center {
  transition: all var(--transition-base);
}

.card.text-center:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.mc-question-item {
  transition: all var(--transition-fast);
}

.mc-question-item:hover {
  box-shadow: var(--shadow-sm);
}

.option-label {
  transition: all var(--transition-fast) !important;
}

.option-label:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.alert-warning {
  background: linear-gradient(to right, var(--warning-light) 0%, #fffbeb 100%);
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: var(--radius-lg);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.col-md-3 .card,
.col-md-4 .card,
.col-md-6 .card,
.col-md-7 .card,
.col-md-8 .card {
  height: 100%;
}

.scanning-tips ul {
  padding-left: 20px;
}

.scanning-tips li {
  margin-bottom: 8px;
  color: var(--foreground-muted);
}

/* ============================================
   Report-Specific Styles
   ============================================ */
.card-warning {
  border-color: var(--destructive-light);
}

.card-header-warning {
  background: #fef2f2;
}

.card-header-warning h3 {
  color: #991b1b;
}

.assessment-box {
  margin-top: 10px;
  padding: 8px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
}

.assessment-score {
  font-size: 12px;
  color: #166534;
  font-weight: 600;
}

.assessment-count {
  font-size: 11px;
  color: var(--foreground-muted);
  margin-top: 4px;
}

.subject-row,
.assessment-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.subject-row:last-child,
.assessment-row:last-child {
  border-bottom: none;
}

details summary {
  font-size: 13px;
  color: var(--muted-foreground);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details .details-content {
  margin-top: 8px;
  font-size: 13px;
}

.action-buttons {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.inline-form {
  display: inline;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */

:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-bg: #ffffff;
  --sidebar-bg-subtle: #f8fafc;
  --sidebar-border: #e2e8f0;
  --sidebar-hover: #f1f5f9;
  --sidebar-active: rgba(168, 139, 157, 0.1);
  --sidebar-active-border: #A88B9D;
  --sidebar-text: #475569;
  --sidebar-text-muted: #64748b;
  --sidebar-text-bright: #1e293b;
  --mobile-header-height: 56px;
}

/* Body states */
body.has-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Mobile Header - Hidden on desktop */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--mobile-header-height);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0 16px;
  align-items: center;
  gap: 12px;
  z-index: 1001;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--sidebar-text);
  transition: background 0.15s;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
}

.mobile-logo {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.mobile-logo a {
  color: var(--sidebar-text-bright);
  text-decoration: none;
}

/* Sidebar Container */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.25s ease, width 0.25s ease;
  overflow: hidden;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  color: var(--sidebar-text-bright);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #A88B9D 0%, #8a6f7f 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(168, 139, 157, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-icon svg {
  color: white;
  flex-shrink: 0;
}

.sidebar-logo:hover .logo-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(168, 139, 157, 0.45);
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sidebar-text-bright);
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--sidebar-text-muted);
  transition: all 0.15s;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

/* Quick Create Section */
.sidebar-quick-create {
  padding: 16px 14px 12px;
  position: relative;
}

.quick-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #A88B9D 0%, #8a6f7f 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(168, 139, 157, 0.25);
}

.quick-create-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 139, 157, 0.35);
  background: linear-gradient(135deg, #8a6f7f 0%, #755d69 100%);
}

.quick-create-btn svg {
  flex-shrink: 0;
}

.quick-create-btn .chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.sidebar-quick-create.open .quick-create-btn .chevron {
  transform: rotate(180deg);
}

.quick-create-dropdown {
  position: absolute;
  top: 100%;
  left: 14px;
  right: 14px;
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 10;
}

.sidebar-quick-create.open .quick-create-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.quick-create-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: background 0.15s;
}

.quick-create-option:hover {
  background: var(--sidebar-hover);
}

.quick-create-option svg {
  color: var(--sidebar-text-muted);
  flex-shrink: 0;
}

.quick-create-option .option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-create-option .option-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--sidebar-text-bright);
}

.quick-create-option .option-desc {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  font-weight: 400;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-text-muted);
}

.nav-section {
  padding: 8px 14px;
}

.nav-section-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
  padding: 12px 12px 8px;
  margin-bottom: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-bright);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--sidebar-active-border);
  border-radius: 0 2px 2px 0;
}

.sidebar-link svg {
  flex-shrink: 0;
  color: var(--sidebar-text-muted);
  transition: color 0.15s;
}

.sidebar-link:hover svg {
  color: var(--sidebar-text);
}

.sidebar-link.active svg {
  color: var(--sidebar-active-border);
}

.sidebar-link span:not(.nav-badge) {
  flex: 1;
}

/* Navigation Badge */
.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav-badge.new {
  background: linear-gradient(135deg, #A88B9D 0%, #8a6f7f 100%);
  color: white;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: auto;
}

.sidebar-link.ai-assistant {
  background: rgba(168, 139, 157, 0.1);
  border: 1px solid rgba(168, 139, 157, 0.2);
  margin-bottom: 12px;
  color: var(--sidebar-text);
}

.sidebar-link.ai-assistant svg {
  color: #A599D9;
}

.sidebar-link.ai-assistant:hover {
  background: rgba(168, 139, 157, 0.15);
  border-color: rgba(168, 139, 157, 0.3);
  color: var(--sidebar-text-bright);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #A88B9D 0%, #8a6f7f 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar-img {
  background: none;
  padding: 0;
}

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

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--sidebar-text-bright);
}

.user-role {
  font-size: 12px;
  color: var(--sidebar-text-muted);
}

/* User Dropdown */
.sidebar-user-container {
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.sidebar-user-container.open .sidebar-user {
  background: var(--sidebar-hover);
}

.user-chevron {
  margin-left: auto;
  color: var(--sidebar-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sidebar-user-container.open .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.sidebar-user-container.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.user-dropdown-item svg {
  color: var(--sidebar-text-muted);
  flex-shrink: 0;
}

.user-dropdown-item:hover svg {
  color: var(--sidebar-text);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 6px 0;
}

.user-dropdown-logout {
  color: #ef4444;
}

.user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.user-dropdown-logout svg {
  color: #ef4444;
}

.user-dropdown-logout:hover svg {
  color: #f87171;
}

/* User Dropdown Upgrade Button */
.user-dropdown-upgrade {
  color: #f59e0b;
}

.user-dropdown-upgrade:hover {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.user-dropdown-upgrade svg {
  color: #f59e0b;
}

.user-dropdown-upgrade:hover svg {
  color: #fbbf24;
}

/* Plan Badge Colors */
.user-plan-free {
  color: #9ca3af;
}

.user-plan-basic {
  color: #60a5fa;
}

.user-plan-pro {
  color: #34d399;
}

.user-plan-founder {
  color: #a78bfa;
  font-weight: 600;
}

/* Sidebar Auth Buttons (Not logged in) */
.sidebar-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.sidebar-auth-buttons .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-auth-buttons .btn-outline {
  background: transparent;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
}

.sidebar-auth-buttons .btn-outline:hover {
  background: var(--sidebar-hover);
  border-color: var(--sidebar-text-muted);
  color: var(--sidebar-text-bright);
}

.sidebar-auth-buttons .btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: white;
}

.sidebar-auth-buttons .btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.sidebar-auth-buttons .btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

/* Locked Navigation Items (Feature Gating) */
.sidebar-link-locked {
  opacity: 0.5;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-link-locked:hover {
  background: transparent !important;
  color: var(--sidebar-text-muted) !important;
}

.sidebar-link-locked .lock-icon {
  color: var(--sidebar-text-muted);
  opacity: 0.7;
  flex-shrink: 0;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s;
}

/* Main Content with Sidebar */
.main-with-sidebar {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-with-sidebar .main-content {
  flex: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 24px 0 0 0;
}

.footer-with-sidebar {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--foreground-muted);
  font-size: 13px;
}

.footer-with-sidebar .main-content {
  max-width: 100%;
  margin: 0;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Collapsed Sidebar State */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .sidebar-link span:not(.nav-badge),
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .quick-create-btn span,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .nav-badge {
  display: none;
}

body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px 12px;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-quick-create {
  padding: 12px 8px 8px;
}

body.sidebar-collapsed .quick-create-btn {
  padding: 10px;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed {
  padding-left: var(--sidebar-collapsed-width);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar-collapse-btn {
    display: none;
  }

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

  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  .main-with-sidebar {
    margin-left: 0;
    padding-top: var(--mobile-header-height);
  }

  .main-with-sidebar .main-content {
    padding: 24px 16px 16px 16px;
  }

  .footer-with-sidebar {
    margin-left: 0;
    padding: 16px;
  }

  /* Hide old header and nav on sidebar pages */
  body.has-sidebar .header,
  body.has-sidebar .nav {
    display: none;
  }

  /* ====== MOBILE TOUCH TARGET FIXES ====== */
  /* Make sidebar wider on mobile for better touch targets */
  .sidebar {
    width: 85vw;
    max-width: 320px;
  }

  /* Larger touch targets for nav group toggles (min 48px height) */
  .nav-group-toggle {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 52px;
  }

  .nav-group-toggle svg:first-child {
    width: 22px;
    height: 22px;
  }

  /* Larger touch targets for sidebar links (min 48px height) */
  .sidebar-link {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 52px;
  }

  .sidebar-link svg {
    width: 22px;
    height: 22px;
  }

  /* Submenu links - still need good touch targets */
  .nav-submenu .sidebar-link {
    padding: 14px 16px 14px 52px;
    font-size: 15px;
    min-height: 48px;
  }

  .nav-submenu .sidebar-link::before {
    left: 36px;
  }

  /* Quick create button - larger on mobile */
  .quick-create-btn {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 52px;
  }

  /* Quick create dropdown options - larger touch targets */
  .quick-create-option {
    padding: 14px 16px;
    min-height: 56px;
  }

  .quick-create-option svg {
    width: 22px;
    height: 22px;
  }

  .quick-create-option .option-title {
    font-size: 15px;
  }

  .quick-create-option .option-desc {
    font-size: 12px;
  }

  /* Sidebar header - more breathing room */
  .sidebar-header {
    padding: 16px;
  }

  .sidebar-logo .logo-icon svg {
    width: 32px;
    height: 32px;
  }

  .sidebar-logo .logo-text {
    font-size: 20px;
  }

  /* User profile section - larger touch target */
  .sidebar-user {
    padding: 14px 16px;
    min-height: 60px;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .user-name {
    font-size: 15px;
  }

  .user-role {
    font-size: 13px;
  }

  /* User dropdown items - larger touch targets */
  .user-dropdown-item {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 48px;
  }

  /* Mobile header - larger toggle button */
  .sidebar-toggle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-toggle svg {
    width: 28px;
    height: 28px;
  }

  /* AI Assistant link - prominent on mobile */
  .sidebar-link.ai-assistant {
    padding: 14px 16px;
    min-height: 52px;
    margin: 12px 16px;
  }

  /* Nav section padding */
  .sidebar-nav {
    padding: 8px 12px;
  }

  .sidebar-quick-create {
    padding: 16px;
  }

  /* Footer spacing */
  .sidebar-footer {
    padding: 12px;
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  :root {
    --sidebar-width: 220px;
  }

  .main-with-sidebar .main-content {
    padding: 24px 24px 20px 24px;
  }
}

/* Hide old header/nav when sidebar is present */
body.has-sidebar > .header,
body.has-sidebar > nav.nav {
  display: none;
}

/* ============================================
   NESTED EXPANDABLE MENUS - Sphere UI Style
   ============================================ */

/* Nav Group Container */
.nav-group {
  margin-bottom: 4px;
}

/* Group Toggle Button */
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  text-align: left;
}

.nav-group-toggle:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.nav-group-toggle.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-bright);
}

.nav-group-toggle.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--sidebar-active-border);
  border-radius: 0 2px 2px 0;
}

.nav-group-toggle svg:first-child {
  flex-shrink: 0;
  color: var(--sidebar-text-muted);
  transition: color 0.15s;
}

.nav-group-toggle:hover svg:first-child {
  color: var(--sidebar-text);
}

.nav-group-toggle.active svg:first-child {
  color: var(--sidebar-active-border);
}

.nav-group-toggle .nav-group-label {
  flex: 1;
}

/* Expand/Collapse Chevron */
.nav-group-toggle .expand-icon {
  flex-shrink: 0;
  color: var(--sidebar-text-muted);
  transition: transform 0.2s ease, color 0.15s;
  margin-left: auto;
}

.nav-group-toggle:hover .expand-icon {
  color: var(--sidebar-text);
}

.nav-group.expanded .nav-group-toggle .expand-icon {
  transform: rotate(90deg);
}

/* Nav Count Badge on Group */
.nav-group-toggle .nav-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--sidebar-bg-subtle);
  color: var(--sidebar-text-muted);
  margin-right: 4px;
}

/* Submenu Container */
.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, opacity 0.2s ease;
  opacity: 0;
  padding-left: 8px;
}

.nav-group.expanded .nav-submenu {
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.35s ease-in, opacity 0.2s ease 0.05s;
}

/* Submenu Items */
.nav-submenu .sidebar-link {
  padding-left: 44px;
  font-size: 13px;
  color: var(--sidebar-text-muted);
  position: relative;
}

.nav-submenu .sidebar-link::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sidebar-text-muted);
  opacity: 0.5;
  transition: all 0.15s;
}

.nav-submenu .sidebar-link:hover::before {
  opacity: 1;
  background: var(--sidebar-text);
}

.nav-submenu .sidebar-link.active::before {
  width: 6px;
  height: 6px;
  background: var(--sidebar-active-border);
  opacity: 1;
}

.nav-submenu .sidebar-link:hover {
  color: var(--sidebar-text);
  background: var(--sidebar-hover);
}

.nav-submenu .sidebar-link.active {
  color: var(--sidebar-text-bright);
  background: var(--sidebar-active);
}

/* Override the left border for submenu active items */
.nav-submenu .sidebar-link.active::after {
  display: none;
}

/* Nested submenu - Level 2 */
.nav-submenu .nav-group {
  margin-bottom: 0;
}

.nav-submenu .nav-group-toggle {
  padding-left: 44px;
  font-size: 13px;
}

.nav-submenu .nav-submenu .sidebar-link {
  padding-left: 60px;
  font-size: 12px;
}

.nav-submenu .nav-submenu .sidebar-link::before {
  left: 44px;
  width: 3px;
  height: 3px;
}

/* Collapsed sidebar state for nav groups */
body.sidebar-collapsed .nav-group-toggle .nav-group-label,
body.sidebar-collapsed .nav-group-toggle .expand-icon,
body.sidebar-collapsed .nav-group-toggle .nav-count {
  display: none;
}

body.sidebar-collapsed .nav-group-toggle {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .nav-submenu {
  display: none;
}

/* Divider within nav sections */
.nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 12px 14px;
}

/* Nav Section with dividers */
.nav-section + .nav-section {
  border-top: 1px solid var(--sidebar-border);
  margin-top: 8px;
  padding-top: 8px;
}

/* Animation for smooth expand/collapse */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-group.expanded .nav-submenu .sidebar-link {
  animation: slideDown 0.2s ease forwards;
}

.nav-group.expanded .nav-submenu .sidebar-link:nth-child(1) { animation-delay: 0.02s; }
.nav-group.expanded .nav-submenu .sidebar-link:nth-child(2) { animation-delay: 0.04s; }
.nav-group.expanded .nav-submenu .sidebar-link:nth-child(3) { animation-delay: 0.06s; }
.nav-group.expanded .nav-submenu .sidebar-link:nth-child(4) { animation-delay: 0.08s; }
.nav-group.expanded .nav-submenu .sidebar-link:nth-child(5) { animation-delay: 0.10s; }

/* Hover effect for parent when child is hovered */
.nav-group:hover > .nav-group-toggle {
  background: var(--sidebar-hover);
}

/* Focus styles for accessibility */
.nav-group-toggle:focus-visible {
  outline: 2px solid var(--sidebar-active-border);
  outline-offset: -2px;
}

.nav-submenu .sidebar-link:focus-visible {
  outline: 2px solid var(--sidebar-active-border);
  outline-offset: -2px;
}
