/* ============================================================
   ACQUISITION OS — Design System Complet v3
   ============================================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #1a1a24;
  --border: #2a2a3a;
  --border-light: #3a3a4f;
  --text-primary: #f0f0ff;
  --text-secondary: #9090b0;
  --text-muted: #5a5a7a;
  --accent: #6c63ff;
  --accent-hover: #7c73ff;
  --accent-light: rgba(108, 99, 255, 0.15);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.15);
  --gradient-hero: linear-gradient(135deg, #6c63ff 0%, #a855f7 50%, #ec4899 100%);
  --gradient-card: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(168,85,247,0.06));
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --transition: all 0.2s ease;
  --sidebar-width: 240px;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5a7a' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select option { background: var(--bg-secondary); }

/* ─── Layout ─────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-container {
  padding: 32px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-hero);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(108,99,255,0.4);
}
.logo-text {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}
.nav-section {
  margin-bottom: 4px;
}
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  background: var(--accent);
  color: white;
  flex-shrink: 0;
}
.nav-badge.new { background: var(--success); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-org {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 56px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
#mobile-menu-btn { display: none; }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-gradient {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(108,99,255,0.06) 100%);
  border-color: rgba(108,99,255,0.2);
}
.card-gradient:hover { border-color: rgba(108,99,255,0.35); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-gradient {
  background: var(--gradient-hero);
  color: white;
  box-shadow: 0 4px 16px rgba(108,99,255,0.3);
}
.btn-gradient:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108,99,255,0.45);
}
.btn-gradient:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: var(--success); color: white; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: rgba(90,90,122,0.2); color: var(--text-muted); }

/* ─── Tags ───────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
}
.alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-warning { background: var(--warning-light); border: 1px solid rgba(245,158,11,0.25); color: var(--warning); }
.alert-warning span { color: var(--text-secondary); }
.alert-danger { background: var(--danger-light); border: 1px solid rgba(239,68,68,0.25); color: var(--danger); }
.alert-danger span { color: var(--text-secondary); }
.alert-success { background: var(--success-light); border: 1px solid rgba(34,197,94,0.25); color: var(--success); }
.alert-success span { color: var(--text-secondary); }
.alert-info { background: var(--info-light); border: 1px solid rgba(59,130,246,0.25); color: var(--info); }
.alert-info span { color: var(--text-secondary); }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }
.separator {
  border: none;
  border-top: 1px solid var(--border);
  position: relative;
}

/* ─── Radio & Checkbox options ───────────────────────────────── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.radio-option:hover { border-color: var(--accent); background: rgba(108,99,255,0.05); }
.radio-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.radio-option-label { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.radio-option-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.checkbox-option:hover { border-color: var(--accent); }
.checkbox-option.selected {
  border-color: var(--success);
  background: var(--success-light);
}

/* ─── Grids ──────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─── Progress bars ──────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--accent);
}

/* ─── NBA Card (Next Best Action) ────────────────────────────── */
.nba-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.nba-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(108,99,255,0.05));
  pointer-events: none;
}
.nba-icon { font-size: 1.5rem; flex-shrink: 0; }
.nba-content { flex: 1; }
.nba-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.nba-action {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ─── Modules Grid ───────────────────────────────────────────── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-height: 100px;
}
.module-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.2);
}
.module-card.module-done {
  border-color: rgba(34,197,94,0.3);
  background: var(--success-light);
}
.module-card.module-done:hover { border-color: var(--success); }
.module-icon { font-size: 1.5rem; }
.module-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.3;
}
.module-score {
  font-size: 0.85rem;
  font-weight: 800;
}
.module-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: white;
  font-weight: 700;
}

/* ─── Empty states ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 400px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  animation: slideToast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  max-width: 400px;
  cursor: pointer;
}
.toast-success { background: #0f2e1a; border: 1px solid rgba(34,197,94,0.4); border-left: 3px solid var(--success); color: #86efac; }
.toast-error { background: #2a0a0a; border: 1px solid rgba(239,68,68,0.4); border-left: 3px solid var(--danger); color: #fca5a5; }
.toast-info { background: #0f1e35; border: 1px solid rgba(59,130,246,0.4); border-left: 3px solid var(--info); color: #93c5fd; }
.toast-warning { background: #2a1500; border: 1px solid rgba(245,158,11,0.4); border-left: 3px solid var(--warning); color: #fcd34d; }

/* ─── Animations keyframes ───────────────────────────────────── */
@keyframes slideToast {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ─── Animations classes ─────────────────────────────────────── */
.animate-fade { animation: fadeIn 0.35s ease both; }
.animate-scale { animation: scaleIn 0.3s ease both; }
.animate-slide-up { animation: slideUp 0.4s ease both; }

/* ─── Loading states & AI thinking ──────────────────────────── */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* AI Thinking animation */
.ai-thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}
.dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

