/* ═══════════════════════════════════════════════════════════════
   INTELIO — Design System v2 "Private Banking Digital"
   ═══════════════════════════════════════════════════════════════ */

/* ─── 0. RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* ─── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Palette */
  --navy-deep:  #0F1B33;
  --navy-mid:   #162240;
  --navy-line:  #1E2E4A;
  --paper:      #F1EEE7;
  --paper-dim:  #EAE6DE;
  --surface:    #fff;
  --ink:        #1C2333;
  --accent:     #8B6F3E;
  --accent-lo:  #8B6F3E18;
  --accent-mid: #6B5230;
  --accent-deep: #6B5530;
  --slate:      #5B6478;
  --slate-lo:   #5B647820;
  --line:       #E2DED4;
  --line-dark:  #D4CFC5;

  /* Sémantique */
  --success:    #2D6A4F;
  --success-lo: rgba(45,106,79,.12);
  --error:      #C0392B;
  --error-lo:   rgba(192,57,43,.1);
  --warn:       #9B6A00;
  --warn-lo:    rgba(155,106,0,.1);

  /* Couleurs catégorielles ponctuelles (simulateurs — répartition revenus/succession) */
  --cat-alert:   #D0736E;
  --cat-neutral: #B8A99A;

  /* Survol des onglets segmentés inactifs (sur fond --paper-dim) */
  --hover-overlay: rgba(255,255,255,.6);

  /* Palette Chart.js — segments donut/bar, du plus clair au plus foncé */
  --chart-1: #E3DAC9;
  --chart-2: #D4C5A9;
  --chart-3: #C6B189;
  --chart-4: #B89C68;
  --chart-5: #A7874B;
  --chart-6: #886D3B;
  --chart-7: #68532C;
  --chart-8: #48391E;

  /* Typographie */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* Espacements */
  --sidebar-w:    220px;
  --topbar-h:     56px;
  --gutter:       24px;
  --radius:       6px;
  --radius-sm:    4px;
  --radius-lg:    10px;

  /* Ombres */
  --shadow-sm:    0 1px 3px rgba(15,27,51,.06);
  --shadow-md:    0 2px 8px rgba(15,27,51,.10);

  /* Transitions */
  --t-fast:  0.12s ease;
  --t-base:  0.18s ease;
}

/* ─── Mode sombre — mêmes tokens, valeurs recalculées ──────────
   Le navy (--navy-deep/mid/line) n'est PAS redéfini ici : il n'est utilisé
   que comme fond de blocs déjà sombres (sidebar, bulles de chat, avatars,
   slides) avec du texte clair dessus — il reste lisible tel quel dans les
   deux thèmes et changer sa valeur casserait la sidebar sans bénéfice. */
:root[data-theme="dark"] {
  --paper:      #1A1A1A;
  --paper-dim:  #242424;
  --surface:    #242424;
  --ink:        #ECEAE4;
  --accent:     #C9A668;
  --accent-lo:  #C9A66825;
  --accent-mid: #D9B67A;
  --accent-deep: #D9B67A;
  --slate:      #A39B8E;
  --slate-lo:   #A39B8E25;
  --line:       #3A3A3A;
  --line-dark:  #4A4A4A;

  --success:    #4FAE7C;
  --success-lo: rgba(79,174,124,.16);
  --error:      #E07362;
  --error-lo:   rgba(224,115,98,.16);
  --warn:       #D9A94A;
  --warn-lo:    rgba(217,169,74,.16);

  --cat-alert:   #E0897F;
  --cat-neutral: #9C9184;

  --hover-overlay: rgba(255,255,255,.08);

  /* Substitut du navy pour les blocs "déjà sombres par design" (hero bars, bulles, badges,
     FAB...) — le navy saturé jure à côté de l'anthracite neutre du mode sombre. Sidebar,
     login et l'aperçu de slide (document client, hors thème app) ne l'utilisent pas. */
  --deep-dark: #141414;

  --chart-1: #4A3F2C;
  --chart-2: #5C4C34;
  --chart-3: #74603F;
  --chart-4: #8C744B;
  --chart-5: #A68957;
  --chart-6: #C0A16A;
  --chart-7: #D3B87F;
  --chart-8: #E6D2A3;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 2px 10px rgba(0,0,0,.5);
}

/* ─── Interrupteur mode sombre (Réglages) ───────────────────── */
.theme-switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; flex-shrink: 0; }
.theme-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.theme-switch-track {
  position: absolute;
  inset: 0;
  background: var(--line-dark);
  border-radius: 999px;
  transition: background var(--t-base);
}
.theme-switch-track::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform var(--t-base);
  box-shadow: var(--shadow-sm);
}
.theme-switch input:checked ~ .theme-switch-track { background: var(--accent); }
.theme-switch input:checked ~ .theme-switch-track::before { transform: translateX(18px); }
.theme-switch input:focus-visible ~ .theme-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Intégrations (Réglages) ───────────────────────────────── */
.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.integration-row:last-child { border-bottom: none; }
.integration-row-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.integration-row--disabled { opacity: .55; }
/* Bouton "Se connecter à Google" — seule exception admise à la palette bronze unique : c'est un
   logo/bouton de marque tierce (Google), pas un élément décoratif d'Intelio. */
.btn-google-connect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #3c4043;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: box-shadow var(--t-fast), background var(--t-fast);
  flex-shrink: 0;
}
.btn-google-connect:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ─── 2. TYPOGRAPHIE DE BASE ────────────────────────────────── */
html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  height: 100vh;
  overflow: hidden;
}

