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

/* ===================================================
   DESIGN SYSTEM — AUTOTERAPIA
   =================================================== */

:root {
  /* Core Brand Colors */
  --brand-50: #f0f4ff;
  --brand-100: #e0e9ff;
  --brand-200: #c0d3ff;
  --brand-300: #93b3ff;
  --brand-400: #6088ff;
  --brand-500: #3d5afe;
  --brand-600: #2c47e8;
  --brand-700: #2236c5;
  --brand-800: #1c2d9e;
  --brand-900: #1a2780;

  /* Teal accent */
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;

  /* Purple accent */
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;

  /* Success / Warning / Danger */
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;

  /* Neutral Grays (Dark Mode Base) */
  --gray-0: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-850: #172033;
  --gray-900: #0f172a;
  --gray-950: #080d19;

  /* Semantic tokens — Dark Mode */
  --bg-primary: #0c1220;
  --bg-secondary: #111827;
  --bg-card: #151e2e;
  --bg-card-hover: #1a2540;
  --bg-input: #1a2540;
  --bg-modal: #0f172a;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-subtle: rgba(255,255,255,0.07);
  --border-default: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.2);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5), 0 4px 14px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.6);
  --shadow-brand: 0 4px 20px rgba(61,90,254,0.4);
  --shadow-glow: 0 0 40px rgba(61,90,254,0.15);

  /* Glassmorphism */
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --glass-backdrop: blur(16px) saturate(180%);

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* Border radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px;
  --radius-xl: 20px; --radius-2xl: 28px; --radius-full: 9999px;

  /* Typography */
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

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

.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; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand-400); }
.text-teal { color: var(--teal-400); }
.text-purple { color: var(--purple-400); }
.text-green { color: var(--green-400); }
.text-red { color: var(--red-400); }
.text-yellow { color: var(--yellow-400); }
.text-orange { color: var(--orange-400); }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ===================================================
   LAYOUT
   =================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-6); }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 var(--sp-6); }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 var(--sp-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

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

/* ===================================================
   COMPONENTS — CARDS
   =================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

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

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
}

/* ===================================================
   COMPONENTS — BUTTONS
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--duration-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.07); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: white;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(61,90,254,0.55); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }

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

.btn-teal {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
  color: white;
  box-shadow: 0 4px 20px rgba(20,184,166,0.4);
}
.btn-teal:hover { box-shadow: 0 6px 28px rgba(20,184,166,0.55); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: white;
}

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }
.btn-full { width: 100%; }

/* Loading spinner */
.btn-loading { position: relative; }
.btn-loading::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===================================================
   COMPONENTS — FORMS
   =================================================== */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.form-label .required { color: var(--red-400); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all var(--duration-fast) var(--ease-out);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(61,90,254,0.2);
  background: rgba(61,90,254,0.05);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-secondary); }

.form-error { font-size: 0.8rem; color: var(--red-400); display: flex; align-items: center; gap: 4px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ===================================================
   COMPONENTS — BADGES
   =================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-brand { background: rgba(61,90,254,0.15); color: var(--brand-400); border: 1px solid rgba(61,90,254,0.3); }
.badge-green { background: rgba(34,197,94,0.12); color: var(--green-400); border: 1px solid rgba(34,197,94,0.25); }
.badge-yellow { background: rgba(234,179,8,0.12); color: var(--yellow-400); border: 1px solid rgba(234,179,8,0.25); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red-400); border: 1px solid rgba(239,68,68,0.25); }
.badge-orange { background: rgba(249,115,22,0.12); color: var(--orange-400); border: 1px solid rgba(249,115,22,0.25); }
.badge-purple { background: rgba(168,85,247,0.12); color: var(--purple-400); border: 1px solid rgba(168,85,247,0.25); }
.badge-teal { background: rgba(20,184,166,0.12); color: var(--teal-400); border: 1px solid rgba(20,184,166,0.25); }
.badge-gray { background: rgba(100,116,139,0.15); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* ===================================================
   COMPONENTS — SIDEBAR / NAVIGATION
   =================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: 260px;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 var(--sp-6) var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--sp-4);
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-500), var(--purple-500));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-brand);
}

.sidebar-nav { flex: 1; padding: 0 var(--sp-3); }
.sidebar-section { margin-bottom: var(--sp-6); }
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 var(--sp-3) var(--sp-2);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(61,90,254,0.12);
  color: var(--brand-400);
  border: 1px solid rgba(61,90,254,0.2);
}

