/* ============================================================
   Y'IA Design System — V2 Premium
   Design tokens, palette, typographie, composants globaux
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  /* Charte B+C — confiance claire (bleu profond, blanc, bulle orange), voix humaine (italique) */
  --yia-nuit: #0E1B2C;
  --yia-bulle: #FF7A2F;

  --yia-primary: #1F4FD1;
  --yia-primary-light: #4A73E0;
  --yia-primary-dark: #163A9C;
  --yia-primary-hover: #1A44B8;
  --yia-primary-50: #EAF0FD;
  --yia-primary-100: #D5E1FB;
  --yia-primary-200: #AFC4F5;

  --yia-accent: #FF7A2F;         /* Orange bulle */
  --yia-accent-light: #FF9A5C;
  --yia-accent-50: #FFF0E5;

  --yia-coral: #E5484D;
  --yia-coral-light: #FCE8EB;
  --yia-tangerine: #FF7A2F;
  --yia-tangerine-light: #FFF0E5;
  --yia-lime: #0B7A5E;

  --yia-success: #0B7A5E;        /* Émeraude */
  --yia-success-light: #E1F3EC;
  --yia-warning: #B4530A;        /* Ambre */
  --yia-warning-light: #FFF0E5;
  --yia-danger: #C8344A;
  --yia-danger-light: #FCE8EB;
  --yia-info: #1F4FD1;
  --yia-info-light: #EAF0FD;

  /* Couleur de chaque offre */
  --offre-besoin: #1F4FD1;
  --bg-subtle: #F1F3F7;
  --offre-quelquun: #0B7A5E;
  --offre-solution: #B4530A;
  --offre-formation: #6A3FA0;

  /* Neutres — ardoise froide */
  --yia-gray-950: #08111D;
  --yia-gray-900: #0E1B2C;
  --yia-gray-800: #1B2A40;
  --yia-gray-700: #2A3750;
  --yia-gray-600: #3B4A64;
  --yia-gray-500: #52607A;
  --yia-gray-400: #8A96AB;
  --yia-gray-300: #C3CCDA;
  --yia-gray-200: #E1E7F0;
  --yia-gray-100: #F0F3F8;
  --yia-gray-50: #F8FAFD;
  --yia-white: #FFFFFF;

  /* Semantic */
  --bg-primary: #F8FAFD;
  --bg-surface: var(--yia-white);
  --bg-elevated: var(--yia-white);
  --border-default: #E1E7F0;
  --border-strong: var(--yia-gray-300);
  --text-primary: #0E1B2C;
  --text-secondary: #33415A;
  --text-muted: #6B7890;
  --text-inverse: var(--yia-white);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Manrope', 'Inter', sans-serif;
  --font-voice: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

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

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

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(14, 27, 44, 0.05);
  --shadow-sm: 0 1px 4px rgba(14, 27, 44, 0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(14, 27, 44, 0.1), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 24px rgba(14, 27, 44, 0.12), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 40px rgba(14, 27, 44, 0.14), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-2xl: 0 25px 60px rgba(14, 27, 44, 0.2);
  --shadow-glow: 0 0 0 3px rgba(14, 27, 44, 0.2);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Sidebar */
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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


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

img { max-width: 100%; display: block; }

/* --- Typography Scale --- */
.text-xs { font-size: 11px; line-height: 1.5; }
.text-sm { font-size: 13px; line-height: 1.5; }
.text-base { font-size: 15px; line-height: 1.6; }
.text-md { font-size: 16px; line-height: 1.6; }
.text-lg { font-size: 18px; line-height: 1.5; }
.text-xl { font-size: 20px; line-height: 1.4; }
.text-2xl { font-size: 24px; line-height: 1.3; }
.text-3xl { font-size: 30px; line-height: 1.25; }
.text-4xl { font-size: 36px; line-height: 1.2; }
.text-5xl { font-size: 48px; line-height: 1.15; }
.text-6xl { font-size: 60px; line-height: 1.1; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--yia-primary); }
.text-accent { color: var(--yia-accent); }
.text-success { color: var(--yia-success); }
.text-warning { color: var(--yia-warning); }
.text-danger { color: var(--yia-danger); }
.text-white { color: var(--yia-white); }