/* Échelle typographique */
.t-display   { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.t-heading   { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.t-subhead   { font-family: var(--font-body);    font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--slate); }
.t-body      { font-family: var(--font-body);    font-size: 14px; line-height: 1.6; color: var(--ink); }
.t-small     { font-family: var(--font-body);    font-size: 12px; color: var(--slate); }
.t-micro     { font-family: var(--font-body);    font-size: 11px; letter-spacing: .03em; color: var(--slate); }
.t-mono      { font-family: var(--font-mono);    font-size: 13px; color: var(--ink); }
.t-mono-sm   { font-family: var(--font-mono);    font-size: 12px; color: var(--slate); }

/* ─── 3. SCROLLBARS ─────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--line-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate); }

/* ─── 4. LAYOUT — APP SHELL ─────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── 5. SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--navy-deep);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  transition: width var(--t-base), min-width var(--t-base);
}

/* Logo + bouton réduire/développer */
.sidebar-top-row {
  display: flex;
  align-items: center;
  padding: 20px 10px 16px;
  border-bottom: 1px solid var(--navy-line);
}
/* Spacer de même largeur que le bouton (26px) : le logo, en flex:1 entre les deux, se centre alors
   par rapport à la largeur réelle du sidebar plutôt que par rapport à l'espace restant après le
   bouton (ce qui le décalait visuellement vers la gauche). */
.sidebar-top-spacer { width: 26px; flex-shrink: 0; }
.sidebar-logo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: opacity var(--t-fast);
}
.sidebar-collapse-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.45);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-collapse-btn .ti { font-size: 15px; }
.sidebar-collapse-btn:hover { background: var(--navy-mid); color: #fff; }
[data-theme="dark"] .sidebar-collapse-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark .ti { font-size: 16px; color: #fff; }

.logo-wordmark {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .02em;
}
.logo-wordmark span {
  font-size: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  color: rgba(255,255,255,.4);
  margin-left: 6px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Groupes de nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-group { margin-bottom: 4px; }

.nav-group-label {
  font-size: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 14px 18px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-fast);
}

/* Bouton nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 18px;
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 13.5px;
  font-weight: 400;
  text-align: left;
  transition: all var(--t-fast);
  border-radius: 0;
  position: relative;
}
.nav-item .ti { font-size: 16px; flex-shrink: 0; }
.nav-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--t-fast); }

.nav-item:hover {
  background: var(--navy-mid);
  color: rgba(255,255,255,.85);
}

.nav-item.active {
  background: var(--navy-mid);
  color: #fff;
  font-weight: 500;
}
.nav-item.active .ti { color: var(--accent); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* Badge nav */
.nav-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  line-height: 1.4;
}

/* ─── Sidebar rétractable ────────────────────────────────────────
   Le rétrécissement de largeur (transition ci-dessus sur .sidebar) est déjà l'essentiel de
   l'animation ; le texte n'est pas basculé en display:none mais en opacity, pour qu'il s'estompe
   pendant la transition plutôt que de disparaître d'un coup — sobre, sans rebond. Les icônes
   restent toujours visibles et cliquables (jamais un sidebar totalement invisible). */
.app-layout.sidebar-collapsed .sidebar { width: 64px; min-width: 64px; }
.app-layout.sidebar-collapsed .sidebar-top-spacer { display: none; }
.app-layout.sidebar-collapsed .sidebar-logo { flex: 0; width: 0; gap: 0; opacity: 0; pointer-events: none; }
.app-layout.sidebar-collapsed .sidebar-top-row { justify-content: center; padding: 20px 0 16px; }
/* Le libellé passe à largeur 0 (pas seulement opacity:0) : sinon, resté en flex:1, il continue de
   pousser l'icône vers la gauche et laisse un espace visuellement plus large à droite qu'à gauche —
   c'est très exactement le défaut de symétrie signalé. */
.app-layout.sidebar-collapsed .nav-group-label,
.app-layout.sidebar-collapsed .nav-badge {
  opacity: 0;
  pointer-events: none;
}
.app-layout.sidebar-collapsed .nav-item span {
  flex: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
}
.app-layout.sidebar-collapsed .nav-item { justify-content: center; padding: 9px 0; gap: 0; }
.app-layout.sidebar-collapsed .nav-item.active::before { left: 2px; }

/* Séparateur sidebar */
.sidebar-sep {
  height: 1px;
  background: var(--navy-line);
  margin: 6px 0;
}

/* Bottom sidebar (settings, profil) */
.sidebar-bottom {
  border-top: 1px solid var(--navy-line);
  padding: 8px 0 10px;
}

/* Mode sombre — sidebar en anthracite (pas de bleu) + accent bronze au lieu du navy-mid.
   Le navy reste inchangé partout ailleurs (avatars, bulles, login, hero cards) : seule
   la sidebar, qui jurait à côté du nouveau fond neutre, est concernée par ce correctif. */
[data-theme="dark"] .sidebar { background: var(--deep-dark); }
[data-theme="dark"] .sidebar-top-row,
[data-theme="dark"] .sidebar-bottom { border-color: #2A2A2A; }
[data-theme="dark"] .sidebar-sep { background: #2A2A2A; }
[data-theme="dark"] .nav-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: rgba(255,255,255,.85);
}
[data-theme="dark"] .nav-item.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Mode sombre — suite du correctif sidebar : tous les autres blocs "déjà sombres par
   design" (fond navy fixe + contenu clair dessus) recolorés en anthracite pour la même
   raison (bleu saturé qui jure à côté du fond neutre). Les accents bronze à l'intérieur
   (icônes, points, boutons) ne sont pas touchés — ils gardent leur contraste tel quel.
   Explicitement exclus : `.sidebar` (déjà traité ci-dessus, valeur propre), `.login-card`
   (écran de connexion, hors scope de ce correctif), `.slide-navy`/`.slide-thumb` (aperçu
   de la présentation exportée — un document client à charte fixe, pas un écran de l'app),
   `.repartition-fin`/`.legend-dot.fin` (couleur catégorielle "Financier" dans une légende,
   pas un bloc — la recolorer en anthracite la rendrait invisible sur les fonds sombres). */
[data-theme="dark"] .badge-ia-comp,
[data-theme="dark"] .assistant-welcome-icon,
[data-theme="dark"] .assistant-msg-user .assistant-msg-bubble,
[data-theme="dark"] a.assistant-source-badge:hover,
[data-theme="dark"] .assist-msg-user .assist-msg-bubble,
[data-theme="dark"] .dash-hero,
[data-theme="dark"] .assistant-fab,
[data-theme="dark"] .prospects-metrics-bar,
[data-theme="dark"] .prospect-convert-toast {
  background: var(--deep-dark);
}
[data-theme="dark"] .assistant-fab .fab-dot { border-color: var(--deep-dark); }

/* Cas particulier : ce toggle est un état "actif" de segmented control (comme .tab-btn.active
   ailleurs), pas un bloc statique — il suit donc la même règle que le sidebar (bronze plutôt
   qu'anthracite), pour ne pas devenir indiscernable de l'état inactif juste à côté. */
[data-theme="dark"] .agenda-view-btn.active { background: var(--accent); }

/* ─── 6. ZONE DE CONTENU ─────────────────────────────────────── */
.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--paper);
}

/* Topbar optionnelle (contexte de vue) */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  gap: 12px;
  background: var(--paper);
  flex-shrink: 0;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Zone principale scrollable */
.view-wrap {
  flex: 1;
  overflow-y: auto;
  padding: var(--gutter);
}
.view-wrap--no-pad { padding: 0; }

/* Panels de vue */
.panel { display: none; flex-direction: column; height: 100%; }
.panel.active { display: flex; }

/* ─── 7. BOUTONS ─────────────────────────────────────────────── */

/* Primaire — bronze */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn .ti { font-size: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-mid); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-dark);
}
.btn-secondary:hover { background: var(--paper-dim); border-color: var(--line-dark); }

.btn-ghost {
  background: transparent;
  color: var(--slate);
  border: none;
  padding: 7px 12px;
}
.btn-ghost:hover { background: var(--paper-dim); color: var(--ink); }

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(192,57,43,.25);
}
.btn-danger:hover { background: rgba(192,57,43,.06); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

/* Icône seule */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--slate);
  transition: all var(--t-fast);
}
.btn-icon:hover { background: var(--paper-dim); color: var(--ink); }
.btn-icon .ti { font-size: 16px; }

/* ─── 8. INPUTS ─────────────────────────────────────────────── */
.input-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.input-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--slate);
  letter-spacing: .02em;
}
.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,111,62,.12);
}
.input::placeholder { color: rgba(91,100,120,.45); }

.input-search {
  position: relative;
}
.input-search .ti {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  font-size: 15px;
  pointer-events: none;
}
.input-search input { padding-left: 34px; }

