/* ==========================================================================
   CRM BlueIa · feuille principale
   Propriétaire : socle-front. Les vues écrivent dans assets/css/views/<vue>.css
   et préfixent leurs classes par le nom de la vue (.session-…, .leads-…).

   SOMMAIRE
    1. Jetons            couleurs, tons, espacements, rayons, ombres, typographie
    2. Base              reset, texte, liens, focus
    3. Mise en page      .shell .sidebar .main .page-head .page-body .auth-screen
    4. Utilitaires       .row .stack .grow .muted .mono .num .truncate .hidden …
    5. Boutons           .btn (+ --primary --secondary --ghost --danger --sm --lg --block --icon)
    6. Boutons résultat  .result-grid .btn-result (+ .tone-*)
    7. Formulaires       .field .input .select .textarea .check .segmented .field-row .fieldset
    8. Puces de filtre   .filters .filter-group .chips .chip .search
    9. Badges            .badge (+ .tone-*), .dot
   10. Cartes            .card .kpi .kpi-grid .alert
   11. Tableaux          .table-wrap .table .table-toolbar .pagination
   12. Onglets           .tabs .tab .tabs__panel
   13. Superpositions    .overlay .modal .drawer .popover .toast-stack .toast
   14. États             .empty .spinner .skeleton
   15. Chronologie       .timeline
   16. Téléphone         .phone-block
   17. Progression       .progress
   18. Tableau de bord   .dash-grid .col-*
   19. Pipeline          .pipeline .pipeline__col .pipeline__card
   20. Graphiques        .chart .chart-legend .ch-*
   21. Fiche             .kv .section-title .divider
   22. Tablette          @media
   Tons disponibles partout : success warn danger info violet muted neutral accent
   ========================================================================== */

/* 1. Jetons ---------------------------------------------------------------- */
:root {
  --paper: #FAFAF9;
  --card: #fff;
  --ink: #10141B;
  --navy: #0A1422;
  --accent: #2F5BFF;
  --accent-d: #1E3FCC;
  --cyan: #00D4F0;
  --violet: #8B5CF6;
  --soft: #EAEFFF;
  --muted: #5B6472;
  --line: #E6E7E3;

  --ink-2: #2A303B;
  --line-strong: #D3D5CF;
  --hover: #F3F4F1;
  --navy-2: #121F33;
  --navy-line: #1D2B42;
  --navy-text: #A9B4C6;

  /* Tons : fond, texte, plein, bord */
  --success-bg: #E8F6EC; --success-fg: #166534; --success: #15803D; --success-line: #BFE5CB;
  --warn-bg: #FEF3E0;    --warn-fg: #92400E;    --warn: #B45309;    --warn-line: #F6D8A4;
  --danger-bg: #FDECEC;  --danger-fg: #9F1D1D;  --danger: #C62828;  --danger-line: #F5C6C6;
  --info-bg: #E2F6FB;    --info-fg: #075E78;    --info: #0284A8;    --info-line: #B4E4F0;
  --violet-bg: #F1EBFE;  --violet-fg: #5B21B6;  --violet-s: #7C3AED; --violet-line: #DACBFB;
  --muted-bg: #F1F1EF;   --muted-fg: #5B6472;   --muted-s: #8A919C;  --muted-line: #E0E1DD;
  --neutral-bg: #EAEDF1; --neutral-fg: #334155; --neutral: #475569;  --neutral-line: #D3D9E0;
  --accent-bg: #EAEFFF;  --accent-fg: #1E3FCC;  --accent-line: #C9D5FF;

  /* Grille de 8 px */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  --r-sm: 6px; --r: 8px; --r-lg: 10px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(16, 20, 27, .05);
  --shadow-2: 0 4px 16px rgba(16, 20, 27, .08);
  --shadow-3: 0 16px 48px rgba(10, 20, 34, .2);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-title: 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --fs-xs: 11px; --fs-sm: 12px; --fs: 14px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  --fs-phone: 44px;

  --control-h: 36px;
  --sidebar-w: 232px;
  --sidebar-w-min: 64px;
}

/* Tons génériques : tout composant lit --tone-bg, --tone-fg, --tone, --tone-line.
   Le préfixe :root donne à ces classes la priorité sur les valeurs par défaut qu'un composant déclare
   pour lui-même (.badge, .btn-result, .alert, .kpi…), quel que soit l'ordre des feuilles.
   Dans une feuille de vue : déclarer un défaut avec UNE seule classe (.session-box { --tone: … }), le ton l'emportera. */