/* --- Layout --- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--space-6); }
.container-sm { max-width: 860px; margin: 0 auto; padding: 0 var(--space-6); }
.container-lg { max-width: 1440px; margin: 0 auto; padding: 0 var(--space-6); }

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

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

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-elevated { box-shadow: var(--shadow-lg); }
.card-interactive { cursor: pointer; }
.card-interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.card-body { }
.card-footer { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-default); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 10px 20px; border-radius: var(--radius-full); font-family: var(--font-primary);
  font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
  border: none; transition: all var(--transition-fast); white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--yia-primary);
  color: var(--yia-white);
}
.btn-primary:hover { background: var(--yia-primary-dark); color: var(--yia-white); }

.btn-secondary {
  background: var(--yia-primary-50); color: var(--yia-primary);
  border: 1.5px solid var(--yia-primary-200);
}
.btn-secondary:hover { background: var(--yia-primary-100); color: var(--yia-primary-dark); border-color: var(--yia-primary); }

.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--yia-gray-100); border-color: var(--yia-gray-300); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--yia-gray-100); color: var(--text-primary); }

.btn-danger { background: var(--yia-danger); color: var(--yia-white); }
.btn-danger:hover { background: #A82A3D; color: var(--yia-white); }

.btn-success { background: var(--yia-success); color: var(--yia-white); }
.btn-success:hover { background: #08604A; color: var(--yia-white); }

.btn-accent {
  background: var(--yia-bulle); color: var(--yia-nuit);
}
.btn-accent:hover { background: #F2661A; color: var(--yia-nuit); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-xl { padding: 16px 36px; font-size: 16px; border-radius: var(--radius-xl); }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }
.btn-icon-sm { padding: 7px; border-radius: var(--radius-sm); }

/* --- Badges / Status --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.4;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-primary { background: var(--yia-primary-100); color: var(--yia-primary-dark); }
.badge-primary .badge-dot { background: var(--yia-primary); }
.badge-success { background: var(--yia-success-light); color: #065F46; }
.badge-success .badge-dot { background: var(--yia-success); }
.badge-warning { background: var(--yia-warning-light); color: #92400E; }
.badge-warning .badge-dot { background: var(--yia-warning); }
.badge-danger { background: var(--yia-danger-light); color: #991B1B; }
.badge-danger .badge-dot { background: var(--yia-danger); }
.badge-info { background: var(--yia-info-light); color: #1E40AF; }
.badge-info .badge-dot { background: var(--yia-info); }
.badge-gray { background: var(--yia-gray-100); color: var(--yia-gray-600); }
.badge-gray .badge-dot { background: var(--yia-gray-400); }
.badge-accent { background: var(--yia-accent-50); color: #164E63; }
.badge-accent .badge-dot { background: var(--yia-accent); }
.badge-purple { background: #F3E8FF; color: #6B21A8; }
.badge-purple .badge-dot { background: #9333EA; }
.badge-muted { background: var(--yia-gray-100); color: var(--text-muted); }
.badge-muted .badge-dot { background: var(--text-muted); }
.badge-default { background: var(--yia-gray-100); color: var(--text-secondary); }
.badge-default .badge-dot { background: var(--yia-gray-400); }

/* --- Inputs & Forms --- */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--yia-danger); }

.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border-default); background: var(--bg-surface);
  font-family: var(--font-primary); font-size: 14px; color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none; line-height: 1.5;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--yia-primary); box-shadow: var(--shadow-glow);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 100px; }
.select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6B8A' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* --- Divider --- */
.divider { height: 1px; background: var(--border-default); margin: var(--space-6) 0; }
.divider-vertical { width: 1px; background: var(--border-default); margin: 0 var(--space-4); align-self: stretch; }