textarea.input { resize: vertical; min-height: 80px; line-height: 1.55; }

select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%235B6478' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; cursor: pointer; }

/* ─── 9. CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-deep);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15,27,51,.06), 0 6px 20px rgba(15,27,51,.07);
}
.card-body { padding: 18px 20px; background: var(--surface); }
.card-header {
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  padding-left: 10px;
  border-left: 3px solid var(--accent-deep);
}
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper-dim);
}

/* Card clickable */
.card-interactive { transition: box-shadow var(--t-base), border-color var(--t-base); cursor: pointer; }
.card-interactive:hover { border-color: var(--line-dark); box-shadow: var(--shadow-sm); }

/* ─── 10. MOTIF LIGNE DE REGISTRE ───────────────────────────── */
/* Appliqué aux sections de données denses (profil client, produits) */
.register-list { }
.register-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.register-row:last-child { border-bottom: none; }
.register-row:first-child { border-top: 1px solid var(--line); }
/* Séparateurs teintés bronze dans les onglets client */
#client-tab-content .register-row { border-color: rgba(139,111,62,.15); }
#client-tab-content .register-row:first-child { border-top-color: rgba(139,111,62,.15); }
.register-label {
  flex: 0 1 auto;
  width: 185px;
  min-width: 100px;
  color: var(--slate);
  font-size: 13px;
}
.register-value {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.register-value.accent { color: var(--accent); font-weight: 600; }

/* Section header avec label registre */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

/* ─── 11. BADGES & PILLS ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-accent  { background: var(--accent-lo); color: var(--accent); }
.badge-slate   { background: var(--slate-lo);   color: var(--slate); }
.badge-paper   { background: var(--paper-dim);  color: var(--slate); border: 1px solid var(--line); }
.badge-success { background: var(--success-lo); color: var(--success); }
.badge-warn    { background: rgba(155,106,0,.1); color: var(--warn); }
.badge-error   { background: rgba(192,57,43,.1); color: var(--error); }


/* ─── 12. TABS — segmented control, cohérent avec le sélecteur de période ── */
.tabs {
  display: inline-flex;
  gap: 3px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  width: fit-content;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  transition: all var(--t-fast);
}
.tab-btn:hover { color: var(--ink); background: var(--hover-overlay); }
.tab-btn.active {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.tab-btn.active:hover { background: var(--accent-mid); }

/* ─── Sélecteur de période (Reporting) ──────────────────────── */
.period-select { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period-select-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slate);
  margin-right: 4px;
}
.period-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--slate);
  transition: all var(--t-fast);
}
.period-btn:hover { border-color: var(--accent); color: var(--ink); background: var(--paper-dim); }
.period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.period-btn.active:hover { background: var(--accent-mid); }

.reporting-custom-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
.reporting-custom-range input[type="date"] { padding: 4px 8px; font-size: 12px; width: 132px; }

/* Message "période vide" — ton complice plutôt qu'un tableau vide sec */
.reporting-empty .state-empty-title { margin-top: 10px; }

/* ─── 13. ÉTATS (loading, empty, error) ─────────────────────── */
.state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  color: var(--slate);
  font-size: 13.5px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line-dark);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.state-empty .ti { font-size: 36px; color: var(--line-dark); }
.state-empty-title { font-size: 15px; font-weight: 500; color: var(--slate); }
.state-empty-sub { font-size: 13px; color: var(--slate); opacity: .7; max-width: 280px; }

/* ─── 14. DISCLAIMER LÉGAL ───────────────────────────────────── */
.legal-disclaimer {
  font-size: 11px;
  color: var(--slate);
  opacity: .65;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 20px;
  line-height: 1.5;
}

/* ─── 15. DIVIDER ────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.divider-dark { background: var(--line-dark); }

/* ─── 16. STEPPER (tunnel 3 étapes) ─────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.step-connector {
  flex: 1;
  height: 1px;
  background: var(--line);
  margin: 0 8px;
}
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  background: var(--surface);
  flex-shrink: 0;
  transition: all var(--t-base);
}
.step-circle.active  { border-color: var(--accent); background: var(--accent); color: #fff; }
.step-circle.done    { border-color: var(--accent); background: var(--accent-lo); color: var(--accent); }
.step-label { font-size: 12px; color: var(--slate); white-space: nowrap; }
.step-item.active .step-label { color: var(--ink); font-weight: 600; }

/* ─── 17. WAVEFORM / AUDIO ───────────────────────────────────── */
.waveform-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
}
.waveform-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: wave .8s ease-in-out infinite;
  transform-origin: bottom;
}
.waveform-bar:nth-child(2) { animation-delay: .1s; }
.waveform-bar:nth-child(3) { animation-delay: .2s; }
.waveform-bar:nth-child(4) { animation-delay: .3s; }
.waveform-bar:nth-child(5) { animation-delay: .15s; }
.waveform-bar:nth-child(6) { animation-delay: .25s; }
.waveform-bar:nth-child(7) { animation-delay: .05s; }
@keyframes wave {
  0%, 100% { height: 6px; opacity: .5; }
  50%       { height: 28px; opacity: 1; }
}

/* ─── 18. BLOCS STRUCTURÉS FEATURE 6 ────────────────────────── */
/* Bordure pointillée sous texte éditable = signal d'édition discret */
.editable-block {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 60px;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.editable-block[contenteditable="true"] {
  border-style: dashed;
  border-color: var(--line-dark);
}
.editable-block[contenteditable="true"]:focus {
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 3px var(--accent-lo);
}

.synth-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.synth-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--paper-dim);
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.synth-block-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.synth-block-body {
  padding: 14px 16px;
}

/* ─── 19. SLIDE PREVIEW (feature 3 — présentation) ──────────── */
/* Les slides elles-mêmes utilisent navy plein + gros chiffres */
.slide-navy {
  background: var(--navy-deep);
  color: #fff;
  font-family: var(--font-body);
}
.slide-navy .slide-amount {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}
.slide-navy .slide-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

/* Miniature slide (barre de navigation) */
.slide-thumb {
  width: 80px;
  height: 46px;
  border-radius: 4px;
  background: var(--navy-deep);
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t-fast);
  overflow: hidden;
}
.slide-thumb.active { border-color: var(--accent); }
.slide-thumb:hover  { border-color: rgba(139,111,62,.5); }

/* ─── 20. TAGS / PRODUITS ────────────────────────────────────── */
.tags-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--paper-dim);
  color: var(--slate);
  border: 1px solid var(--line);
}
.tag-accent { background: var(--accent-lo); color: var(--accent); border-color: rgba(139,111,62,.2); }

/* ─── 21. PAGE NEUTRE DE TEST (design system preview) ────────── */
.ds-preview {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px var(--gutter);
}
.ds-swatch-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.ds-swatch {
  width: 70px; height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex; align-items: flex-end;
  padding: 4px 6px;
  font-size: 9px; color: rgba(255,255,255,.7); font-family: var(--font-mono);
  flex-shrink: 0;
}
.ds-swatch.light { color: var(--slate); }

