/* =======================================================
   EduTrack — Production SaaS Design System & Core Styles
   Modern • Premium • Responsive • High-Contrast • Fast
   ======================================================= */

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

:root {
  /* ---------------- Brand & Accent Colors ---------------- */
  --primary: #6366f1;
  --primary-rgb: 99, 102, 241;
  --primary-hover: #4f46e5;
  --primary-active: #4338ca;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --secondary: #8b5cf6;
  --secondary-rgb: 139, 92, 246;
  --secondary-hover: #7c3aed;

  --accent-cyan: #06b6d4;
  --accent-sky: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  /* ---------------- Semantic Status Colors ---------------- */
  --success: #10b981;
  --success-rgb: 16, 185, 129;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);
  --success-text: #34d399;

  --warning: #f59e0b;
  --warning-rgb: 245, 158, 11;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);
  --warning-text: #fbbf24;

  --danger: #ef4444;
  --danger-rgb: 239, 68, 68;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);
  --danger-text: #f87171;

  --info: #0ea5e9;
  --info-rgb: 14, 165, 233;
  --info-bg: rgba(14, 165, 233, 0.12);
  --info-border: rgba(14, 165, 233, 0.3);
  --info-text: #38bdf8;

  /* ---------------- Neutral Surfaces & Elevations ---------------- */
  --bg-dark: #070a12;
  --bg-darker: #04060a;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-solid: #111827;
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-surface: #131d31;
  --bg-surface-elevated: #1e293b;
  --bg-surface-high: #243048;

  /* ---------------- Borders & Dividers ---------------- */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.04);

  /* ---------------- Typography ---------------- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;

  --text-main: #f8fafc;
  --text-sub: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0b0f19;

  /* ---------------- Shadows & Glows ---------------- */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 14px 28px -4px rgba(0, 0, 0, 0.6), 0 6px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.25);
  --shadow-glow-cyan: 0 0 30px rgba(6, 182, 212, 0.25);
  --shadow-glow-emerald: 0 0 30px rgba(16, 185, 129, 0.25);

  /* ---------------- Border Radii ---------------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  /* ---------------- Transitions ---------------- */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-dark);
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(139, 92, 246, 0.03) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =======================================================
   2. TYPOGRAPHY
   ======================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 600; }
h5 { font-size: 0.95rem; font-weight: 600; }
h6 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

p {
  color: var(--text-sub);
}

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

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

code, pre {
  font-family: var(--font-mono);
}

/* Gradient Text Utilities */
.gradient-text {
  background: linear-gradient(135deg, #c7d2fe 0%, #818cf8 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-text-amber {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 60%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, #a7f3d0 0%, #34d399 50%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* =======================================================
   3. LAYOUT & GRID UTILITIES
   ======================================================= */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 28px;
  padding-right: 28px;
}

.container-fluid {
  width: 100%;
  padding-left: 28px;
  padding-right: 28px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
  .container { padding-left: 16px; padding-right: 16px; }
}

/* Helper Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }
.text-white { color: #ffffff; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* =======================================================
   4. BUTTON SYSTEM
   ======================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  font-family: inherit;
  user-select: none;
  position: relative;
  overflow: hidden;
  min-height: 44px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0f19;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  color: #0b0f19;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-sub);
  backdrop-filter: blur(8px);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary-light);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

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

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.btn-sm { padding: 6px 14px; font-size: 0.825rem; border-radius: var(--radius-sm); min-height: 34px; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; border-radius: var(--radius-md); min-height: 52px; }
.btn-block { width: 100%; }

/* Loading Spinner on Buttons */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: calc(50% - 9px);
  left: calc(50% - 9px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinner 0.7s linear infinite;
}

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

/* =======================================================
   5. FORM CONTROLS & INPUTS
   ======================================================= */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.form-label .required-star {
  color: var(--danger);
  margin-left: 3px;
}

.form-control, .form-select, textarea.form-control {
  width: 100%;
  padding: 11px 16px;
  background-color: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.925rem;
  font-family: inherit;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  min-height: 44px;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.2);
  background-color: #162033;
}

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

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

/* Password Toggle Wrapper */
.pwd-toggle-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-toggle-wrap .form-control {
  padding-right: 44px;
}

.pwd-toggle {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  user-select: none;
}

.pwd-toggle:hover {
  color: #ffffff;
}

/* Password Strength Meter */
.pwd-meter-container {
  margin-top: 8px;
}

.pwd-meter-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}

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