/* --- Progress --- */
.progress-bar {
  height: 6px; background: var(--yia-gray-200); border-radius: var(--radius-full); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: var(--radius-full); transition: width var(--transition-slow);
  background: var(--yia-primary);
}

/* --- Avatar --- */
.avatar {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--yia-primary-200) 0%, var(--yia-primary) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--yia-white); flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 60px; height: 60px; font-size: 20px; }

/* --- Tabs --- */
.tabs { display: flex; border-bottom: 2px solid var(--border-default); gap: 0; margin-bottom: var(--space-6); }
.tab-item {
  padding: 12px 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition-fast); white-space: nowrap;
}
.tab-item:hover { color: var(--yia-primary); }
.tab-item.active { color: var(--yia-primary); border-bottom-color: var(--yia-primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- Admin tab content --- */
.admin-tab-content { animation: fadeIn 0.2s ease; }
.admin-tab-content.active { display: block; }
.prompt-row { cursor: default; }
.prompt-row:hover { background: var(--yia-gray-50); }

/* --- Param row (config display) --- */
.param-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border-default);
}
.param-row:last-child { border-bottom: none; }

/* --- KPI Cards --- */
.kpi-card {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--yia-primary);
  opacity: 0; transition: opacity 0.2s;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.kpi-label-tooltip {
  font-size: 11px; color: var(--text-muted); font-weight: 400; font-style: italic;
  margin-top: 2px; line-height: 1.4; text-transform: none; letter-spacing: 0;
}
.kpi-value { font-size: 32px; font-weight: 800; color: var(--text-primary); line-height: 1.1; margin: var(--space-2) 0; }
.kpi-delta { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi-delta-up { color: var(--yia-success); }
.kpi-delta-down { color: var(--yia-danger); }
.kpi-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: var(--space-3);
}

/* --- Table --- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-default); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  background: var(--yia-gray-50); padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em; border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border-default); color: var(--text-primary); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--yia-gray-50); }
.table tbody tr.selected { background: var(--yia-primary-50); }

/* --- Sidebar Layout --- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--yia-nuit);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.main-content,
.main-area {
  margin-left: var(--sidebar-width); flex: 1; min-width: 0; min-height: 100vh;
  display: flex; flex-direction: column;
}
.topbar {
  height: var(--topbar-height); background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-8); position: sticky; top: 0; z-index: 50;
  box-shadow: none;
}
.page-content,
.content,
.content-wide { flex: 1; padding: var(--space-8); width: 100%; }
/* .content-wide: pas de contrainte de largeur max — pleine largeur dispo */
.content-wide { max-width: none; }

/* --- Sidebar Components --- */
.sidebar-logo {
  padding: var(--space-5) var(--space-5); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand { color: var(--yia-white); }
.sidebar-tagline { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; letter-spacing: 0.05em; line-height: 1.5; }
.sidebar-accelerateur {
  font-size: 10px; font-weight: 700; color: var(--yia-accent);
  margin-top: 6px; letter-spacing: 0.06em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-3); }
.sidebar-section { margin-bottom: var(--space-5); }
.sidebar-section-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.35);
  text-transform: uppercase; letter-spacing: 0.12em; padding: 0 var(--space-3); margin-bottom: var(--space-2);
}
.sidebar-item {
  display: flex; align-items: center; gap: var(--space-3); padding: 9px 12px;
  border-radius: var(--radius-md); color: #C9D3E3; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast); text-decoration: none; margin-bottom: 1px;
}
.sidebar-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.sidebar-item.active {
  background: var(--yia-primary); color: var(--yia-white); font-weight: 600;
}
.sidebar-item.active .sidebar-icon { color: var(--yia-white); }
.sidebar-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sidebar-item.active .sidebar-icon { opacity: 1; }
.sidebar-badge {
  margin-left: auto; background: var(--yia-bulle); color: var(--yia-nuit);
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-full);
  }

.sidebar-footer { padding: var(--space-4) var(--space-3); border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-user { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); }
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--yia-white); }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); }