/* ─── 22. RESPONSIVE (minimal — desktop first) ───────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 56px; }
  .logo-wordmark,
  .nav-group-label,
  .nav-item span,
  .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .ti { font-size: 18px; }
  .logo-mark { margin: 0 auto; }
  .sidebar-logo { justify-content: center; }
}

/* ─── 23. UTILITAIRES ────────────────────────────────────────── */
.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-end  { justify-content: flex-end; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.opacity-50 { opacity: .5; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ═══════════════════════════════════════════════════════════════
   COMPOSANTS SPÉCIFIQUES — ajoutés Phase 1
   ═══════════════════════════════════════════════════════════════ */

/* ─── ACTUALITÉS ─────────────────────────────────────────────── */
.actus-filters {
  display: flex;
  gap: 6px;
  padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  overflow-x: auto;
  flex-shrink: 0;
}
.actus-filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  font-size: 13px;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.actus-filter-btn:hover { background: var(--paper-dim); color: var(--ink); border-color: var(--line-dark); }
.actus-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.actus-filter-btn.active:hover { background: var(--accent-mid); }

/* Card article */
.actu-card {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px var(--gutter);
  transition: background var(--t-fast);
}
.actu-card:hover { background: var(--paper-dim); }
#actus-list .actu-card:first-child { border-top: 1px solid var(--line); }

.actu-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.actu-card-fav-btn {
  background: none;
  border: none;
  color: var(--line-dark);
  font-size: 15px;
  padding: 0 2px;
  cursor: pointer;
  margin-left: auto;
  transition: color var(--t-fast);
  display: flex;
  align-items: center;
}
.actu-card-fav-btn:hover,
.actu-card-fav-btn.actu-card-fav-active { color: var(--accent); }

.actu-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
}
.actu-card-title a:hover { color: var(--accent); }

.actu-card-resume {
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.55;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.actu-card-actions { display: flex; gap: 4px; }

.actu-ai-block {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--paper-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ─── SYNTHÈSES VOCALES ──────────────────────────────────────── */

.synth-search-dropdown {
  position: absolute;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 100;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.synth-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast);
}
.synth-search-item:last-child { border-bottom: none; }
.synth-search-item:hover { background: var(--paper-dim); }
.synth-search-empty { color: var(--slate); cursor: default; }
.synth-search-empty:hover { background: transparent; }

.synth-search-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-lo);
  color: var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.synth-client-ctx {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.synth-ctx-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-lo);
  color: var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.synth-input-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.synth-input-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--slate);
  font-size: 13px;
  transition: all var(--t-fast);
}
.synth-input-tab:hover { background: var(--paper-dim); border-color: var(--line-dark); }
.synth-input-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.synth-input-tab.active:hover { background: var(--accent-mid); }
.synth-input-tab .ti { font-size: 15px; }

.synth-record-area {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}
.synth-record-idle,
.synth-record-active,
.synth-record-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.synth-rec-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
  box-shadow: 0 0 0 8px var(--accent-lo);
}
.synth-rec-btn:hover { background: var(--accent-mid); transform: scale(1.05); }
.synth-rec-btn .ti { font-size: 26px; }

.synth-timer {
  font-size: 22px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.synth-audio-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-lo);
  color: var(--accent);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.synth-upload-area {
  border: 2px dashed var(--line-dark);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.synth-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-lo);
}
.synth-file-preview {
  padding: 12px 14px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.synth-recent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.synth-recent-card:hover {
  border-color: var(--line-dark);
  box-shadow: var(--shadow-sm);
}

/* ─── PROFILS CLIENTS ────────────────────────────────────────── */

.clients-stats-bar {
  display: flex;
  gap: 12px;
}
.clients-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  flex: 1;
}
.csc-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.csc-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 2px;
}

.clients-grid-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) {
  .clients-grid-inner { grid-template-columns: 1fr; }
}

.client-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-lo);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Tags selector formulaire */
.tags-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}
.tag-select { cursor: pointer; transition: all var(--t-fast); }
.tag-select.active {
  background: var(--accent-lo);
  color: var(--accent);
  border-color: rgba(139,111,62,.3);
  font-weight: 500;
}

/* ─── BADGE IA (Phase 3 — composant unique) ─────────────────── */
/* Glyphe : point bronze + barre navy, lus comme "Généré par IA" */
.badge-ia-comp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 6px;
  border-radius: 12px;
  background: var(--navy-deep);
  color: rgba(255,255,255,.75);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  font-family: var(--font-body);
  white-space: nowrap;
  user-select: none;
}
.badge-ia-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─── ASSISTANT DE CONNAISSANCE ──────────────────────────────── */
.assistant-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.assistant-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
}

/* Welcome screen */
.assistant-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.assistant-welcome-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--navy-deep);
  color: var(--accent);
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

/* Pills questions suggérées */
.assistant-suggested { width: 100%; max-width: 540px; }
.assistant-suggested-label { text-align: left; }
.assistant-suggested-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}
.assistant-pill {
  padding: 7px 13px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
}
.assistant-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lo);
}

/* Messages */
.assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.assistant-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 85%;
}
.assistant-msg-user { align-self: flex-end; align-items: flex-end; }
.assistant-msg-ia   { align-self: flex-start; align-items: flex-start; }

.assistant-msg-bubble {
  padding: 11px 15px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
}
.assistant-msg-user .assistant-msg-bubble {
  background: var(--navy-deep);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}
.assistant-msg-ia .assistant-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
}

/* Source badge sous réponse IA */
.assistant-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.assistant-source-badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--paper-dim);
  color: var(--slate);
  border: 1px solid var(--line);
}

/* État refus hors périmètre */
.assistant-msg-refused .assistant-msg-bubble {
  background: rgba(155,106,0,.06);
  border-color: rgba(155,106,0,.25);
  color: var(--warn);
}

/* Source badges cliquables */
a.assistant-source-badge {
  text-decoration: none;
  cursor: pointer;
}
a.assistant-source-badge:hover {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}

/* Typing indicator */
.carry-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.carry-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--slate);
  animation: carry-dot 1.2s infinite;
}
.carry-typing span:nth-child(2) { animation-delay: .2s; }
.carry-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes carry-dot {
  0%,80%,100% { opacity: .3; transform: scale(.7); }
  40%          { opacity: 1;  transform: scale(1); }
}

/* Messages popup (assist-msg) */
.assist-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
}
.assist-msg-user { align-self: flex-end; align-items: flex-end; }
.assist-msg-bot  { align-self: flex-start; align-items: flex-start; }
.assist-msg-bubble {
  padding: 9px 13px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.55;
}
.assist-msg-user .assist-msg-bubble {
  background: var(--navy-deep);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}
.assist-msg-bot .assist-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
}
.assist-msg-refused .assist-msg-bubble {
  background: rgba(155,106,0,.06);
  border-color: rgba(155,106,0,.25);
  color: var(--warn);
}
.assist-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

/* Zone de saisie */
.assistant-input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 12px var(--gutter) 16px;
}
.assistant-input-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.assistant-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 140px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.assistant-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lo);
}
.assistant-send-btn {
  height: 40px;
  width: 40px;
  padding: 0;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius);
}
.assistant-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  opacity: .65;
}

/* ─── AGENDA ──────────────────────────────────────────────────── */
/* Indicateur de synchro Google — discret (point de couleur + court texte), remplace l'ancien
   bandeau imposant. Un seul point de couleur suffit à distinguer les 3 états. */