.pwd-meter-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Form Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.form-check input[type="checkbox"], .form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* =======================================================
   6. CARDS & CONTAINERS
   ======================================================= */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: var(--transition-smooth);
  position: relative;
}

.card-hover:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  background-color: rgba(6, 10, 18, 0.6);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* =======================================================
   7. TABLES & DATA VIEWS
   ======================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

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

.table th {
  background-color: rgba(23, 32, 51, 0.95);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  vertical-align: middle;
  transition: var(--transition);
}

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

.table tbody tr:hover td {
  background-color: rgba(99, 102, 241, 0.05);
  color: var(--text-main);
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-search-input {
  max-width: 320px;
  width: 100%;
}

/* =======================================================
   8. BADGES & PILLS
   ======================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  line-height: 1.3;
  white-space: nowrap;
}

.badge-primary { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); }
.badge-success { background: var(--success-bg); color: #34d399; border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-bg); color: #fbbf24; border: 1px solid var(--warning-border); }
.badge-danger { background: var(--danger-bg); color: #f87171; border: 1px solid var(--danger-border); }
.badge-info { background: var(--info-bg); color: #38bdf8; border: 1px solid var(--info-border); }
.badge-secondary { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }

/* =======================================================
   9. ALERTS & NOTIFICATION BANNERS
   ======================================================= */
.alert {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
  font-size: 0.925rem;
  position: relative;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease-out;
}

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

.alert-success { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); color: #6ee7b7; }
.alert-danger { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-warning { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); color: #fde68a; }
.alert-info { background: rgba(14, 165, 233, 0.12); border: 1px solid rgba(14, 165, 233, 0.3); color: #7dd3fc; }

.alert-icon { font-size: 1.3rem; font-weight: bold; flex-shrink: 0; }
.alert-message { flex: 1; line-height: 1.5; }
.alert-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 2px 6px;
}
.alert-close:hover { opacity: 1; }

/* =======================================================
   10. TOAST NOTIFICATION ENGINE
   ======================================================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: var(--transition-smooth);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateX(40px) scale(0.95);
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-danger { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info { border-left: 4px solid var(--info); }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.9rem; color: #ffffff; margin-bottom: 2px; }
.toast-desc { font-size: 0.825rem; color: var(--text-sub); line-height: 1.4; }
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px;
}
.toast-close:hover { color: #ffffff; }

/* =======================================================
   11. MODALS, DRAWERS & DIALOGS
   ======================================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 11, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

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

.modal-box {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-smooth);
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

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

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(6, 10, 18, 0.7);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* =======================================================
   12. GLOBAL COMMAND PALETTE / SEARCH MODAL
   ======================================================= */
.command-palette-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 11, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 100px;
  padding-left: 20px;
  padding-right: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.command-palette-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.command-palette-modal {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  overflow: hidden;
  transform: translateY(-20px) scale(0.97);
  transition: var(--transition-smooth);
}

.command-palette-backdrop.active .command-palette-modal {
  transform: translateY(0) scale(1);
}

.command-palette-search-wrap {
  position: relative;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 14px 20px;
  gap: 12px;
}

.command-palette-icon {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.command-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
}

.command-palette-shortcut {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.command-palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  list-style: none;
}

.command-palette-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.925rem;
  transition: var(--transition);
}

.command-palette-item a:hover, .command-palette-item a.selected {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
}

.command-palette-footer {
  padding: 10px 20px;
  background: rgba(6, 10, 18, 0.6);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* =======================================================
   13. EMPTY STATES & SKELETON LOADERS
   ======================================================= */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: rgba(17, 24, 39, 0.4);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  display: inline-block;
  opacity: 0.9;
}

.empty-state .empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size: 0.885rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 20px;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 37%, rgba(255, 255, 255, 0.04) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-circle { border-radius: var(--radius-full); }

/* =======================================================
   14. PUBLIC HEADER & NAVBAR
   ======================================================= */
.navbar {
  background-color: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 14px 0;
  transition: var(--transition);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  text-decoration: none;
}

.brand-logo .logo-badge {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 16px var(--primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-sub);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover, .nav-links a.active {
  color: #ffffff;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 2px;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =======================================================
   15. PUBLIC FOOTER
   ======================================================= */
.footer {
  background-color: #04060a;
  border-top: 1px solid var(--border-color);
  padding: 60px 0 28px;
  margin-top: auto;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 16px;
}

/* Progress bar */
.progress {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

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