/* design-system.css — Variables & base styles (from dashboard.html) */

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

:root {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1f8;
  --bg-input: #f4f5fa;
  --border: rgba(99,102,241,0.10);
  --border-hover: rgba(99,102,241,0.30);
  --text-primary: #1a1b2e;
  --text-secondary: #5c5e78;
  --text-muted: #9395a8;
  --accent-blue: #6366f1;
  --accent-cyan: #0ea5e9;
  --accent-violet: #7c3aed;
  --accent-rose: #ec4899;
  --accent-amber: #d97706;
  --accent-emerald: #059669;
  --gradient-primary: linear-gradient(135deg,#6366f1,#7c3aed,#a78bfa);
  --gradient-mesh: radial-gradient(ellipse at 20% 0%,rgba(99,102,241,0.04) 0%,transparent 50%),
                   radial-gradient(ellipse at 80% 100%,rgba(124,58,237,0.03) 0%,transparent 50%);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px var(--border);
  --shadow-card-hover: 0 8px 32px rgba(99,102,241,0.08), 0 0 0 1px var(--border-hover);
  --font-display: 'Syne', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
}

html { scroll-behavior: smooth; }

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

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Layout */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.nav-link.active {
  background: rgba(99,102,241,0.08);
  color: var(--accent-blue);
  font-weight: 600;
}

.nav-link .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.sidebar-user {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-compte {
  font-size: 11px;
  color: var(--text-muted);
}

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  max-width: 1200px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Animations */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

/* Responsive */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 72px 16px 32px; }
}

/* Icon utilities */
.icon-cyan { background: rgba(34,211,238,0.1); color: var(--accent-cyan); }
.icon-violet { background: rgba(167,139,250,0.1); color: var(--accent-violet); }
.icon-rose { background: rgba(244,114,182,0.1); color: var(--accent-rose); }
.icon-amber { background: rgba(251,191,36,0.1); color: var(--accent-amber); }
.icon-emerald { background: rgba(52,211,153,0.1); color: var(--accent-emerald); }
.icon-blue { background: rgba(99,102,241,0.1); color: var(--accent-blue); }

/* Stagger entrance animations */
@keyframes staggerFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.05s; }
.stagger-2 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.10s; }
.stagger-3 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.15s; }
.stagger-4 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.20s; }
.stagger-5 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.25s; }
.stagger-6 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.30s; }
.stagger-7 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.35s; }
.stagger-8 { animation: staggerFadeUp 0.4s ease both; animation-delay: 0.40s; }

/* Skeleton loading placeholders */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, rgba(99,102,241,0.06) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  min-height: 20px;
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 6px;
}

.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.h-8 { height: 8px; }
.skeleton-line.h-32 { height: 32px; }
.skeleton-line.h-48 { height: 48px; }

.skeleton-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

/* Consulting insight card */
.insight-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.03), rgba(124,58,237,0.02));
  border-left: 3px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.insight-card:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(124,58,237,0.04));
}

.insight-card .insight-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.insight-card .insight-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.insight-card .insight-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}

.insight-card .insight-trend.up { color: var(--accent-emerald); }
.insight-card .insight-trend.down { color: #dc2626; }
.insight-card .insight-trend.neutral { color: var(--text-muted); }

/* Empty state (guided) */
.empty-state-guided {
  text-align: center;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(99,102,241,0.015);
}

.empty-state-guided .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-state-guided .empty-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state-guided .empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.empty-state-guided .empty-steps {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
}

.empty-state-guided .empty-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.empty-state-guided .empty-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

/* Health ring indicator */
.health-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}

.health-ring:hover {
  transform: scale(1.05);
}

.health-ring .ring-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  z-index: 1;
}

.health-ring .ring-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  font-weight: 500;
}

/* Badge variants */
.badge-success { background: rgba(5,150,105,0.1); color: var(--accent-emerald); }
.badge-warning { background: rgba(217,119,6,0.1); color: var(--accent-amber); }
.badge-info { background: rgba(14,165,233,0.1); color: var(--accent-cyan); }
.badge-danger { background: rgba(239,68,68,0.1); color: #dc2626; }

/* Page purpose subtitle */
.page-purpose {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* Explainer text (before generate actions) */
.generation-explainer {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(99,102,241,0.03);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(99,102,241,0.2);
  margin-top: 8px;
  line-height: 1.5;
}