.agenda-sync-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px var(--gutter);
  font-size: 11.5px;
  color: var(--slate);
  flex-shrink: 0;
}
.agenda-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.agenda-sync-dot.warn { background: var(--warn); }
.agenda-sync-dot.off  { background: var(--slate); opacity: .5; }
.agenda-sync-link { color: var(--accent); cursor: pointer; font-weight: 500; }
.agenda-sync-link:hover { text-decoration: underline; }

.agenda-view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.agenda-view-btn {
  padding: 5px 12px;
  font-size: 12.5px;
  border: none;
  background: transparent;
  color: var(--slate);
  cursor: pointer;
  transition: all var(--t-fast);
}
.agenda-view-btn.active { background: var(--navy-deep); color: #fff; }

/* Bandeau "journée entière" au-dessus de la grille */
.agenda-allday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px var(--gutter) 0;
}
.agenda-allday-chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: var(--accent-lo);
  color: var(--ink);
  cursor: pointer;
}

/* Grille agenda — jour. Événements en position absolue (top/height calculés depuis leur
   durée réelle en minutes) sur un calque séparé, plutôt qu'une liste par créneau horaire —
   c'est ce qui permet à un RDV d'1h d'occuper visuellement deux fois la hauteur d'un RDV
   de 30 min, et de faire apparaître la ligne "heure actuelle". */
.agenda-day-grid {
  position: relative;
  margin: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.agenda-hour-row {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.agenda-hour-row:last-child { border-bottom: none; }
.agenda-hour-label {
  width: 64px;
  flex-shrink: 0;
  padding: 8px 10px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  border-right: 1px solid var(--line);
}
.agenda-hour-cell {
  flex: 1;
  cursor: pointer;
  transition: background var(--t-fast);
}
.agenda-hour-cell:hover { background: var(--accent-lo); }

.agenda-events-layer {
  position: absolute;
  top: 0; left: 64px; right: 0; bottom: 0;
  pointer-events: none;
}

.agenda-event {
  position: absolute;
  overflow: hidden;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11.5px;
  border-left: 3px solid var(--accent);
  background: var(--accent-lo);
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: var(--shadow-sm);
  transition: filter var(--t-fast);
}
.agenda-event:hover { filter: brightness(.97); }
.agenda-event-time  { font-family: var(--font-mono); font-size: 10px; color: var(--accent); line-height: 1.3; }
.agenda-event-title { font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* RDV trop court pour empiler heure + titre (durée réelle < hauteur minimale) : une seule ligne
   centrée, l'heure reste consultable via l'infobulle native (title) et le panneau détail au clic. */
.agenda-event-compact { display: flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.agenda-event-compact .agenda-event-time { display: none; }
.agenda-event-compact .agenda-event-title { font-size: 11px; }

/* RDV très court (ex. 15 min) : badge compact plutôt qu'un bloc étiré à une hauteur minimale — un
   bloc aurait débordé visuellement sur le créneau suivant et laissé croire à une durée plus longue
   qu'en réalité. Hauteur quasi fixe (pas proportionnelle à la grille), forme de pilule plutôt que
   de rectangle, pour se lire clairement comme "un point dans le temps" et non comme une plage. */
.agenda-event-badge {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 19px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--accent-lo);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: auto;
  z-index: 2;
  transition: filter var(--t-fast);
}
.agenda-event-badge:hover { filter: brightness(.97); }
.agenda-event-badge-time  { font-family: var(--font-mono); font-size: 9.5px; color: var(--accent); flex-shrink: 0; }
.agenda-event-badge-title { font-size: 10.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.agenda-event-badge.agenda-event-intelio { background: color-mix(in srgb, var(--navy-deep) 10%, transparent); }
.agenda-event-badge.agenda-event-intelio .agenda-event-badge-time { color: var(--navy-deep); }
[data-theme="dark"] .agenda-event-badge.agenda-event-intelio { background: color-mix(in srgb, var(--ink) 12%, transparent); }
[data-theme="dark"] .agenda-event-badge.agenda-event-intelio .agenda-event-badge-time { color: var(--ink); }
.agenda-event-badge.agenda-event-google { background: color-mix(in srgb, var(--accent-mid) 14%, transparent); }
.agenda-event-badge.agenda-event-google .agenda-event-badge-time { color: var(--accent-mid); }

/* RDV Intelio en cours de glissement (drag and drop) */
.agenda-event[draggable="true"] { cursor: grab; }
.agenda-event-dragging { opacity: .4; }

/* Créneau libre survolé pendant un glissement — indique où le RDV sera déposé */
.agenda-hour-cell.agenda-drop-target,
.agenda-week-hour-cell.agenda-drop-target {
  background: var(--accent-lo);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* Aperçu léger flottant au survol d'un créneau libre, avant clic */
.agenda-hover-ghost {
  position: fixed;
  z-index: 9999;
  display: none;
  pointer-events: none;
  background: var(--navy-deep);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 9px;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

/* Créé dans Intelio (éditable) — teinte navy pour se distinguer du bronze "Google" (lecture
   seule), en restant dans la même famille de couleurs du design system. */
.agenda-event-intelio {
  border-left-color: var(--navy-deep);
  background: color-mix(in srgb, var(--navy-deep) 8%, transparent);
}
[data-theme="dark"] .agenda-event-intelio {
  border-left-color: var(--slate);
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.agenda-allday-chip.agenda-event-intelio { border-left-color: var(--navy-deep); }

/* Importé de Google Calendar — nuance bronze différenciée, lecture seule */
.agenda-event-google {
  border-left-color: var(--accent-mid);
  background: color-mix(in srgb, var(--accent-mid) 12%, transparent);
}
.agenda-allday-chip.agenda-event-google { border-left-color: var(--accent-mid); }

.agenda-google-badge, .agenda-intelio-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
}
.agenda-google-badge  { color: var(--accent-mid); }
.agenda-intelio-badge { color: var(--navy-deep); }
[data-theme="dark"] .agenda-intelio-badge { color: var(--ink); }
.agenda-google-badge .ti, .agenda-intelio-badge .ti { font-size: 11px; }

/* Ligne "heure actuelle" */
.agenda-now-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid var(--accent);
  z-index: 5;
  pointer-events: none;
}
.agenda-now-dot {
  position: absolute;
  left: -4px; top: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* Grille agenda — semaine, même principe que la vue jour, une colonne par jour */
.agenda-week-grid-wrap {
  margin: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.agenda-week-headers {
  display: grid;
  grid-template-columns: 64px repeat(7, 1fr);
  border-bottom: 2px solid var(--line);
}
.agenda-week-time-col { border-right: 1px solid var(--line); }
.agenda-week-col-label {
  padding: 12px 6px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.agenda-week-col-label:last-child { border-right: none; }
.agenda-week-col-day  { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }
.agenda-week-col-date { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.agenda-week-col-label.today .agenda-week-col-day,
.agenda-week-col-label.today .agenda-week-col-date { color: var(--accent); }

.agenda-week-body { display: flex; }
.agenda-week-hour-labels { width: 64px; flex-shrink: 0; border-right: 1px solid var(--line); }
.agenda-week-hour-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--slate);
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--line);
}
.agenda-week-days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); }
.agenda-week-day-col { position: relative; border-right: 1px solid var(--line); }
.agenda-week-day-col:last-child { border-right: none; }
.agenda-week-day-col.today-col { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.agenda-week-hour-cell {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--t-fast);
}
.agenda-week-hour-cell:hover { background: var(--accent-lo); }
.agenda-week-day-col .agenda-events-layer { left: 0; }
.agenda-week-day-col .agenda-event { font-size: 10px; padding: 2px 5px; }
.agenda-week-day-col .agenda-event-time { font-size: 9px; }
.agenda-week-day-col .agenda-event-badge { padding: 0 6px; }
.agenda-week-day-col .agenda-event-badge-title { font-size: 10px; }

/* Sélecteur de date rapide — popover ancré sous le bouton calendrier de la topbar */
.agenda-datepicker-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px;
  width: 224px;
}
.agenda-dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.agenda-dp-month-label { font-size: 12.5px; font-weight: 600; color: var(--ink); text-transform: capitalize; }
.agenda-dp-weekdays, .agenda-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.agenda-dp-weekdays div { font-size: 10px; text-align: center; color: var(--slate); padding-bottom: 4px; }
.agenda-dp-cell {
  font-size: 11.5px;
  text-align: center;
  padding: 5px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}
.agenda-dp-cell:hover { background: var(--accent-lo); }
.agenda-dp-cell--empty { cursor: default; }
.agenda-dp-cell--empty:hover { background: none; }
.agenda-dp-today { font-weight: 700; color: var(--accent); }
.agenda-dp-selected { background: var(--accent); color: #fff; }

/* ─── DASHBOARD ──────────────────────────────────────────────── */

/* Hero : CTA + stats */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy-deep);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.dash-hero-left { display: flex; flex-direction: column; gap: 6px; }
.dash-hero-label { color: rgba(255,255,255,.45); }

/* Stats bar dans le hero */
.dash-stats-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.dash-stat {
  padding: 12px 22px;
  border-right: 1px solid var(--navy-line);
  text-align: center;
  min-width: 90px;
}
.dash-stat:last-child { border-right: none; }
.dash-stat-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.dash-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-top: 3px;
}

/* Grille dashboard 2 colonnes */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.dash-col-left,
.dash-col-right { display: flex; flex-direction: column; }

/* Aperçu Reporting (dashboard) — donut + chiffres clés */
.dash-reporting-preview-grid {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.dash-reporting-preview-grid .chart-canvas-wrap.chart-donut { width: 160px; height: 160px; flex-shrink: 0; }
.dash-reporting-preview-stats {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-reporting-preview-stats .stat-card { padding: 10px 14px; }
.dash-reporting-preview-stats .stat-card-val { font-size: 19px; }

/* Placeholder agenda */
.dash-agenda-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  text-align: center;
}

/* Aperçu "Agenda du jour" (dashboard) — petites cartes plutôt qu'une ligne de texte brute, même
   distinction visuelle Intelio/Google (navy/bronze) que sur l'écran Agenda lui-même. */
.dash-rdv-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy-deep);
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
[data-theme="dark"] .dash-rdv-card { border-left-color: var(--slate); }
.dash-rdv-card:hover { background: var(--paper-dim); box-shadow: var(--shadow-sm); }
.dash-rdv-card + .dash-rdv-card { margin-top: 8px; }
.dash-rdv-card.dash-rdv-google { border-left-color: var(--accent-mid); }
.dash-rdv-card-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 42px;
}
.dash-rdv-card-title {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-rdv-card-source {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--slate);
}
.dash-rdv-card-source .ti { font-size: 12px; }
.dash-rdv-card.dash-rdv-google .dash-rdv-card-source { color: var(--accent-mid); }

/* Rows actus dans dashboard */
.dash-actu-row { align-items: flex-start; }
.dash-actus-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 10px 20px 6px;
}

