/* ============================================================
   DESIGN SYSTEM - Aplikasi Penilaian Biologi
   SMA Negeri 2 Ciamis
   ============================================================ */

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

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Primary Colors - Emerald Green (Biology theme) */
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;

  /* Secondary Colors - Deep Blue */
  --secondary-50: #eff6ff;
  --secondary-100: #dbeafe;
  --secondary-200: #bfdbfe;
  --secondary-300: #93c5fd;
  --secondary-400: #60a5fa;
  --secondary-500: #3b82f6;
  --secondary-600: #2563eb;
  --secondary-700: #1d4ed8;
  --secondary-800: #1e40af;
  --secondary-900: #1e3a8a;

  /* Accent Colors */
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-rose: #f43f5e;
  --accent-rose-light: #fb7185;
  --accent-violet: #8b5cf6;
  --accent-violet-light: #a78bfa;
  --accent-teal: #14b8a6;
  --accent-cyan: #06b6d4;

  /* Dark Theme */
  --bg-primary: #0a0f1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(17, 24, 39, 0.5);
  --bg-glass-light: rgba(31, 41, 55, 0.6);
  --bg-hover: rgba(31, 41, 55, 0.8);

  /* Surface */
  --surface-1: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);

  /* Text Colors */
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #111827;

  /* Border */
  --border-primary: rgba(255, 255, 255, 0.08);
  --border-secondary: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(16, 185, 129, 0.5);

  /* Status */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.15);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.15);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
  --shadow-glow-lg: 0 0 40px rgba(16, 185, 129, 0.2);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(5, 150, 105, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-300);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.text-gradient {
  background: linear-gradient(135deg, var(--primary-400), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass-light);
  color: var(--text-primary);
  border: 1px solid var(--border-secondary);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary-600);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  color: white;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   FORMS / INPUTS
   ============================================================ */
.form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-glass);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15), var(--shadow-glow);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: var(--space-1);
}

/* Input with icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .form-input {
  padding-left: 44px;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(20px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.card:hover {
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
}

.card-body {
  position: relative;
}

.card-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-primary);
}

/* Stat Card */
.stat-card {
  text-align: center;
  padding: var(--space-6);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto var(--space-4);
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-1);
}

.stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-600) #0d1524;
  box-sizing: border-box;
}

/* Prominent custom scrollbar for horizontal scrolling tables */
.table-container::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-container::-webkit-scrollbar-track {
  background: #0d1524;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--primary-600), var(--primary-500));
  border-radius: 6px;
  border: 2px solid #0d1524;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

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

.table thead {
  background: var(--bg-glass-light);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  vertical-align: middle;
}

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

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

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

/* Editable cell */
.table td.editable {
  cursor: pointer;
  position: relative;
}

.table td.editable:hover {
  background: var(--surface-3);
}

.table td.editable input {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-primary);
  border: 1px solid var(--primary-500);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  text-align: center;
}

.table td.editable input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* Grade colors */
.grade-high { color: var(--success); font-weight: 600; }
.grade-mid { color: var(--accent-amber); font-weight: 600; }
.grade-low { color: var(--danger); font-weight: 600; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-neutral {
  background: var(--surface-3);
  color: var(--text-secondary);
}

/* Predikat badges */
.badge-A { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-B { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-C { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-D { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-8);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-spring);
  position: relative;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
}

.modal-close:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.modal h3 {
  margin-bottom: var(--space-6);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-xl);
  animation: toastSlideIn 0.4s var(--transition-spring) forwards;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before { background: var(--success); }
.toast-error::before { background: var(--danger); }
.toast-warning::before { background: var(--warning); }
.toast-info::before { background: var(--info); }

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-1);
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  font-size: 1rem;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-exit {
  animation: toastSlideOut 0.3s ease forwards;
}

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

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

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notification-bell {
  position: relative;
  cursor: pointer;
}

.notification-bell .bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bellPulse 2s infinite;
}

@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.notification-bell .bell-icon {
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.notification-bell:hover .bell-icon {
  color: var(--primary-400);
}

.notification-bell.has-new .bell-icon {
  animation: bellShake 0.8s ease;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-15deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(-10deg); }
  75% { transform: rotate(5deg); }
}

/* Notification Dropdown */
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  width: 360px;
  max-height: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-normal);
}

.notification-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-dropdown-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notification-dropdown-header h4 {
  font-size: 0.9375rem;
}

.notification-list {
  max-height: 320px;
  overflow-y: auto;
}

.notification-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.notification-item:hover {
  background: var(--surface-2);
}

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

.notification-item.unread {
  background: var(--surface-1);
  border-left: 3px solid var(--primary-500);
}

.notification-item .notif-text {
  font-size: 0.8125rem;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.notification-item .notif-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.notification-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(8px);
}

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

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

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

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  overflow-x: auto;
}

.tab {
  padding: var(--space-2) var(--space-5);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.tab.active {
  background: var(--primary-600);
  color: white;
  box-shadow: var(--shadow-md);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.hidden { display: none !important; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.4s ease forwards; }

/* Stagger animations */
.stagger > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr;
  }
  
  .card { padding: var(--space-4); }
  
  .notification-dropdown {
    width: calc(100vw - 32px);
    right: -60px;
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    max-width: none;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  
  .btn { padding: var(--space-3) var(--space-4); }
  .tabs { overflow-x: auto; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state .empty-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-cyan));
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
  padding: var(--space-2);
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-primary);
  margin: var(--space-2) 0;
}

/* ============================================================
   DRAG AND DROP
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--border-secondary);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary-500);
  background: rgba(16, 185, 129, 0.05);
}

.drop-zone .drop-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.drop-zone .drop-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.drop-zone .drop-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