/* --- Page Header --- */
.page-header { margin-bottom: var(--space-8); }
.page-title { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: var(--space-1); line-height: 1.5; }
.page-actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }

/* --- Toast / Notifications --- */
.toast-container { position: fixed; bottom: 90px; right: 24px; z-index: 9000; display: flex; flex-direction: column; gap: var(--space-3); }
.toast {
  min-width: 320px; max-width: 400px; padding: 14px 18px; border-radius: var(--radius-lg);
  background: var(--bg-surface); border: 1px solid var(--border-default); box-shadow: var(--shadow-xl);
  display: flex; align-items: flex-start; gap: var(--space-3); animation: toastIn 0.3s ease;
}
.toast-success { border-left: 4px solid var(--yia-success); }
.toast-warning { border-left: 4px solid var(--yia-warning); }
.toast-error { border-left: 4px solid var(--yia-danger); }
.toast-info { border-left: 4px solid var(--yia-info); }
.toast-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { margin-left: auto; cursor: pointer; color: var(--text-muted); flex-shrink: 0; }

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

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 5000;
  display: flex; align-items: center; justify-content: center; padding: var(--space-6);
  backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity var(--transition-base);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-surface); border-radius: var(--radius-2xl); box-shadow: var(--shadow-2xl);
  max-width: 520px; width: 100%; transform: translateY(20px); transition: transform var(--transition-base);
  border: 1px solid var(--border-default);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: var(--space-6); border-bottom: 1px solid var(--border-default); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.modal-body { padding: var(--space-6); }
.modal-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-default); display: flex; gap: var(--space-3); justify-content: flex-end; }
.modal-close { cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); transition: all var(--transition-fast); }
.modal-close:hover { color: var(--text-primary); background: var(--yia-gray-100); }

/* --- Y'IA Quelqu'un Floating Button --- MORE VISIBLE & IMPACTFUL */
.yia-quelquun-btn {
  position: fixed; bottom: 28px; right: 28px; z-index: 4000;
  background: var(--offre-quelquun);
  color: var(--yia-white); border: none; border-radius: var(--radius-2xl);
  padding: 15px 24px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(11,122,94,0.35);
  display: flex; align-items: center; gap: 10px; font-family: var(--font-primary);
  font-size: 14px; font-weight: 700; transition: all var(--transition-base); text-decoration: none;
  border: 2px solid rgba(255,255,255,0.25);
}
.yia-quelquun-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(11,122,94,0.45);
  color: var(--yia-white);
}
.yia-quelquun-pulse {
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.9);
  position: relative; flex-shrink: 0;
}
.yia-quelquun-pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: rgba(255,255,255,0.35); animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.8); opacity: 0; } }

/* --- Demo Bar --- */
.demo-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 3000;
  background: rgba(18, 14, 38, 0.97); backdrop-filter: blur(16px);
  border-top: 1px solid rgba(31, 79, 209, 0.35); padding: 12px 24px;
  display: flex; align-items: center; gap: 16px;
}
.demo-bar-label { font-size: 11px; font-weight: 700; color: var(--yia-accent); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.demo-steps { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; }
.demo-step {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.45); cursor: pointer;
  transition: all var(--transition-fast); white-space: nowrap; text-decoration: none;
}
.demo-step:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); }
.demo-step.active { background: rgba(79,70,229,0.3); color: var(--yia-primary-light); font-weight: 700; }
.demo-step.done { color: rgba(16,185,129,0.7); }
.demo-step-num {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.demo-step.active .demo-step-num { background: var(--yia-primary); color: white; }
.demo-step.done .demo-step-num { background: rgba(16,185,129,0.3); }
.demo-controls { display: flex; gap: 8px; }

/* --- Persona Switch --- */
.persona-switch {
  display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--yia-gray-50);
  border: 1px solid var(--border-default); border-radius: var(--radius-full);
}
.persona-btn {
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; border: none;
  background: transparent; color: var(--text-secondary);
}
.persona-btn.active { background: var(--yia-primary); color: var(--yia-white); box-shadow: 0 2px 8px rgba(79,70,229,0.3); }
.persona-btn:hover:not(.active) { background: var(--yia-gray-200); }