:root .tone-success { --tone-bg: var(--success-bg); --tone-fg: var(--success-fg); --tone: var(--success);  --tone-line: var(--success-line); }
:root .tone-warn    { --tone-bg: var(--warn-bg);    --tone-fg: var(--warn-fg);    --tone: var(--warn);     --tone-line: var(--warn-line); }
:root .tone-danger  { --tone-bg: var(--danger-bg);  --tone-fg: var(--danger-fg);  --tone: var(--danger);   --tone-line: var(--danger-line); }
:root .tone-info    { --tone-bg: var(--info-bg);    --tone-fg: var(--info-fg);    --tone: var(--info);     --tone-line: var(--info-line); }
:root .tone-violet  { --tone-bg: var(--violet-bg);  --tone-fg: var(--violet-fg);  --tone: var(--violet-s); --tone-line: var(--violet-line); }
:root .tone-muted   { --tone-bg: var(--muted-bg);   --tone-fg: var(--muted-fg);   --tone: var(--muted-s);  --tone-line: var(--muted-line); }
:root .tone-neutral { --tone-bg: var(--neutral-bg); --tone-fg: var(--neutral-fg); --tone: var(--neutral);  --tone-line: var(--neutral-line); }
:root .tone-accent  { --tone-bg: var(--accent-bg);  --tone-fg: var(--accent-fg);  --tone: var(--accent);   --tone-line: var(--accent-line); }

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-overlay { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--ink); }
h1 { font-size: var(--fs-xl); line-height: 1.2; }
h2 { font-size: var(--fs-lg); line-height: 1.25; }
h3 { font-size: var(--fs-md); line-height: 1.3; }
h4 { font-size: var(--fs); line-height: 1.3; }
p { margin: 0 0 var(--s-3); }
p:last-child { margin-bottom: 0; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }
::selection { background: var(--soft); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 36px; height: 36px; stroke-width: 1.5; }

/* 3. Mise en page ---------------------------------------------------------- */
#app { min-height: 100%; }
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  width: var(--sidebar-w); height: 100vh; flex: none;
  display: flex; flex-direction: column;
  background: var(--navy); color: var(--navy-text);
  border-right: 1px solid var(--navy-line);
  z-index: 50;
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-4) var(--s-4) var(--s-3); }
.brand { display: inline-flex; align-items: baseline; gap: var(--s-2); text-decoration: none; }
.brand:hover { text-decoration: none; }
/* Seul usage du dégradé de marque dans toute l'application. */
.brand__name {
  font-family: var(--font-title); font-weight: 700; font-size: 22px; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--cyan), var(--accent) 55%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; color: var(--navy-text); text-transform: uppercase; }
.sidebar__toggle {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--navy-text);
}
.sidebar__toggle:hover { background: var(--navy-2); color: #fff; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: var(--s-2) var(--s-3) var(--s-4); scrollbar-width: thin; scrollbar-color: var(--navy-line) transparent; }
.nav-group { margin-top: var(--s-4); }
.nav-group:first-child { margin-top: var(--s-1); }
.nav-group__title { padding: 0 var(--s-3) var(--s-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6F7C92; }
.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 40px; padding: 0 var(--s-3); margin-bottom: 2px;
  border-radius: var(--r); color: var(--navy-text); font-weight: 500; text-decoration: none;
}
.nav-item:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav-item.is-active { background: rgba(47, 91, 255, .18); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item__badge {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
}
.sidebar__foot { border-top: 1px solid var(--navy-line); padding: var(--s-3); display: flex; align-items: center; gap: var(--s-2); }
.user-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2); border-radius: var(--r); color: #fff; text-decoration: none; }
.user-chip:hover { background: var(--navy-2); text-decoration: none; }
.user-chip.is-active { background: var(--navy-2); }
.user-chip__avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy-line); color: #fff; font-family: var(--font-title); font-weight: 600; font-size: var(--fs-sm);
}
.user-chip__text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-chip__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__role { font-size: var(--fs-xs); color: var(--navy-text); }
.sidebar__logout {
  width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r); background: transparent; color: var(--navy-text);
}
.sidebar__logout:hover { background: var(--navy-2); color: #fff; }

/* Barre repliée : icônes seules */
.shell.is-collapsed .sidebar { width: var(--sidebar-w-min); }
.shell.is-collapsed .sidebar__head { flex-direction: column; padding: var(--s-3) 0; }
.shell.is-collapsed .brand__rest,
.shell.is-collapsed .brand__tag,
.shell.is-collapsed .nav-group__title,
.shell.is-collapsed .nav-item__label,
.shell.is-collapsed .user-chip__text { display: none; }
.shell.is-collapsed .sidebar__nav { padding: var(--s-2); }
.shell.is-collapsed .nav-group { margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--navy-line); }
.shell.is-collapsed .nav-group:first-child { border-top: 0; padding-top: 0; }
.shell.is-collapsed .nav-item { justify-content: center; padding: 0; position: relative; }
.shell.is-collapsed .nav-item__badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
.shell.is-collapsed .sidebar__foot { flex-direction: column; padding: var(--s-2); }
.shell.is-collapsed .user-chip { justify-content: center; padding: var(--s-1); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-5) var(--s-6) var(--s-4);
}
.page-head__titles { min-width: 0; }
.page-head__sub { margin: var(--s-1) 0 0; color: var(--muted); }
.page-head__sub:empty { display: none; }
.page-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.page-body { flex: 1; padding: 0 var(--s-6) var(--s-7); }
.view { display: block; }
.view--narrow, .narrow { max-width: 720px; }
.view--medium, .medium { max-width: 1080px; }