/* Rows clients dans dashboard */
.dash-client-row:hover { background: var(--paper-dim); }

/* ─── ACADÉMIE (Fiches & Formations) ─────────────────────────── */
.academie-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.academie-filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.academie-filter-btn:hover { background: var(--paper-dim); color: var(--ink); border-color: var(--line-dark); }
.academie-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.academie-filter-btn.active:hover { background: var(--accent-mid); }

.academie-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) {
  .academie-grid { grid-template-columns: 1fr 1fr; }
}

.academie-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.academie-card-interactive { cursor: pointer; }
.academie-card-interactive:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.academie-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.academie-card-icon { font-size: 22px; line-height: 1; }
.academie-card-title { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.academie-card-desc { font-size: 12px; color: var(--slate); line-height: 1.5; margin-bottom: 10px; }
.academie-card-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--slate);
  margin-top: auto;
}
.academie-card-meta span { display: flex; align-items: center; gap: 4px; }
.academie-card-meta .ti { font-size: 12px; }
.academie-progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--paper-dim);
  overflow: hidden;
  margin-top: 10px;
}
.academie-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.academie-card-progress-lbl { font-size: 10.5px; color: var(--slate); margin-top: 5px; }
.academie-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.academie-card-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--paper-dim);
  color: var(--slate);
}

/* ─── ACCORDION FORMULAIRE CLIENT ───────────────────────────── */
.client-form-header {
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.accordion-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: clip;
  background: var(--surface);
}

.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  transition: background .15s;
}
.accordion-toggle:hover { background: var(--paper-dim); }

.accordion-chevron {
  font-size: 14px;
  color: var(--slate);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.accordion-section.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  padding: 0 16px;
}
.accordion-section.open .accordion-content {
  max-height: 1800px;
  padding: 12px 16px 16px;
}

/* Client screens — flex containers pour scroll correct */
#clients-list-screen,
#clients-detail-screen,
#clients-form-screen {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

/* Tableau patrimoine financier */
.pf-header {
  display: flex;
  gap: 6px;
  padding: 0 0 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--slate);
}
.pf-header-type  { min-width: 120px; max-width: 120px; }
.pf-header-etab  { flex: 1; }
.pf-header-mt    { width: 110px; text-align: right; }
.pf-header-frais { min-width: 160px; text-align: right; }

.pf-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pf-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.pf-row:last-child { border-bottom: none; }
.pf-row-type {
  min-width: 120px;
  max-width: 120px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 0 4px;
}
.pf-fees {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.pf-no-frais {
  font-size: 11px;
  color: var(--slate);
  font-style: italic;
  padding: 0 4px;
  min-width: 80px;
}

/* Bouton flottant assistant */
/* ─── FAB flottant assistant ────────────────────────────────── */
.assistant-fab {
  position: fixed !important;
  bottom: 80px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 20px rgba(15,27,51,.4);
  z-index: 500;
  transition: transform .15s, box-shadow .15s;
}
.assistant-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(15,27,51,.55);
}
.assistant-fab .fab-dot {
  position: absolute;
  top: 9px; right: 9px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 1.5px solid var(--navy-deep);
}