/* --- Search --- */
.search-wrap { position: relative; }
.search-input { padding-left: 38px !important; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* --- Chips / Filters --- */
.filter-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1.5px solid var(--border-default); background: var(--bg-surface);
  color: var(--text-secondary); transition: all var(--transition-fast);
}
.chip:hover { border-color: var(--yia-primary); color: var(--yia-primary); }
.chip.active { background: var(--yia-primary); border-color: var(--yia-primary); color: var(--yia-white); }

/* --- Empty State --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-16) var(--space-8); text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.5; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.empty-text { font-size: 14px; color: var(--text-secondary); max-width: 360px; line-height: 1.6; margin-bottom: var(--space-6); }

/* --- Gradient Backgrounds --- */
.gradient-hero {
  background: linear-gradient(135deg, #0E1B2C 0%, #13243B 40%, #13243B 100%);
}
.gradient-card {
  background: linear-gradient(135deg, var(--yia-primary-50) 0%, var(--yia-accent-50) 100%);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--yia-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--yia-gray-400); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-fade { animation: fadeIn 0.4s ease; }
.animate-slide-up { animation: slideUp 0.4s ease; }
.animate-spin { animation: spin 1s linear infinite; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--transition-base); }
  .sidebar.open { transform: translateX(0); }
  .main-content,
  .main-area { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .page-content,
  .content,
  .content-wide { padding: var(--space-5); }
  .demo-steps { display: none; }
  .topbar { padding: 0 var(--space-4); }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .yia-quelquun-btn span { display: none; }
  .yia-quelquun-btn { padding: 14px; border-radius: 50%; }
}

/* --- Misc utilities --- */
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.rounded { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }
.border { border: 1px solid var(--border-default); }
.bg-white { background: var(--bg-surface); }
.bg-primary-50 { background: var(--yia-primary-50); }
.text-center { text-align: center; }
.cursor-pointer { cursor: pointer; }
.no-select { user-select: none; }

/* --- Toast animation keyframes --- */
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; display: inline-block; }

/* ============================================================
   Charte B+C — titres, voix humaine, logo, offres
   ============================================================ */
h1, h2, h3, h4, .card-title, .modal-title { font-family: var(--font-display); letter-spacing: -0.01em; }
h1, h2 { letter-spacing: -0.02em; }
/* La voix humaine : mots clés des titres et noms d'offres */
.voix, em.voix { font-family: var(--font-voice); font-style: italic; font-weight: 400; color: var(--yia-primary); letter-spacing: 0; }
.voix-besoin { color: var(--offre-besoin); }
.voix-quelquun { color: var(--offre-quelquun); }
.voix-solution { color: var(--offre-solution); }
.voix-formation { color: var(--offre-formation); }

/* Logo : Y + bulle-apostrophe + IA */
.yia-logo { display: inline-flex; align-items: flex-start; font-family: var(--font-display); font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: inherit; }
.yia-logo svg { flex-shrink: 0; }
.yia-logo-sm { font-size: 30px; }
.yia-logo-md { font-size: 44px; }
.yia-logo-lg { font-size: 72px; }

.offre-card { border: 1px solid var(--border-default); border-top: 4px solid var(--offre, var(--yia-primary)); border-radius: var(--radius-lg); background: var(--bg-surface); padding: var(--space-5); }
.offre-besoin { --offre: var(--offre-besoin); }
.offre-quelquun { --offre: var(--offre-quelquun); }
.offre-solution { --offre: var(--offre-solution); }
.offre-formation { --offre: var(--offre-formation); }

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

/* ============================================================
   Accueil
   ============================================================ */