/* ─── Score Ring ─────────────────────────────────────────────── */
.score-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.score-ring-label {
  position: absolute;
  text-align: center;
  font-weight: 800;
}
.score-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── Onboarding ─────────────────────────────────────────────── */
.onboarding-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}
.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.onboarding-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  overflow-y: auto;
}
.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 640px;
  animation: fadeIn 0.3s ease;
}
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition);
}
.step:not(:last-child)::after {
  content: '→';
  color: var(--text-muted);
  margin-left: 6px;
  font-size: 0.75rem;
}
.step.active, .step.completed {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}
.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}
.step.active .step-dot, .step.completed .step-dot {
  background: var(--accent);
  color: white;
}
.step-label { font-size: 0.8rem; }

/* ─── Landing page ───────────────────────────────────────────── */
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(108,99,255,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-glow-2 {
  position: absolute;
  bottom: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(168,85,247,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-light);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 800px;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 40px;
  line-height: 1.7;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-primary);
}
.hero-stat-label { font-size: 0.75rem; color: var(--text-muted); }
.gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Features section ───────────────────────────────────────── */
.features-section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.feature-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(108,99,255,0.15);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

/* ─── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-bg-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(108,99,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s ease;
}

/* ─── Scrollbar personnalisée ────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Code & pre ─────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}
pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-input);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  border: 1px solid var(--border);
}

/* ─── Divider ────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 16px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ─── Stat card ──────────────────────────────────────────────── */
.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.stat-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Skeleton loader ────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .page-container { max-width: 100%; }
}

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

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-content { margin-left: 0; }
  #mobile-menu-btn { display: flex !important; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-container { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .hero-title { font-size: 2rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .modules-grid { grid-template-columns: repeat(3, 1fr); }
  .page-header { flex-direction: column; }
  .nba-card { flex-direction: column; text-align: center; }
  .modal { max-width: calc(100vw - 32px); }
  .modal-body, .modal-footer { padding: 16px; }
}

@media (max-width: 480px) {
  .modules-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { flex-direction: column; gap: 16px; }
  .steps { gap: 4px; }
  #toast-container { right: 12px; left: 12px; max-width: 100%; }
}

/* ─── Coach IA ───────────────────────────────────────────────── */
#coach-panel {
  display: none;
  flex-direction: column;
}
#coach-panel.open {
  display: flex !important;
}
#coach-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-fab 3s infinite;
}
@keyframes pulse-fab {
  0%, 100% { box-shadow: 0 8px 24px rgba(108,99,255,0.4); }
  50% { box-shadow: 0 8px 32px rgba(108,99,255,0.7); }
}
.coach-msg {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  animation: fadeInUp 0.2s ease;
}
.coach-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6c63ff, #a855f7);
  color: white;
  border-bottom-right-radius: 4px;
}
.coach-msg-bot {
  align-self: flex-start;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
#coach-typing::after {
  content: '';
  display: inline-block;
  animation: typing-dots 1s infinite;
}
@keyframes typing-dots {
  0% { content: '⠋'; }
  20% { content: '⠙'; }
  40% { content: '⠹'; }
  60% { content: '⠸'; }
  80% { content: '⠼'; }
  100% { content: '⠴'; }
}
.coach-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px;
  margin-bottom: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.coach-suggestion:hover {
  background: rgba(108,99,255,0.08);
  border-color: rgba(108,99,255,0.3);
  color: var(--accent);
}
#coach-messages {
  display: flex;
  flex-direction: column;
}

/* ─── Guided roadmap step ────────────────────────────────────── */
.guided-step-current {
  border-color: rgba(108,99,255,0.4) !important;
  background: rgba(108,99,255,0.06) !important;
}
.guided-step-done {
  border-color: rgba(34,197,94,0.3) !important;
  background: rgba(34,197,94,0.04) !important;
}

/* ─── Modules guidés débutant ────────────────────────────────── */
.modules-grid-guided {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.module-card-guided {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.module-card-guided:hover {
  border-color: rgba(108,99,255,0.4);
  background: rgba(108,99,255,0.04);
  transform: translateX(4px);
}
.module-card-guided.module-done {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.04);
}
.module-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg,#6c63ff,#a855f7);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-card-guided.module-done .module-step-num {
  background: var(--success);
}
.module-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ─── Tooltips contextuels ───────────────────────────────────── */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  vertical-align: middle;
}
.tooltip-trigger:hover { opacity: 1; }

#global-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: none;
}

/* ─── Coach IA dans les modules ──────────────────────────────── */
.module-coach-hint {
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.module-coach-hint-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.module-coach-hint-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.module-coach-hint-text strong { color: var(--accent); }

/* ─── Guided panel coach panel responsive ─────────────────────── */
@media (max-width: 768px) {
  #coach-panel { width: calc(100vw - 32px); right: 16px; }
  .modules-grid-guided { gap: 8px; }
}