/* ─── Popup compact assistant ───────────────────────────────── */
.assistant-popup {
  position: fixed !important;
  bottom: 140px;
  right: 24px;
  width: 360px;
  max-height: 480px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(15,27,51,.22), 0 2px 8px rgba(15,27,51,.12);
  z-index: 499;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.assistant-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}
.assistant-popup-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assistant-popup-input {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  align-items: flex-end;
}
.assistant-popup-input .input {
  font-size: 13px;
  resize: none;
  flex: 1;
  max-height: 80px;
  min-height: 36px;
}
@media (max-width: 600px) {
  .assistant-popup { right: 12px; width: calc(100vw - 24px); bottom: 76px; }
}

/* ─── Barre répartition patrimoniale ───────────────────────── */
.repartition-bar-wrap { margin: 4px 0 8px; }
.repartition-bar {
  display: flex;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  gap: 2px;
  background: var(--line);
}
.repartition-seg { height: 100%; transition: width .3s; }
.repartition-fin  { background: var(--navy-deep); }
.repartition-immo { background: var(--accent); }
.repartition-legend {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--slate);
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-dot.fin  { background: var(--navy-deep); }
.legend-dot.immo { background: var(--accent); }

/* ─── Simulateurs ──────────────────────────────────────────── */
.simul-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 3px;
  width: fit-content;
}
.simul-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  transition: all var(--t-fast);
}
.simul-tab:hover { color: var(--ink); background: var(--hover-overlay); }
.simul-tab.active {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.simul-tab.active:hover { background: var(--accent-mid); }
.simul-input {
  padding: 4px 8px !important;
  height: 32px !important;
  font-size: 13px !important;
  font-family: var(--font-mono);
}

/* ─── Filtres/tri clients ────────────────────────────────────── */
.clients-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.select-sm {
  width: auto !important;
  height: 32px !important;
  padding: 0 28px 0 8px !important;
  font-size: 12px !important;
  flex: 0 0 auto;
}

/* ─── Client card — patrimoine lines ────────────────────────── */
.cc-pat-lines {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cc-pat-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11.5px;
}
.cc-pat-label { color: var(--slate); flex: 0 0 auto; }
.cc-pat-val   { font-family: var(--font-mono); color: var(--accent); font-size: 11.5px; }

/* ─── Questionnaire profil de risque ────────────────────────── */
.risque-quiz { display: flex; flex-direction: column; gap: 14px; }
.risque-question { }
.risque-question-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}
.risque-options { display: flex; flex-direction: column; gap: 4px; }
.risque-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--slate);
  transition: border-color .15s, background .15s;
}
.risque-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--ink);
}
.risque-option input[type=radio] { accent-color: var(--accent); margin: 0; }
.risque-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  margin-top: 4px;
}
.risque-result.none { background: var(--paper-dim); color: var(--slate); }

/* ─── PF frais simplifié ─────────────────────────────────────── */
.pf-add-frais-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--slate);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.pf-add-frais-btn:hover { color: var(--ink); }
.pf-fees-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pf-frais-unit { font-size: 11px; color: var(--slate); }

/* ─── Kanban Prospects ───────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 16px 0;
  min-height: calc(100vh - 160px);
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 230px;
  min-width: 230px;
  background: var(--paper-dim);
  border-radius: 10px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}
.kanban-col-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--slate);
}
.kanban-col-count {
  font-size: 11px;
  color: var(--slate);
  background: var(--line);
  border-radius: 10px;
  padding: 1px 7px;
}
.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}
.kanban-cards.drag-over {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 6px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow .15s, border-color .15s;
}
.kanban-card:hover { border-color: var(--line-dark); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.kanban-card.dragging { opacity: .4; cursor: grabbing; }
.kanban-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.kanban-card-meta {
  font-size: 11.5px;
  color: var(--slate);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kanban-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.kanban-add-btn {
  margin: 6px 8px 8px;
  width: calc(100% - 16px);
  background: none;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  color: var(--slate);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, color .15s;
}
.kanban-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.kanban-col.col-gagne .kanban-col-title { color: var(--accent-mid); }
.kanban-col.col-perdu  .kanban-col-title { color: #9e5757; }
.kanban-col.col-gagne  { border-color: rgba(139,111,62,.35); }
.kanban-col.col-perdu  { border-color: color-mix(in srgb, #9e5757 20%, var(--line)); }

/* ─── Donut patrimoine + graphiques Chart.js ────────────────────── */
.essentiel-encours-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .essentiel-encours-grid { grid-template-columns: 1fr; }
}
.essentiel-donut-col { display: flex; flex-direction: column; align-items: center; }
.donut-chart-wrap { position: relative; width: 100%; max-width: 240px; height: 240px; margin: 0 auto 16px; }
.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.donut-legend-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink);
}
.donut-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-val { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.donut-legend-pct { color: var(--slate); font-weight: 400; font-size: 10.5px; }

.chart-card-body { padding: 16px 20px; }
.chart-canvas-wrap { position: relative; width: 100%; height: 220px; }
.chart-canvas-wrap.chart-tall { height: 280px; }
.chart-canvas-wrap.chart-donut { height: 280px; max-width: 280px; margin: 0 auto; }

/* ─── Reporting — stat cards, trend, entonnoir ──────────────────── */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-card-val {
  font-family: var(--font-body);
  font-size: 23px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}
.stat-card-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 4px;
}
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 7px;
}
.trend-badge.trend-up   { color: var(--success); }
.trend-badge.trend-down { color: var(--error); }
.trend-badge.trend-none { color: var(--slate); font-weight: 400; font-style: italic; }

.funnel-wrap { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 32px; align-items: center; gap: 10px; }
.funnel-label { font-size: 12px; color: var(--slate); text-align: right; }
.funnel-bar-wrap { background: var(--paper-dim); border-radius: 5px; overflow: hidden; height: 22px; }
.funnel-bar { height: 100%; border-radius: 5px; transition: width .3s ease; }
.funnel-count { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: right; }
.funnel-terminal-row { display: flex; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.funnel-terminal { flex: 1; text-align: center; padding: 10px; border-radius: 8px; }
.funnel-terminal-client { background: rgba(139,111,62,.12); }
.funnel-terminal-perdu  { background: rgba(158,87,87,.08); }
.funnel-terminal-val { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--ink); }
.funnel-terminal-client .funnel-terminal-val { color: var(--accent-mid); }
.funnel-terminal-perdu  .funnel-terminal-val { color: #9e5757; }
.funnel-terminal-lbl { font-size: 10.5px; color: var(--slate); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ─── Reporting — alerte de concentration, produits jamais placés ───── */
.concentration-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--warn-lo);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  border-radius: 10px;
  padding: 13px 16px;
}
.concentration-alert .ti { font-size: 18px; color: var(--warn); flex-shrink: 0; margin-top: 1px; }
.concentration-alert-title { font-size: 12.5px; font-weight: 700; color: var(--warn); margin-bottom: 2px; }
.concentration-alert-text { font-size: 12px; color: var(--ink); line-height: 1.5; }

.jamais-places-list { display: flex; flex-direction: column; }
.jamais-places-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.jamais-places-row:last-child { border-bottom: none; }

/* ─── Prospect form modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,7,14,.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── Round 7 — Patrimoine cards (Item 1) ───────────────────── */
.pat-card {
  margin-bottom: 18px;
}
.pat-card-header {
  background: var(--surface);
}