.acc { max-width: 1080px; padding-bottom: 72px; }
.acc-hero { padding: var(--space-6, 24px) 0 var(--space-8, 32px); border-bottom: 1px solid var(--border-default); margin-bottom: 32px; }
.acc-surtitre { font-size: 15px; color: var(--text-secondary); margin: 0 0 8px; }
.acc-question { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 800; color: var(--text-primary); margin: 0 0 14px; max-width: 760px; }
.acc-question .voix { font-size: 1.08em; }
.acc-intro { font-size: 16px; line-height: 1.6; color: var(--text-secondary); max-width: 600px; margin: 0 0 24px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.acc-section { margin-bottom: 36px; }
.acc-section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.acc-h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 14px; }
.acc-lien { font-size: 14px; font-weight: 600; color: var(--yia-primary); text-decoration: none; }
.acc-compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.acc-compteur { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); text-decoration: none; color: inherit; transition: border-color .15s; }
.acc-compteur:hover { border-color: var(--yia-primary); }
.acc-compteur.actif { border-left: 4px solid #FF7A2F; }
.acc-valeur { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.acc-compteur:not(.actif) .acc-valeur { color: var(--text-muted); }
.acc-libelle { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 6px; }
.acc-aide { font-size: 12px; color: var(--text-muted); }
.acc-besoins { display: flex; flex-direction: column; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); overflow: hidden; }
.acc-besoin { display: block; padding: 16px 20px; text-decoration: none; color: inherit; border-top: 1px solid var(--border-default); }
.acc-besoin:first-child { border-top: 0; }
.acc-besoin:hover { background: var(--yia-primary-50, #F3F6FE); }
.acc-besoin-tete { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.acc-ref { font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.acc-titre { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.acc-alerte { font-size: 11px; font-weight: 700; color: #B4530A; background: #FFF1E8; border-radius: 999px; padding: 2px 8px; }
.acc-etapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; list-style: none; padding: 0; margin: 0; }
.acc-etapes li { font-size: 11px; font-weight: 600; color: var(--text-muted); padding-top: 8px; border-top: 3px solid var(--border-default); }
.acc-etapes li.fait { border-top-color: var(--yia-primary); color: var(--text-secondary); }
.acc-etapes li.courant { border-top-color: #FF7A2F; color: var(--text-primary); }
.acc-detail { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.acc-vide { padding: 24px; border: 1px dashed var(--border-default); border-radius: var(--radius-lg); color: var(--text-secondary); font-size: 14px; }
.acc-vide a { color: var(--yia-primary); font-weight: 600; }
.acc-offres { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.acc-offre { display: flex; flex-direction: column; text-align: left; text-decoration: none; color: inherit; font: inherit; cursor: pointer; transition: box-shadow .15s; }
.acc-offre:hover { box-shadow: var(--shadow-md); }
.acc-offre.bientot { cursor: default; opacity: .75; }
.acc-offre.bientot:hover { box-shadow: none; }
.acc-offre-nom { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--text-primary); }
.acc-offre-nom .voix { font-size: 1.12em; }
.acc-offre-texte { font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 8px 0 14px; flex: 1; }
.acc-offre-action { font-size: 13px; font-weight: 700; color: var(--offre); }
@media (max-width: 640px) {
  .acc-etapes li { font-size: 0; padding-top: 6px; }
  .acc-etapes li.courant { font-size: 11px; }
}

/* ============================================================
   Exprimer un besoin : choix du mode
   ============================================================ */
.cm { max-width: 1040px; margin: 0 auto; padding-bottom: 72px; }
.cm-tete { margin: 8px 0 32px; }
.cm-titre { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--text-primary); margin: 0 0 12px; }
.cm-titre .voix { font-size: 1.08em; }
.cm-intro { font-size: 16px; line-height: 1.6; color: var(--text-secondary); max-width: 680px; margin: 0; }
.cm-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 36px; }
.cm-mode { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px 22px 20px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.cm-mode:hover { border-color: var(--offre-besoin); box-shadow: var(--shadow-md); }
.cm-mode.recommande { border: 2px solid var(--offre-besoin); padding: 23px 21px 19px; }
.cm-badge { position: absolute; top: -11px; left: 20px; background: #FF7A2F; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cm-icone { color: var(--offre-besoin); margin-bottom: 4px; }
.cm-mode-titre { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text-primary); }
.cm-mode-texte { font-size: 13px; line-height: 1.55; color: var(--text-secondary); flex: 1; }
.cm-mode-action { font-size: 13px; font-weight: 700; color: var(--offre-besoin); margin-top: 6px; }
.cm-mode-action::after { content: ' →'; }
.cm-suite { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 24px 0 0; margin: 0; border-top: 1px solid var(--border-default); }
.cm-suite li { counter-increment: s; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.cm-suite li::before { content: counter(s); display: block; font-family: var(--font-voice); font-style: italic; font-size: 30px; line-height: 1; color: #FF7A2F; margin-bottom: 6px; }
.cm-suite strong { color: var(--text-primary); }

/* ============================================================
   Cockpit Studio
   ============================================================ */
.ck2 { max-width: 1180px; padding-bottom: 72px; }
.ck2-tete { margin: 8px 0 28px; }
.ck2-titre { font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; color: var(--text-primary); margin: 0 0 8px; }
.ck2-titre .voix { font-size: 1.08em; }
.ck2-sous { font-size: 15px; color: var(--text-secondary); margin: 0; }
.ck2-section { margin-bottom: 32px; min-width: 0; }
.ck2-chaine { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); overflow: hidden; }
.ck2-chaine li { border-left: 1px solid var(--border-default); position: relative; }
.ck2-chaine li:first-child { border-left: 0; }
.ck2-chaine a { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; text-decoration: none; color: inherit; border-top: 4px solid var(--border-default); height: 100%; }
.ck2-chaine li.actif a { border-top-color: var(--offre-besoin); }
.ck2-chaine li.alerte a { border-top-color: #FF7A2F; }
.ck2-chaine a:hover { background: var(--yia-primary-50); }
.ck2-chaine li:not(.actif) .acc-valeur { color: var(--text-muted); }
.ck2-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }
@media (max-width: 1000px) { .ck2-cols { grid-template-columns: 1fr; } }
.ck2-liste { border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); overflow: hidden; }
.ck2-ligne { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border-default); text-decoration: none; color: inherit; }
.ck2-ligne:first-child { border-top: 0; }
.ck2-ligne:hover { background: var(--yia-primary-50); }
.ck2-rang { font-family: var(--font-voice); font-style: italic; font-size: 24px; color: #FF7A2F; width: 28px; text-align: center; flex-shrink: 0; }
.ck2-ligne-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ck2-ligne-titre { font-size: 14px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck2-ligne-meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck2-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--yia-gray-100, #F1F3F7); color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }
.ck2-tag.lourd { background: #EEF2FC; color: var(--offre-besoin); }
.ck2-tag.prio { background: #FFF1E8; color: #B4530A; }
.ck2-score { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text-primary); flex-shrink: 0; }
.ck2-cta { font-size: 12px; font-weight: 700; color: var(--offre-besoin); flex-shrink: 0; }
.ck2-vide { padding: 20px; font-size: 13px; color: var(--text-muted); }
.ck2-note { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.ck2-outils { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ck2-outil { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); text-decoration: none; color: inherit; }
.ck2-outil:hover { border-color: var(--offre-besoin); }
.ck2-outil-titre { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.ck2-outil-texte { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Étapes de l'expression d'un besoin (affinage) */
.af-etapes { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 0; margin: 0 0 20px; }
.af-etapes li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.af-etapes li span { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; border: 1.5px solid var(--border-default); }
.af-etapes li.fait { color: var(--text-secondary); }
.af-etapes li.fait span { background: var(--offre-besoin); border-color: var(--offre-besoin); color: #fff; }
.af-etapes li.courant { color: var(--text-primary); }
.af-etapes li.courant span { background: #FF7A2F; border-color: #FF7A2F; color: #fff; }
.af-etapes .voix { font-size: 1.15em; }