/* Écrans hors coquille : connexion, démarrage, erreur de démarrage */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s-5); background: var(--paper); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: var(--s-6); }
.auth-brand { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-5); }
.auth-brand__name { font-family: var(--font-title); font-weight: 700; font-size: 26px; letter-spacing: -.02em; color: var(--navy); }
.auth-brand__tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); color: var(--muted); }

/* 4. Utilitaires ----------------------------------------------------------- */
.row { display: flex; align-items: center; gap: var(--s-2); }
.row--wrap { flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--sm { gap: var(--s-2); }
.stack--lg { gap: var(--s-5); }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.strong { font-weight: 600; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-accent { color: var(--accent-d); }
.hidden, [hidden] { display: none !important; }
.print-only { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent-d); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }
.divider { border-top: 1px solid var(--line); margin: var(--s-4) 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: var(--s-5) 0 var(--s-3); }
.section-title:first-child { margin-top: 0; }
.section-title h2, .section-title h3 { margin: 0; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* 5. Boutons ---------------------------------------------------------------
   h('button', {class: 'btn btn--primary'}, 'Enregistrer')  ou  button('Enregistrer', {variant: 'primary'}) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-4);
  border: 1px solid transparent; border-radius: var(--r);
  font-weight: 600; font-size: var(--fs); line-height: 1; white-space: nowrap; text-decoration: none;
  background: var(--card); color: var(--ink);
  transition: background-color .12s, border-color .12s, color .12s;
  user-select: none; position: relative;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-d); }
.btn--secondary { background: var(--card); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-1); }
.btn--secondary:hover { background: var(--hover); border-color: #BFC2BA; }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: #ECEDE9; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #A61E1E; }
.btn--danger-soft { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-line); }
.btn--danger-soft:hover { background: #FAD9D9; }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #116A32; }
.btn--sm { min-height: 28px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { min-height: 48px; padding: 0 var(--s-5); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--xl { min-height: 64px; padding: 0 var(--s-6); font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn--block { display: flex; width: 100%; }
.btn--icon { width: var(--control-h); padding: 0; }
.btn--icon.btn--sm { width: 28px; }
.btn--icon.btn--lg { width: 48px; }
.btn:disabled, .btn[aria-disabled="true"], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after, .btn--danger-soft.is-loading::after { border-color: rgba(16, 20, 27, .2); border-top-color: var(--ink); }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btn-group > .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 6. Gros boutons de résultat d'appel ---------------------------------------
   <div class="result-grid"><button class="btn-result tone-success">…</button></div>
   Un clic = un résultat. Teinte douce au repos, plein au survol. */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s-3); }
.result-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.result-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn-result {
  --tone-bg: var(--neutral-bg); --tone-fg: var(--neutral-fg); --tone: var(--neutral); --tone-line: var(--neutral-line);
  display: flex; align-items: center; justify-content: center; gap: var(--s-2); text-align: center;
  min-height: 72px; padding: var(--s-3) var(--s-4);
  border: 1px solid var(--tone-line); border-left: 4px solid var(--tone); border-radius: var(--r-lg);
  background: var(--tone-bg); color: var(--tone-fg);
  font-family: var(--font-title); font-weight: 600; font-size: var(--fs-md); line-height: 1.2;
  transition: background-color .12s, color .12s, border-color .12s;
  user-select: none;
}
.btn-result:hover { background: var(--tone); border-color: var(--tone); color: #fff; }
.btn-result:active { transform: translateY(1px); }
.btn-result.is-selected { background: var(--tone); border-color: var(--tone); color: #fff; box-shadow: 0 0 0 3px var(--tone-line); }
.btn-result:disabled, .btn-result.is-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-result__label { display: block; }
.btn-result__hint { display: block; margin-top: 2px; font-family: var(--font); font-weight: 500; font-size: var(--fs-xs); opacity: .85; }
.btn-result__text { display: flex; flex-direction: column; }

/* 7. Formulaires -----------------------------------------------------------
   field({label, name, type, value, hint, required}) construit .field complet. */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); }
.field__req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: var(--fs-sm); color: var(--muted); }
.field__error { font-size: var(--fs-sm); color: var(--danger); font-weight: 500; }
.field__error:empty { display: none; }
.field__control { position: relative; display: flex; align-items: stretch; gap: var(--s-2); }
.field__control > .input, .field__control > .select, .field__control > .textarea { flex: 1; min-width: 0; }
.input, .select, .textarea {
  width: 100%; min-height: var(--control-h); padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--card); color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: #9AA1AC; }
.input:hover, .select:hover, .textarea:hover { border-color: #BFC2BA; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft); outline: none; }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--muted-bg); color: var(--muted); cursor: not-allowed; }
.textarea { padding: var(--s-2) var(--s-3); min-height: 88px; line-height: 1.45; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6472' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input--lg, .select--lg { min-height: 48px; font-size: var(--fs-md); }
.input--sm, .select--sm { min-height: 28px; font-size: var(--fs-sm); padding-left: var(--s-2); }
.select--sm { padding-right: 28px; background-position: right 6px center; }
.input--mono { font-family: var(--font-mono); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field.has-error .input:focus, .field.has-error .select:focus, .field.has-error .textarea:focus { box-shadow: 0 0 0 3px var(--danger-bg); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field--span2 { grid-column: span 2; }
.field--full { grid-column: 1 / -1; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); margin: 0; background: var(--card); min-width: 0; }
.fieldset > legend, .fieldset__legend { padding: 0 var(--s-2); font-family: var(--font-title); font-weight: 600; font-size: var(--fs); color: var(--ink); }
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form-actions { display: flex; align-items: center; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-2); }
.form-actions--start { justify-content: flex-start; }

/* Case à cocher et bouton radio : toute la ligne est cliquable */
.check { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--control-h); padding: 0 var(--s-2); margin-left: calc(var(--s-2) * -1); border-radius: var(--r-sm); cursor: pointer; user-select: none; }
.check:hover { background: var(--hover); }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check--block { display: flex; }
.check.is-disabled { opacity: .5; cursor: not-allowed; }

/* Choix unique à gros boutons (oui / non / à qualifier, score de 1 à 5) */
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--card); overflow: hidden; }
.segmented__btn {
  min-height: calc(var(--control-h) - 2px); min-width: 44px; padding: 0 var(--s-3);
  border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--ink-2); font-weight: 500;
}
.segmented__btn:last-child { border-right: 0; }
.segmented__btn:hover { background: var(--hover); }
.segmented__btn.is-on { background: var(--accent); color: #fff; font-weight: 600; }
.segmented--block { display: flex; flex-wrap: nowrap; }
.segmented--block .segmented__btn { flex: 1; min-width: 0; padding: 0 var(--s-2); }
.segmented--lg .segmented__btn { min-height: 46px; font-size: var(--fs-md); padding: 0 var(--s-4); }
.input-affix { display: inline-flex; align-items: center; padding: 0 var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--muted-bg); color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }

/* 8. Puces de filtre -------------------------------------------------------
   filterBar({groups, search, onChange}) construit .filters complet. */
.filters { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.filters--inline { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: var(--s-4) var(--s-5); }
.filters__top { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.filter-group { display: flex; align-items: flex-start; gap: var(--s-3); min-width: 0; }
.filter-group__label { flex: none; width: 96px; padding-top: 7px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.filters--inline .filter-group { flex-direction: column; gap: var(--s-1); }
.filters--inline .filter-group__label { width: auto; padding-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--card); color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s; user-select: none;
}
.chip:hover { background: var(--hover); border-color: #BFC2BA; }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.is-on:hover { background: var(--accent-d); border-color: var(--accent-d); }
.chip__count { font-family: var(--font-mono); font-size: var(--fs-xs); opacity: .75; }
.chip--clear { border-style: dashed; color: var(--muted); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .icon { position: absolute; left: 10px; top: 50%; margin-top: -9px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 34px; padding-right: 34px; }
.search__clear { position: absolute; right: 4px; top: 50%; margin-top: -14px; width: 28px; height: 28px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.search__clear:hover { background: var(--hover); color: var(--ink); }

/* 9. Badges ----------------------------------------------------------------
   badge('Signé', 'success')   statusBadge('rappel')   resultBadge('repondeur') */
.badge {
  --tone-bg: var(--neutral-bg); --tone-fg: var(--neutral-fg); --tone: var(--neutral); --tone-line: var(--neutral-line);
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 22px; padding: 0 var(--s-2);
  border-radius: var(--r-sm); border: 1px solid var(--tone-line);
  background: var(--tone-bg); color: var(--tone-fg);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge--dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.badge--solid { background: var(--tone); border-color: var(--tone); color: #fff; }
.badge--lg { min-height: 28px; padding: 0 var(--s-3); font-size: var(--fs); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--muted-s)); flex: none; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--muted-bg); color: var(--ink-2); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; }
.count-pill.tone-danger, .count-pill.tone-warn, .count-pill.tone-success, .count-pill.tone-accent { background: var(--tone-bg); color: var(--tone-fg); }

/* 10. Cartes, chiffres clés, bandeaux --------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); min-height: 52px; }
.card__title { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-md); margin: 0; }
.card__sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.card__actions { display: flex; align-items: center; gap: var(--s-2); }
.card__body { padding: var(--s-4); }
.card__body--flush { padding: 0; }
.card__foot { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.card--pad { padding: var(--s-4); }
.card--click { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.card--click:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4); }
.kpi {
  --tone: var(--line-strong);
  display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-4); background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-top: 3px solid var(--tone); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  text-decoration: none; min-width: 0;
}
a.kpi:hover, button.kpi:hover { text-decoration: none; border-color: var(--tone-line, var(--accent-line)); border-top-color: var(--tone); box-shadow: var(--shadow-2); }
button.kpi { text-align: left; font: inherit; }
.kpi__label { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: var(--s-2); }
.kpi__value { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi[class*="tone-"] .kpi__value { color: var(--tone-fg); }
.kpi__hint { font-size: var(--fs-sm); color: var(--muted); }

.alert {
  --tone-bg: var(--info-bg); --tone-fg: var(--info-fg); --tone: var(--info); --tone-line: var(--info-line);
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border: 1px solid var(--tone-line); border-left: 4px solid var(--tone); border-radius: var(--r);
  background: var(--tone-bg); color: var(--tone-fg);
}
.alert__body { flex: 1; min-width: 0; }
.alert__title { font-weight: 600; }
.alert .icon { margin-top: 1px; }

/* 11. Tableaux denses --------------------------------------------------------
   dataTable({id, columns, fetch}) : pagination et tri côté serveur.
   .table-wrap défile et garde l'en-tête collé. tr.is-late = rappel en retard. */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; min-width: 0; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); min-height: 48px; }
.table-toolbar__info { color: var(--muted); font-size: var(--fs-sm); }
.table-toolbar__info strong { color: var(--ink); font-family: var(--font-mono); }
.table-wrap { overflow: auto; max-height: var(--table-max-h, calc(100vh - 250px)); min-height: 120px; scrollbar-width: thin; }
.table-wrap--free { max-height: none; min-height: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th, .table td { padding: 0 var(--s-3); height: 40px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th {
  position: sticky; top: 0; z-index: 2; height: 36px;
  background: #F4F4F1; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.wrap { white-space: normal; overflow-wrap: anywhere; padding-top: var(--s-2); padding-bottom: var(--s-2); }
.table td.num, .table th.num { text-align: right; }
.table td.center, .table th.center { text-align: center; }
.table td.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.table td.actions { text-align: right; overflow: visible; }
.table--compact th, .table--compact td { height: 32px; padding: 0 var(--s-2); }
.table--roomy td { height: 52px; }
.th-sort { display: inline-flex; align-items: center; gap: var(--s-1); height: 100%; min-height: 36px; margin: 0 calc(var(--s-3) * -1); padding: 0 var(--s-3); border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.th-sort:hover { color: var(--ink); background: #EAEAE6; }
.th-sort__arrow { width: 12px; height: 12px; opacity: .35; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
th.is-sorted { color: var(--ink); }
th.is-sorted .th-sort__arrow { opacity: 1; color: var(--accent); }
th.num .th-sort { flex-direction: row-reverse; }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover td { background: #F5F7FF; }
.table tbody tr.is-selected td { background: var(--soft); }
.table tbody tr.is-muted td { color: var(--muted); }
.table tbody tr.is-late td { background: #FFF5F5; }
.table tbody tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tbody tr.is-late.is-clickable:hover td { background: #FDE9E9; }
.table tbody tr.is-late .late-text, .late-text { color: var(--danger); font-weight: 600; }
.table tbody tr.is-today td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.table tbody.is-loading { opacity: .45; pointer-events: none; }
.table td.table__state { height: auto; padding: var(--s-5); white-space: normal; text-align: center; max-width: none; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.table-foot { border-top: 1px solid var(--line); padding: var(--s-2) var(--s-3); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.pagination__info { color: var(--muted); font-size: var(--fs-sm); }
.pagination__info strong { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.pagination__nav { display: flex; align-items: center; gap: var(--s-1); }
.pagination__page { padding: 0 var(--s-3); font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }
.pagination__page strong { font-family: var(--font-mono); }
.pagination__per { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--muted); }
.pagination__per .select { width: auto; }

/* 12. Onglets ---------------------------------------------------------------- */
.tabs { display: flex; flex-direction: column; min-width: 0; }
.tabs__list { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs__list::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-4); margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--hover); border-radius: var(--r) var(--r) 0 0; }
.tab.is-active { color: var(--accent-d); border-bottom-color: var(--accent); }
.tabs__panel { padding-top: var(--s-4); min-width: 0; }
.tabs--pills .tabs__list { border-bottom: 0; gap: var(--s-2); }
.tabs--pills .tab { min-height: 36px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); margin: 0; background: var(--card); }
.tabs--pills .tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* 13. Superpositions : modale, tiroir, popover, toasts ------------------------ */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: var(--s-5);
  background: rgba(10, 20, 34, .5);
  animation: fade-in .12s ease-out;
}
.overlay--drawer { justify-content: flex-end; padding: 0; }
.modal {
  display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100vh - 48px);
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
}
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 800px; }
.modal--xl { max-width: 1080px; }
.modal__head, .drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); }
.modal__title, .drawer__title { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-lg); margin: 0; min-width: 0; }
.modal__close, .drawer__close { width: 36px; height: 36px; flex: none; margin-right: calc(var(--s-2) * -1); border: 0; border-radius: var(--r); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.modal__close:hover, .drawer__close:hover { background: var(--hover); color: var(--ink); }
.modal__body, .drawer__body { padding: var(--s-5); overflow-y: auto; flex: 1; min-height: 0; }
.modal__foot, .drawer__foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); background: #FCFCFB; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal__foot:empty, .drawer__foot:empty { display: none; }
.modal__foot .left, .drawer__foot .left { margin-right: auto; }
.drawer {
  display: flex; flex-direction: column; width: 520px; max-width: 100vw; height: 100vh;
  background: var(--card); box-shadow: var(--shadow-3);
  animation: slide-in .16s ease-out;
}
.drawer--wide { width: 760px; }
.drawer__foot { border-radius: 0; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.popover-anchor { position: relative; display: inline-flex; }
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  min-width: 220px; max-height: 420px; overflow-y: auto; padding: var(--s-2);
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}
.popover--right { left: auto; right: 0; }
.popover__title { padding: var(--s-1) var(--s-2) var(--s-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.popover .check { display: flex; margin-left: 0; }
.popover__foot { border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-2); }
.menu-item { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 36px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-align: left; text-decoration: none; }
.menu-item:hover { background: var(--hover); text-decoration: none; }
.menu-item--danger { color: var(--danger); }

.toast-stack { position: fixed; left: 50%; bottom: var(--s-5); transform: translateX(-50%); z-index: 1200; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  --tone: var(--cyan);
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3);
  min-height: 52px; max-width: 640px; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  background: var(--navy); color: #fff; border-radius: var(--r-lg); border-left: 4px solid var(--tone); box-shadow: var(--shadow-3);
  animation: toast-in .14s ease-out;
}
.toast.tone-success { --tone: #34C56B; }
.toast.tone-danger { --tone: #F26363; }
.toast.tone-warn { --tone: #F5A524; }
.toast.tone-info { --tone: var(--cyan); }
.toast__msg { flex: 1; min-width: 0; font-weight: 500; padding: var(--s-1) 0; }
.toast__action { min-height: 36px; padding: 0 var(--s-4); border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--r); background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; white-space: nowrap; }
.toast__action:hover { background: #fff; color: var(--navy); border-color: #fff; }
.toast__close { width: 32px; height: 32px; flex: none; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--navy-text); display: inline-flex; align-items: center; justify-content: center; }
.toast__close:hover { background: var(--navy-2); color: #fff; }
.toast.is-leaving { opacity: 0; transition: opacity .15s; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 14. États : vide, chargement, squelettes ------------------------------------ */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s-2); padding: var(--s-7) var(--s-5); color: var(--muted); }
.empty--card { background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty--sm { padding: var(--s-5) var(--s-4); }
.empty__icon { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--muted-bg); color: var(--muted); margin-bottom: var(--s-2); }
.empty__title { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-md); color: var(--ink); }
.empty__text { max-width: 420px; }
.empty .btn { margin-top: var(--s-3); }
.spinner { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--muted); }
.spinner::before { content: ''; width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner--block { display: flex; justify-content: center; padding: var(--s-6); }
.skeleton { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, #ECEDE9 25%, #F5F5F2 45%, #ECEDE9 65%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton--line { height: 12px; margin: 6px 0; }
.skeleton--title { height: 20px; width: 40%; margin-bottom: var(--s-3); }
.skeleton--block { height: 120px; border-radius: var(--r-lg); }
.skeleton--kpi { height: 104px; border-radius: var(--r-lg); }
.skeleton--row { height: 16px; }
.skeleton-group { display: flex; flex-direction: column; gap: var(--s-2); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* 15. Chronologie -------------------------------------------------------------
   timeline(items) ou renderTimeline(root, données de GET /leads/{id}) */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline__item { --tone: var(--muted-s); --tone-bg: var(--muted-bg); --tone-fg: var(--muted-fg); position: relative; display: flex; gap: var(--s-3); padding: 0 0 var(--s-4) 0; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: relative; z-index: 1; width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tone-bg); color: var(--tone-fg); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--tone); }
.timeline__dot .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.timeline__content { flex: 1; min-width: 0; padding-top: 2px; }
.timeline__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.timeline__title { font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.timeline__when { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.timeline__meta { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.timeline__body { margin-top: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.timeline__item.is-cancelled .timeline__title, .timeline__item.is-cancelled .timeline__body { text-decoration: line-through; color: var(--muted); }
.timeline__day { position: relative; z-index: 1; display: inline-block; margin: 0 0 var(--s-3) 32px; padding: 2px var(--s-2); border-radius: var(--r-sm); background: var(--muted-bg); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.timeline--compact .timeline__item { padding-bottom: var(--s-3); }
.timeline--compact .timeline__body { padding: var(--s-1) var(--s-2); }

/* 16. Bloc téléphone géant, copiable d'un clic --------------------------------
   phoneBlock('0612345678', {label: 'Mobile'}) */
.phone-block {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); width: 100%;
  padding: var(--s-4) var(--s-5); border: 1px solid var(--accent-line); border-radius: var(--r-lg);
  background: var(--soft); color: var(--navy); text-align: left;
  transition: background-color .12s, border-color .12s;
}
.phone-block:hover { background: #DDE5FF; border-color: var(--accent); }
.phone-block__text { display: flex; flex-direction: column; min-width: 0; }
.phone-block__label { font-size: var(--fs-sm); font-weight: 600; color: var(--accent-d); letter-spacing: .04em; text-transform: uppercase; }
.phone-block__number { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-phone); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.phone-block__hint { display: inline-flex; align-items: center; gap: var(--s-2); flex: none; padding: var(--s-2) var(--s-3); border-radius: var(--r); background: var(--card); border: 1px solid var(--accent-line); color: var(--accent-d); font-weight: 600; font-size: var(--fs-sm); }
.phone-block.is-copied { background: var(--success-bg); border-color: var(--success); }
.phone-block.is-copied .phone-block__hint { color: var(--success-fg); border-color: var(--success-line); }
.phone-block--sm { padding: var(--s-2) var(--s-4); background: var(--card); border-color: var(--line-strong); }
.phone-block--sm:hover { background: var(--hover); border-color: #BFC2BA; }
.phone-block--sm .phone-block__number { font-size: 24px; }
.phone-block--sm .phone-block__label { color: var(--muted); }
.phone-block--sm .phone-block__hint { border: 0; background: transparent; padding: 0; color: var(--muted); }
.phone-block.is-empty { background: var(--muted-bg); border-color: var(--line-strong); color: var(--muted); cursor: default; }

/* 17. Barre de progression ---------------------------------------------------- */
.progress { --tone: var(--accent); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.progress__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); color: var(--muted); }
.progress__head strong { font-family: var(--font-mono); color: var(--ink); }
.progress__track { height: 8px; border-radius: var(--r-pill); background: #E9EAE6; overflow: hidden; }
.progress__bar { height: 100%; width: 0; border-radius: var(--r-pill); background: var(--tone); transition: width .25s ease-out; }
.progress--lg .progress__track { height: 12px; }

/* 18. Grille du tableau de bord ------------------------------------------------
   <div class="dash-grid"><section class="card col-8">…</section><section class="card col-4">…</section></div> */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-9 { grid-column: span 9; } .col-12 { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s-5); align-items: start; }
.split--wide { grid-template-columns: minmax(0, 1fr) 460px; }
.split__aside { position: sticky; top: var(--s-4); }

/* 19. Colonnes de pipeline ---------------------------------------------------- */
.pipeline { display: flex; gap: var(--s-3); align-items: flex-start; overflow-x: auto; padding-bottom: var(--s-3); }
.pipeline__col { --tone: var(--neutral); flex: 1 0 264px; max-width: 360px; display: flex; flex-direction: column; background: #F1F1EE; border: 1px solid var(--line); border-top: 3px solid var(--tone); border-radius: var(--r-lg); max-height: calc(100vh - 220px); }
.pipeline__head { padding: var(--s-3); display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pipeline__title { font-family: var(--font-title); font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.pipeline__sum { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pipeline__body { display: flex; flex-direction: column; gap: var(--s-2); padding: 0 var(--s-2) var(--s-2); overflow-y: auto; min-height: 64px; scrollbar-width: thin; }
.pipeline__card { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); text-align: left; color: var(--ink); text-decoration: none; }
button.pipeline__card, a.pipeline__card { cursor: pointer; font: inherit; }
button.pipeline__card:hover, a.pipeline__card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2); text-decoration: none; }
.pipeline__card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline__card-meta { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pipeline__card-amount { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.pipeline__empty { padding: var(--s-4) var(--s-2); text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* 20. Graphiques SVG (core/charts.js) ------------------------------------------ */
.chart { width: 100%; min-width: 0; }
.chart__svg { display: block; width: 100%; overflow: visible; }
.chart__empty { padding: var(--s-5); text-align: center; color: var(--muted); }
.ch-label { font-family: var(--font); font-size: 12px; fill: var(--ink-2); }
.ch-label--muted { fill: var(--muted); }
.ch-label--strong { font-weight: 600; fill: var(--ink); }
.ch-value { font-family: var(--font-mono); font-size: 12px; font-weight: 600; fill: var(--ink); }
.ch-value--in { fill: #fff; }
.ch-axis { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.ch-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ch-base { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ch-track { fill: #F1F1EE; }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { opacity: .1; stroke: none; }
.ch-point { stroke: var(--card); stroke-width: 2; }
.ch-hit { fill: transparent; }
.ch-hit:hover { fill: rgba(47, 91, 255, .06); }
.ch-bar { transition: opacity .12s; }
.ch-bar:hover { opacity: .8; }
.ch-t-accent  { fill: var(--accent);   stroke: var(--accent); }
.ch-t-info    { fill: #06B6D4;         stroke: #06B6D4; }
.ch-t-violet  { fill: var(--violet);   stroke: var(--violet); }
.ch-t-success { fill: #22A355;         stroke: #22A355; }
.ch-t-warn    { fill: #E59411;         stroke: #E59411; }
.ch-t-danger  { fill: #DC4545;         stroke: #DC4545; }
.ch-t-neutral { fill: #64748B;         stroke: #64748B; }
.ch-t-muted   { fill: #B6BBC4;         stroke: #B6BBC4; }
.ch-bar[class*="ch-t-"], .ch-point[class*="ch-t-"] { stroke: none; }
.ch-point[class*="ch-t-"] { stroke: var(--card); }
.ch-line[class*="ch-t-"] { fill: none; }
.ch-area[class*="ch-t-"] { stroke: none; }
.chart-spark { display: block; overflow: visible; }
.ch-heat-0 { fill: #F1F1EE; } .ch-heat-1 { fill: #DCE4FF; } .ch-heat-2 { fill: #B3C3FF; } .ch-heat-3 { fill: #7F98FF; } .ch-heat-4 { fill: #4B6DFF; } .ch-heat-5 { fill: #1E3FCC; }
.ch-heat-text { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-2); text-anchor: middle; pointer-events: none; }
.ch-heat-text--dark { fill: #fff; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-2); }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart-legend__swatch.ch-t-accent { background: var(--accent); } .chart-legend__swatch.ch-t-info { background: #06B6D4; }
.chart-legend__swatch.ch-t-violet { background: var(--violet); } .chart-legend__swatch.ch-t-success { background: #22A355; }
.chart-legend__swatch.ch-t-warn { background: #E59411; } .chart-legend__swatch.ch-t-danger { background: #DC4545; }
.chart-legend__swatch.ch-t-neutral { background: #64748B; } .chart-legend__swatch.ch-t-muted { background: #B6BBC4; }
.chart-legend__swatch.ch-heat-0 { background: #F1F1EE; } .chart-legend__swatch.ch-heat-1 { background: #DCE4FF; }
.chart-legend__swatch.ch-heat-2 { background: #B3C3FF; } .chart-legend__swatch.ch-heat-3 { background: #7F98FF; }
.chart-legend__swatch.ch-heat-4 { background: #4B6DFF; } .chart-legend__swatch.ch-heat-5 { background: #1E3FCC; }
.chart-legend--scale { gap: 3px; color: var(--muted); }
.chart-legend--scale .chart-legend__swatch { width: 20px; height: 12px; border-radius: 2px; }
.chart-legend--scale .chart-legend__end { margin: 0 var(--s-2); font-family: var(--font-mono); font-size: var(--fs-xs); }

/* 21. Fiche : paires libellé / valeur ------------------------------------------ */
.kv { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: var(--s-2) var(--s-4); margin: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-sm); padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv--2 { grid-template-columns: minmax(100px, 17%) minmax(0, 1fr) minmax(100px, 17%) minmax(0, 1fr); }
.copyable { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; font: inherit; text-align: left; }
.copyable:hover { background: var(--soft); color: var(--accent-d); }
.copyable .icon { opacity: .45; }
.copyable:hover .icon { opacity: 1; }
.script-box { padding: var(--s-4); background: #FFFDF5; border: 1px solid #EFE6C8; border-radius: var(--r-lg); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.6; }
.details { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.details + .details { margin-top: var(--s-2); }
.details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-4); font-weight: 600; user-select: none; }
.details > summary::-webkit-details-marker { display: none; }
.details > summary::after { content: ''; width: 8px; height: 8px; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -4px; transition: transform .12s; }
.details[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.details > summary:hover { background: var(--hover); border-radius: var(--r); }
.details__body { padding: 0 var(--s-4) var(--s-4); color: var(--ink-2); white-space: pre-wrap; }

/* 22. Tablette ------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .page-head { padding: var(--s-4) var(--s-5) var(--s-3); }
  .page-body { padding: 0 var(--s-5) var(--s-6); }
  .col-3 { grid-column: span 6; }
  .col-4, .col-5 { grid-column: span 6; }
  .col-7, .col-8, .col-9 { grid-column: 1 / -1; }
  .split, .split--wide { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-4); }
  .field-row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --fs-phone: 38px; }
}
@media (max-width: 900px) {
  .page-head { padding: var(--s-4); }
  .page-body { padding: 0 var(--s-4) var(--s-6); }
  .col-2, .col-3, .col-4, .col-5, .col-6 { grid-column: 1 / -1; }
  .split, .split--wide { grid-template-columns: minmax(0, 1fr); }
  .split__aside { position: static; }
  .field-row, .field-row--3, .field-row--4 { grid-template-columns: minmax(0, 1fr); }
  .field--span2 { grid-column: auto; }
  .kv--2 { grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); }
  .result-grid--3, .result-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-group { flex-direction: column; gap: var(--s-1); }
  .filter-group__label { width: auto; padding-top: 0; }
  .drawer, .drawer--wide { width: 100vw; }
  .phone-block__hint span { display: none; }
  :root { --fs-phone: 32px; }
}
@media (pointer: coarse) {
  :root { --control-h: 40px; }
  .chip { min-height: 36px; }
  .table th, .table td { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