/* ─── Round 7 — Prospects metrics bar (Item 4) ──────────────── */
.prospects-metrics-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--navy-deep);
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}
.prospect-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 80px;
}
.prospect-metric-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.prospect-metric-lbl {
  font-size: 10.5px;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.prospect-metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.prospect-metric-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  color: rgba(255,255,255,.75);
}
.prospect-metric-chip-label { }
.prospect-metric-chip-val {
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 11px;
}

/* ─── Prospect tags & enrichissements CRM ───────────────────── */
.prospect-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 2px;
}
.prospect-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(139,111,62,.15);
  color: #8B6F3E;
  border: 1px solid rgba(139,111,62,.25);
  white-space: nowrap;
}
.prospect-potentiel {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.prospects-source-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--line);
  background: var(--paper-dim);
}
.prospect-source-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.prospect-source-label { color: var(--slate); }
.prospect-source-rate  { font-weight: 600; color: var(--ink); }

/* ─── Timeline historique prospect ──────────────────────────── */
.prospect-timeline-section {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 14px;
}
.prospect-timeline-list {
  max-height: 180px;
  overflow-y: auto;
}
.prospect-timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.prospect-timeline-row:last-child { border-bottom: none; }
.prospect-timeline-icon {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}
.prospect-timeline-label {
  flex: 1;
  font-size: 12.5px;
  color: var(--ink);
}
.prospect-timeline-date {
  font-size: 11px;
  color: var(--slate);
  white-space: nowrap;
  opacity: .7;
}

/* ─── Round 7 — Prospect → Client toast (Item 3) ────────────── */
.prospect-convert-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--navy-deep);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  max-width: 420px;
  animation: toast-in .25s ease;
}
@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.prospect-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(139,111,62,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.prospect-toast-body { flex: 1; }
.prospect-toast-title { font-size: 13px; font-weight: 700; color: #fff; }
.prospect-toast-sub   { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; }

/* ─── Round 7 — Produits CGP checkbox (Item 5) ──────────────── */
.pf-cgp-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--slate);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.pf-cgp-label input[type=checkbox] { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }
.pf-cgp-text { }
.pf-cgp-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ─── Carry — tabs bar ───────────────────────────────────────── */
.carry-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: none;
  padding: 10px 20px;
  background: var(--paper);
  flex-shrink: 0;
}
.carry-tab {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: all var(--t-fast);
}
.carry-tab.active {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.carry-tab.active:hover { background: var(--accent-mid); }
.carry-tab:hover:not(.active) { color: var(--ink); background: var(--paper-dim); }

/* ─── Carry — history rows ───────────────────────────────────── */
.carry-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s;
}
.carry-history-row:last-child { border-bottom: none; }
.carry-history-row:hover { background: var(--paper-dim); margin: 0 -16px; padding: 10px 16px; border-radius: 8px; }
.carry-history-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--paper-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--slate); font-size: 16px;
  flex-shrink: 0;
}
.carry-history-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.carry-history-date  { font-size: 11px; color: var(--slate); margin-top: 2px; }

/* ─── Carry — copy button on IA messages ────────────────────── */
.carry-copy-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  cursor: pointer;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  transition: color .15s, border-color .15s;
}
.carry-copy-btn:hover { color: var(--ink); border-color: var(--slate); }

/* ─── Correcteur — layout deux colonnes ─────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.correcteur-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
}
@media (max-width: 860px) {
  .correcteur-layout { grid-template-columns: 1fr; }
}
.correcteur-card {
  box-shadow: 0 1px 3px rgba(15,27,51,.06);
}
.correcteur-textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  font-size: 13.5px;
  line-height: 1.7;
  font-family: var(--font-body);
}
.correcteur-counter {
  margin-top: 8px;
  font-size: 11px;
  color: var(--slate);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ─── Correcteur — état vide résultat ───────────────────────── */
.correcteur-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 12px;
  text-align: center;
}
.correcteur-empty-icon {
  font-size: 36px;
  color: var(--line-dark, #ccc);
  display: block;
}
.correcteur-empty-label {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.6;
}

/* ─── Correcteur — diff highlighting ────────────────────────── */
mark.diff-add {
  background: rgba(139,111,62,.15);
  color: var(--accent-mid);
  border-radius: 3px;
  padding: 1px 3px;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(139,111,62,.3);
}
s.diff-del {
  color: var(--danger, #c0392b);
  text-decoration: line-through;
  opacity: .5;
}

/* ─── Ma gamme — product rows ────────────────────────────────── */
.gamme-group { padding-bottom: 4px; }
.gamme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.gamme-row:last-child { border-bottom: none; }
.gamme-frais-chip {
  font-size: 10.5px;
  color: var(--slate);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.gamme-pdf-label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--slate);
  transition: border-color .15s;
}
.gamme-pdf-label:hover { border-color: var(--accent); }
.gamme-pdf-validation {
  margin-top: 10px;
  background: var(--paper-dim);
  border: 1px solid rgba(139,111,62,.2);
  border-radius: 8px;
  padding: 12px 14px;
}
.gamme-pdf-arg-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ── Tunnel slides fullscreen ── */
#tunnel-slides-viewer:-webkit-full-screen { aspect-ratio: auto; height: 100vh; width: 100vw; border-radius: 0; }
#tunnel-slides-viewer:fullscreen { aspect-ratio: auto; height: 100vh; width: 100vw; border-radius: 0; }
#tunnel-slides-viewer:fullscreen .ti-chevron-left,
#tunnel-slides-viewer:fullscreen .ti-chevron-right { font-size: 20px; }

/* ══════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════════ */

#login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at 50% 44%, #6B4B24 0%, #3C2610 50%, #1E1209 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--navy-deep);
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow:
    0 2px 4px  rgba(0,0,0,.18),
    0 10px 30px rgba(0,0,0,.38),
    0 44px 88px rgba(0,0,0,.52),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.login-card .input-label { color: rgba(240,239,233,.6); }

.login-card .input {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.11);
  color: rgb(240,239,233);
}

.login-card .input::placeholder { color: rgba(240,239,233,.25); }

.login-card .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,111,62,.28);
  background: rgba(255,255,255,.09);
}

.login-error {
  background: rgba(220,40,40,.14);
  border: 1px solid rgba(220,40,40,.3);
  color: #ff8585;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-legal {
  font-size: 11px;
  color: rgba(240,239,233,.32);
  text-align: center;
  margin-top: 20px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════
   STATISTIQUES ADMIN
   ══════════════════════════════════════════════════════════════════ */

.stats-user-row {
  display: grid;
  grid-template-columns: 1fr 80px 70px 70px 70px 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.stats-user-row:last-child { border-bottom: none; }
.stats-user-row.stats-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--bg);
  border-radius: 7px 7px 0 0;
}
.stats-never-used {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.stats-never-chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(220,80,40,.1);
  color: #b03020;
  border: 1px solid rgba(220,80,40,.2);
  white-space: nowrap;
}
.stats-feature-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.stats-feature-bar:last-child { border-bottom: none; }
.stats-bar-fill {
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
  opacity: .7;
  min-width: 3px;
}