.sidebar-link .link-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link .link-badge {
  margin-left: auto;
  background: var(--brand-500);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.sidebar-user:hover { background: var(--glass-bg); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-500), var(--purple-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.user-avatar-lg {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-500), var(--purple-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
  flex-shrink: 0;
}

.main-content {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-width: 0;
  min-height: 100vh;
  padding: var(--sp-8);
  background: var(--bg-primary);
  flex: 1;
}

/* ===================================================
   COMPONENTS — TOPBAR
   =================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
}

.topbar-title h1 { font-size: 1.75rem; font-family: var(--font-display); font-weight: 800; }
.topbar-title p { color: var(--text-secondary); margin-top: var(--sp-1); }

.topbar-actions { display: flex; align-items: center; gap: var(--sp-3); }

/* ===================================================
   COMPONENTS — STAT CARDS
   =================================================== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

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

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon-brand { background: rgba(61,90,254,0.15); }
.stat-icon-teal { background: rgba(20,184,166,0.15); }
.stat-icon-purple { background: rgba(168,85,247,0.15); }
.stat-icon-green { background: rgba(34,197,94,0.15); }
.stat-icon-orange { background: rgba(249,115,22,0.15); }

.stat-info { flex: 1; }
.stat-value { font-size: 2rem; font-weight: 800; font-family: var(--font-display); line-height: 1; }
.stat-label { color: var(--text-secondary); font-size: 0.875rem; margin-top: var(--sp-1); }
.stat-change { font-size: 0.8rem; margin-top: var(--sp-2); display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--green-400); }
.stat-change.down { color: var(--red-400); }

/* ===================================================
   COMPONENTS — ALERTS / DISCLAIMERS
   =================================================== */
.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  font-size: 0.9rem;
}

.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 4px; }

.alert-info { background: rgba(61,90,254,0.08); border: 1px solid rgba(61,90,254,0.2); color: var(--text-primary); }
.alert-info .alert-icon { color: var(--brand-400); }
.alert-warning { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.2); color: var(--text-primary); }
.alert-warning .alert-icon { color: var(--yellow-400); }
.alert-medical {
  background: linear-gradient(135deg, rgba(61,90,254,0.06), rgba(168,85,247,0.06));
  border: 1px solid rgba(61,90,254,0.15);
  color: var(--text-primary);
}
.alert-medical .alert-icon { color: var(--brand-400); }
.alert-success { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); color: var(--text-primary); }
.alert-success .alert-icon { color: var(--green-400); }
.alert-danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: var(--text-primary); }
.alert-danger .alert-icon { color: var(--red-400); }

/* ===================================================
   COMPONENTS — TABLES
   =================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
}

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

thead th {
  padding: 14px var(--sp-5);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

tbody td {
  padding: 14px var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ===================================================
   COMPONENTS — MODAL
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--sp-8);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-xl);
}

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

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.modal-title { font-size: 1.25rem; font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  transition: color var(--duration-fast);
}
.modal-close:hover { color: var(--text-primary); }

/* ===================================================
   COMPONENTS — TOASTS
   =================================================== */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slideInRight var(--duration-normal) var(--ease-out);
}

.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.warning { border-color: rgba(234,179,8,0.3); }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg { flex: 1; font-size: 0.9rem; color: var(--text-primary); }
.toast-close { color: var(--text-muted); cursor: pointer; font-size: 1rem; }
.toast-close:hover { color: var(--text-primary); }

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

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--brand-500), var(--teal-500));
  transition: width var(--duration-slow) var(--ease-out);
}

/* ===================================================
   COMPONENTS — ASSESSMENT SPECIFIC
   =================================================== */
.assessment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.assessment-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, linear-gradient(90deg, var(--brand-500), var(--teal-500)));
}

.assessment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-default);
}

.assessment-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: var(--sp-4);
}

/* Result levels */
.level-low { color: var(--green-400); }
.level-minimal { color: var(--green-400); }
.level-mild { color: var(--yellow-400); }
.level-moderate { color: var(--orange-400); }
.level-moderately_severe { color: var(--red-400); }
.level-significant { color: var(--red-400); }
.level-severe { color: var(--red-500); }

.level-bar {
  height: 12px;
  border-radius: var(--radius-full);
  position: relative;
  background: var(--bg-input);
  overflow: hidden;
}

/* ===================================================
   PAGE TRANSITIONS
   =================================================== */
.page-enter {
  animation: pageEnter var(--duration-slow) var(--ease-out) both;
}

/* ===================================================
   UTILITIES
   =================================================== */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }

.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mr-2 { margin-right: var(--sp-2); }
.ml-auto { margin-left: auto; }

.p-0 { padding: 0; }
.p-4 { padding: var(--sp-4); }
.p-6 { padding: var(--sp-6); }
.p-8 { padding: var(--sp-8); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.rounded-full { border-radius: var(--radius-full); }
.rounded-lg { border-radius: var(--radius-lg); }

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--sp-6) 0;
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================================================
   SCROLLBAR
   =================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pageEnter { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { from { left: -100%; } to { left: 200%; } }
@keyframes float { 0%,100% { transform: translateY(0px) rotate(0deg); } 33% { transform: translateY(-15px) rotate(1deg); } 66% { transform: translateY(-8px) rotate(-1deg); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-bounce { animation: bounce 1.5s infinite; }
.animate-fadeIn { animation: fadeIn var(--duration-normal) var(--ease-out); }
.animate-slideUp { animation: slideUp var(--duration-slow) var(--ease-out); }

/* Skeleton loader */
.skeleton {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  top: 0; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  animation: shimmer 1.5s infinite;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
  .app-layout { flex-direction: column; }
  .sidebar { transform: translateX(-100%); transition: transform var(--duration-normal) var(--ease-out); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; padding: var(--sp-4); }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-size: 1.2rem;
    position: fixed;
    top: var(--sp-4);
    left: var(--sp-4);
    z-index: 200;
  }

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

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-3); }
  .topbar { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .modal { padding: var(--sp-6); }
  .container { padding: 0 var(--sp-4); }
}

.mobile-menu-btn { display: none; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.mobile-overlay.active { display: block; }
