/*
 * DigiSales — Logiciel propriétaire d'Electroclass.
 * © 2026 Electroclass. Tous droits réservés.
 * Usage interne exclusif. Toute reproduction, distribution, modification ou
 * réutilisation, totale ou partielle, sans autorisation écrite préalable
 * d'Electroclass est strictement interdite.
 */

/* =========================================================
   ELECTROCLASS — Dashboard Commercial & Opérationnel
   Charte graphique : Dark mode digital
   Palette Slate 950 / Accent Cyan #38bdf8
   Typographie : Karbon (titres), Lato (corps), Inter (fallback)
   Radius : règle des 9px
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Surfaces */
  --bg-deep:        #020617;   /* Slate 950 — fond profond */
  --bg-surface:     #0f172a;   /* Slate 900 — cartes */
  --bg-elevation:   #1e293b;   /* Slate 800 — entêtes / hover */
  --bg-elevation-2: #273449;
  --bg-surface-2:   #131e36;   /* fin de dégradé des cartes/tuiles (kpi-card, chart-card) */
  --panel:          15, 23, 42;  /* triplet RVB des panneaux/bandeaux translucides : rgba(var(--panel), a) */
  --border:         #334155;   /* Slate 700 */
  --border-soft:    #1e293b;

  /* Textes */
  --text:           #f8fafc;
  --text-body:      #cbd5e1;
  --text-muted:     #94a3b8;
  --text-caption:   #64748b;

  /* Accents (charte Electroclass) */
  --primary:        #38bdf8;   /* Cyan 400 */
  --primary-deep:   #3b82f6;   /* Blue 500 */
  --primary-dark:   #0ea5e9;
  --corporate:      #162883;   /* Bleu corporate (print) */

  /* États */
  --success:        #4C9D42;
  --warning:        #F49819;
  --danger:         #ef4444;
  --info:           #38bdf8;

  /* Effets */
  --glow-soft:      0 0 15px rgba(56,189,248,0.25);
  --glow-strong:    0 0 30px rgba(6,182,212,0.4), 0 0 8px rgba(56,189,248,0.8);
  --shadow-card:    0 10px 20px rgba(0,0,0,0.3);
  --shadow-deep:    0 20px 50px rgba(0,0,0,0.5);

  /* Radius (règle des 9) */
  --r-sm:  4.5px;
  --r:     9px;
  --r-lg:  18px;

  /* Polices */
  --font-heading: 'Karbon', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Lato', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Accent du Pipeline (sous-onglets de Statut, barre Prévisions, totaux
     pondérés). Deux variables plutôt qu'une : `-txt` sert au TEXTE posé sur le
     fond de la page, où il faut un ton plus profond pour rester lisible ;
     `--pipe-accent` sert aux aplats, bordures et fonds teintés. En sombre les
     deux valent le turquoise d'origine (le user le trouve plus agréable) ; le
     thème clair les remplace par le bleu du logo DigiSales. */
  --pipe-accent:     #06b6d4;
  --pipe-accent-txt: #06b6d4;
}

/* =========================================================
   THÈME CLAIR — surcharge des variables (html[data-theme="light"]).
   Le mode sombre reste le défaut ; ce bloc ne s'applique que lorsque
   l'utilisateur bascule en clair via le bouton (choix mémorisé).
   ========================================================= */
:root[data-theme="light"] {
  /* Surfaces */
  --bg-deep:        #f1f5f9;   /* fond page */
  --bg-surface:     #ffffff;   /* cartes */
  --bg-elevation:   #e2e8f0;   /* entêtes / hover */
  --bg-elevation-2: #cbd5e1;
  --bg-surface-2:   #eef2f7;   /* fin de dégradé clair des cartes/tuiles */
  --panel:          226, 232, 240; /* panneaux/bandeaux translucides clairs (slate-200) */
  --border:         #cbd5e1;
  --border-soft:    #e2e8f0;

  /* Textes */
  --text:           #0f172a;
  --text-body:      #1e293b;
  --text-muted:     #475569;
  --text-caption:   #64748b;

  /* Accents — cyan plus profond pour un bon contraste sur fond clair */
  --primary:        #0284c7;
  --primary-deep:   #2563eb;
  --primary-dark:   #0369a1;

  /* Accent du Pipeline en thème clair = BLEU DU LOGO DigiSales (#0ea5e9, la
     teinte de départ du dégradé de l'icône) pour les aplats et bordures ; le
     texte prend le même bleu un cran plus profond (#0284c7, déjà `--primary`
     ici) car #0ea5e9 sur blanc tombe sous le seuil de lisibilité en petit corps. */
  --pipe-accent:     #0ea5e9;
  --pipe-accent-txt: #0284c7;

  /* Effets adoucis */
  --glow-soft:      0 0 0 1px rgba(2,132,199,0.10);
  --glow-strong:    0 6px 18px rgba(2,132,199,0.20);
  --shadow-card:    0 1px 3px rgba(var(--panel),0.10), 0 1px 2px rgba(var(--panel),0.06);
  --shadow-deep:    0 12px 30px rgba(var(--panel),0.16);
}
:root[data-theme="light"] body {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(56,189,248,0.08) 0%, rgba(241,245,249,0) 45%),
    radial-gradient(circle at 80% 100%, rgba(59,130,246,0.06) 0%, rgba(241,245,249,0) 50%),
    radial-gradient(circle at center, #ffffff 0%, #eef2f7 100%);
}
/* Logo Electroclass : tracés blancs -> sombres en mode clair (carrés cyan inchangés). */
:root[data-theme="light"] .brand-logo path[fill="#f8fafc"] { fill: #0f172a; }

/* --- Logo DigiSales : le carré du sommet suit le mot « Digi » (v2.418) ----------
   RÈGLE, valable dans les DEUX thèmes : le carré du SOMMET a la couleur du mot
   « Digi » et les 9 autres celle du mot « Sales » (bleu de marque #38bdf8, posé à
   plat dans le SVG, identique en clair et en sombre).
   « Digi » suit var(--text) : blanc en sombre, bleu nuit en clair. Le carré du
   sommet est donc `#f8fafc` dans le SVG et bascule ici, exactement comme la règle
   du logo Electroclass juste au-dessus.
   Historique : la v2.417 faisait l'INVERSE (9 carrés bleu nuit + sommet bleu), ce
   qui cassait la correspondance carré-du-haut/« Digi » visible en mode sombre.
   Plus aucun dégradé ni halo (retirés à la source : SVG + .digisales-logo/.accent),
   donc plus besoin de `filter: none` ni de surcharge sur « Sales » ici. */
:root[data-theme="light"] .digisales-logo rect[fill="#f8fafc"] { fill: #0f172a; }
/* En-tête : le dégradé est codé en dur (sombre) -> on l'éclaircit en mode clair. */
:root[data-theme="light"] .app-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(241,245,249,0.88) 100%);
}
/* Lignes « offre perdue » : fond eclairci par --panel -> on repasse le texte en sombre. */
:root[data-theme="light"] .data-table tbody tr.offre-perdue { color: var(--text-body); }

/* === Mode clair : pastilles statut / type / action / échéance / jauge ===
   En sombre, le texte est un pastel clair sur fond translucide ; sur fond clair il
   faut un texte plus FONCÉ (≈ teinte 700) pour rester lisible sur l'aplat coloré.
   On ne change que la couleur du texte. */
/* Statuts (badges génériques) */
:root[data-theme="light"] .badge.success     { color: #15803d; }
:root[data-theme="light"] .badge.danger      { color: #b91c1c; }
:root[data-theme="light"] .badge.warning     { color: #b45309; }
:root[data-theme="light"] .badge.violet      { color: #6d28d9; }
:root[data-theme="light"] .badge.sky         { color: #0369a1; }
:root[data-theme="light"] .badge.primary     { color: #1d4ed8; }
:root[data-theme="light"] .badge.negociation { color: #0f766e; }
:root[data-theme="light"] .badge.indigo      { color: #4338ca; }
:root[data-theme="light"] .badge.rose        { color: #be185d; }
:root[data-theme="light"] .badge.fuchsia     { color: #a21caf; }
:root[data-theme="light"] .badge.lime        { color: #4d7c0f; }
:root[data-theme="light"] .badge.emeraude    { color: #047857; }
:root[data-theme="light"] .badge.jaune       { color: #a16207; }
:root[data-theme="light"] .badge.ardoise     { color: #334155; }
/* Types machine / gammes (Cartes Trello, Vente Annuelle, Stockage / Classement) */
:root[data-theme="light"] .badge.gamme-distrib    { color: #1d4ed8; }
:root[data-theme="light"] .badge.gamme-stock      { color: #b45309; }
:root[data-theme="light"] .badge.gamme-classement { color: #15803d; }
:root[data-theme="light"] .badge.gamme-divers     { color: #334155; }
:root[data-theme="light"] .badge.gamme-info       { color: #6d28d9; }
/* Actions (Gestion des Leads) */
:root[data-theme="light"] .badge.action-attente     { color: #b45309; }
:root[data-theme="light"] .badge.action-plus        { color: #334155; }
:root[data-theme="light"] .badge.action-rappeler    { color: #b91c1c; }
:root[data-theme="light"] .badge.action-doc         { color: #0369a1; }
:root[data-theme="light"] .badge.action-faire-offre { color: #a16207; }
:root[data-theme="light"] .badge.action-offre       { color: #15803d; }
:root[data-theme="light"] .badge.action-rdv         { color: #0f766e; }
/* Échéances (Tâches) */
:root[data-theme="light"] .echeance-calme      { color: #15803d; }
:root[data-theme="light"] .echeance-proche     { color: #b45309; }
:root[data-theme="light"] .echeance-aujourdhui { color: #c2410c; }
:root[data-theme="light"] .echeance-retard     { color: #b91c1c; }
/* Sélecteur d'année (badges sous le nom) */
:root[data-theme="light"] .year-selector-btn .year-badge.is-current { color: #0369a1; }
:root[data-theme="light"] .year-selector-btn .year-badge.is-future  { color: #0f766e; }
:root[data-theme="light"] .year-selector-btn .year-badge.is-archive { color: #475569; }
/* Fraîcheur des données */
:root[data-theme="light"] .data-freshness.fresh   { color: #15803d; }
:root[data-theme="light"] .data-freshness.stale   { color: #b45309; }
:root[data-theme="light"] .data-freshness.missing { color: #b91c1c; }
/* Spotlights (tableau de bord Tâches) */
:root[data-theme="light"] .spotlight-retard .spotlight-number,
:root[data-theme="light"] .spotlight-retard .sl-tag  { color: #b91c1c; }
:root[data-theme="light"] .spotlight-today .spotlight-number,
:root[data-theme="light"] .spotlight-today .sl-tag   { color: #c2410c; }
:root[data-theme="light"] .spotlight-semaine .spotlight-number,
:root[data-theme="light"] .spotlight-semaine .sl-tag { color: #0369a1; }
:root[data-theme="light"] .spotlight-card.is-empty .spotlight-number { color: #15803d; }
/* Jauges (pourcentage central) */
:root[data-theme="light"] .gauge-text.gauge-ok      .gauge-percent { color: #15803d; }
:root[data-theme="light"] .gauge-text.gauge-warning .gauge-percent { color: #b45309; }
:root[data-theme="light"] .gauge-text.gauge-danger  .gauge-percent { color: #b91c1c; }
:root[data-theme="light"] .gauge-text.gauge-blue    .gauge-percent { color: #1d4ed8; }
:root[data-theme="light"] .gauge-text.gauge-blue    .gauge-value   { color: var(--text); }
/* Cellules éditables vides : le texte indicatif (« Montant… », « Cliquez pour écrire… »)
   était trop pâle sur les lignes blanches (opacity 0.6 héritée) -> lisible en mode clair. */
:root[data-theme="light"] .cell-edit-text:empty::before { color: #64748b; opacity: 1; }

/* --- Bouton de bascule de thème (soleil / lune) --- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: var(--bg-elevation); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r);
  cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ic-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }

/* --- Bascule de densité d'affichage (Complet / Compact) --- */
.view-toggle {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  background: var(--bg-elevation); border: 1px solid var(--border);
  border-radius: var(--r);
}
.view-toggle .vt-opt {
  appearance: none; cursor: pointer; border: 0; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: calc(var(--r) - 2px); white-space: nowrap;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.view-toggle .vt-opt:hover { color: var(--text); }
.view-toggle .vt-opt.is-active {
  background: var(--bg-surface); color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

/* --- Menu « Affichage » : regroupe densité + couleurs + thème sous une icône --- */
.appearance-menu { position: relative; display: inline-flex; }
.appearance-panel { min-width: 250px; }
.appearance-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 6px 8px; border-radius: 6px;
}
.appearance-row + .appearance-row { border-top: 1px solid var(--border-soft); }
.appearance-label { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
/* Dans le menu, le bouton de thème redevient une simple bascule alignée à droite. */
.appearance-row .theme-toggle { width: 34px; height: 30px; }

/* Pipeline — sous-onglets par statut : pilules modernes, charte Electroclass
   (cyan --primary + glow sur l'actif), adaptées thème sombre ET clair via les
   variables. Compteur en chip intégré. */
.pipeline-statut-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 16px;
  align-items: center;
}
/* Bascule des sous-onglets de Statut : bouton dans la BARRE D'OUTILS
   (#pipeline-statut-btn) qui affiche le filtre actif + compteur ; la ligne de puces
   #pipeline-statut-tabs s'affiche/se masque en dessous (attribut hidden).
   Style .pipe-stab (turquoise de la charte, .chip-count natif) — hors du sélecteur
   i18n .btn-action qui réécrit innerHTML. Taille alignée sur les .btn de la barre. */
/* Double classe (.pipe-stab.pipe-statut-btn) pour battre en spécificité la règle
   `.pipe-stab { padding:7px 14px; font-size:12px }` définie plus bas (sinon, à
   spécificité égale, la dernière l'emportait → bouton Statut plus court que Créer/Vue).
   Les PUCES de sous-onglets (.pipe-stab sans .pipe-statut-btn) gardent leur petite taille. */
.pipe-stab.pipe-statut-btn { padding: 5px 16px; font-size: 13px; font-family: var(--font-body); }
/* La pastille compteur a une hauteur fixe (18px) pensée pour les PUCES de sous-onglets ;
   dans le bouton Statut de la barre elle dépassait la ligne de texte et rendait le bouton
   plus HAUT que Créer/Vue. Ici on la laisse épouser la ligne (hauteur auto) → même hauteur. */
.pipe-stab.pipe-statut-btn .chip-count { height: auto; min-width: auto; padding: 0 7px; line-height: 1; }
.pipe-statut-btn .pipe-statut-active { display: inline-flex; align-items: center; gap: 8px; }
.pipe-statut-btn .pst-caret { opacity: 0.75; transition: transform .18s ease; }
.pipe-statut-btn.is-open .pst-caret { transform: rotate(180deg); }
/* Bascule du bloc statistiques du Pipeline (bouton « Stats »). Replié : la classe
   pipe-stats-off (sur #panel-pipeline) masque jauges + tuiles + graphiques → gain de
   place « tableau d'abord ». Caret vers le haut quand affiché (is-open). Le bouton
   disparaît si le mode « Compact » global est déjà actif (stats deja masquées). */
.pipe-stats-btn .pst-caret { opacity: 0.75; transition: transform .18s ease; }
.pipe-stats-btn.is-open .pst-caret { transform: rotate(180deg); }
#panel-pipeline.pipe-stats-off #pipeline-gauges,
#panel-pipeline.pipe-stats-off #pipeline-kpis,
#panel-pipeline.pipe-stats-off #pipeline-charts { display: none; }
html.vue-compacte #pipeline-stats-btn { display: none; }
/* Barre « Prévisions » (filtre inline du tableau) : choix du critère + résumé + export. */
.pipeline-previsions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--pipe-accent) 30%, var(--border-soft));
  border-radius: 10px;
  background: color-mix(in srgb, var(--pipe-accent) 6%, var(--bg-surface));
}
#pipeline-previsions-btn.is-active {
  color: var(--pipe-accent-txt);
  border-color: var(--pipe-accent);
  background: color-mix(in srgb, var(--pipe-accent) 14%, var(--bg-surface));
}
/* Prévisions — totaux de l'extraction.
   Trois rendus des MÊMES chiffres : la ligne de la barre (ci-dessus), ce bandeau de
   tuiles (bascule « ▦ Tuiles ») et le pied du tableau. Les valeurs pondérées portent
   l'accent du Pipeline pour se distinguer d'un coup d'œil des montants bruts. */
.pipeline-prev-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: -6px 0 12px;
}
.prev-tile {
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--pipe-accent) 22%, var(--border-soft));
  border-radius: 10px;
  background: color-mix(in srgb, var(--pipe-accent) 4%, var(--bg-surface));
}
.prev-tile-lbl { font-size: 11px; color: var(--text-muted); letter-spacing: 0.2px; }
.prev-tile-val { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--text-body); }
.prev-tile.is-pond .prev-tile-val { color: var(--pipe-accent-txt); }
/* Mêmes valeurs pondérées quand les totaux sont affichés SUR LA LIGNE de la barre
   (bascule « Ligne ») : même accent que les tuiles, pour qu'on les distingue des
   montants bruts quel que soit l'affichage choisi. */
.pipeline-previsions-bar .prev-pond { color: var(--pipe-accent-txt); }
/* Pied de tableau : sous-total sous les colonnes, COLLÉ en bas de la zone de
   défilement (même principe que l'en-tête collant), donc toujours lisible sans
   dérouler jusqu'au bout. */
#table-pipeline tfoot tr.pipe-foot-total td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 4px 10px;
  border-top: 2px solid color-mix(in srgb, var(--pipe-accent) 45%, var(--border-soft));
  background: color-mix(in srgb, var(--pipe-accent) 8%, var(--bg-surface));
  white-space: nowrap;
  line-height: 1.2;
}
#table-pipeline tfoot .pf-num { text-align: right; }
#table-pipeline tfoot .pf-lbl { font-weight: 700; color: var(--text-body); }
#table-pipeline tfoot .pf-main { font-weight: 700; color: var(--text-body); }
#table-pipeline tfoot .pf-sub { font-size: 11px; font-weight: 600; color: var(--pipe-accent-txt); }
@media (max-width: 640px) {
  .pipeline-prev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prev-tile-val { font-size: 17px; }
}

/* Sous-onglets de Statut du Pipeline et critères de la barre Prévisions : accent
   `--pipe-accent` — turquoise de la charte Electroclass (#06b6d4) en thème sombre,
   bleu du logo DigiSales (#0ea5e9) en thème clair. */
.pipe-stab {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  --pipe-turq: var(--pipe-accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  /* Forme rectangulaire (comme les boutons « Créer », etc.) plutôt qu'en pilule. */
  border-radius: var(--r);
  color: var(--pipe-accent-txt);
  background: var(--bg-surface);
  border: 1px solid color-mix(in srgb, var(--pipe-turq) 38%, var(--border-soft));
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.pipe-stab:hover {
  color: var(--pipe-accent-txt);
  border-color: var(--pipe-turq);
}
.pipe-stab.is-active {
  color: #fff;
  border-color: var(--pipe-turq);
  background: var(--pipe-turq);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pipe-turq) 40%, transparent),
              0 3px 14px -5px color-mix(in srgb, var(--pipe-turq) 60%, transparent);
}
.pipe-stab .chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: color-mix(in srgb, var(--pipe-turq) 18%, transparent);
  color: var(--pipe-turq);
}
.pipe-stab.is-active .chip-count {
  background: color-mix(in srgb, #fff 30%, transparent);
  color: #fff;
}

/* Pipeline — en-têtes de colonnes réordonnables par glisser-déposer. */
#table-pipeline thead th[draggable="true"] { cursor: grab; user-select: none; }
#table-pipeline thead th[draggable="true"]:active { cursor: grabbing; }

/* Pipeline / Tâches — la poignée de redimensionnement (.col-resizer, position:absolute)
   a besoin d'un en-tête « positionné » comme référence. On utilise `sticky` (et NON
   `relative`) : `sticky` sert AUSSI de bloc conteneur pour l'absolu ET fige l'en-tête
   verticalement (top:0). `relative` cassait le figement vertical des en-têtes. */
#table-pipeline thead th:not(.col-frozen),
#table-taches thead th:not(.col-frozen) { position: sticky; top: 0; }
#table-pipeline .col-resizer,
#table-taches .col-resizer {
  position: absolute; top: 0; right: 0; width: 7px; height: 100%;
  cursor: col-resize; user-select: none; touch-action: none; z-index: 4;
}
#table-pipeline .col-resizer::after,
#table-taches .col-resizer::after {
  content: ""; position: absolute; top: 20%; bottom: 20%; right: 2px; width: 2px;
  border-radius: 2px; background: var(--border); opacity: 0; transition: opacity 0.15s;
}
#table-pipeline .col-resizer:hover::after,
#table-pipeline .col-resizer:active::after,
#table-taches .col-resizer:hover::after,
#table-taches .col-resizer:active::after { opacity: 1; background: var(--primary); }
/* Mise en page fixe quand des largeurs sont définies : les largeurs d'en-tête font
   foi ; le contenu qui dépasse est masqué (élargir la colonne le révèle). */
#table-pipeline.pipe-table-fixed,
#table-taches.pipe-table-fixed { table-layout: fixed; }
#table-pipeline.pipe-table-fixed th,
#table-pipeline.pipe-table-fixed td,
#table-taches.pipe-table-fixed th,
#table-taches.pipe-table-fixed td { overflow: hidden; }
/* Pagination (perf) : « Afficher plus » en pied de tableau, rendu comme une BANDE
   PLEINE LARGEUR (repli visible du chargement automatique au défilement) — plus
   découvrable qu'un petit bouton centré. La cellule ne colle pas à une colonne :
   padding 0 + overflow visible (sinon table-layout:fixed la clipperait). */
#table-pipeline tr.pipe-loadmore-row td { padding: 0; overflow: visible; background: transparent; }
#table-pipeline tr.pipe-loadmore-row:hover td { background: transparent; }

/* Virtualisation du Pipeline (Vague 3 phase 2e, mode ?vlist=1). Lignes a UNE
   ligne de texte (hauteur uniforme -> calcul d'index de bande trivial) : le
   contenu long est coupe avec des points de suspension ; la borne max-width
   donne une largeur de reference aux colonnes auto (sans elle, nowrap les
   etirerait a la longueur du plus long contenu). Les espaceurs haut/bas
   simulent la hauteur des lignes non materialisees (~60 <tr> reels). */
#table-pipeline.pipe-virtual td { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 300px; }
#table-pipeline tr.pipe-vspace td { padding: 0 !important; border: 0 !important; background: transparent !important; }
#table-pipeline tr.pipe-vspace:hover td { background: transparent !important; }
.pipe-loadmore-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; box-sizing: border-box; padding: 11px 14px;
  border: none; border-top: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  color: var(--primary); font: 600 13px var(--font-body, inherit); cursor: pointer;
  transition: background .12s;
}
.pipe-loadmore-btn:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.pipe-loadmore-more { font-weight: 700; }
.pipe-loadmore-count { font-size: 12px; font-weight: 500; opacity: .7; }
/* Deux boutons de réinitialisation (Ordre / Largeurs) dans le panneau Colonnes. */
.pipe-col-resets { display: inline-flex; gap: 6px; }

/* Pipeline — panneau « Colonnes » (cases à cocher afficher/masquer), thème-aware. */
/* Le bouton « ⚙ Colonnes » ancre son menu : le panneau flotte PAR-DESSUS le
   tableau (positionné en absolu sous le bouton), au lieu de pousser le contenu. */
.pipe-col-anchor { position: relative; display: inline-flex; }
#pipeline-col-panel,
#taches-col-panel {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 100;
}
/* Pipeline : bouton à droite de la barre → panneau ancré à droite (s'ouvre vers la gauche). */
#pipeline-col-panel { right: 0; }
/* Tâches : bouton à gauche de la barre → panneau ancré à gauche (s'ouvre vers la droite,
   reste à l'écran au lieu de déborder hors cadre à gauche). */
#taches-col-panel { left: 0; }
.pipe-col-menu {
  display: inline-block;
  min-width: 264px;
  max-width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, .65);
}
.pipe-col-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pipe-col-menu-title {
  font-weight: 700; font-size: 12px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--primary);
}
.pipe-col-reset {
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border-soft));
  background: transparent; color: var(--text-caption);
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.pipe-col-reset:hover { color: var(--primary); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
/* Croix de fermeture du menu « Colonnes » (Pipeline et Tâches). Détachée des
   pastilles « ↺ » par une marge : c'est une action de fenêtre, pas un réglage de
   colonnes — on ne doit pas la cliquer par erreur en visant « Ordre ». */
.pipe-col-close {
  margin-left: 4px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft); border-radius: 6px;
  background: transparent; color: var(--text-caption);
  font-size: 13px; line-height: 1; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.pipe-col-close:hover { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pipe-col-menu-sub { margin: 4px 0 12px; font-size: 11px; color: var(--text-caption); }
.pipe-col-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 56vh; overflow-y: auto; }
.pipe-col-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 10px;
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s;
}
.pipe-col-item:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.pipe-col-item.is-hidden { opacity: .55; }
.pipe-col-item.dragging { opacity: .4; }
.pipe-col-item.drag-over { border-color: transparent; box-shadow: inset 0 3px 0 -1px var(--pipe-turq); }
.pipe-col-grip { display: inline-flex; color: var(--text-caption); cursor: grab; flex: 0 0 auto; }
.pipe-col-grip:active { cursor: grabbing; }
.pipe-col-item:hover .pipe-col-grip { color: var(--pipe-turq); }
.pipe-col-check { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; cursor: pointer; font-size: 13px; color: var(--text-body); }
.pipe-col-check input { cursor: pointer; accent-color: var(--primary); width: 15px; height: 15px; flex: 0 0 auto; }
.pipe-col-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vue compacte : masque l'en-tête visuel (jauges + tuiles KPI + mini-graphes +
   spotlight) des onglets de travail. L'onglet Tableau de Bord (#panel-analyses)
   est épargné car il EST, par nature, fait de ces éléments. */
html.vue-compacte .tab-panel:not(#panel-analyses) [id^="gauge-"],
/* Pipeline : conteneur de jauges + donut (id « pipeline-gauges », sans classe
   « gauge- » → non capté par le sélecteur ci-dessus). */
html.vue-compacte .tab-panel:not(#panel-analyses) #pipeline-gauges,
html.vue-compacte .tab-panel:not(#panel-analyses) .kpi-row,
html.vue-compacte .tab-panel:not(#panel-analyses) .charts-row,
html.vue-compacte .tab-panel:not(#panel-analyses) .spotlight-row,
/* Trimestres T1-T4 : jauge Prime sur Marge + tuile Suivi des Paiements (toutes deux
   dans .trimestre-gauge-row). Total Annuel épargné (vue de synthèse). */
html.vue-compacte .tab-panel:not(#panel-analyses) .trimestre-gauge-row:not(#trim-gauge-total) {
  display: none !important;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(56,189,248,0.07) 0%, rgba(2,6,23,0) 45%),
    radial-gradient(circle at 80% 100%, rgba(59,130,246,0.06) 0%, rgba(2,6,23,0) 50%),
    radial-gradient(circle at center, #0a1224 0%, #020617 100%);
  background-attachment: fixed;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-elevation); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-elevation-2); }

/* ====================== HEADER ====================== */
.app-header {
  background: linear-gradient(180deg, rgba(2,6,23,0.95) 0%, rgba(var(--panel),0.85) 100%);
  border-bottom: 1px solid var(--border-soft);
  /* Hauteur réduite (v2.416) : padding VERTICAL 18 -> 8px => bandeau 75 -> 55px, à
     TAILLE DE LOGOS INCHANGÉE (.brand-logo 36px, .digisales-logo 40px). Plancher =
     le bloc DigiSales (40px, en position absolue) : ne pas descendre sous ~50px sans
     réduire les logos. ⚠ `.tabs { top }` DOIT suivre cette hauteur (voir ce sélecteur). */
  padding: 8px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-text {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Centrage EXACT (v2.416). L'ancien décalage `- 6px` compensait le sous-titre
     « By ClaudeChris » affiché sous le wordmark ; ce sous-titre a été RETIRÉ (v2.265),
     le décalage était donc devenu obsolète et déséquilibrait le bloc (mesuré : 11px de
     marge en haut contre 24px en bas). Sans lui, le bloc est vraiment centré — ce qui
     est indispensable maintenant que le bandeau est plus court (55px). */
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.brand-text .subtitle {
  text-align: center;
  margin-top: 1px;
  font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: none;
  background: linear-gradient(90deg, #ff8a00 0%, #ff5e3a 50%, #ffb347 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 18px rgba(255,138,0,0.55);
  filter: drop-shadow(0 0 6px rgba(255,94,58,0.35));
}
.brand-logo {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(56,189,248,0.35));
}
/* Ligne titre centrée : icône DigiSales accolée à gauche du nom "DigiSales" */
.brand-title-row {
  display: flex;
  align-items: flex-start;   /* le logo s'aligne sur la ligne "DigiSales", pas sur le bloc entier */
  justify-content: center;
  gap: 10px;
}
/* Wordmark "Digi" + "Sales" sur une ligne. La pastille version est hors flux, à
   droite de "Sales", avec son BAS aligné sur le bas du logo/wordmark "DigiSales"
   (logo et wordmark font ~40px, alignés en haut dans .brand-title-row). */
.brand-wordmark {
  display: flex;
  align-items: flex-start;
}
.brand-sales-wrap {
  position: relative;
}
.brand-sales-wrap .app-version {
  position: absolute;
  left: 100%;
  bottom: 0;            /* bas de la pastille = bas de "Sales" = bas du logo */
  margin-left: 12px;
  white-space: nowrap;
  z-index: 20;          /* au-dessus du fond du header pour rester cliquable */
  pointer-events: auto; /* garantit le clic même si un parent le neutralise */
}
.digisales-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  /* Halo retiré (v2.418) : logo entièrement PLAT dans les deux thèmes. Sur fond clair
     il délavait les contours ; sur fond sombre il faisait doublon avec le bleu vif. */
}
.brand-text h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  color: var(--text);
}
/* Mot « Sales » (v2.418) : à PLAT, dans le bleu de marque — le MÊME que les carrés du
   logo, en clair comme en sombre. Remplace le dégradé `background-clip: text` + halo
   (pensés pour un fond sombre) qui le rendaient délavé sur blanc. « Digi » (.brand-digi)
   n'a pas de règle propre : il suit var(--text), donc blanc en sombre / bleu nuit en clair. */
.brand-text h1 .accent {
  color: #38bdf8;
}
.data-freshness {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevation);
  border: 1px solid var(--border);
  border-radius: var(--r);
  white-space: nowrap;
  line-height: 1.2;
}
.data-freshness.fresh    { color: #86d175; border-color: rgba(76,157,66,0.4); background: rgba(76,157,66,0.10); }
.data-freshness.stale    { color: #fbbf3a; border-color: rgba(244,152,25,0.4); background: rgba(244,152,25,0.10); }
.data-freshness.missing  { color: #f87171; border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.10); }

/* Version : petite pastille (entourage conservé) à droite de "By ClaudeChris" */
.brand-text .app-version {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary);
  -webkit-text-fill-color: var(--primary); /* annule le dégradé orange du sous-titre */
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 999px;
  vertical-align: middle;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(56,189,248,0.15);
}
.brand-text .subtitle {
  color: var(--text-muted);
}
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ====================== TABS ====================== */
.tabs {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  /* ⚠ COUPLÉ à la hauteur de `.app-header` : on colle 3px SOUS son bord bas (léger
     chevauchement volontaire — cf. le calcul de `--pipe-chrome` dans DigiSales.html).
     En-tête 55px (v2.416, était 75) -> 52px (était 72). Toute modification du padding
     vertical de .app-header doit mettre cette valeur à jour, sinon : valeur trop grande
     = interstice où les lignes défilent ; trop petite = onglets masqués sous l'en-tête. */
  top: 52px;
  z-index: 49;
  backdrop-filter: blur(12px);
}
.tabs-list { display: flex; overflow-x: auto; flex: 1 1 auto; min-width: 0; }
.tabs-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 0;   /* réduit la hauteur du bandeau des onglets */
  flex-shrink: 0;
}

/* Chip d'identification de session (a droite des onglets) : conteneur neutre,
   layout HORIZONTAL — sélecteur d'année + pastille utilisateur (+ filtre « Voir »)
   sur UNE SEULE ligne, pour réduire la hauteur du bandeau des onglets. */
.session-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;     /* les pilules (année / nom / filtre) alignées sur une ligne */
  flex-wrap: wrap;         /* si l'espace manque (petits écrans), on passe à la ligne au lieu de déborder */
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding: 2px 0;
  font-family: var(--font-heading);
  position: relative;      /* ancre du dropdown du menu utilisateur (mode API) */
}

/* Sous-bouton "utilisateur connecte" : declenche le prompt de modification du nom. */
.session-chip .session-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 16px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-body);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  user-select: none;
}
.session-chip .session-user:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.40);
}
.session-chip .session-icon {
  display: inline-flex;
  align-items: center;
  color: var(--primary);  /* SVG fill="currentColor" -> cyan */
  line-height: 1;
}
.session-chip .session-icon svg { display: block; }
.session-chip .session-name { font-weight: 600; letter-spacing: 0.2px; }

/* Selecteur d'annee (meme ligne que le nom) : meme philosophie pill, plus compact */
.session-chip .year-selector-btn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 16px;
  gap: 6px;
}
.session-chip .year-selector-btn .year-icon  { font-size: 13px; }
.session-chip .year-selector-btn .year-badge { font-size: 9px; padding: 1px 5px; }

@media (max-width: 900px) {
  .session-chip { gap: 3px; }
  .session-chip .session-user { font-size: 11px; padding: 3px 10px; gap: 6px; }
  .session-chip .year-selector-btn { font-size: 11px; padding: 3px 10px; }
}

/* Rangée du bas de la chip session : filtre « Voir » (mode API, rôles viewAll)
   aligné sur la MÊME ligne que la pastille utilisateur. */
.session-chip .session-user-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Filtre « Voir : par commercial » (rôles viewAll, mode API — api-mode-writes.js).
   Pilule pleine turquoise→cyan (charte Electroclass : cyan-500 #06b6d4 / accent
   #38bdf8) : contrairement aux pastilles translucides voisines, elle doit SAUTER
   AUX YEUX de la direction/admin. Texte slate 950 pour le contraste (les deux
   thèmes gardent la même pilule, le dégradé reste lisible sur clair et sombre). */
.owner-filter { position: relative; }
.owner-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  border: 1px solid rgba(103, 232, 249, 0.55);   /* cyan-300 */
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #020617;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
  transition: box-shadow 0.15s, filter 0.15s;
  user-select: none;
}
.owner-filter-btn:hover { filter: brightness(1.08); box-shadow: 0 0 18px rgba(6, 182, 212, 0.50); }
.owner-filter-btn .of-value { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.owner-filter-btn .of-caret { font-size: 10px; opacity: 0.75; }

/* Menu du filtre : même langage que les menus Outils/compte (fond thème, coins
   10px, ombre profonde, items .tools-menu-item avec survol cyan). */
.owner-filter-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.owner-filter-dropdown .ofd-header {
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px 6px;
}
.owner-filter-dropdown .tools-menu-item.active {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--primary);
  font-weight: 700;
}
@media (max-width: 900px) {
  .session-chip .session-user-row { gap: 6px; }
  .owner-filter-btn { font-size: 11px; padding: 3px 10px; }
  .owner-filter-btn .of-value { max-width: 110px; }
}
/* Onglet Tâches masqué (réglage « Affichage » par commercial, cf. DigiOngletTaches). */
html.masquer-onglet-taches nav.tabs .tab[data-tab="taches"] { display: none; }
.tab {
  background: transparent;
  border: none;
  padding: 8px 12px;   /* onglets compactés : padding horizontal réduit 20→12 px (vertical 8px inchangé) — moins d'espace perdu autour du nom */
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;   /* espacement des lettres resserré (était 0.5px) : noms d'onglets plus compacts */
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(56,189,248,0.35);
  text-shadow: 0 0 12px rgba(56,189,248,0.4);
}

/* Icônes SVG des onglets / sous-onglets : monochrome au trait (couleur = texte via
   currentColor → theme-aware, hérite du survol/actif). Taille fixe, alignées au texte.
   Onglets/sous-onglets restent en `inline` (pas flex) pour ne pas casser le
   « 1ᵉʳ Trimestre » (<sup>) : on aligne l'icône via vertical-align. */
.tab .tab-ic,
.subtab .tab-ic {
  width: 16px; height: 16px;
  vertical-align: -0.18em;
  margin-right: 5px;   /* espace icône↔texte resserré (était 7px) */
}
.subtab .tab-ic { width: 15px; height: 15px; margin-right: 6px; }

/* ====================== SHEET SELECTOR ====================== */
.sheet-selector {
  background: linear-gradient(160deg, rgba(244,152,25,0.08), rgba(244,152,25,0.02));
  border-bottom: 1px solid rgba(244,152,25,0.3);
  padding: 14px 28px;
}
.sheet-selector h3 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--warning);
}
.mapping-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.mapping-row label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  gap: 4px;
}
.mapping-row select {
  padding: 8px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--r);
  min-width: 180px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}
.mapping-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }

/* ====================== MAIN ====================== */
main { padding: 10px 28px 24px; }   /* espace tabs↔barre d'outils = espace barre↔sous-onglets (~14px) */
.tab-panel { display: none; animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ====================== SÉLECTEUR D'ANNÉE (header) ====================== */
.year-selector { position: relative; }
.year-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(var(--panel), 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.18s ease;
}
.year-selector-btn:hover {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.10);
}
.year-selector-btn .year-icon { font-size: 14px; }
.year-selector-btn .year-label { font-weight: 600; }
.year-selector-btn .year-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.year-selector-btn .year-badge.is-current {
  background: rgba(56, 189, 248, 0.22);   /* Cyan 400 brand Electroclass */
  color: #7dd3fc;                          /* Cyan 300 (plus clair sur fond sombre) */
  border: 1px solid rgba(56, 189, 248, 0.50);
}
.year-selector-btn .year-badge.is-archive {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.year-selector-btn .year-badge.is-future {
  background: rgba(20, 184, 166, 0.20);   /* teal = année à venir, modifiable */
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.50);
}
.year-selector-btn .year-caret {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: 2px;
}
.year-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
}
.year-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-body);
  transition: background 0.12s;
}
.year-menu-item:hover { background: rgba(56, 189, 248, 0.10); }
.year-menu-item.is-active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--primary);
}
.year-menu-item .ymi-year { font-weight: 700; font-size: 14px; }
.year-menu-item .ymi-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
}
.year-menu-item .ymi-badge.is-current { background: rgba(56, 189, 248, 0.22); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.50); }
.year-menu-item .ymi-badge.is-future  { background: rgba(20, 184, 166, 0.20); color: #5eead4; border: 1px solid rgba(20, 184, 166, 0.50); }
.year-menu-item .ymi-badge.is-archive { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.year-menu-separator { height: 1px; background: var(--border-soft); margin: 6px 4px; }
.year-menu-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--text-body);
  cursor: pointer;
  text-align: left;
  margin-top: 4px;
}
.year-menu-action:hover { background: rgba(56, 189, 248, 0.10); border-color: var(--primary); }

/* ====================== BANDEAU LECTURE SEULE ARCHIVE ====================== */
.read-only-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, rgba(244, 152, 25, 0.18), rgba(244, 152, 25, 0.06));
  border-bottom: 1px solid rgba(244, 152, 25, 0.35);
  padding: 10px 28px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: #fbbf24;
  letter-spacing: 0.5px;
}
.read-only-banner.hidden { display: none; }
.read-only-banner .rob-icon { font-size: 18px; }
.read-only-banner .rob-text { flex: 1; }
.read-only-banner .rob-back {
  background: rgba(244, 152, 25, 0.18);
  border: 1px solid rgba(244, 152, 25, 0.4);
  border-radius: 6px;
  padding: 6px 12px;
  color: #fde68a;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.read-only-banner .rob-back:hover { background: rgba(244, 152, 25, 0.28); }

/* En mode archive, on grise les boutons d'écriture et on bloque les inputs.
   La classe .archive-mode est posée sur <body> par app.js. */
body.archive-mode .btn-action,
body.archive-mode #btnUpdate,
body.archive-mode #btnNouvelleTache {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.5);
}
body.archive-mode [contenteditable="true"] {
  pointer-events: none;
  background: rgba(148, 163, 184, 0.05) !important;
  color: var(--text-muted);
}
body.archive-mode input.payment-date,
body.archive-mode input.payment-montant {
  pointer-events: none;
  opacity: 0.6;
}

/* ====================== MODAL Paramètres de l'année ====================== */
.year-config-fieldset {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.year-config-fieldset legend {
  padding: 0 8px;
  font-family: var(--font-heading);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
}
.year-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.year-config-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.year-config-grid input {
  background: rgba(var(--panel), 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-body);
  font-family: inherit;
  font-size: 13px;
}
.year-config-grid input:focus { outline: none; border-color: var(--primary); }
.year-config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.year-config-table th, .year-config-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
}
.year-config-table th {
  font-family: var(--font-heading);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.year-config-table input {
  width: 100%;
  background: rgba(var(--panel), 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 4px 6px;
  color: var(--text-body);
  font-family: inherit;
  font-size: 12px;
  text-align: right;
}
.year-config-table .yc-plafond { text-align: right; font-variant-numeric: tabular-nums; color: var(--primary); }

/* ====================== MENU DONNÉES (popover état + mise à jour) ====================== */
.data-menu { position: relative; }
.data-menu .data-menu-btn {
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.data-menu .data-menu-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 6px currentColor;
}
.data-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
}
.data-menu-dropdown .dmd-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
}
.data-menu-dropdown .dmd-label {
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.data-menu-dropdown .dmd-value {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-body);
}
.data-menu-dropdown .dmd-separator {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 0 10px;
}
.data-menu-dropdown .dmd-update {
  width: 100%;
  justify-content: center;
}

/* ====================== MENU OUTILS (dropdown 4 actions utilitaires) ====================== */
.tools-menu { position: relative; }
.tools-menu .tools-caret { color: var(--text-muted); font-size: 10px; }
.tools-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tools-menu-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text-body);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.tools-menu-item:hover {
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--primary);
}

/* Menus déroulants de barre d'outils (regroupement d'actions, ex. Cartes Trello :
   « Template ▾ » / « Ligne ▾ »). Réutilise le style .tools-menu-dropdown, mais ancré
   à GAUCHE du bouton (une barre d'outils se lit de gauche à droite) et masqué par
   défaut ([hidden]) puisque le panneau vit en dur dans le HTML. */
.row-actions-menu { position: relative; display: inline-block; }
.row-actions-menu .row-menu-btn .tools-caret { margin-left: 2px; }
.row-actions-menu .tools-menu-dropdown { left: 0; right: auto; min-width: 220px; }
.row-actions-menu .tools-menu-dropdown[hidden] { display: none; }
/* Item destructif (Supprimer) : signalé en rouge, comme .btn-danger. */
.tools-menu-item.danger { color: #fca5a5; }
.tools-menu-item.danger:hover { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fecaca; }

/* ====================== MENU UTILISATEUR (compte — mode API) ======================
   Dropdown accroché à la pastille « 👤 Prénom Nom ▾ » du bandeau d'onglets :
   Mes emails / Administration (selon droits) / Déconnexion. Les items réutilisent
   .tools-menu-item pour rester homogènes avec les menus Outils et Données. */
.session-user .session-caret { color: var(--text-muted); font-size: 10px; margin-left: 2px; }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-menu-dropdown .umd-header { padding: 8px 12px 6px; }
.user-menu-dropdown .umd-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-body);
}
.user-menu-dropdown .umd-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.user-menu-dropdown .umd-separator {
  height: 1px;
  background: var(--border-soft);
  margin: 4px 2px;
}
/* Items du menu compte : icône SVG « trait » + libellé sur une même ligne.
   Le SVG hérite de la couleur du texte (currentColor) : il suit donc le survol
   cyan des items et le survol rouge de Déconnexion. */
.user-menu-dropdown .tools-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Nouveautés : pastille de non-lu + fiches du panneau ------------------ */
/* Compteur dans l'item de menu : c'est LUI qui fait découvrir le panneau (sans
   repère visuel, une entrée de menu de plus resterait invisible — le défaut du
   numéro de version). `margin-left:auto` le pousse à droite de l'item. */
.user-menu-dropdown .nv-badge {
  margin-left: auto;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #06202a;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  flex: none;
}
/* Point sur la pastille du compte : visible SANS ouvrir le menu. */
.session-chip .nv-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--panel), 0.9);
  pointer-events: none;
}
.session-chip { position: relative; }

.nv-list { display: flex; flex-direction: column; gap: 10px; }
.nv-card {
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(var(--panel), 0.35);
}
/* Fiche non lue : liseré d'accent à gauche — repérable en balayant la liste. */
.nv-card.nv-neuf { border-left-color: var(--primary); }
.nv-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.nv-titre { font-weight: 700; color: var(--text); font-size: 14px; }
.nv-pastille {
  background: var(--primary);
  color: #06202a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}
/* Texte des pastilles : sombre sur le cyan clair du thème sombre, blanc sur le
   bleu plus soutenu du thème clair — sinon l'un des deux passe sous le seuil AA. */
/* En clair, le blanc sur --primary ne donnait que 4,1:1 (mesuré) : sous le seuil
   AA de 4,5 pour ce petit texte. On fonce le fond -> 5,6:1. */
:root[data-theme="light"] .user-menu-dropdown .nv-badge,
:root[data-theme="light"] .nv-pastille { color: #fff; background: var(--primary-dark); }
.nv-date { margin-left: auto; color: var(--text-caption); font-size: 11px; }
.nv-card p { margin: 4px 0; font-size: 13px; line-height: 1.45; color: var(--text-body); }
.nv-card .nv-pourquoi strong, .nv-card .nv-ou strong { color: var(--text); margin-right: 4px; }
.nv-card .nv-ou { color: var(--text-muted); }
/* « M'y emmener » (lot 2) : discret au repos, franc au survol — la fiche reste
   lisible d'abord, l'action est là pour qui veut essayer tout de suite. */
.nv-actions { margin-top: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Renvoi au guide (lot 3) : lien DISCRET à côté de l'action, pour ne pas la
   concurrencer — « M'y emmener » fait essayer, le guide fait comprendre. */
.nv-guide { color: var(--text-muted); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
.nv-guide:hover { color: var(--primary); }
:root[data-theme="light"] .nv-guide:hover { color: var(--primary-dark); }
.nv-go {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nv-go:hover { background: var(--primary); color: #06202a; }
/* En clair, --primary sur le fond de la fenêtre ne donne que 4,1:1 (mesuré) :
   sous le seuil AA de 4,5 pour ce texte de 12 px. Teinte foncée -> 5,6:1. */
:root[data-theme="light"] .nv-go { color: var(--primary-dark); border-color: var(--primary-dark); }
:root[data-theme="light"] .nv-go:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
@media (max-width: 640px) {
  .nv-date { margin-left: 0; }
  .nv-card { padding: 9px 10px; }
}
.user-menu-dropdown .umd-ico {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.8;
}
.user-menu-dropdown .tools-menu-item:hover .umd-ico { opacity: 1; }
/* Déconnexion : survol en rouge pour signaler l'action « sortie » */
.user-menu-dropdown .umd-logout:hover {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.30);
  color: #ef4444;
}

/* ====================== MODALE « MES EMAILS » (charte, thèmes clair/sombre) ======================
   Fenêtre des modèles .eml par commercial : variables de thème + composants .btn
   de la charte (plus aucun style « bricolé » inline ni input file natif). */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  /* pas de backdrop-filter : très coûteux au rendu (captures/PC modestes) */
  z-index: 200000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 40px 16px;
}
.ds-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  width: 720px;
  max-width: 100%;
  color: var(--text-body);
  font-family: var(--font-body);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.10);
  /* Tenir dans la fenêtre : en-tête (et pied éventuel) fixes, corps défilant —
     pour les modales plus hautes que l'écran (ex. « Envoi auto des Prévisions »
     avec la liste des statuts). Repli : l'overlay reste `overflow:auto`. */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px); /* 80px = padding vertical de .ds-modal-overlay */
}
.ds-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  flex: 0 0 auto; /* en-tête fixe quand le corps défile */
}
.ds-modal-head h2 {
  margin: 0;
  font-size: 17px;
  color: var(--primary);
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
}
.ds-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.ds-modal-close:hover { color: var(--danger); background: rgba(239, 68, 68, 0.10); }
.ds-modal-body { padding: 18px 22px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.ds-modal-intro { font-size: 12.5px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.6; }
/* Variantes de largeur + sous-modale empilée (éditeur de permissions) */
.ds-modal--wide { width: 880px; }
.ds-modal--mid { width: 620px; }
/* Administration : tableau large (Rôle, Équipe, Pastille…) — on exploite la
   largeur de l'écran pour éviter le défilement horizontal, tout en gardant une
   marge sur les grands moniteurs. max-width:100% (.ds-modal) borne sur mobile. */
.ds-modal--xwide { width: min(1240px, 94vw); }
.ds-overlay-top { z-index: 200001; }
/* Thème clair : voile doux (le voile noir uniforme donnait l'impression de rester en sombre) */
:root[data-theme="light"] .ds-modal-overlay { background: rgba(71, 85, 105, 0.38); }

/* Briques communes des modales chartées (Administration, éditeur de rôles…) */
.ds-section-title {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  margin: 0 0 10px;
}
.ds-sep { border: none; border-top: 1px solid var(--border-soft); margin: 20px 0; }
.ds-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.ds-field { font-size: 11px; color: var(--text-muted); }
.ds-input {
  width: 100%;
  padding: 7px 9px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text);
  box-sizing: border-box;
  font-size: 13px;
  margin-top: 3px;
  font-family: var(--font-body);
}
.ds-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow-soft); }
.ds-msg { font-size: 12px; margin-top: 10px; min-height: 16px; }

/* ====================== FICHIERS DES OFFRES (modale 📎, mode API) ======================
   Pièces jointes d'une offre : zone de glisser-déposer + tableau des fichiers.
   La modale réutilise .ds-modal ; le bouton 📎 de la colonne réutilise .journal-btn. */
.files-ico { width: 14px; height: 14px; vertical-align: -2px; }
.ofm-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 2px dashed var(--border-soft);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.ofm-drop--over {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
}
.ofm-drop .ofm-hint { flex-basis: 100%; text-align: center; font-size: 11px; opacity: 0.8; }
.ofm-ro-tag { font-size: 12px; font-weight: 400; opacity: 0.65; margin-left: 6px; }
.ofm-table td { padding: 6px 4px; }
.ofm-table .ofm-nom { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ofm-table .ofm-meta { color: var(--text-muted); white-space: nowrap; }
.ofm-table .ofm-par { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.ofm-table .ofm-actions { text-align: right; white-space: nowrap; }
.ofm-table .ofm-actions .btn { padding: 4px 10px; font-size: 12px; }
.ofm-table .ofm-actions .ofm-del:hover { border-color: rgba(239, 68, 68, 0.5); color: #ef4444; }
/* Bouton « Image de carte » : discret par défaut, mis en avant quand c'est la couverture. */
.ofm-table .ofm-actions .ofm-cover.is-cover { border-color: var(--primary); color: var(--primary); }
.ofm-table tr.ofm-cover-row .ofm-nom { color: var(--primary); }
.ofm-trash { margin-top: 12px; }
.ofm-trash summary { cursor: pointer; color: var(--text-muted); font-size: 12px; }
.ofm-trash-row { opacity: 0.7; }
/* Pied de fenêtre : bouton « Valider » (fermeture explicite ; désactivé pendant
   un téléversement pour signaler qu'il n'est pas terminé). */
.ofm-foot {
  display: flex;
  justify-content: flex-end;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--border-soft);
}
.ofm-foot .btn:disabled { opacity: 0.6; cursor: wait; }

/* Filet de sécurité : une table à nombreuses colonnes (ex. Admin Utilisateurs) défile
   horizontalement dans sa modale au lieu de déborder du cadre. */
.ds-table-scroll { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ds-table thead tr { color: var(--text-muted); font-size: 11px; text-transform: uppercase; text-align: left; }
.ds-table thead th { padding: 6px; font-weight: 600; }
.ds-table tbody tr { border-top: 1px solid var(--border-soft); }
.ds-table tbody tr:hover { background: rgba(56, 189, 248, 0.05); }
.ds-table td { padding: 7px 6px; }

/* Archives Pipeline (lecture seule) — même look que le Pipeline : les nombreuses
   colonnes ne doivent PAS s'enrouler. `white-space: nowrap` garde les EN-TÊTES sur
   une seule ligne et dimensionne chaque colonne à son contenu ; le débordement
   horizontal défile dans le .table-wrapper (overflow:auto). En-tête figé au défilement. */
.ds-table-archives { table-layout: auto; }
.ds-table-archives th,
.ds-table-archives td { white-space: nowrap; vertical-align: middle; }
.ds-table-archives thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-surface);
}
.ds-table-archives .arch-cell { pointer-events: none; }
/* Colonnes de texte libre (Matériel, Message, Commentaire) : bornées + troncature « … »
   pour ne pas étirer démesurément le tableau (le texte complet reste consultable en
   réactivant l'affaire dans le Pipeline). */
.ds-table-archives .arch-cell--wide,
.ds-table-archives .arch-cell--wide .cell-edit-text {
  display: block; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ds-badge {
  font-size: 10px;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1px 6px;
}
.ds-caption { color: var(--text-caption); font-size: 11px; }
.ds-muted { color: var(--text-muted); }
.ds-dirty { margin-right: auto; font-size: 12px; font-weight: 700; color: var(--warning); display: none; }

/* Carte par bouton d'envoi (slot) */
.myeml-slot {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
  background: rgba(var(--panel), 0.45);
}
.myeml-slot-title {
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  margin: 0 0 6px;
}
.myeml-tokens { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 2; }
.token-chip {
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--primary);
  font-size: 11.5px;
}
.myeml-list { font-size: 13px; color: var(--text-body); }
.myeml-empty { color: var(--text-muted); font-size: 12.5px; }
.myeml-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.myeml-table tr { border-top: 1px solid var(--border-soft); }
.myeml-table tr:hover { background: rgba(56, 189, 248, 0.05); }
.myeml-table td { padding: 7px 6px; }
.myeml-row-tokens { font-size: 11px; color: var(--text-caption); }
.myeml-note { font-size: 11px; color: var(--text-caption); margin: 6px 0 0; }
.myeml-import-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.myeml-msg { font-size: 12px; margin-top: 8px; min-height: 16px; }

/* Boutons compacts (lignes de tableau) + état désactivé charté */
.btn-mini { padding: 4px 9px; font-size: 12.5px; }
.btn-mini + .btn-mini { margin-left: 4px; }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.10); }
/* État désactivé : surface neutre EXPLICITE (pas une simple opacité, qui rendait
   les boutons primaires quasi invisibles sur fond sombre). Lisible dans les 2 thèmes,
   et le passage désactivé -> actif (cyan) devient évident. */
.btn:disabled,
.btn:disabled:hover {
  background: var(--bg-elevation);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.8;
}

/* ====================== SÉLECTEUR DE FICHIER CHARTÉ ======================
   Remplace l'input file natif (« Choisir un fichier ») : l'input reste dans le
   DOM (masqué) pour que le code lisant .files fonctionne tel quel ; on affiche
   un bouton charté + le nom du fichier choisi. */
.file-pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; }
.file-pick input[type="file"] { display: none; }
.file-pick-btn { white-space: nowrap; }
.file-pick-name {
  font-size: 12px;
  color: var(--text-caption);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.file-pick-name.has-file { color: var(--text-body); font-style: normal; font-weight: 600; }


/* ====================== SÉLECTEUR DE LANGUE (drapeaux) ====================== */
.lang-selector { position: relative; display: inline-flex; }
.flag-ico {
  width: 22px;
  height: 15px;
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  line-height: 1;
}
.lang-btn:hover { border-color: rgba(56, 189, 248, 0.4); }
.lang-btn .lang-caret { color: var(--text-muted); font-size: 10px; }
.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-menu.hidden { display: none; }
.lang-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-body);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.lang-opt:hover {
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--primary);
}
.lang-opt.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}
.lang-opt-label { white-space: nowrap; }

/* ====================== TABLEAU DE BORD (Analyses pluri-annuelles) ====================== */
.analyses-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(var(--panel), 0.85);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 22px;
  position: sticky;
  top: 124px;
  z-index: 47;
  backdrop-filter: blur(8px);
}
.analyses-control .ac-left,
.analyses-control .ac-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.analyses-control .ac-title {
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 4px;
}
.analyses-year-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(var(--panel), 0.5);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.5px;
  transition: border-color 0.15s;
}
.analyses-year-check:has(input:checked) { border-color: var(--yc); box-shadow: 0 0 0 1px var(--yc) inset; }
.analyses-year-check input { accent-color: var(--yc); }
.analyses-year-check .ayc-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
}
.analyses-year-check .ayc-label { font-weight: 700; color: var(--text-body); }
.analyses-control .ac-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--text-body);
  cursor: pointer;
}
.analyses-control .ac-toggle em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 10px;
}

.analyses-section {
  margin-bottom: 28px;
}
.analyses-section-title {
  font-family: var(--font-heading);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.analyses-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 30px;
  text-align: center;
  background: rgba(var(--panel), 0.4);
  border: 1px dashed var(--border-soft);
  border-radius: 8px;
}

/* Cartes d'année — Section Vue d'ensemble */
.analyses-yearcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.year-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}
.year-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.year-card-year {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.year-card-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 7px;
  border-radius: 3px;
}
.year-card-body { padding: 12px 16px; }
.ycb-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-family: var(--font-heading);
  font-size: 13px;
}
.ycb-row.ycb-prime { padding-left: 12px; font-size: 12px; color: var(--text-muted); }
.ycb-row.ycb-total {
  padding: 8px 12px;
  margin: 6px -8px 0;
  border-radius: 6px;
  font-size: 14px;
}
.ycb-label { color: var(--text-muted); }
.ycb-val { color: var(--text-body); font-variant-numeric: tabular-nums; }
.ycb-sep { height: 1px; background: var(--border-soft); margin: 8px 0; }

/* Grille générique pour les sections Évolution / Répartition / Primes */
.analyses-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}
.chart-card.chart-card-wide { grid-column: 1 / -1; }

/* Section Revendeurs (Tableau de bord) : tuile compacte (largeur bornée) + <select>
   aligné sur la charte des menus (cf. .prev-filter select). */
.ana-revendeurs-wrap { max-width: 560px; }
.ana-revendeur-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ana-revendeur-filter-label {
  font-family: var(--font-heading);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted);
}
.ana-revendeur-filter select {
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 700;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  border: none; border-radius: 8px; padding: 7px 11px; cursor: pointer;
  box-shadow: var(--glow-soft);
  transition: box-shadow 0.15s, transform 0.15s;
}
.ana-revendeur-filter select:hover { box-shadow: var(--glow-strong); transform: translateY(-1px); }
.ana-revendeur-filter select:focus { outline: none; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35); }
.ana-revendeur-filter select option { background: var(--bg-surface); color: var(--text); font-weight: 400; }

/* ============ Tableau de Bord v2 : graphiques SVG aux couleurs de THÈME ============
   Les textes/grilles des SVG passent par des classes -> variables (clair/sombre). */
.chs text { font-family: var(--font-body); }
.chs .chs-grid { stroke: var(--border-soft); stroke-width: 1; }
.chs .chs-tick { fill: var(--text-muted); font-size: 9.5px; }
.chs .chs-val  { fill: var(--text-body); font-size: 9.5px; font-weight: 700; }
.chs .chs-end  { font-size: 10.5px; font-weight: 700; }
.chs .chs-objective { stroke: var(--text-caption); stroke-width: 1.2; stroke-dasharray: 5 4; }
.lc-legend-obj { color: var(--text-caption); }

/* Bandeau d'indicateurs (Vue d'ensemble) */
.ana-hero-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-family: var(--font-heading); }
.ana-hero-year { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.ana-hero-owner { font-size: 13px; color: var(--text-muted); }
.ana-hero-ytd { font-size: 10px; font-weight: 700; color: var(--primary); border: 1px solid rgba(56,189,248,0.4); border-radius: 8px; padding: 1px 7px; letter-spacing: 1px; }
.ana-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.ana-hero-card {
  background: linear-gradient(160deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.ana-hero-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); font-family: var(--font-heading); }
.ana-hero-value { font-size: 21px; font-weight: 700; color: var(--text); margin: 3px 0 4px; font-family: var(--font-heading); }
.ana-hero-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.ana-hero-foot { display: flex; align-items: center; gap: 8px; min-height: 18px; flex-wrap: wrap; }
.ana-spark { flex-shrink: 0; opacity: 0.9; }
.ana-delta { font-size: 11px; font-weight: 700; white-space: nowrap; }
.ana-delta em { font-style: normal; font-weight: 400; color: var(--text-caption); font-size: 10px; }
.ana-up { color: var(--success); }
.ana-down { color: var(--danger); }
.ana-delta-na { color: var(--text-caption); font-weight: 400; }
.ana-progress-mini { display: inline-block; flex: 1; min-width: 50px; height: 5px; background: var(--bg-elevation); border-radius: 3px; overflow: hidden; }
.ana-progress-mini span { display: block; height: 100%; border-radius: 3px; }
.ana-muted { color: var(--text-caption); }

/* Chips de filtre commercial (barre de contrôle) */
.ana-owner-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 14px; }
.ana-owner-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-family: var(--font-heading);
  color: var(--text-body);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ana-owner-chip:hover { border-color: var(--oc, var(--primary)); color: var(--oc, var(--primary)); }
.ana-owner-chip.is-active { background: var(--oc, var(--primary)); border-color: var(--oc, var(--primary)); color: var(--bg-deep); font-weight: 700; }

/* Course à l'objectif */
.ana-obj-row {
  display: grid;
  grid-template-columns: 200px 1fr 130px;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-radius: 8px;
}
.ana-obj-row[data-owner] { cursor: pointer; }
.ana-obj-row[data-owner]:hover { background: rgba(56, 189, 248, 0.06); }
.ana-obj-who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-body); font-family: var(--font-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ana-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}
.ana-obj-track { position: relative; height: 8px; background: var(--bg-elevation); border-radius: 4px; }
.ana-obj-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.ana-obj-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-caption); opacity: 0.8; }
.ana-obj-num { font-size: 12.5px; font-weight: 700; text-align: right; font-family: var(--font-heading); white-space: nowrap; }
.ana-obj-num em { font-style: normal; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.ana-obj-note { font-size: 10.5px; color: var(--text-caption); margin-top: 10px; }
@media (max-width: 760px) {
  .ana-obj-row { grid-template-columns: 120px 1fr 110px; }
}

/* Classement commerciaux */
.ana-rank tbody tr { cursor: pointer; }
.ana-rank .ana-rank-pos { font-weight: 700; color: var(--text-muted); }
.ana-rank .ana-rank-pos.is-first { color: #fbbf24; }
.ana-rank .ana-avatar { vertical-align: middle; margin-right: 4px; }

/* Activité des commerciaux : en-tête (titre + sélecteur de métrique) + tableau mensuel */
.ana-activity-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.ana-activity-head .ana-owner-chips { margin-left: 6px; }
.ana-activity .ana-avatar { vertical-align: middle; margin-right: 4px; }
.ana-activity tfoot .ana-activity-total td { border-top: 2px solid var(--border-soft); font-weight: 700; color: var(--text-body); }

/* Barres horizontales (Top départements) */
.ana-hbars { display: flex; flex-direction: column; gap: 6px; }
.ana-hbar-row { display: grid; grid-template-columns: 64px 1fr 56px; align-items: center; gap: 10px; }
.ana-hbar-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ana-hbar-track { height: 8px; background: var(--bg-elevation); border-radius: 4px; overflow: hidden; }
.ana-hbar-fill { display: block; height: 100%; border-radius: 4px; }
.ana-hbar-val { font-size: 11px; font-weight: 700; color: var(--text-body); text-align: right; font-family: var(--font-heading); }

/* Line chart / grouped bar / stacked bar */
.line-chart { width: 100%; }
.line-chart svg { display: block; }
.lc-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--font-heading);
  color: var(--text-muted);
}
.lc-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.lc-legend-swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 2px;
}

/* Entonnoir conversion */
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.funnel-card {
  background: rgba(var(--panel), 0.55);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px 16px;
}
.funnel-card h4 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 16px;
  letter-spacing: 1px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px 90px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  font-family: var(--font-heading);
}
.funnel-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-size: 10px; }
.funnel-bar-bg { background: rgba(var(--panel), 0.6); border-radius: 4px; height: 22px; overflow: hidden; }
.funnel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.funnel-val { text-align: right; color: var(--text-body); font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-conv { color: var(--primary); font-size: 11px; }
.funnel-summary {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12px;
  color: var(--text-muted);
}
.funnel-summary strong { color: var(--text-body); }

/* ====================== SUB-TABS (Vente Annuelle : Accueil / T1-T4 / Total) ====================== */
.subtabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 6px;
  background: rgba(var(--panel), 0.85);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  /* Se fige juste sous la barre des onglets principaux (header 72px + tabs ~52px).
     z-index 48 pour passer SOUS les tabs (49) et le header (50). */
  position: sticky;
  top: 124px;
  z-index: 48;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.subtab {
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.subtab sup { font-size: 9px; margin: 0 1px; }
.subtab:hover {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
}
.subtab.active {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.12) inset;
}
.subtab-panel { display: none; animation: fadeIn 0.25s ease; }
.subtab-panel.active { display: block; }

/* Ligne des jauges trimestres (CA + Prime Marge + Prime Acompte / CA Annuel) */
.trimestre-gauge-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* ================== Tableau de suivi des paiements de primes (Cds X T A24:C33) ================== */
.kpi-card.payments-card {
  text-align: left;
  padding: 12px 14px;
}
.kpi-card.payments-card h4 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-body);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}
.payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--font-heading);
  table-layout: fixed;
}
.payments-table th {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary);
  padding: 8px 6px;
  text-align: left;
  border-bottom: 2px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.07);
}
.payments-table th.col-montant { text-align: right; width: 90px; }
.payments-table th.col-date    { width: 130px; }
/* En-tete vide pour la colonne Date dans le thead principal :
   on l'aplatit pour qu'il ne ressemble PAS a un en-tete (annonce plus bas via .payments-subheader). */
.payments-table thead th.col-date-empty {
  background: transparent;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: normal;
}
/* Sous-en-tete qui annonce "Date de Versement" juste au-dessus des 4 lignes editables.
   Toute la ligne adopte le style d'un en-tete (bande bleue) pour creer une rupture nette
   entre la zone "Primes acquises" et la zone "Versements", mais seul le 3eme cellule
   porte le texte -> l'en-tete est tie a la colonne Date sans ambiguite. */
.payments-table tr.payments-subheader td {
  padding: 8px 6px;
  background: rgba(56, 189, 248, 0.07);
  border-bottom: 2px solid rgba(56, 189, 248, 0.45);
  border-top: 1px solid var(--border-soft);
}
.payments-table tr.payments-subheader td:last-child {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary);
  text-align: left;
}
.payments-table td {
  padding: 3px 4px;
  border-bottom: 1px dashed rgba(148,163,184,0.12);
  vertical-align: middle;
  font-size: 11px;
}
.payments-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.payments-table tr.payments-summary td {
  color: #94a3b8;
  background: rgba(var(--panel), 0.35);
}
.payments-table tr.payments-summary-total td {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.10);
  border-bottom: 2px solid rgba(56, 189, 248, 0.35);
}
.payments-table tr.payments-separator td {
  border: none;
  height: 4px;
  padding: 0;
}
.payments-table tr.payments-total td {
  background: rgba(76, 157, 66, 0.10);
  color: #86efac;
  border-top: 1px solid rgba(76, 157, 66, 0.35);
}
.payments-table tr.payments-reste-warning td {
  background: rgba(244, 152, 25, 0.10);
  color: #fbbf24;
}
.payments-table tr.payments-reste-success td {
  background: rgba(76, 157, 66, 0.18);
  color: #86efac;
}
.payments-table input.payment-date,
.payments-table input.payment-montant {
  background: rgba(var(--panel), 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 2px 4px;
  color: var(--text-body);
  font-family: inherit;
  font-size: 11px;
  width: 100%;
  box-sizing: border-box;
}
.payments-table input.payment-montant { text-align: right; }
.payments-table input.payment-date:focus,
.payments-table input.payment-montant:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}
/* Champ date des paiements : color-scheme rend le calendrier natif (icône +
   popup) lisible selon le thème — sinon l'icône sombre est invisible sur fond
   sombre. Champ entièrement cliquable : un clic ouvre le calendrier (showPicker,
   app.js), plus besoin de viser la petite icône. */
.payments-table input.payment-date {
  color-scheme: dark;
  cursor: pointer;
}
:root[data-theme="light"] .payments-table input.payment-date {
  color-scheme: light;
}
.payments-table input.payment-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.95;
}
.payments-table input[type="number"]::-webkit-inner-spin-button,
.payments-table input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ================== Recap paiements primes (sous-onglet Total Annuel) ==================
   Placement : sous le tableau "Detail par trimestre".
   3 categories (Acompte / Marge / TOTAL), chaque categorie en 2 sous-lignes verticales :
     1) header : label + pictogramme statut
     2) progress : barre + % + montants verse / acquis */
.prime-payments-recap {
  background: linear-gradient(140deg, rgba(56,189,248,0.05), rgba(var(--panel),0.45));
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 18px;
  max-width: 560px;
}
.prime-payments-recap h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0.3px;
}
.prime-payments-recap .recap-subtitle {
  font-weight: 400;
  color: var(--text-caption);
  font-size: 10px;
}
.recap-row {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(148,163,184,0.08);
}
.recap-row:last-child { border-bottom: none; }
.recap-row-total {
  border-top: 1px solid var(--border-soft);
  border-bottom: none;
  padding-top: 10px;
  margin-top: 4px;
}
.recap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11px;
  font-family: var(--font-heading);
}
.recap-label {
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.recap-row-total .recap-label {
  color: #F49819;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 12px;
}
.recap-status {
  font-size: 13px;
  line-height: 1;
}
.recap-progress {
  display: grid;
  grid-template-columns: 1fr 44px auto;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-heading);
}
.recap-bar {
  height: 9px;
  background: rgba(var(--panel), 0.7);
  border: 1px solid rgba(148,163,184,0.10);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.recap-row-total .recap-bar { height: 11px; }
.recap-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
}
.recap-fill.recap-acompte { background: linear-gradient(90deg, #0ea5e9, #38bdf8); box-shadow: 0 0 8px rgba(56,189,248,0.35); }
.recap-fill.recap-marge   { background: linear-gradient(90deg, #16a34a, #4C9D42); box-shadow: 0 0 8px rgba(76,157,66,0.35); }
.recap-fill.recap-total   { background: linear-gradient(90deg, #d97706, #F49819); box-shadow: 0 0 10px rgba(244,152,25,0.45); }
.recap-percent {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
  font-weight: 600;
}
.recap-row-total .recap-percent { color: #F49819; font-weight: 700; }
.recap-amounts {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}
.recap-row-total .recap-amounts {
  color: var(--text-body);
  font-size: 11px;
  font-weight: 600;
}
/* Ligne « Reste à régler » (cumul annuel) : pas de barre de progression (déjà
   représentée par le % de la ligne TOTAL), juste le montant mis en évidence. */
.recap-row-reste { border-top: 1px dashed rgba(148, 163, 184, 0.15); padding-top: 8px; margin-top: 2px; }
.recap-reste-line { display: flex; justify-content: flex-end; }
.recap-reste-amount {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.recap-reste-amount.recap-reste-success { color: #4C9D42; }
.recap-reste-amount.recap-reste-warning { color: #F49819; }

/* Bandeau de tuiles primes spécifique aux trimestres */
.kpi-card.prime-card {
  background: linear-gradient(140deg, rgba(56,189,248,0.10), rgba(56,189,248,0.02));
  border-color: rgba(56,189,248,0.35);
}
.kpi-card.prime-card .label { color: var(--primary); }
.kpi-card.prime-card .value {
  font-size: 26px;
  text-shadow: 0 0 14px rgba(56,189,248,0.35);
}
.kpi-card.prime-acompte { border-left: 3px solid #38bdf8; }
.kpi-card.prime-marge   { border-left: 3px solid #4C9D42; }
.kpi-card.prime-ca      { border-left: 3px solid #F49819; }
.kpi-card.prime-total {
  border: 1px solid rgba(244, 152, 25, 0.45);
  background: linear-gradient(140deg, rgba(244,152,25,0.12), rgba(244,152,25,0.02));
}
.kpi-card.prime-total .label { color: #F49819; }
.kpi-card.prime-total .value {
  font-size: 28px;
  text-shadow: 0 0 14px rgba(244,152,25,0.45);
}

/* En-tête de période de trimestre (mois inclus) */
.trimestre-period {
  font-family: var(--font-heading);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 0 0 4px;
}

/* ====================== KPIs ====================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* ===== Tuiles "spotlight" Tâches : En retard / Aujourd'hui ===== */
.spotlight-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .spotlight-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px)  { .spotlight-row { grid-template-columns: 1fr; } }
.spotlight-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 18px 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.spotlight-card.is-clickable { cursor: pointer; }
.spotlight-card.is-clickable:hover { transform: translateY(-2px); }
.spotlight-head { display: flex; align-items: center; gap: 10px; }
.spotlight-icon { font-size: 22px; line-height: 1; }
.spotlight-title {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.spotlight-number { font-size: 46px; font-weight: 800; line-height: 1; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.spotlight-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.spotlight-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* Liste défilable quand il y a beaucoup de lignes (montre ~4 lignes, scroll pour le reste) */
.spotlight-list.is-scrollable {
  max-height: 132px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.6) transparent;
}
.spotlight-list.is-scrollable::-webkit-scrollbar { width: 6px; }
.spotlight-list.is-scrollable::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; }
.spotlight-list.is-scrollable::-webkit-scrollbar-track { background: transparent; }
.spotlight-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-body); }
.spotlight-list .sl-title,
.spotlight-list .sl-client { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spotlight-list .sl-client {
  cursor: pointer;
  border-bottom: 1px dashed rgba(255,255,255,0.25);
  transition: color 0.12s ease, border-color 0.12s ease;
}
.spotlight-list .sl-client:hover { color: #fff; border-bottom-color: currentColor; }
.spotlight-list .sl-client.active { color: #fff; font-weight: 700; border-bottom-style: solid; border-bottom-color: currentColor; }
.spotlight-list .sl-tag { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.spotlight-more { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.spotlight-foot { margin-top: 12px; font-size: 11px; font-weight: 600; color: var(--primary); }

/* Variante "En retard" (rouge) */
.spotlight-retard { background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(239,68,68,0.05)); border-color: rgba(239,68,68,0.45); }
.spotlight-retard .spotlight-number { color: #fca5a5; }
.spotlight-retard .sl-tag { background: rgba(239,68,68,0.25); color: #fecaca; }
.spotlight-retard.is-clickable:hover { box-shadow: 0 10px 28px rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.7); }

/* Variante "Aujourd'hui" (ambre) */
.spotlight-today { background: linear-gradient(135deg, rgba(244,152,25,0.18), rgba(244,152,25,0.05)); border-color: rgba(244,152,25,0.45); }
.spotlight-today .spotlight-number { color: #fcd9a3; }
.spotlight-today .sl-tag { background: rgba(244,152,25,0.22); color: #ffe1b3; }
.spotlight-today.is-clickable:hover { box-shadow: 0 10px 28px rgba(244,152,25,0.22); border-color: rgba(244,152,25,0.7); }

/* Variante "Cette semaine" (bleu ciel) */
.spotlight-semaine { background: linear-gradient(135deg, rgba(56,189,248,0.16), rgba(56,189,248,0.04)); border-color: rgba(56,189,248,0.42); }
.spotlight-semaine .spotlight-number { color: #bae6fd; }
.spotlight-semaine .sl-tag { background: rgba(56,189,248,0.20); color: #d7f0fc; }
.spotlight-semaine.is-clickable:hover { box-shadow: 0 10px 28px rgba(56,189,248,0.22); border-color: rgba(56,189,248,0.7); }

/* État apaisé quand 0 (vert) — prioritaire sur les variantes ci-dessus */
.spotlight-card.is-empty { background: linear-gradient(135deg, rgba(76,157,66,0.14), rgba(76,157,66,0.03)); border-color: rgba(76,157,66,0.35); }
.spotlight-card.is-empty .spotlight-number { color: #86efac; }

/* Filtre actif (tuile sélectionnée) */
.spotlight-card.active { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: var(--glow-soft); }

/* Pulsation discrète quand il y a des tâches en retard */
.spotlight-card.pulse { animation: spotlightPulse 2.4s ease-in-out infinite; }
@keyframes spotlightPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0.16); }
}
@media (prefers-reduced-motion: reduce) { .spotlight-card.pulse { animation: none; } }
.kpi-card {
  background: linear-gradient(160deg, var(--bg-surface) 0%, var(--bg-surface-2) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--primary);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(56,189,248,0.08), transparent 50%);
  pointer-events: none;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--glow-soft);
  border-color: var(--border);
}
.kpi-card.success { border-left-color: var(--success); }
.kpi-card.warning { border-left-color: var(--warning); }
.kpi-card.danger  { border-left-color: var(--danger); }
.kpi-card.info    { border-left-color: var(--info); }
.kpi-card.primary { border-left-color: var(--primary); }
.kpi-card.muted   { border-left-color: var(--text-caption); }
.kpi-card.negociation { border-left-color: #14b8a6; }
/* Tuile KPI cliquable (filtre rapide), ex. "Transférés" */
.kpi-card.kpi-clickable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.kpi-card.kpi-clickable:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
.kpi-card.kpi-clickable.is-active {
  outline: 2px solid #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.25);
}
.kpi-card.kpi-clickable.is-active .label::after { content: ' · filtre actif'; color: #5eead4; font-weight: 600; }
.subpanel-intro { color: var(--text-muted); font-size: 13px; margin: 4px 0 16px; }
.subpanel-intro strong { color: var(--text-body); }

/* Bouton "Suivi" (journal) dans le tableau Leads */
.journal-btn {
  background: rgba(56,189,248,0.10);
  border: 1px solid rgba(56,189,248,0.30);
  color: var(--primary);
  border-radius: 14px; padding: 3px 10px;
  cursor: pointer; font-size: 13px; font-family: var(--font-heading);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.journal-btn:hover { background: rgba(56,189,248,0.20); border-color: var(--primary); }

/* Pastille « Commercial » (propriétaire de la ligne — Leads, rôles viewAll) :
   initiales sur fond coloré stable par commercial (background inline, dérivé
   de son id), nom complet en info-bulle. Lisible dans les deux thèmes. */
.owner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
/* Colonne « Com. » compacte : cellule centrée, largeur calée sur la pastille
   (l'en-tête court fait le reste — le nom complet reste en info-bulle).
   Sélecteur avec .data-table : bat la règle générique « .data-table td » (left). */
.data-table td[data-col="_owner"] { text-align: center; width: 1%; white-space: nowrap; }
/* Info-bulle instantanée de la pastille (position:fixed, posée par
   api-mode-writes.js — insensible à l'overflow des tableaux). */
.owner-tooltip {
  position: fixed;
  z-index: 999999;
  background: var(--bg-surface);
  color: var(--text-body);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  white-space: nowrap;
}
/* Administration : sélecteur de couleur de la pastille (aperçu + input + ↺). */
.adm-color {
  width: 30px;
  height: 24px;
  padding: 0 2px;
  margin: 0 4px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
}

/* Cellule Remarques (Leads & Offres) : texte éditable + bouton « ➜ Suivi » */
.cell-comment { display: flex; align-items: flex-start; gap: 6px; }
.cell-comment .cell-edit-text { flex: 1 1 auto; min-width: 0; }
.comment-journal-btn {
  flex: 0 0 auto; align-self: center;
  background: rgba(56,189,248,0.10);
  border: 1px solid rgba(56,189,248,0.30);
  color: var(--primary);
  border-radius: 14px; padding: 2px 8px;
  cursor: pointer; font-size: 12px; font-family: var(--font-heading);
  white-space: nowrap; transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.comment-journal-btn:hover { background: rgba(56,189,248,0.20); border-color: var(--primary); }
.comment-journal-btn.is-empty { opacity: 0.35; }
.comment-journal-btn.is-empty:hover { opacity: 0.6; }
.journal-btn .journal-count {
  background: var(--primary); color: #020617; font-weight: 700;
  border-radius: 9px; padding: 0 6px; font-size: 11px; min-width: 16px; text-align: center;
}

/* Fenêtre timeline de suivi */
.journal-modal {
  background: var(--bg-surface); border: 1px solid rgba(56,189,248,0.3); border-radius: 12px;
  padding: 22px 24px; width: 560px; max-width: 94vw;
  color: var(--text-body); box-shadow: 0 24px 50px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; max-height: 86vh;
}
.journal-modal h3 { margin: 0 0 14px; font-size: 16px; color: var(--primary); }
.journal-list {
  flex: 1; overflow-y: auto; min-height: 120px; max-height: 50vh;
  border: 1px solid var(--border-soft); border-radius: 8px;
  padding: 10px 12px; background: rgba(2,6,23,0.4); margin-bottom: 14px;
}
.journal-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 7px 0; border-bottom: 1px dashed rgba(148,163,184,0.12);
  font-size: 13px; line-height: 1.4;
}
.journal-item:last-child { border-bottom: none; }
.journal-when { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 118px; font-size: 12px; }
.journal-ic { font-size: 14px; line-height: 1.3; }
.journal-body { display: flex; flex-direction: column; gap: 1px; }
.journal-label { font-weight: 600; color: var(--text-body); }
.journal-detail { color: var(--text-muted); font-size: 12px; }
.journal-user { color: var(--text-caption); font-size: 11px; font-style: italic; }
.journal-item.journal-relance .journal-label { color: #fbbf3a; }
.journal-item.journal-creation .journal-label { color: var(--primary); }
.journal-body { flex: 1; }
.journal-del {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-caption); font-size: 13px; padding: 2px 4px;
  border-radius: 5px; opacity: 0.5; transition: opacity 0.15s, background 0.15s;
  align-self: center; flex-shrink: 0;
}
.journal-item:hover .journal-del { opacity: 1; }
.journal-del:hover { background: rgba(239,68,68,0.18); color: #f87171; opacity: 1; }
/* Bouton éditer (stylo) */
.journal-edit {
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; padding: 2px 4px; border-radius: 5px;
  opacity: 0.5; transition: opacity 0.15s, background 0.15s; align-self: center; flex-shrink: 0;
}
.journal-item:hover .journal-edit { opacity: 1; }
.journal-edit:hover { background: rgba(56,189,248,0.18); opacity: 1; }
/* Mode édition inline d'une ligne de suivi */
.journal-item.journal-edit-mode { gap: 8px; align-items: center; }
.journal-edit-mode .journal-edit-date {
  background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 6px;
  color: var(--text-body); font-family: inherit; font-size: 12px; padding: 5px 7px;
}
.journal-edit-mode .journal-edit-text {
  flex: 1; background: var(--bg-deep); border: 1px solid var(--primary); border-radius: 6px;
  color: var(--text-body); font-family: inherit; font-size: 13px; padding: 5px 9px;
}
.journal-save, .journal-cancel {
  border: none; cursor: pointer; border-radius: 6px; font-size: 13px;
  padding: 5px 9px; flex-shrink: 0;
}
.journal-save { background: rgba(76,157,66,0.25); color: #86efac; }
.journal-save:hover { background: rgba(76,157,66,0.40); }
.journal-cancel { background: rgba(148,163,184,0.18); color: var(--text-muted); }
.journal-cancel:hover { background: rgba(148,163,184,0.30); }
.journal-add { display: flex; gap: 8px; margin-bottom: 12px; }
.journal-add input[type="date"] {
  background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 6px;
  color: var(--text-body); font-family: inherit; font-size: 13px; padding: 6px 8px;
}
.journal-add input[type="text"] {
  flex: 1; background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 6px;
  color: var(--text-body); font-family: inherit; font-size: 13px; padding: 6px 10px;
}
.journal-foot { display: flex; justify-content: flex-end; }

/* Cases à bascule cliquables (PV reçu / Affaire Facturée — Ventes) */
.bool-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px;
  cursor: pointer; font-weight: 700; font-size: 13px; user-select: none;
  border: 1px solid transparent; transition: all 0.15s;
}
.bool-toggle.on  { background: rgba(76,157,66,0.20); color: #86efac; border-color: rgba(76,157,66,0.45); }
.bool-toggle.off { background: rgba(148,163,184,0.10); color: #64748b; border-color: var(--border-soft); }
.bool-toggle:hover { filter: brightness(1.25); border-color: var(--primary); }
/* Ligne appartenant à une sélection de PLUSIEURS lignes : le clic s'appliquera à toute
   la sélection. Le liseré cyan prévient AVANT le clic — un lot part vite de travers si
   rien ne distingue « je marque cette ligne » de « j'en marque vingt ». */
.bool-toggle.bulk { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(56,189,248,0.35) inset; }

/* Bouton Récap Entreprise 👤 dans les tableaux (Pipeline…). ⚠ L'icône est un
   masque .ds-ic teinté par currentColor : sans `color` explicite, un <button>
   retombe sur le noir natif du navigateur — invisible sur le thème sombre
   (régression de la migration émoji → ds-ic). Muted sans infos, accent primary
   quand le récap est renseigné — même langage que .journal-btn (🕐/📎). */
.address-btn {
  background: transparent; border: 1px solid var(--border-soft); border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 2px 8px; line-height: 1.4;
  opacity: 0.45; transition: opacity 0.15s, border-color 0.15s, background 0.15s;
}
.address-btn:hover { opacity: 1; border-color: var(--primary); background: rgba(56,189,248,0.10); }
.address-btn.has-addr { opacity: 1; border-color: rgba(56,189,248,0.35); color: var(--primary); }

/* Modale « Envoi automatique des Prévisions » (PrevisionsAuto, api-mode-writes) */
.pa-fs { border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.pa-fs legend { font-size: 12px; color: var(--text-muted); padding: 0 6px; }
.pa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pa-grid .ds-input, .pa-fs .ds-input { width: 100%; box-sizing: border-box; }
.pa-log { width: 100%; border-collapse: collapse; font-size: 12px; }
.pa-log th, .pa-log td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border-soft); }
.pa-log th { color: var(--text-muted); font-weight: 600; }
.pa-dest { color: var(--text-muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fenêtre Adresse */
.address-modal {
  background: var(--bg-surface); border: 1px solid rgba(56,189,248,0.3); border-radius: 12px;
  padding: 22px 24px; width: 440px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto;   /* récap complet : scroll interne, boutons toujours accessibles */
  color: var(--text-body); box-shadow: 0 24px 50px rgba(0,0,0,0.55);
}
.address-modal h3 { margin: 0 0 16px; font-size: 16px; color: var(--primary); }
.address-modal .addr-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--text-muted); }
.address-modal .addr-field input,
.address-modal .addr-field select {
  background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 6px;
  color: var(--text-body); font-family: inherit; font-size: 13px; padding: 8px 10px;
}
.address-modal .addr-row { display: flex; gap: 12px; }
.address-modal .addr-cp { width: 120px; flex-shrink: 0; }
.address-modal .addr-ville { flex: 1; }
.address-modal .addr-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Fenêtre de transfert Lead -> Offre Tech Com (choix de l'année) */
.transfer-modal-overlay {
  position: fixed; inset: 0; z-index: 200000;
  background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
}
.transfer-modal {
  background: var(--bg-surface);
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 12px;
  padding: 24px 26px;
  width: 440px; max-width: 92vw;
  color: var(--text-body);
  box-shadow: 0 24px 50px rgba(0,0,0,0.55);
}
.transfer-modal h3 { margin: 0 0 12px; font-size: 17px; color: var(--primary); }
.transfer-modal .tm-recap { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }
.transfer-modal .tm-recap strong { color: var(--text-body); }
.transfer-modal .tm-label { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.transfer-modal .tm-years { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.transfer-modal .tm-year {
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
  background: rgba(var(--panel),0.6); border: 1px solid var(--border-soft);
  color: var(--text-body); font-family: inherit; font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.transfer-modal .tm-year:hover { border-color: var(--primary); }
.transfer-modal .tm-year.selected {
  background: rgba(56,189,248,0.18); border-color: var(--primary); color: var(--primary);
}
.transfer-modal .tm-custom { margin-bottom: 18px; font-size: 13px; color: var(--text-muted); }
.transfer-modal .tm-custom input {
  width: 110px; margin-left: 6px; padding: 6px 10px;
  background: var(--bg-deep); border: 1px solid var(--border-soft); border-radius: 6px;
  color: var(--text-body); font-family: inherit; font-size: 13px;
}
.transfer-modal .tm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Tuiles avec couleurs Action (Gestion des Leads) */
.kpi-card.action-attente     { border-left-color: #F49819; }
.kpi-card.action-rappeler    { border-left-color: #ef4444; }
.kpi-card.action-doc         { border-left-color: #38bdf8; }
.kpi-card.action-faire-offre { border-left-color: #facc15; }
.kpi-card.action-offre       { border-left-color: #4C9D42; }
.kpi-card.action-rdv         { border-left-color: #14b8a6; }
.kpi-card .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}
.kpi-card .value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text);
  line-height: 1.1;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ====================== CHARTS ====================== */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.chart-card {
  background: linear-gradient(160deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.chart-card h4 {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-body);
}
.bar-row .bar-label { width: 100px; color: var(--text-muted); font-weight: 500; }
.bar-row .bar-bg {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  height: 14px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.bar-row .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-deep) 100%);
  box-shadow: 0 0 12px rgba(56,189,248,0.35);
  transition: width 0.35s ease;
}
.bar-row .bar-fill.success { background: linear-gradient(90deg, #4C9D42, #65bf57); box-shadow: 0 0 10px rgba(76,157,66,0.4); }
.bar-row .bar-fill.danger  { background: linear-gradient(90deg, #ef4444, #b91c1c); box-shadow: 0 0 10px rgba(239,68,68,0.35); }
.bar-row .bar-fill.warning { background: linear-gradient(90deg, #F49819, #d97706); box-shadow: 0 0 10px rgba(244,152,25,0.35); }
.bar-row .bar-fill.info    { background: linear-gradient(90deg, #38bdf8, #0891b2); }
.bar-row .bar-fill.primary { background: linear-gradient(90deg, #38bdf8, #3b82f6); }
.bar-row .bar-fill.negociation { background: linear-gradient(90deg, #14b8a6, #0d9488); box-shadow: 0 0 10px rgba(20,184,166,0.35); }
.bar-row .bar-val { width: 80px; text-align: right; font-weight: 700; color: var(--text); font-family: var(--font-heading); }
/* Tuile à liste longue (ex. CA/Nb par type de machine) : hauteur bornée à ~9 lignes
   (24px/ligne : 14px de barre + bordures + 8px de marge), défilement vertical fin
   au lieu d'étirer la carte. Padding-right pour ne pas recouvrir la valeur. */
.bar-scroll {
  max-height: 216px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.6) transparent;
}
.bar-scroll::-webkit-scrollbar { width: 6px; }
.bar-scroll::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.55); border-radius: 999px; }
.bar-scroll::-webkit-scrollbar-track { background: transparent; }
/* Barre segmentée (statut × catégorie de machine) : segments côte à côte. */
.bar-row .bar-stack { display: flex; }
.bar-row .bar-stack .bar-seg { display: block; height: 100%; transition: width 0.35s ease; }
/* En-tête de la tuile « Affaires perdues · machines » : total + montant perdu. */
.lost-head {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--danger);
  font-family: var(--font-heading);
  margin: 0 0 10px;
}

/* ====================== TOOLBAR ====================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search {
  flex: 0 1 320px;
  /* Aligné sur la hauteur compacte des .btn (v2.415) : sans cela, le champ restait
     ~9px plus haut que les boutons et la barre d'outils gardait son ancienne hauteur. */
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  transition: all 0.2s;
}
.search::placeholder { color: var(--text-caption); }
.search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Barre d'outils rapprochée du bandeau d'onglets et STABLE au défilement (TOUS les
   onglets). La barre est collante (top: --pipe-chrome = bas du bandeau d'onglets), mais
   au repos elle se posait ~13px plus bas (padding haut de <main>), si bien qu'au début
   du défilement elle « remontait » de ces ~13px avant de se figer. On remonte chaque
   panneau (marge négative) pour que sa position de repos coïncide avec son point
   d'accroche : la barre est collée sous les onglets dès le départ et ne bouge plus. */
.tab-panel { margin-top: -12px; }
/* Pipeline : recherche + tous les boutons sur UNE SEULE ligne (gain de place).
   La recherche se réduit (au lieu d'occuper sa propre ligne) et le bloc d'actions
   prend le reste de la largeur ; ses boutons débordent en interne si nécessaire. */
#panel-pipeline .toolbar { flex-wrap: nowrap; align-items: flex-start; }
/* Barre d'outils du Pipeline COLLANTE au défilement (l'écran étant l'accueil de
   tous les commerciaux, on garde recherche + Vue + Statut + Prévisions sous les yeux).
   Elle se cale sous l'en-tête d'app + le bandeau d'onglets (déjà sticky) : offset
   --pipe-chrome calculé en JS (robuste mobile/compact/retour à la ligne ; repli 110px).
   Fond opaque (les lignes défilent dessous) + léger ombrage. z-index sous le bandeau
   d'onglets (49) et au-dessus du tableau. Les en-têtes de colonnes ne collent pas
   (défilement page + conteneur overflow-x → sticky impossible ; décision séparée).
   Appliqué à TOUS les onglets à barre d'outils (Pipeline, Tâches, Cartes Trello,
   Vente Annuelle) pour un comportement homogène. */
#panel-pipeline .toolbar,
#panel-taches .toolbar,
#panel-trello .toolbar,
#panel-ventes .toolbar {
  position: sticky;
  top: var(--pipe-chrome, 110px);
  z-index: 40;
  background: var(--bg-deep);
  /* 1er calque : bande opaque (couleur de page) de 16px AU-DESSUS de la barre — comble
     tout interstice résiduel entre le bandeau d'onglets et la barre (les lignes ne
     défilent plus dans cette bande). Elle se glisse SOUS le bandeau d'onglets (z 49 >
     40), donc invisible là où ils se chevauchent. 2e calque : ombre portée sous la barre. */
  box-shadow: 0 -16px 0 0 var(--bg-deep), 0 6px 10px -6px rgba(0, 0, 0, 0.45);
  padding-top: 6px;
  margin-bottom: 10px;
}
#panel-pipeline .search { flex: 0 1 240px; min-width: 140px; }
#panel-pipeline .actions { flex: 1 1 auto; min-width: 0; align-items: center; }

/* Vente Annuelle — cas particulier (sous-onglets). La barre d'outils a été REMONTÉE
   juste sous les sous-onglets (au-dessus des tableaux de bord). Pour qu'elle se fige
   SANS dérive (et non seulement après que les sous-onglets aient défilé), on rend les
   sous-onglets EUX AUSSI collants : ils restent sous le bandeau d'onglets, et la barre
   se cale juste en dessous. Les sous-onglets restent ainsi accessibles au défilement. */
#panel-ventes nav.subtabs {
  position: sticky;
  top: var(--pipe-chrome, 110px);
  z-index: 41;               /* au-dessus de la barre (40), sous le bandeau d'onglets (49) */
  background: var(--bg-deep);
  box-shadow: 0 -16px 0 0 var(--bg-deep);   /* comble l'interstice avec le bandeau d'onglets */
  margin-bottom: 6px;        /* rapproche la barre des sous-onglets (repos = accroche → pas de dérive) */
}
/* La barre de Ventes se cale SOUS les sous-onglets pinnés (~54px de haut). */
#panel-ventes .toolbar { top: calc(var(--pipe-chrome, 110px) + 54px); }
/* Écart onglets↔sous-onglets aligné sur les autres onglets (le nav des sous-onglets a
   son propre espacement → on remonte un peu plus le panneau Ventes). */
#panel-ventes { margin-top: -21px; }

/* ====================== BUTTONS ====================== */
.btn {
  background: var(--bg-elevation);
  border: 1px solid var(--border);
  /* Hauteur compacte (v2.415) : padding VERTICAL réduit 9 -> 5px (38 -> 30px de haut)
     à taille de texte INCHANGÉE (13px). S'applique à tous les boutons de tous les
     onglets (classe partagée) ; le bouton « Statut » du Pipeline et le champ de
     recherche des barres d'outils sont alignés sur cette hauteur (cf. règles dédiées). */
  padding: 5px 16px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-body);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Respecte l'attribut HTML "hidden" même quand un élément a aussi une classe
   avec display: inline-flex / flex / grid (ex: .btn). */
[hidden] { display: none !important; }
.btn:hover {
  background: var(--bg-elevation-2);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: var(--bg-deep);
  border: none;
  font-weight: 700;
  box-shadow: var(--glow-soft);
}
.btn-primary:hover {
  color: var(--bg-deep);
  box-shadow: var(--glow-strong);
  transform: translateY(-1px);
}
.btn-action {
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.3);
  color: var(--primary);
}
.btn-action:hover {
  background: rgba(56,189,248,0.16);
  border-color: var(--primary);
  box-shadow: var(--glow-soft);
  color: var(--primary);
}
.btn-action.btn-danger {
  background: rgba(239,68,68,0.10);
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}
.btn-action.btn-danger:hover {
  background: rgba(239,68,68,0.20);
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239,68,68,0.35);
  color: #fecaca;
}

/* ====================== TABLE ====================== */
.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: auto;
  box-shadow: var(--shadow-card);
}
/* PLUS de plafond de hauteur par DÉFAUT sur les tableaux. Ce plafond (max-height:65vh)
   « rattrapait » sans cesse le tableau Pipeline (plafond bas réintroduit ~3-4 fois via
   les overrides successifs). Le seul tableau qui le veut est celui d'un modal
   (Historique) → on le lui remet explicitement ci-dessous. Résultat : les tableaux des
   onglets (Pipeline/Tâches/Ventes/Trello) ne peuvent PLUS être plafonnés, quoi qu'il
   arrive. Le Tableau de bord n'a pas de .table-wrapper. */
.modal .table-wrapper { max-height: 65vh; }
/* Tableaux Pipeline / Tâches / Vente Annuelle / Cartes Trello : plus de plafond de
   hauteur ni de scroll interne. Le tableau se déploie sur toute sa hauteur (la page
   défile verticalement) et le défilement HORIZONTAL passe par la barre du navigateur
   en bas de l'écran — une seule barre, toujours accessible (fini la barre interne
   redondante au milieu de l'écran). Le Tableau de bord (#panel-analyses) garde son
   comportement d'origine. */
#pipe-views .table-wrapper,
#panel-taches .table-wrapper,
#panel-ventes .table-wrapper,
#panel-trello .table-wrapper {
  /* EN-TÊTES FIGÉS : le tableau défile DANS sa propre zone (barre verticale propre),
     qui remplit la hauteur restante de l'écran sous le chrome collant (onglets +
     barre d'outils / sous-onglets, mesuré en JS via --table-top). L'en-tête (thead
     sticky top:0) reste ainsi visible pendant le défilement des lignes. Le wrapper
     reste aussi le scroller HORIZONTAL (colonne figée calée sur le tableau).
     Ce n'est PAS l'ancien plafond bas (65vh) : la zone occupe tout l'espace dispo.
     Ce n'est PAS l'ancien plafond bas (65vh) : la zone occupe tout l'espace dispo. */
  max-height: var(--table-h, calc(100dvh - var(--table-top, 176px)));
  /* overflow-x: hidden (v2.355) → PAS de barre horizontale NATIVE (elle se retrouvait
     au ras du bas de l'écran, empilée sous la barre flottante = double barre moche et
     inutilisable). Le défilement horizontal passe UNIQUEMENT par la barre FLOTTANTE
     turquoise (#floatingScroll, fixée en bas du viewport), qui pilote scrollLeft — ce
     qui fonctionne même en overflow-x:hidden. La barre VERTICALE native reste (auto). */
  overflow-x: hidden;
  overflow-y: auto;
}
/* Volet de détail OUVERT : le tableau reprend un défilement horizontal CONTENU dans
   sa zone (à gauche du volet), au lieu de faire déborder toute la page — sinon le volet,
   qui vit dans le flux, glisse hors de l'écran au défilement horizontal. Le volet (sibling
   flex) reste fixe et toutes les colonnes restent atteignables (la zone défile À CÔTÉ du
   volet, aucune n'est cachée derrière lui). IMPORTANT : PAS de plafond de hauteur — le
   tableau garde sa pleine hauteur et la PAGE défile verticalement (comme hors volet) ;
   `overflow-y: clip` évite une barre verticale interne parasite. La barre horizontale de
   cette zone est ré-affichée plus bas (elle est masquée par défaut sur .table-wrapper).
   La classe .has-detail est posée par pipeline.js (_applyDetailLayout). */
#pipe-split.has-detail .table-wrapper {
  overflow-x: hidden;   /* idem : défilement horizontal via la barre flottante uniquement */
  overflow-y: auto;
  max-height: var(--table-h, calc(100dvh - var(--table-top, 176px)));
}
/* Vue Liste + VOLET ouvert : la PAGE ne doit pas défiler verticalement (le tableau et
   le volet défilent chacun dans leur propre zone). On verrouille donc le défilement
   vertical du document → plus de barre de défilement verticale « tout à droite », et le
   petit débordement résiduel (dû aux barres de défilement) ne peut plus faire remonter le
   contenu ni rogner la bande de Statut. Le sélecteur :has() ne cible QUE le cas Pipeline
   actif + volet visible : dès qu'on change d'onglet ou qu'on ferme le volet, le défilement
   de page redevient normal (aucune incidence sur le Tableau de bord, etc.).
   v2.365 : élargi de `#pipe-split.has-detail` (volet ouvert seulement) à toute la
   VUE LISTE (`#pipe-split.view-liste`, posée par _applyView) — le volet n'existe qu'en
   vue Liste, donc ce cas est inclus. But : supprimer « une fois pour toutes » la barre
   verticale « tout à droite » de la page en vue Liste (le tableau garde SA barre interne).
   Cartes/Timeline NON ciblées : leur contenu peut être plus haut et la page doit défiler.
   v2.386 : restreint aux INDICATEURS REPLIÉS (`pipe-stats-off`, bouton « Indicateurs »).
   Dépliés, les jauges/tuiles/graphiques au-dessus du tableau dépassent l'écran : la page
   DOIT défiler, sinon le tableau est inatteignable (vécu). Le tableau garde alors sa
   zone défilante interne « hauteur d'écran sous le chrome » (cf. sizeTableWrappers) :
   la virtualisation (bande 2e sur le scrollTop du wrapper) reste intacte. */
html:has(#panel-pipeline.active.pipe-stats-off #pipe-split.view-liste) { overflow-y: hidden; }
/* Volet ouvert : le tableau garde sa PLEINE HAUTEUR (aucun plafond) et son
   overflow:visible. Le tableau large déborde alors sous le volet, mais le volet passe
   AU-DESSUS (z-index, cf. .pipe-detail) et masque ce débordement — donc plus d'en-têtes
   de colonnes par-dessus le volet, sans re-limiter la hauteur du tableau. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text-body);
}
.data-table th, .data-table td {
  padding: 7px 6px;              /* padding horizontal compacté (était 10px) : colonnes moins larges */
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  max-width: 280px;            /* garde-fou : aucune colonne ne s'étire à l'excès */
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Densité « Serré » (réglage Affichage → Densité) : réduit la hauteur des lignes
   pour afficher plus d'affaires à l'écran. On ne touche qu'au padding VERTICAL
   (l'horizontal reste pour la lisibilité). S'applique à tous les .data-table. */
html.lignes-compactes .data-table th,
html.lignes-compactes .data-table td { padding-top: 2px; padding-bottom: 2px; }
.data-table thead th {
  background: var(--bg-elevation);
  position: sticky;
  top: 0;                       /* en-tête figé en haut de la zone défilante du tableau */
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  z-index: 5;                   /* au-dessus des cellules du corps (dont la colonne figée, z2) */
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(56,189,248,0.04); }
.data-table tbody tr.selected { background: rgba(56,189,248,0.12); box-shadow: inset 3px 0 0 var(--primary); }

/* Colonne « identité » (Client/Société) figée horizontalement : reste visible en
   défilant vers la droite, comme un volet figé Excel. Fond opaque obligatoire
   (les autres colonnes défilent dessous) ; ombre légère pour marquer la limite.
   Le fond suit la VRAIE couleur de la ligne via la variable --row-bg (définie
   plus bas pour chaque statut/survol/sélection) — repli neutre si non définie.
   Deux couches : la teinte --row-bg est PRÉ-COMPOSÉE sur une base opaque
   --bg-surface (le fond réel du tableau). Poser --row-bg seul empilerait la
   teinte semi-transparente sur celle que le tr peint déjà sous la cellule
   (0,45 × 2 ≈ 0,70 d'opacité → colonne plus foncée que le reste de la ligne). */
.data-table td.col-frozen {
  position: sticky;
  left: 0;
  z-index: 2;
  background: linear-gradient(var(--row-bg, transparent), var(--row-bg, transparent)), var(--bg-surface);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.15);
}
/* Coin figé (en-tête d'une colonne figée) : sticky top:0 (hérité) + left:0. z-index le
   plus élevé pour rester au-dessus de l'en-tête (z5) ET de la colonne figée du corps (z2). */
.data-table thead th.col-frozen {
  left: 0;
  z-index: 6;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.15);
}

/* Affichage « sobre » (bouton Couleurs/Sobre) : neutralise le fond coloré des lignes
   par statut (Leads, Offres, Tâches, Cartes Trello, Trimestres) sur tous les onglets.
   La sélection (.selected) et les badges/coches de statut restent visibles : seul le
   tint disparaît. */
html.sans-couleur-ligne .data-table tbody tr[class*="lead-"]:not(.selected),
html.sans-couleur-ligne .data-table tbody tr[class*="offre-"]:not(.selected),
html.sans-couleur-ligne .data-table tbody tr[class*="tache-"]:not(.selected),
html.sans-couleur-ligne .data-table tbody tr[class*="trello-"]:not(.selected),
html.sans-couleur-ligne .data-table tbody tr.vente-facturee:not(.selected) {
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  /* La colonne figée doit aussi perdre le tint (spécificité > règles --row-bg par statut). */
  --row-bg: var(--bg-surface);
}
html.sans-couleur-ligne .data-table tbody tr[class*="lead-"]:not(.selected):hover,
html.sans-couleur-ligne .data-table tbody tr[class*="offre-"]:not(.selected):hover,
html.sans-couleur-ligne .data-table tbody tr[class*="tache-"]:not(.selected):hover,
html.sans-couleur-ligne .data-table tbody tr[class*="trello-"]:not(.selected):hover,
html.sans-couleur-ligne .data-table tbody tr.vente-facturee:not(.selected):hover {
  background: rgba(56,189,248,0.04) !important;
  --row-bg: var(--bg-elevation);
}

/* Statut d'affaire pour l'onglet Leads (colonnes W -> AC du fichier Excel)
   Une ligne sans couleur = lead a traiter (aucune case cochee) */
.data-table tbody tr.lead-gagnee {
  background: rgba(76,157,66,0.45);
  box-shadow: inset 6px 0 0 #4C9D42, 0 0 0 1px rgba(76,157,66,0.30);
}
.data-table tbody tr.lead-gagnee:hover  { background: rgba(76,157,66,0.60); }

.data-table tbody tr.lead-finalisation {
  background: rgba(56,189,248,0.45);
  box-shadow: inset 6px 0 0 #38bdf8, 0 0 0 1px rgba(56,189,248,0.30);
}
.data-table tbody tr.lead-finalisation:hover  { background: rgba(56,189,248,0.60); }

.data-table tbody tr.lead-encours {
  background: rgba(59,130,246,0.45);
  box-shadow: inset 6px 0 0 #3b82f6, 0 0 0 1px rgba(59,130,246,0.30);
}
.data-table tbody tr.lead-encours:hover  { background: rgba(59,130,246,0.60); }

.data-table tbody tr.lead-relancee {
  background: rgba(244,152,25,0.50);
  box-shadow: inset 6px 0 0 #F49819, 0 0 0 1px rgba(244,152,25,0.35);
}
.data-table tbody tr.lead-relancee:hover  { background: rgba(244,152,25,0.65); }

/* Lead transféré vers Offre Tech Com : teinte teal (cohérent avec l'icône 📤) */
.data-table tbody tr.lead-transferred {
  background: rgba(20,184,166,0.40);
  box-shadow: inset 6px 0 0 #14b8a6, 0 0 0 1px rgba(20,184,166,0.30);
}
.data-table tbody tr.lead-transferred:hover { background: rgba(20,184,166,0.55); }
/* Badge "📤 année(s)" dans la cellule Client */
.badge-transfer {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  background: rgba(20,184,166,0.20); color: #5eead4;
  border: 1px solid rgba(20,184,166,0.45); border-radius: 10px;
  font-size: 11px; font-weight: 700; white-space: nowrap; vertical-align: middle;
}

.data-table tbody tr.lead-reportee {
  background: rgba(148,163,184,0.38);
  box-shadow: inset 6px 0 0 #94a3b8;
}
.data-table tbody tr.lead-reportee:hover  { background: rgba(148,163,184,0.55); }

.data-table tbody tr.lead-abandonnee {
  background: rgba(100,116,139,0.40);
  box-shadow: inset 6px 0 0 #64748b;
  opacity: 0.82;
}
.data-table tbody tr.lead-abandonnee:hover  { background: rgba(100,116,139,0.60); opacity: 1; }

.data-table tbody tr.lead-perdue        { background: rgba(0, 0, 0, 0.55); box-shadow: inset 4px 0 0 #000000; }
.data-table tbody tr.lead-perdue:hover  { background: rgba(0, 0, 0, 0.70); }

/* Coloration de ligne dans l'onglet Offres Tech Com — un peu plus visible que les leads */
.data-table tbody tr.offre-gagnee {
  background: rgba(76,157,66,0.45);
  box-shadow: inset 6px 0 0 #4C9D42, 0 0 0 1px rgba(76,157,66,0.30);
}
.data-table tbody tr.offre-gagnee:hover  { background: rgba(76,157,66,0.60); }

.data-table tbody tr.vente-facturee {
  background: rgba(76,157,66,0.45);
  box-shadow: inset 6px 0 0 #4C9D42, 0 0 0 1px rgba(76,157,66,0.30);
}
.data-table tbody tr.vente-facturee:hover  { background: rgba(76,157,66,0.60); }

.data-table tbody tr.offre-perdue {
  background: rgba(var(--panel),0.78);
  box-shadow: inset 6px 0 0 #000, 0 0 0 1px rgba(0,0,0,0.6);
  color: #e2e8f0;
}
.data-table tbody tr.offre-perdue:hover  { background: rgba(var(--panel),0.88); }
.data-table tbody tr.offre-perdue .badge { background: rgba(0,0,0,0.55); color: #f1f5f9; border-color: rgba(255,255,255,0.18); }

.data-table tbody tr.offre-encours {
  background: rgba(59,130,246,0.45);
  box-shadow: inset 6px 0 0 #3b82f6, 0 0 0 1px rgba(59,130,246,0.30);
}
.data-table tbody tr.offre-encours:hover  { background: rgba(59,130,246,0.60); }

.data-table tbody tr.offre-relancee {
  background: rgba(244,152,25,0.50);
  box-shadow: inset 6px 0 0 #F49819, 0 0 0 1px rgba(244,152,25,0.35);
}
.data-table tbody tr.offre-relancee:hover  { background: rgba(244,152,25,0.65); }

.data-table tbody tr.offre-chaud {
  background: rgba(255,106,0,0.55);
  box-shadow: inset 6px 0 0 #ff6a00, 0 0 0 1px rgba(255,106,0,0.40);
}
.data-table tbody tr.offre-chaud:hover  { background: rgba(255,106,0,0.70); }
.data-table tbody tr.offre-chaud .badge { background: rgba(255,106,0,0.30); color: #ffd9b3; border-color: rgba(255,106,0,0.6); }

.data-table tbody tr.offre-reportee {
  background: rgba(148,163,184,0.38);
  box-shadow: inset 6px 0 0 #94a3b8;
}
.data-table tbody tr.offre-reportee:hover  { background: rgba(148,163,184,0.55); }

.data-table tbody tr.offre-abandonnee {
  background: rgba(100,116,139,0.40);
  box-shadow: inset 6px 0 0 #64748b;
  opacity: 0.82;
}
.data-table tbody tr.offre-abandonnee:hover  { background: rgba(100,116,139,0.60); opacity: 1; }

/* ============== Vue Kanban — Offres Tech Com ============== */
/* Board horizontal : une colonne par statut, défilement latéral. Reprend les
   variables de thème (clair/sombre) pour rester cohérent avec le reste de l'app. */
.kanban-board {
  display: flex;
  gap: 12px;
  /* Barre H toujours visible : le board est un ruban horizontal de hauteur bornée
     (chaque colonne défile verticalement en interne, cf. .kanban-col / -body). La
     barre reste donc juste sous les colonnes, sans devoir dérouler une colonne pleine. */
  overflow-x: scroll;
  overflow-y: hidden;
  align-items: flex-start;
  padding: 4px 2px 8px;
  scrollbar-width: thin;                          /* Firefox */
  scrollbar-color: var(--primary) rgba(var(--panel), 0.4);
}
/* Barre de défilement horizontale bien visible (reprend l'accent cyan des tableaux) */
.kanban-board::-webkit-scrollbar { height: 14px; }
.kanban-board::-webkit-scrollbar-track { background: rgba(var(--panel), 0.4); border-radius: 999px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: var(--primary-deep); background-clip: content-box; border: 3px solid transparent; }
.kanban-col {
  flex: 0 0 244px;
  width: 244px;
  display: flex;
  flex-direction: column;
  /* Hauteur bornée au viewport : les cartes défilent DANS la colonne, la barre H du
     board reste visible. --kanban-h est calculée en JS d'après la position réelle du
     board (sizeKanbanBoard, app.js) ; le calc() n'est qu'un repli avant ce calcul. */
  max-height: var(--kanban-h, calc(100vh - 320px));
  /* Fond = couleur de la pastille de statut (--kdot), en mode Couleur. Teinte
     franche (les cartes ont un fond opaque -> restent lisibles). Repli neutre
     d'abord (navigateurs sans color-mix), puis le mélange. */
  background: rgba(var(--panel), 0.45);
  background: color-mix(in srgb, var(--kdot, transparent) 60%, var(--bg-surface));
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px;
}
/* Mode « Sobre » : on retire la teinte de colonne (fond neutre), comme pour les
   lignes des tableaux (html.sans-couleur-ligne). */
html.sans-couleur-ligne .kanban-col { background: rgba(var(--panel), 0.45); }
.kanban-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;   /* en-tête fixe : seul le corps de colonne défile */
  padding: 2px 2px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.kanban-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.kanban-col-title { font-weight: 700; font-size: 13px; color: var(--text); }
.kanban-col-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(var(--panel), 0.65);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.kanban-col-total { flex-basis: 100%; font-size: 12px; color: var(--text-muted); padding-left: 17px; }
.kanban-col-body {
  display: flex; flex-direction: column; gap: 10px; min-height: 44px;
  flex: 1 1 auto;                 /* occupe la hauteur restante de la colonne */
  overflow-y: auto; overflow-x: hidden;   /* les cartes défilent ici, pas le board */
  padding-right: 2px;             /* évite que la barre chevauche les cartes */
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.6) transparent;
}
.kanban-col-body::-webkit-scrollbar { width: 8px; }
.kanban-col-body::-webkit-scrollbar-track { background: transparent; }
.kanban-col-body::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; }
.kanban-empty { text-align: center; color: var(--text-caption); font-size: 12px; padding: 10px 0; }

/* Glisser-déposer : carte saisissable, carte en cours de déplacement, colonne cible. */
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card[draggable="true"]:active { cursor: grabbing; }
.kanban-dragging { opacity: 0.45; }
.kanban-col.kanban-drop-target {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px;
  cursor: pointer;
  box-shadow: inset 4px 0 0 var(--kdot, var(--border));
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.kanban-card:hover,
.kanban-card:focus-visible {
  border-color: var(--primary);
  box-shadow: inset 4px 0 0 var(--kdot, var(--border)), var(--shadow-card);
  transform: translateY(-1px);
  outline: none;
}
.kanban-thumb {
  height: 60px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  background: rgba(var(--panel), 0.55);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-caption);
}
.kanban-thumb svg { width: 26px; height: 26px; opacity: 0.6; }
/* Vignette avec image de couverture : cadre CARRÉ, l'image ENTIÈRE s'y adapte
   (object-fit: contain → aucun rognage ; d'éventuelles bandes apparaissent autour
   d'une image non carrée). height:auto écrase le 60px de base pour aspect-ratio.
   Fond blanc : les images produit sont des rendus sur fond blanc → bandes discrètes. */
.kanban-thumb--img {
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--border);
  border-style: solid;
  overflow: hidden;
  background: #fff;
}
.kanban-thumb--img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kanban-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.kanban-card-title { font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.35; margin-bottom: 6px; }
.kanban-card-montant { font-weight: 700; font-size: 13px; color: var(--text); }
.kanban-card-marge { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kanban-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kanban-foot-spacer { flex: 1 1 auto; }
.kanban-files { font-size: 12px; color: var(--text-muted); }
/* Boutons Suivi / Fichiers de la carte : compacts, alignés à droite du pied. */
.kanban-card-actions { display: inline-flex; gap: 4px; align-items: center; }
.kanban-card-actions .journal-btn { padding: 2px 6px; font-size: 12px; }

/* ============== Pipeline : bascule de vue + zoom + vue Carte ============== */
/* Bascule de vue (Liste / Cartes / Timeline) — segmented control. */
.pipe-view-seg, .pipe-zoom {
  display: inline-flex; align-items: center; gap: 2px;
  background: rgba(var(--panel), 0.6); border: 1px solid var(--border);
  border-radius: 9px; padding: 2px;
}
.pipe-view-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: none; background: transparent; color: var(--text-muted);
  font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 7px; cursor: pointer;
}
.pipe-view-btn svg { width: 16px; height: 16px; }
.pipe-view-btn.is-active {
  background: var(--bg-surface); color: var(--text); font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}
/* Sélecteur de vue fusionné en un seul bouton (Liste / Cartes / Timeline via menu). */
.pipe-view-menu-btn { display: inline-flex; align-items: center; gap: 7px; }
.pipe-view-menu-btn .pipe-view-cur-ic { width: 15px; height: 15px; }
.pipe-view-menu-btn .pipe-caret { opacity: 0.65; margin-left: -1px; }
/* Bouton « ⋯ » (menu Plus d'options) : ellipse un peu plus grande, largeur compacte. */
.pipe-more-btn { font-size: 18px; line-height: 1; font-weight: 700; letter-spacing: 1px; padding-left: 12px; padding-right: 12px; }
/* Item actif dans le menu de vue : pastille cyan à gauche + libellé accentué. */
.row-menu-panel .tools-menu-item.is-active { color: var(--text); font-weight: 700; }
.row-menu-panel .tools-menu-item svg { width: 16px; height: 16px; }
/* Séparateur dans un menu déroulant (ex. menu Vue : items de bascule de vue au-dessus,
   actions Volet / Carte en dessous). Fin filet aux couleurs du thème. */
.row-menu-panel .tools-menu-sep { height: 1px; background: var(--border-soft); margin: 4px 6px; }
.pipe-zoom-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: none; background: transparent;
  color: var(--text-muted); border-radius: 7px; cursor: pointer;
}
.pipe-zoom-btn:hover { background: var(--bg-surface); color: var(--text); }
.pipe-zoom-btn svg { width: 16px; height: 16px; }
.pipe-zoom-val { min-width: 44px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-muted); }

/* Vue Carte du Pipeline : réutilise .kanban-board/.kanban-col/.kanban-card. */
.pipeline-kanban { zoom: var(--pipe-zoom, 1); margin-top: 4px; }
/* Colonnes plus HAUTES qu'en Kanban Offres + hauteur DIVISÉE par le zoom : ainsi,
   dézoomer montre RÉELLEMENT plus de cartes (la colonne occupe la même hauteur à
   l'écran quel que soit le zoom, mais contient plus de contenu logique). ~80vh de
   hauteur visible (le board déborde sous le pli → la page défile pour tout voir). */
.pipeline-kanban .kanban-col { max-height: calc(80vh / var(--pipe-zoom, 1)); }
/* Filtre de sous-onglet actif : les colonnes non ciblées sont voilées. */
.kanban-col-veiled { opacity: 0.32; filter: saturate(0.45); }
/* En-tête de carte (pastille Type + société) et éléments propres au Pipeline. */
.kanban-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.kanban-card-head .kanban-card-title { margin-bottom: 0; }
.kanban-card-head .badge { font-size: 10px; padding: 1px 7px; }
.kanban-chance { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.kanban-chance-track { flex: 1 1 auto; height: 5px; background: rgba(var(--panel), 0.7); border-radius: 9px; overflow: hidden; }
.kanban-chance-bar { display: block; height: 100%; background: var(--primary); border-radius: 9px; }
.kanban-chance-val { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.kanban-ech { font-size: 10.5px; font-weight: 700; color: var(--text-muted); background: rgba(var(--panel), 0.7); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.kanban-next { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Placeholder « à venir » (vue Timeline, Phase 1). */
.pipeline-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 60px 20px; color: var(--text-muted);
  background: var(--bg-surface); border: 1px dashed var(--border); border-radius: var(--r);
}
.pipeline-soon-emoji { font-size: 34px; }
.pipeline-soon-title { font-size: 16px; font-weight: 800; color: var(--text); }
.pipeline-soon-sub { font-size: 13px; color: var(--text-caption); }

/* ============== Vue Timeline (frise chronologique des affaires) ============== */
/* Zoom (--pipe-zoom) : pilote la hauteur des rangées → dézoomer montre plus d'affaires.
   Largeur de la colonne « Affaire » figée pour aligner l'axe (en-tête) et les
   lignes de fond (corps). */
#pipeline-timeline {
  --tl-name-w: 190px;
  overflow: auto;
  max-height: 74vh;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.pipe-tl { min-width: 640px; display: flex; flex-direction: column; }
.pipe-tl-head {
  position: sticky; top: 0; z-index: 3;
  display: grid; grid-template-columns: var(--tl-name-w) 1fr;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.pipe-tl-head-name {
  padding: 8px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-muted); border-right: 1px solid var(--border);
}
.pipe-tl-head-axis { position: relative; height: 34px; }
.pipe-tl-mlabel {
  position: absolute; top: 9px; transform: translateX(4px);
  font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap;
}
/* Lignes verticales de mois (en-tête + fond du corps). */
.pipe-tl-mline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .5; }
.pipe-tl-body { position: relative; }
/* Overlay des lignes de mois + trait « aujourd'hui », sur toute la hauteur du corps,
   calé sur la piste (après la colonne nom). Aligné avec les barres (mêmes %). */
.pipe-tl-lines { position: absolute; top: 0; bottom: 0; left: var(--tl-name-w); right: 0; pointer-events: none; z-index: 0; }
.pipe-tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.5); z-index: 1; }
.pipe-tl-row {
  position: relative; display: grid; grid-template-columns: var(--tl-name-w) 1fr;
  border-bottom: 1px solid var(--border-soft, var(--border)); cursor: pointer;
}
.pipe-tl-row:hover { background: rgba(56,189,248,0.06); }
.pipe-tl-row.is-dimmed { opacity: .32; }
.pipe-tl-name {
  padding: calc(8px * var(--pipe-zoom, 1)) 14px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden;
}
.pipe-tl-soc { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-tl-stage { font-size: 11px; color: var(--text-muted); }
.pipe-tl-track { position: relative; height: calc(46px * var(--pipe-zoom, 1)); }
.pipe-tl-bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: calc(16px * var(--pipe-zoom, 1)); border-radius: 8px; z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pipe-tl-dot {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 11px; height: 11px; border-radius: 50%; border: 2px solid #38bdf8; z-index: 3;
}
.pipe-tl-dot.start { background: var(--bg-surface); }
.pipe-tl-endlabel {
  position: absolute; top: 50%; transform: translate(8px, -50%);
  font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; z-index: 2;
}
.pipe-tl-legend {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 16px;
  border-top: 1px solid var(--border); background: var(--panel);
  font-size: 12px; color: var(--text-muted);
}
.pipe-tl-leg { display: inline-flex; align-items: center; gap: 7px; }
.pipe-tl-legdot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--primary); }
.pipe-tl-legdot.start { background: var(--bg-surface); }
.pipe-tl-legdot.end { background: var(--primary); }
.pipe-tl-legtoday { width: 3px; height: 14px; border-radius: 2px; background: #ef4444; }

/* ============== Lignes Tâches : couleur selon statut ============== */
.data-table tbody tr.tache-afaire {
  background: rgba(56,189,248,0.18);
  box-shadow: inset 6px 0 0 #38bdf8;
}
.data-table tbody tr.tache-afaire:hover  { background: rgba(56,189,248,0.32); }

.data-table tbody tr.tache-encours {
  background: rgba(244,152,25,0.30);
  box-shadow: inset 6px 0 0 #F49819, 0 0 0 1px rgba(244,152,25,0.30);
}
.data-table tbody tr.tache-encours:hover  { background: rgba(244,152,25,0.45); }

.data-table tbody tr.tache-attente {
  background: rgba(148,163,184,0.30);
  box-shadow: inset 6px 0 0 #94a3b8;
}
.data-table tbody tr.tache-attente:hover  { background: rgba(148,163,184,0.45); }

.data-table tbody tr.tache-terminee {
  background: rgba(76,157,66,0.30);
  box-shadow: inset 6px 0 0 #4C9D42, 0 0 0 1px rgba(76,157,66,0.25);
  opacity: 0.75;
}
.data-table tbody tr.tache-terminee:hover  { background: rgba(76,157,66,0.45); opacity: 1; }

.data-table tbody tr.tache-retard {
  background: rgba(239,68,68,0.40);
  box-shadow: inset 6px 0 0 #ef4444, 0 0 0 1px rgba(239,68,68,0.45);
  animation: tacheRetardPulse 2s ease-in-out infinite;
}
@keyframes tacheRetardPulse {
  0%, 100% { box-shadow: inset 6px 0 0 #ef4444, 0 0 0 1px rgba(239,68,68,0.45); }
  50%      { box-shadow: inset 6px 0 0 #ef4444, 0 0 14px rgba(239,68,68,0.55); }
}

/* Colonne n° tâches : compacte, monospace */
#table-taches th[data-col="numero"],
#table-taches td[data-col="numero"] {
  min-width: 50px;
  width: 50px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-weight: 700;
  text-align: center;
}
/* Colonnes dates Tâches : largeur compacte (format YYYY-MM-DD) */
#table-taches th[data-col="date_creation"],
#table-taches td[data-col="date_creation"],
#table-taches th[data-col="date_maj"],
#table-taches td[data-col="date_maj"] {
  min-width: 100px;
  width: 110px;
  white-space: nowrap;
}
/* Colonne Échéance : un peu plus large pour héberger l'affichage enrichi */
#table-taches th[data-col="echeance"],
#table-taches td[data-col="echeance"] {
  min-width: 140px;
  width: 160px;
  white-space: nowrap;
}

/* Cellule Échéance — cliquable, état enrichi */
.echeance-cell {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  transition: background 0.15s;
}
.echeance-cell:hover { background: rgba(56,189,248,0.10); }
.echeance-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11px;
}
.echeance-display {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.echeance-calme        { background: rgba(76,157,66,0.20);  color: #86d175; border: 1px solid rgba(76,157,66,0.40); }
.echeance-proche       { background: rgba(244,152,25,0.22); color: #fde68a; border: 1px solid rgba(244,152,25,0.45); }
.echeance-aujourdhui   { background: rgba(244,114,25,0.30); color: #fed7aa; border: 1px solid rgba(244,114,25,0.60); }
.echeance-retard       { background: rgba(239,68,68,0.32);  color: #fecaca; border: 1px solid rgba(239,68,68,0.65); animation: echeancePulse 2s ease-in-out infinite; }
@keyframes echeancePulse {
  0%, 100% { box-shadow: 0 0 0 rgba(239,68,68,0); }
  50%      { box-shadow: 0 0 14px rgba(239,68,68,0.55); }
}

/* Popover Échéance */
.echeance-popover {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-deep), var(--glow-soft);
  padding: 12px;
  z-index: 260;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.echeance-presets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.echeance-preset {
  background: var(--bg-elevation);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.echeance-preset:hover {
  background: rgba(56,189,248,0.15);
  border-color: var(--primary);
  color: var(--primary);
}
.echeance-preset.echeance-clear {
  grid-column: 1/4;
  color: #f87171;
  border-color: rgba(239,68,68,0.4);
}
.echeance-preset.echeance-clear:hover {
  background: rgba(239,68,68,0.15);
  color: #fecaca;
}
.echeance-date label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.echeance-date input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
}
.echeance-date input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
/* Colonne Titre + Description Tâches — assez large pour saisie confortable */
#table-taches th[data-col="titre"],
#table-taches td[data-col="titre"] {
  min-width: 160px;
  max-width: 240px;
}
#table-taches th[data-col="description"],
#table-taches td[data-col="description"] {
  min-width: 180px;
  max-width: 280px;
}

/* Colonne Message du prospect (Leads) — aperçu compact + bouton "voir plus".
   La ligne reste sur 1 ligne, le détail s'affiche dans une popover dédiée. */
#table-leads th[data-col="message"],
#table-leads td[data-col="message"] {
  min-width: 180px;
  max-width: 260px;
  vertical-align: middle;
}
#table-leads td[data-col="message"] .cell-message {
  display: flex;
  align-items: center;
  gap: 8px;
}
#table-leads td[data-col="message"] .cell-message-preview {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
#table-leads td[data-col="message"] .cell-message-more {
  flex: 0 0 auto;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.35);
  color: var(--primary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#table-leads td[data-col="message"] .cell-message-more:hover {
  background: rgba(56,189,248,0.22);
  border-color: var(--primary);
}

/* Popover Message du prospect — fenêtre flottante */
.message-popover {
  position: absolute;
  z-index: 2000;
  width: 460px;
  max-width: 90vw;
  background: linear-gradient(160deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-deep), var(--glow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.message-popover-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevation);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.message-popover-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}
.message-popover-close:hover { color: var(--primary); }
.message-popover-text {
  width: 100%;
  min-height: 180px;
  max-height: 360px;
  padding: 12px 14px;
  background: var(--bg-deep);
  border: none;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.message-popover-text:focus {
  box-shadow: inset 0 0 0 2px rgba(56,189,248,0.25);
}
.message-popover-footer {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-elevation);
}
.message-popover-hint {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.message-popover-save {
  padding: 6px 14px;
  font-size: 12px;
}

/* Ligne Trello "Affaire complète" — fond vert */
.data-table tbody tr.trello-complete {
  background: rgba(76,157,66,0.45);
  box-shadow: inset 6px 0 0 #4C9D42, 0 0 0 1px rgba(76,157,66,0.35);
}
.data-table tbody tr.trello-complete:hover  { background: rgba(76,157,66,0.60); }

/* Ligne Trello "Template à recevoir" (devrait avoir un Template, pas encore reçu) — fond orange */
.data-table tbody tr.trello-template-attente {
  background: rgba(244,152,25,0.42);
  box-shadow: inset 6px 0 0 #F49819, 0 0 0 1px rgba(244,152,25,0.35);
}
.data-table tbody tr.trello-template-attente:hover  { background: rgba(244,152,25,0.58); }

/* Ligne Trello "Affaire terminée" — fond cyan */
.data-table tbody tr.trello-terminee {
  background: rgba(34,211,238,0.45);
  box-shadow: inset 6px 0 0 #22d3ee, 0 0 0 1px rgba(34,211,238,0.35);
}
.data-table tbody tr.trello-terminee:hover  { background: rgba(34,211,238,0.60); }

.data-table tbody tr.offre-attente {
  background: rgba(14,165,233,0.45);
  box-shadow: inset 6px 0 0 #0ea5e9, 0 0 0 1px rgba(14,165,233,0.30);
}
.data-table tbody tr.offre-attente:hover  { background: rgba(14,165,233,0.60); }

/* Entrées d'historique de type "Système" (mises à jour des données Excel) */
.data-table tbody tr.history-system        { background: rgba(56, 189, 248, 0.08); box-shadow: inset 3px 0 0 var(--primary); }
.data-table tbody tr.history-system:hover  { background: rgba(56, 189, 248, 0.14); }
.data-table tbody tr.history-system td:nth-child(2) { color: var(--primary); font-weight: 600; }

/* La selection (checkbox) reste prioritaire visuellement */
.data-table tbody tr.selected.lead-gagnee,
.data-table tbody tr.selected.lead-finalisation,
.data-table tbody tr.selected.lead-encours,
.data-table tbody tr.selected.lead-relancee,
.data-table tbody tr.selected.lead-transferred,
.data-table tbody tr.selected.lead-reportee,
.data-table tbody tr.selected.lead-abandonnee,
.data-table tbody tr.selected.lead-perdue,
.data-table tbody tr.selected.offre-gagnee,
.data-table tbody tr.selected.offre-perdue,
.data-table tbody tr.selected.offre-encours,
.data-table tbody tr.selected.offre-relancee,
.data-table tbody tr.selected.offre-chaud,
.data-table tbody tr.selected.offre-reportee,
.data-table tbody tr.selected.offre-abandonnee,
.data-table tbody tr.selected.offre-attente { background: rgba(56,189,248,0.18); box-shadow: inset 3px 0 0 var(--primary); }

/* ============================================================================
   Couleur de la colonne figée (.col-frozen) = couleur RÉELLE de la ligne.
   La variable --row-bg duplique la valeur `background` de chaque état de ligne
   ci-dessus (statut, survol, sélection) ; héritée par la cellule figée
   (position:sticky, cf. règle plus haut). Sans effet sur les règles `background`
   existantes : ce bloc est purement additif. À tenir synchronisé si une couleur
   de ligne change ci-dessus.
   ============================================================================ */
.data-table tbody tr { --row-bg: var(--bg-surface); }
.data-table tbody tr:hover { --row-bg: var(--bg-elevation); }
.data-table tbody tr.selected { --row-bg: rgba(56, 189, 248, 0.12); }

.data-table tbody tr.lead-gagnee { --row-bg: rgba(76,157,66,0.45); }
.data-table tbody tr.lead-gagnee:hover { --row-bg: rgba(76,157,66,0.60); }
.data-table tbody tr.lead-finalisation { --row-bg: rgba(56,189,248,0.45); }
.data-table tbody tr.lead-finalisation:hover { --row-bg: rgba(56,189,248,0.60); }
.data-table tbody tr.lead-encours { --row-bg: rgba(59,130,246,0.45); }
.data-table tbody tr.lead-encours:hover { --row-bg: rgba(59,130,246,0.60); }
.data-table tbody tr.lead-relancee { --row-bg: rgba(244,152,25,0.50); }
.data-table tbody tr.lead-relancee:hover { --row-bg: rgba(244,152,25,0.65); }
.data-table tbody tr.lead-transferred { --row-bg: rgba(20,184,166,0.40); }
.data-table tbody tr.lead-transferred:hover { --row-bg: rgba(20,184,166,0.55); }
.data-table tbody tr.lead-reportee { --row-bg: rgba(148,163,184,0.38); }
.data-table tbody tr.lead-reportee:hover { --row-bg: rgba(148,163,184,0.55); }
.data-table tbody tr.lead-abandonnee { --row-bg: rgba(100,116,139,0.40); }
.data-table tbody tr.lead-abandonnee:hover { --row-bg: rgba(100,116,139,0.60); }
.data-table tbody tr.lead-perdue { --row-bg: rgba(0, 0, 0, 0.55); }
.data-table tbody tr.lead-perdue:hover { --row-bg: rgba(0, 0, 0, 0.70); }

.data-table tbody tr.offre-gagnee { --row-bg: rgba(76,157,66,0.45); }
.data-table tbody tr.offre-gagnee:hover { --row-bg: rgba(76,157,66,0.60); }
.data-table tbody tr.vente-facturee { --row-bg: rgba(76,157,66,0.45); }
.data-table tbody tr.vente-facturee:hover { --row-bg: rgba(76,157,66,0.60); }
.data-table tbody tr.offre-perdue { --row-bg: rgba(var(--panel),0.78); }
.data-table tbody tr.offre-perdue:hover { --row-bg: rgba(var(--panel),0.88); }
.data-table tbody tr.offre-encours { --row-bg: rgba(59,130,246,0.45); }
.data-table tbody tr.offre-encours:hover { --row-bg: rgba(59,130,246,0.60); }
.data-table tbody tr.offre-relancee { --row-bg: rgba(244,152,25,0.50); }
.data-table tbody tr.offre-relancee:hover { --row-bg: rgba(244,152,25,0.65); }
.data-table tbody tr.offre-chaud { --row-bg: rgba(255,106,0,0.55); }
.data-table tbody tr.offre-chaud:hover { --row-bg: rgba(255,106,0,0.70); }
.data-table tbody tr.offre-reportee { --row-bg: rgba(148,163,184,0.38); }
.data-table tbody tr.offre-reportee:hover { --row-bg: rgba(148,163,184,0.55); }
.data-table tbody tr.offre-abandonnee { --row-bg: rgba(100,116,139,0.40); }
.data-table tbody tr.offre-abandonnee:hover { --row-bg: rgba(100,116,139,0.60); }
.data-table tbody tr.offre-attente { --row-bg: rgba(14,165,233,0.45); }
.data-table tbody tr.offre-attente:hover { --row-bg: rgba(14,165,233,0.60); }

.data-table tbody tr.tache-afaire { --row-bg: rgba(56,189,248,0.18); }
.data-table tbody tr.tache-afaire:hover { --row-bg: rgba(56,189,248,0.32); }
.data-table tbody tr.tache-encours { --row-bg: rgba(244,152,25,0.30); }
.data-table tbody tr.tache-encours:hover { --row-bg: rgba(244,152,25,0.45); }
.data-table tbody tr.tache-attente { --row-bg: rgba(148,163,184,0.30); }
.data-table tbody tr.tache-attente:hover { --row-bg: rgba(148,163,184,0.45); }
.data-table tbody tr.tache-terminee { --row-bg: rgba(76,157,66,0.30); }
.data-table tbody tr.tache-terminee:hover { --row-bg: rgba(76,157,66,0.45); }
.data-table tbody tr.tache-retard { --row-bg: rgba(239,68,68,0.40); }

.data-table tbody tr.trello-complete { --row-bg: rgba(76,157,66,0.45); }
.data-table tbody tr.trello-complete:hover { --row-bg: rgba(76,157,66,0.60); }
.data-table tbody tr.trello-template-attente { --row-bg: rgba(244,152,25,0.42); }
.data-table tbody tr.trello-template-attente:hover { --row-bg: rgba(244,152,25,0.58); }
.data-table tbody tr.trello-terminee { --row-bg: rgba(34,211,238,0.45); }
.data-table tbody tr.trello-terminee:hover { --row-bg: rgba(34,211,238,0.60); }

.data-table tbody tr.history-system { --row-bg: rgba(56, 189, 248, 0.08); }
.data-table tbody tr.history-system:hover { --row-bg: rgba(56, 189, 248, 0.14); }

.data-table tbody tr.selected.lead-gagnee,
.data-table tbody tr.selected.lead-finalisation,
.data-table tbody tr.selected.lead-encours,
.data-table tbody tr.selected.lead-relancee,
.data-table tbody tr.selected.lead-transferred,
.data-table tbody tr.selected.lead-reportee,
.data-table tbody tr.selected.lead-abandonnee,
.data-table tbody tr.selected.lead-perdue,
.data-table tbody tr.selected.offre-gagnee,
.data-table tbody tr.selected.offre-perdue,
.data-table tbody tr.selected.offre-encours,
.data-table tbody tr.selected.offre-relancee,
.data-table tbody tr.selected.offre-chaud,
.data-table tbody tr.selected.offre-reportee,
.data-table tbody tr.selected.offre-abandonnee,
.data-table tbody tr.selected.offre-attente { --row-bg: rgba(56, 189, 248, 0.18); }

.data-table input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
}

.th-content {
  display: flex;
  align-items: center;
  gap: 3px;                      /* resserré (était 6px) : rapproche le libellé du bouton ▾ */
  justify-content: space-between;
}
.th-label { flex: 1; }
.th-label.sortable { cursor: pointer; user-select: none; transition: color 0.15s; }
.th-label.sortable:hover { color: var(--primary); }
.sort-ind { margin-left: 4px; color: var(--primary); font-size: 10px; }
.filter-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-caption);
  padding: 3px 6px;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}
.filter-btn:hover { background: rgba(56,189,248,0.15); color: var(--primary); }
.filter-btn.active {
  color: var(--primary);
  background: rgba(56,189,248,0.18);
  box-shadow: var(--glow-soft);
}

/* ====================== FILTER POPOVER ====================== */
.filter-popover {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-deep), var(--glow-soft);
  width: 290px;
  max-height: 440px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-body);
}
.fp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.fp-header strong {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.fp-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
}
.fp-close:hover { color: var(--primary); }
.fp-sort {
  display: flex; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.fp-sort-btn {
  flex: 1;
  background: var(--bg-elevation);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-body);
  font-family: var(--font-body);
  transition: all 0.15s;
}
.fp-sort-btn:hover { background: rgba(56,189,248,0.15); border-color: var(--primary); color: var(--primary); }
.fp-search {
  margin: 10px 12px;
  padding: 8px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-body);
}
.fp-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.fp-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  max-height: 230px;
}
.fp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-row:hover { background: rgba(56,189,248,0.08); color: var(--text); }
.fp-row input { cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.fp-row span { overflow: hidden; text-overflow: ellipsis; }
.fp-all {
  margin: 0 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-elevation);
  font-weight: 700;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
}
.fp-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-caption);
  font-size: 12px;
}
.fp-footer {
  display: flex; gap: 6px;
  padding: 12px;
  justify-content: flex-end;
}
.fp-footer .btn { padding: 7px 14px; font-size: 12px; }

/* ====================== BADGES ====================== */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: 1px solid transparent;
}
.badge.success { background: rgba(76,157,66,0.18); color: #86d175; border-color: rgba(76,157,66,0.4); }
.badge.danger  { background: rgba(239,68,68,0.18); color: #f87171; border-color: rgba(239,68,68,0.4); }
.badge.warning { background: rgba(244,152,25,0.18); color: #fbbf3a; border-color: rgba(244,152,25,0.4); }
.badge.info    { background: rgba(56,189,248,0.18); color: var(--primary); border-color: rgba(56,189,248,0.4); }
.badge.muted   { background: rgba(148,163,184,0.15); color: var(--text-muted); border-color: var(--border); }
.badge.violet  { background: rgba(139,92,246,0.18); color: #c4b5fd; border-color: rgba(139,92,246,0.45); }
.badge.sky     { background: rgba(14,165,233,0.20); color: #7dd3fc; border-color: rgba(14,165,233,0.5); }
.badge.primary { background: rgba(59,130,246,0.18); color: #60a5fa; border-color: rgba(59,130,246,0.4); }
.badge.negociation { background: rgba(20,184,166,0.18); color: #5eead4; border-color: rgba(20,184,166,0.45); }
/* Teintes supplémentaires « Mes couleurs » (palette élargie v2.248) */
.badge.indigo   { background: rgba(99,102,241,0.18); color: #a5b4fc; border-color: rgba(99,102,241,0.45); }
.badge.rose     { background: rgba(244,114,182,0.18); color: #f9a8d4; border-color: rgba(244,114,182,0.45); }
.badge.fuchsia  { background: rgba(217,70,239,0.18); color: #f0abfc; border-color: rgba(217,70,239,0.45); }
.badge.lime     { background: rgba(132,204,22,0.18); color: #bef264; border-color: rgba(132,204,22,0.45); }
.badge.emeraude { background: rgba(16,185,129,0.18); color: #6ee7b7; border-color: rgba(16,185,129,0.45); }
.badge.jaune    { background: rgba(234,179,8,0.18);  color: #fde047; border-color: rgba(234,179,8,0.45); }
.badge.ardoise  { background: rgba(71,85,105,0.25);  color: #cbd5e1; border-color: rgba(71,85,105,0.5); }

/* Couleurs spécifiques colonne Action (Gestion des Leads) — design plus visuel */
.badge.action-attente {
  background: linear-gradient(135deg, rgba(244,152,25,0.25) 0%, rgba(251,191,58,0.30) 100%);
  color: #fde68a;
  border-color: rgba(244,152,25,0.6);
  box-shadow: 0 0 8px rgba(244,152,25,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
/* Type Machine par gamme — utilisé dans Vente Annuelle + Cartes Trello */
.badge.gamme-distrib {
  background: linear-gradient(135deg, rgba(59,130,246,0.28) 0%, rgba(56,189,248,0.32) 100%);
  color: #bfdbfe;
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 0 8px rgba(59,130,246,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.gamme-stock {
  background: linear-gradient(135deg, rgba(244,152,25,0.28) 0%, rgba(251,191,58,0.32) 100%);
  color: #fde68a;
  border-color: rgba(244,152,25,0.65);
  box-shadow: 0 0 8px rgba(244,152,25,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.gamme-classement {
  background: linear-gradient(135deg, rgba(76,157,66,0.30) 0%, rgba(132,204,22,0.32) 100%);
  color: #bbf7d0;
  border-color: rgba(76,157,66,0.65);
  box-shadow: 0 0 8px rgba(76,157,66,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.gamme-divers {
  background: linear-gradient(135deg, rgba(148,163,184,0.28) 0%, rgba(100,116,139,0.32) 100%);
  color: #e2e8f0;
  border-color: rgba(148,163,184,0.55);
  box-shadow: 0 0 8px rgba(148,163,184,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.gamme-info {
  background: linear-gradient(135deg, rgba(168,85,247,0.28) 0%, rgba(139,92,246,0.32) 100%);
  color: #ddd6fe;
  border-color: rgba(168,85,247,0.6);
  box-shadow: 0 0 8px rgba(168,85,247,0.35), inset 0 1px 0 rgba(255,255,255,0.10);
  font-weight: 700;
}

.badge.action-plus {
  background: linear-gradient(135deg, rgba(100,116,139,0.30) 0%, rgba(71,85,105,0.32) 100%);
  color: #cbd5e1;
  border-color: rgba(100,116,139,0.55);
  box-shadow: 0 0 8px rgba(100,116,139,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.action-rappeler {
  background: linear-gradient(135deg, rgba(239,68,68,0.28) 0%, rgba(244,63,94,0.32) 100%);
  color: #fecaca;
  border-color: rgba(239,68,68,0.65);
  box-shadow: 0 0 10px rgba(239,68,68,0.40), inset 0 1px 0 rgba(255,255,255,0.10);
  font-weight: 700;
}
.badge.action-doc {
  background: linear-gradient(135deg, rgba(14,165,233,0.25) 0%, rgba(56,189,248,0.30) 100%);
  color: #bae6fd;
  border-color: rgba(56,189,248,0.6);
  box-shadow: 0 0 8px rgba(56,189,248,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.action-faire-offre {
  background: linear-gradient(135deg, rgba(250,204,21,0.28) 0%, rgba(234,179,8,0.32) 100%);
  color: #fef08a;
  border-color: rgba(250,204,21,0.65);
  box-shadow: 0 0 10px rgba(250,204,21,0.40), inset 0 1px 0 rgba(255,255,255,0.10);
  font-weight: 700;
}
.badge.action-offre {
  background: linear-gradient(135deg, rgba(34,197,94,0.25) 0%, rgba(132,204,22,0.30) 100%);
  color: #bbf7d0;
  border-color: rgba(34,197,94,0.6);
  box-shadow: 0 0 8px rgba(34,197,94,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}
.badge.action-rdv {
  background: linear-gradient(135deg, rgba(20,184,166,0.26) 0%, rgba(45,212,191,0.30) 100%);
  color: #99f6e4;
  border-color: rgba(45,212,191,0.6);
  box-shadow: 0 0 8px rgba(45,212,191,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 700;
}

.checkmark { color: var(--success); font-weight: bold; text-shadow: 0 0 8px rgba(76,157,66,0.5); }

/* Badge éditable (clic pour changer le statut Affaire dans les Leads) */
.badge-editable {
  cursor: pointer;
  position: relative;
  padding-right: 22px;
  transition: all 0.15s;
}
.badge-editable::after {
  content: '▾';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  opacity: 0.6;
}
.badge-editable:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 12px rgba(56,189,248,0.25);
}

/* Popover d'édition du statut Affaire */
.status-editor {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-deep), var(--glow-soft);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 250;
  min-width: 200px;
}
.status-editor-header {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 4px 6px 8px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.status-option {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.status-option:hover {
  background: rgba(56,189,248,0.10);
  border-color: rgba(56,189,248,0.3);
}
.status-option.current {
  background: rgba(56,189,248,0.18);
  border-color: var(--primary);
}
/* Option non applicable au type de la ligne (Pipeline) : visible mais inactive. */
.status-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.status-option.is-disabled:hover {
  background: transparent;
  border-color: transparent;
}
.status-option .badge {
  pointer-events: none;
  width: 100%;
}
.crossmark { color: var(--text-caption); }

/* ====================== MODAL ====================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(2,6,23,0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: linear-gradient(160deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-deep), var(--glow-soft);
}
.modal-content.wide { max-width: 1140px; }
.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevation);
}
.modal-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}
.close {
  background: transparent; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
}
.close:hover { color: var(--primary); }
.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-body label {
  display: block;
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.modal-body input,
.modal-body textarea,
.modal-body select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-top: 5px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}
.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.modal-body textarea { resize: vertical; line-height: 1.5; }
.modal-body select {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2394a3b8' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}
.modal-body select option {
  background: var(--bg-elevation);
  color: var(--text);
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-soft);
  display: flex; gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  background: var(--bg-elevation);
}

/* ====================== TEMPLATES EDITOR ====================== */
.template-editor {
  border: 1px solid var(--border-soft);
  border-radius: var(--r);
  margin-bottom: 14px;
  padding: 14px;
  background: var(--bg-deep);
}
.template-editor h4 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.template-editor input,
.template-editor textarea { font-size: 12px; }
.template-editor code {
  font-size: 11px;
  color: var(--text-caption);
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ============== Jauges "Compte-tour" ============== */
/* Conteneur des jauges : 2 jauges côte à côte si présentes */
#gauge-leads-row, #gauge-offres-row, #gauge-trello-row, #gauge-ventes-row, #gauge-taches-row, #pipeline-gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
#gauge-leads-row .gauge-card, #gauge-offres-row .gauge-card, #gauge-trello-row .gauge-card, #gauge-ventes-row .gauge-card, #gauge-taches-row .gauge-card, #pipeline-gauges .gauge-card {
  margin-bottom: 0;
  flex: 0 0 auto;
}

/* Carte spéciale dans la 1ère ligne KPI, occupe 2 cellules de large */
.gauge-card {
  /* La jauge est positionnée hors grille des charts dans un conteneur dédié
     (gauge-offres-row / charts-leads). Compacte ~ 2x un KPI. */
  max-width: 400px;
  width: 100%;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 14px 8px;
}
.gauge-card h4 {
  align-self: stretch;
  text-align: left;
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.gauge-wrapper {
  position: relative;
  width: 100%;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.gauge-svg {
  width: 100%;
  height: auto;
  display: block;
}
.gauge-text {
  position: relative;
  margin-top: 2px;
  text-align: center;
  font-family: var(--font-heading);
  line-height: 1.1;
  pointer-events: none;
}
.gauge-text .gauge-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
}
.gauge-text .gauge-total {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 3px;
}
.gauge-text .gauge-percent {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.gauge-text.gauge-ok      .gauge-percent { color: #86d175; }
.gauge-text.gauge-warning .gauge-percent { color: #fbbf3a; }
.gauge-text.gauge-danger  .gauge-percent { color: #f87171; text-shadow: 0 0 10px rgba(239,68,68,0.5); }

/* Fond de la jauge teinté selon la zone indiquée par l'aiguille */
/* Colonne Numéro OL (Trello) : 1 ligne, max ~8 caractères */
#table-trello th[data-col="numero_ol"],
#table-trello td[data-col="numero_ol"] {
  min-width: 90px;
  max-width: 110px;
  width: 100px;
}
#table-trello td[data-col="numero_ol"] .cell-edit-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  min-height: 18px;
}

/* Onglet Accueil (Vente Annuelle) : chaque ligne sur une seule ligne (pas de wrap).
   Force le nowrap sur le tableau entier et tronque proprement la cellule Matériel
   qui contient les libellés longs. Les cellules éditables (CA, Marge, Stock/Vend)
   gardent un nowrap pour ne pas casser visuellement la hauteur de ligne. */
#table-ventes td,
#table-ventes th {
  white-space: nowrap;
}
#table-ventes td .cell-edit-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#table-ventes td[data-col="materiel"] {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#table-ventes td[data-col="materiel"]:hover {
  /* Affiche le texte complet au survol via le title — pas besoin de wrap */
  cursor: help;
}

/* Cellules vides Stockage / Vending : on n'affiche que l'icône ✎, sans texte
   "Cliquez pour écrire…" — ça compacte fortement la largeur des deux colonnes. */
#table-ventes td[data-col="nb_stockage"] .cell-edit-text,
#table-ventes td[data-col="nb_vending"]  .cell-edit-text {
  min-width: 32px;
  text-align: center;
  padding: 4px 6px;
}
#table-ventes td[data-col="nb_stockage"] .cell-edit-text:empty::before,
#table-ventes td[data-col="nb_vending"]  .cell-edit-text:empty::before {
  content: '✎';
  font-style: normal;
}

/* Colonnes Contact et Email de l'onglet Offres Tech Com — tout sur une seule ligne */
#table-offres th[data-col="contact"],
#table-offres td[data-col="contact"] { min-width: 220px; }
#table-offres th[data-col="email"],
#table-offres td[data-col="email"]   { min-width: 300px; }
#table-offres td[data-col="contact"] .cell-edit-text,
#table-offres td[data-col="email"] .cell-edit-text {
  white-space: nowrap;
  word-break: normal;
  overflow: visible;
}
#table-offres td[data-col="contact"] .cell-edit-text { min-width: 200px; }
#table-offres td[data-col="email"] .cell-edit-text   { min-width: 280px; }

/* Colonne Remarques de l'onglet Offres Tech Com — très large */
#table-offres th[data-col="commentaire"],
#table-offres td[data-col="commentaire"],
#table-leads th[data-col="commentaire"],
#table-leads td[data-col="commentaire"] {
  max-width: 260px;   /* tronqué au repos, défile au focus (édition) */
}

/* Colonne Commentaire de Cartes Trello — doublée (vs ~250px par défaut) */
#table-trello th[data-col="commentaire"],
#table-trello td[data-col="commentaire"] {
  max-width: 240px;
}

/* Donut card placée à côté des jauges : largeur plus grande pour héberger légende */
.gauge-card.donut-card {
  max-width: 700px;
  width: 100%;
}
.gauge-card.donut-card .donut-wrapper { padding: 4px 0; }
/* Légende sur 2 colonnes pour rester compact en hauteur (≤ jauges) */
.gauge-card.donut-card .donut-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}

/* ============== Donut chart (répartition des statuts) ============== */
.donut-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
}
.donut-svg {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 18px rgba(56,189,248,0.15));
  transition: transform 0.3s ease;
}
.donut-svg:hover { transform: scale(1.04); }
.donut-svg circle { transition: stroke-width 0.2s ease, opacity 0.2s ease; cursor: pointer; }
.donut-svg circle:hover { stroke-width: 32; }
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.donut-legend-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.donut-legend-row:hover { background: rgba(56,189,248,0.08); }
.donut-legend-swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}
.donut-legend-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.donut-legend-val {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.donut-legend-pct {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
@media (max-width: 720px) {
  .donut-wrapper { flex-direction: column; align-items: stretch; }
  .donut-svg { align-self: center; }
}

/* Cellule de tableau éditable inline (texte libre) — ex: Remarques Offres */
.cell-edit-text {
  min-width: 90px;
  min-height: 22px;
  padding: 4px 8px;
  border: 1px dashed transparent;
  border-radius: 4px;
  cursor: text;
  white-space: nowrap;          /* une seule ligne par cellule (était pre-wrap -> lignes sur 2 niveaux) */
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cell-edit-text:hover  { border-color: rgba(56,189,248,0.35); background: rgba(56,189,248,0.06); }
/* En édition : on défile horizontalement pour voir/écrire tout le texte (pas de coupe). */
.cell-edit-text:focus  { outline: none; border-color: var(--primary); background: rgba(56,189,248,0.10); overflow-x: auto; text-overflow: clip; }
.cell-edit-text:empty::before {
  content: '✎';
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.6;
}
.cell-edit-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 110px;
}
.cell-edit-money:empty::before { content: '✎ Montant…'; }

.gauge-card.gauge-bg-ok      { background: rgba(76, 157, 66, 0.40); border: 1px solid rgba(76, 157, 66, 0.70); }
.gauge-card.gauge-bg-warning { background: rgba(244, 152, 25, 0.40); border: 1px solid rgba(244, 152, 25, 0.70); }
.gauge-card.gauge-bg-danger  { background: rgba(239, 68, 68, 0.40); border: 1px solid rgba(239, 68, 68, 0.75); }
/* Variante "blue" — fond et texte uniformément bleus (jauge Objectif Annuel) */
.gauge-card.gauge-bg-blue    { background: linear-gradient(135deg, rgba(30,58,138,0.35) 0%, rgba(59,130,246,0.30) 50%, rgba(56,189,248,0.28) 100%); border: 1px solid rgba(59,130,246,0.55); }
.gauge-text.gauge-blue .gauge-percent { color: #93c5fd; }
.gauge-text.gauge-blue .gauge-value   { color: #f1f5f9; }

/* Pulse rouge sur la carte entière quand la jauge est en zone critique */
.gauge-card.gauge-pulse {
  border: 1px solid rgba(239,68,68,0.45) !important;
  animation: gaugePulse 1.8s ease-in-out infinite;
}
@keyframes gaugePulse {
  0%, 100% { box-shadow: 0 10px 20px rgba(0,0,0,0.3), 0 0 0 rgba(239,68,68,0); }
  50%      { box-shadow: 0 10px 20px rgba(0,0,0,0.3), 0 0 32px rgba(239,68,68,0.55); }
}

@media (max-width: 600px) {
  .gauge-card { grid-column: span 1; }
}

/* L'aiguille SVG utilise le `transform="rotate(angle cx cy)"` attribut SVG :
   NE PAS forcer un transform-origin CSS, sinon la rotation se fait autour du milieu
   du segment au lieu de tourner autour du pivot. */

/* Barre de défilement horizontal flottante : DÉSACTIVÉE depuis que les tableaux
   défilent DANS leur propre zone (en-têtes figés). La zone du tableau remplit
   l'écran → sa scrollbar horizontale native est en bas du wrapper, à portée : plus
   besoin d'une barre flottante (qui, sinon, ferait doublon avec la barre native). */
/* Réactivée (v2.353) : quand un tableau borné dépasse le viewport, sa scrollbar
   horizontale native se retrouve SOUS le pli (inatteignable) → la barre flottante
   prend le relais. Le JS ne l'affiche QUE dans ce cas, donc pas de doublon. */
/* Barre de défilement horizontal flottante : fixed bottom du viewport.
   Apparaît uniquement quand un tableau a un overflow horizontal et que sa
   propre scrollbar est sous la zone visible. */
.floating-scroll {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--bg-elevation);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(0,0,0,0.4);
  z-index: 90;
}
.floating-scroll > div {
  height: 1px;
  pointer-events: none;
}
.floating-scroll::-webkit-scrollbar { height: 16px; }
.floating-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 8px; }
.floating-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary-deep); }

/* Scrollbars des tableaux (.table-wrapper) : barres VERTICALE et HORIZONTALE
   turquoise (var(--primary)), un peu plus larges (20px) pour être plus faciles à
   attraper. La barre horizontale native est de nouveau affichée (la barre flottante
   #floatingScroll est désactivée depuis que les tableaux défilent dans leur zone,
   cf. en-têtes figés → plus de risque de double barre). */
.table-wrapper::-webkit-scrollbar { width: 14px; height: 14px; }
.table-wrapper::-webkit-scrollbar-track { background: var(--bg-deep); }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 7px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--primary-deep); }
/* Firefox UNIQUEMENT : barre turquoise à l'épaisseur par défaut (plus large que
   « thin »). Scopé via @supports : poser `scrollbar-color` (propriété standard) sur
   Chromium DÉSACTIVE le style `::-webkit-scrollbar` ci-dessus → la barre repassait à
   la largeur par défaut de l'OS (~17px) au lieu des 20px voulus. Ce bloc ne s'applique
   donc qu'aux navigateurs SANS `::-webkit-scrollbar` (Firefox). */
@supports not selector(::-webkit-scrollbar) {
  .table-wrapper { scrollbar-width: auto; scrollbar-color: var(--primary) var(--bg-deep); }
}

/* ====================== TOAST ====================== */
.toast-container {
  position: fixed;
  top: 90px; right: 24px;
  display: flex; flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast {
  background: linear-gradient(160deg, var(--bg-surface), var(--bg-surface-2));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 13px 18px;
  border-radius: var(--r);
  box-shadow: var(--shadow-deep);
  min-width: 260px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  animation: slideIn 0.3s ease;
}
.toast.success { border-left-color: var(--success); box-shadow: var(--shadow-deep), 0 0 15px rgba(76,157,66,0.2); }
.toast.danger  { border-left-color: var(--danger);  box-shadow: var(--shadow-deep), 0 0 15px rgba(239,68,68,0.2); }
.toast.warning { border-left-color: var(--warning); box-shadow: var(--shadow-deep), 0 0 15px rgba(244,152,25,0.2); }
/* Lien d'action dans un toast (ex. « Télécharger l'email ») : bouton cliquable,
   déclenché par un vrai clic utilisateur (jamais bloqué par Chrome). */
.toast-action {
  display: inline-block; margin-top: 8px; margin-right: 6px; padding: 6px 12px;
  background: var(--primary); color: #fff; border-radius: 8px; text-decoration: none;
  font-weight: 700; font-size: 12.5px; cursor: pointer;
}
.toast-action:hover { background: var(--primary-deep); }
@keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ====================== UTILS ====================== */
code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 11px;
  color: var(--primary);
  background: rgba(56,189,248,0.08);
  padding: 1px 4px;
  border-radius: 3px;
}

/* En-tête responsive : sur fenêtre étroite, le titre centré (positionné en absolu) se
   dé-centre — il passe à gauche, à côté du logo Electroclass — et rapetisse, pour ne
   jamais chevaucher la pastille de synchro ni les actions à droite. */
@media (max-width: 1150px) {
  .brand-text {
    position: static;
    transform: none;
    text-align: left;
  }
  .brand-title-row { justify-content: flex-start; }
  .brand-text .subtitle { text-align: left; }
  .brand-text h1 { font-size: 26px; }
  .digisales-logo { height: 26px; }
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 900px) {
  /* Même padding vertical que le bureau (8px, v2.416) pour que le bandeau garde la
     MÊME hauteur (55px) et reste cohérent avec `.tabs { top: 52px }`. Auparavant 14px :
     le bandeau tombait à 67px alors que les onglets collaient déjà à 72px → interstice
     de ~5px à ce palier (défaut préexistant, corrigé au passage). */
  .app-header { padding: 8px 18px; }
  .brand-text h1 { font-size: 16px; }
  .brand-logo { height: 30px; }
  .digisales-logo { height: 22px; }
  main { padding: 16px; }
  .tabs { padding: 0 14px; }
  .tab { padding: 14px 10px; font-size: 12px; }
  .kpi-card .value { font-size: 22px; }
  .toast-container { right: 12px; left: 12px; }
  .toast { min-width: 0; }
}

/* --- Modale d'import inter-onglets (rechercher + copier une ligne) --- */
.import-search {
  width: 100%; padding: 10px 12px; font-size: 14px; margin-bottom: 10px;
  background: var(--bg-elevation); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r);
}
.import-search:focus { outline: none; border-color: var(--primary); }
.import-results { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.import-hint { color: var(--text-muted); font-size: 13px; padding: 8px 2px; margin: 0; }
.import-result {
  display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 10px;
  width: 100%; text-align: left; cursor: pointer; padding: 8px 10px;
  background: var(--bg-elevation); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r); font: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.import-result:hover { border-color: var(--primary); background: var(--bg-elevation-2); }
.import-result-tab { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; align-self: start; padding-top: 2px; }
.import-result-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.import-result-main { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-result-detail { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Notes de version (« Nouveautés ») --- */
.app-version { cursor: pointer; }
.app-version:hover { text-decoration: underline; }
.release-notes { max-height: 60vh; overflow-y: auto; }
.release-notes .rn-entry { padding: 4px 0 12px; border-bottom: 1px solid var(--border-soft); }
.release-notes .rn-entry:last-child { border-bottom: 0; padding-bottom: 2px; }
.release-notes h4 { margin: 6px 0; color: var(--primary); font-size: 15px; }
.release-notes .rn-date { color: var(--text-muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.release-notes ul { margin: 0; padding-left: 18px; }
.release-notes li { margin: 4px 0; color: var(--text-body); line-height: 1.45; }

/* ============================================================================
   MOBILE (téléphone portrait, ≤ 640px) — v2.252
   Adaptation à l'usage sur smartphone. CSS uniquement : n'affecte ni le bureau
   ni la tablette. Objectifs : navigation par onglets ACCESSIBLE (tous atteignables),
   en-tête/outils plus compacts (moins de défilement avant les données).
   ========================================================================== */
@media (max-width: 640px) {
  /* En-tête : compact et NON collant (libère de la hauteur d'écran). */
  .app-header { position: static; padding: 10px 14px; gap: 8px 12px; }
  .brand { gap: 10px; }
  .brand-logo { height: 26px; }
  .header-actions { gap: 8px; flex-wrap: wrap; }
  .view-toggle .vt-opt { padding: 5px 10px; font-size: 12px; }
  .theme-toggle { width: 34px; height: 34px; }
  .data-menu-btn { padding: 6px 10px; }

  /* Barre d'onglets : empilée en 2 rangées. La liste d'onglets prend TOUTE la
     largeur et défile horizontalement -> tous les onglets sont atteignables
     (avant : comprimée par la rangée d'actions, un seul onglet visible).
     Collante en haut (l'en-tête n'est plus collant, donc pas de chevauchement). */
  .tabs {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 4px 10px;
    top: 0;
  }
  .tabs-list {
    width: 100%;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;               /* barre fine masquée : on défile au doigt */
  }
  .tabs-list::-webkit-scrollbar { height: 0; }
  .tabs-list .tab { flex: 0 0 auto; white-space: nowrap; }
  .tabs-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0 6px;
    flex-wrap: nowrap;
  }

  /* Barre d'outils des panneaux : recherche en pleine largeur, puis les actions
     en dessous qui s'enroulent HORIZONTALEMENT (au lieu d'une longue colonne). */
  .toolbar,
  #panel-pipeline .toolbar { flex-wrap: wrap; gap: 8px; align-items: stretch; }
  .search,
  #panel-pipeline .search { flex: 1 1 100%; min-width: 0; }
  .actions,
  #panel-pipeline .actions { flex: 1 1 100%; min-width: 0; gap: 6px; }

  /* Barres d'outils : NON collantes sur mobile (tous les onglets). La version collante
     du bureau figerait une grande zone sous le bandeau d'onglets — trop coûteux sur
     téléphone. En statique, cette place est récupérée au défilement. On retire aussi le
     cache opaque (utile seulement en collant) et on compacte les boutons. Bureau/tablette
     inchangés. */
  #panel-pipeline .toolbar,
  #panel-taches .toolbar,
  #panel-trello .toolbar,
  #panel-ventes .toolbar {
    position: static;
    box-shadow: none;
    padding-top: 0;
    margin-bottom: 8px;
  }
  /* Mobile : padding vertical aligné sur la hauteur compacte du bureau (v2.415 : 5px)
     — il valait 7px, calé sur l'ancienne hauteur, ce qui rendait les boutons mobiles
     PLUS HAUTS que sur bureau. Compaction horizontale + police 12px conservées. */
  #panel-pipeline .toolbar .btn,
  #panel-pipeline .toolbar .btn-action,
  #panel-pipeline .toolbar .pipe-stab { padding: 5px 11px; font-size: 12px; gap: 5px; }
  /* Vente Annuelle : sous-onglets NON collants sur mobile (comme les barres d'outils). */
  #panel-ventes nav.subtabs { position: static; box-shadow: none; }

  /* NB : l'ancien `overflow-x:auto` sur #pipeline-view-toggle (pour l'ex-sélecteur
     segmenté qui défilait) est retiré : le sélecteur de vue est désormais un seul
     bouton « Vue », et cet overflow rognait le menu déroulant + le panneau Colonnes
     (désormais ancrés ici) sur mobile. On garde juste la largeur max. */
  #pipeline-view-toggle { max-width: 100%; }

  /* Menu « Vue » et panneau « Colonnes » : sur mobile, le bouton « Vue » est vers la
     gauche de la barre ; ancrés à droite (right:0) ils débordaient hors de l'écran à
     gauche. On les CENTRE sous le bouton (positionnement ABSOLU relatif au bouton —
     on évite `position: fixed`, piégé par le `transform` de #panel-pipeline via
     l'animation fadeIn). Largeur plafonnée pour tenir sur tout téléphone ; hauteur
     limitée + défilement pour le panneau Colonnes (long). Clic-extérieur/Échap
     ferment toujours (mécanismes inchangés). */
  #pipeline-view-toggle .row-menu-panel,
  #pipeline-col-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 280px;
    max-height: 78vh;
    overflow: auto;
  }
  #pipeline-col-panel .pipe-col-menu { min-width: 0; max-width: none; width: 100%; }
}

/* ============================================================================
   MOBILE (≤ 640px) — v2.253 : vue Liste du Pipeline en CARTES empilées.
   Le tableau fait ~3760 px de large -> inexploitable au doigt. Sur téléphone,
   chaque ligne devient une carte : Société en titre + champs essentiels étiquetés
   (Date, Contact, Statut, Action, Montant, Échéance). Les autres colonnes sont
   masquées ici (l'export/le bureau gardent tout). CSS uniquement.
   ========================================================================== */
@media (max-width: 640px) {
  #table-pipeline,
  #table-pipeline tbody { display: block; width: auto; }
  #table-pipeline thead { display: none; }
  #table-pipeline tr {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin: 0 0 10px;
    padding: 8px 12px;
    position: relative;
  }
  /* Par défaut : cellules masquées ; on ne montre que l'essentiel. */
  #table-pipeline td { display: none; }
  #table-pipeline td[data-col="societe"],
  #table-pipeline td[data-col="date"],
  #table-pipeline td[data-col="contact"],
  #table-pipeline td[data-col="statut"],
  #table-pipeline td[data-col="action"],
  #table-pipeline td[data-col="montant"],
  #table-pipeline td[data-col="echeance"] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border: 0;
    border-top: 1px solid var(--border-soft);
    text-align: right;
    max-width: 100%;
  }
  #table-pipeline td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    text-align: left;
  }
  /* Société = titre de la carte (en tête, gras, sans étiquette ni bordure). */
  #table-pipeline td[data-col="societe"] {
    order: -1;
    display: block;
    border-top: 0;
    padding: 2px 30px 6px 0;   /* réserve le coin pour la case à cocher */
    font-weight: 700;
    font-size: 15px;
    text-align: left;
  }
  #table-pipeline td[data-col="societe"]::before { content: none; }
  #table-pipeline td.col-frozen { position: static; background: transparent; }
  /* Case à cocher : coin haut-droite de la carte. */
  #table-pipeline td:first-child {
    display: block;
    position: absolute;
    top: 8px; right: 10px;
    padding: 0; border: 0;
  }
  #table-pipeline td:first-child::before { content: none; }
  /* Les cellules éditables/badges s'alignent à droite proprement. */
  #table-pipeline td [contenteditable],
  #table-pipeline td .echeance-cell { text-align: right; min-width: 0; }
}

/* ============================================================================
   Pipeline — VOLET DE DÉTAIL (reading pane, façon Outlook) — v2.255
   Zone principale scindée : vues à gauche, volet optionnel à droite, séparés par
   une poignée de redimensionnement. Style DigiSales actuel. Masqué sur mobile.
   ========================================================================== */
.pipe-split { display: flex; align-items: flex-start; gap: 0; }
.pipe-views { flex: 1 1 auto; min-width: 0; }
.pipe-detail-resizer {
  flex: 0 0 8px; align-self: stretch; cursor: col-resize; position: relative;
  user-select: none; touch-action: none;
}
.pipe-detail-resizer::after {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: 3px; width: 2px;
  border-radius: 2px; background: var(--border); opacity: 0.7; transition: background 0.15s;
}
.pipe-detail-resizer:hover::after, .pipe-detail-resizer:active::after { background: var(--primary); opacity: 1; }
.pipe-detail {
  flex: 0 0 auto; width: var(--pipe-detail-w, 380px);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px; overflow: auto; position: sticky; top: 88px;
  max-height: calc(100vh - 120px);
  /* Au-dessus des en-têtes collants du tableau (z-index 1–3) : le tableau pleine
     largeur peut déborder sous le volet, le volet (fond opaque) le masque proprement. */
  z-index: 10;
}
.pd-empty { color: var(--text-muted); font-size: 13px; padding: 20px 4px; text-align: center; }
.pd-head { position: relative; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 12px; }
.pd-close { position: absolute; top: -4px; right: -4px; background: none; border: 0; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px; border-radius: 6px; }
.pd-close:hover { color: var(--text); background: var(--bg-elevation, rgba(148,163,184,0.15)); }
/* Raccourci « carte » de l'en-tête du volet : à gauche de la croix de fermeture. */
.pd-mapbtn { position: absolute; top: -4px; right: 24px; background: none; border: 0; color: var(--text-muted);
  font-size: 15px; cursor: pointer; padding: 4px; border-radius: 6px; line-height: 1; }
.pd-mapbtn:hover { color: var(--text); background: var(--bg-elevation, rgba(148,163,184,0.15)); }
.pd-num { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted); text-transform: uppercase; }
.pd-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 0 6px; }
.pd-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.pd-montant { font-size: 17px; font-weight: 800; color: var(--text); white-space: nowrap; }
.pd-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pd-marge, .pd-chance { font-size: 12px; color: var(--text-muted); }
.pd-sec { margin-top: 16px; }
.pd-sec-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.pd-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-stage {
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  background: var(--bg-deep); color: var(--text-body); border: 1px solid var(--border);
  transition: all 0.15s;
}
.pd-stage:hover { border-color: var(--primary); color: var(--primary); }
.pd-stage.is-current { background: var(--primary); color: #fff; border-color: var(--primary); }
/* Détails en LISTE type tableau : libellé à gauche / valeur à droite, filet fin
   entre chaque ligne pour délimiter les données (plus lisible que l'ancienne grille). */
.pd-fields { display: flex; flex-direction: column; }
.pd-field { display: grid; grid-template-columns: minmax(88px, 40%) 1fr; gap: 10px;
  align-items: baseline; padding: 7px 2px; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.pd-field:last-child { border-bottom: 0; }
.pd-field-lbl { font-size: 12px; color: var(--text-muted); }
.pd-field-val { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-word; min-width: 0; }
/* Ligne à deux champs (Gamme|Machine, N° devis|Origine, Décision|Installation) :
   deux moitiés côte à côte, chacune libellé au-dessus / valeur en dessous. */
.pd-pair { grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pd-half { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pd-act {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-deep);
  color: var(--text-body); font-size: 11px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.pd-act:hover { border-color: var(--primary); color: var(--primary); }
.pd-act.is-off { opacity: 0.45; cursor: default; }
.pd-act.is-active { border-color: var(--primary); color: var(--primary); }
.pd-act-ic { font-size: 17px; }
/* --- Refonte volet : en-tête condensé, vignette machine, tuiles, note --------- */
/* En-tête : le bloc texte (nom + contact + badge de statut) à gauche, la vignette
   machine à droite qui s'étire sur TOUTE la hauteur de ce bloc (du nom au badge). */
.pd-head-main { display: flex; align-items: stretch; gap: 10px; margin: 2px 0 6px; }
/* Bloc texte de l'en-tête : hauteur STRICTEMENT constante d'une affaire à l'autre
   (le cadre photo s'y cale). Les 3 lignes (nom client, contact, statut) sont donc
   forcées sur UNE ligne chacune (ellipsis si trop long) → le bloc fait toujours la
   même hauteur, et le cadre photo (align-self:stretch) aussi. */
.pd-head-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pd-head-txt > .pd-title,
.pd-head-txt > .pd-contact,
.pd-head-txt > .pd-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-head-txt > .pd-sub { flex-wrap: nowrap; }
.pd-title .cell-edit-text, .pd-contact .cell-edit-text {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Cadre photo : TAILLE FIXE, carré (72×72) → strictement identique pour toutes les
   affaires et tous les formats de photo. `align-self:flex-start` le cale en haut de
   l'en-tête (= haut du nom du client) ; sa hauteur fixe reste dans les limites du bloc
   texte (ne dépasse pas sous le statut). Fond BLANC + object-fit:contain (image ci-dessous)
   → la photo ENTIÈRE est visible, jamais rognée — même présentation que la vue Cartes
   (`.kanban-thumb--img`), à laquelle on s'aligne. */
.pd-thumb { flex: 0 0 auto; width: 72px; height: 72px; align-self: flex-start; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border); background: #fff; position: relative; }
/* Image HORS FLUX (position absolue) : ne dicte pas la taille du cadre (fixe ci-dessus).
   object-fit:contain → toute la photo tient dans le cadre (bandes blanches si format ≠ carré),
   comme la vignette de la vue Cartes. Aucune découpe haut/bas. */
.pd-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
/* Photo cliquable (bouton) : change l'image de la carte (ouvre les Fichiers).
   Réinitialise le style bouton, ajoute un survol + un badge appareil-photo. */
.pd-thumb--edit { padding: 0; cursor: pointer; position: relative; display: block; color: inherit; }
.pd-thumb--edit:hover { border-color: var(--primary); }
.pd-thumb--edit:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
/* Emplacement vide (pas encore d'image) : pictogramme centré. */
.pd-thumb-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 24px; opacity: 0.5; }
/* Badge appareil-photo : discret en bas à droite, plus visible au survol. */
.pd-thumb-cam { position: absolute; right: 3px; bottom: 3px; font-size: 12px; line-height: 1;
  padding: 2px 4px; border-radius: 6px; background: rgba(2,6,23,0.72); opacity: 0.75; transition: opacity 0.15s; pointer-events: none; }
.pd-thumb--edit:hover .pd-thumb-cam, .pd-thumb--edit:focus-visible .pd-thumb-cam { opacity: 1; }
/* Emplacement (chantier « Emplacements & Carte », lot 3) — mini-carte du volet. */
.pd-map { height: 180px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-deep); }
.pd-map .leaflet-container { width: 100%; height: 100%; background: var(--bg-deep); font: inherit; }
.pd-map-addr { margin-top: 6px; font-size: 13px; color: var(--text-body); }
.pd-map-none { margin-top: 4px; font-size: 12px; color: var(--text-muted); font-style: italic; }
/* Mini-carte du volet cliquable -> carte de France (lot 4). */
.pd-map-wrap { position: relative; cursor: pointer; border-radius: 8px; }
.pd-map-wrap .pd-map { pointer-events: none; }   /* le clic ouvre la carte, la mini-carte n'intercepte pas */
.pd-map-hint { position: absolute; left: 0; right: 0; bottom: 0; z-index: 500; text-align: center;
  font-size: 11px; font-weight: 600; color: #fff; background: rgba(2, 6, 23, 0.62);
  padding: 4px 6px; border-radius: 0 0 8px 8px; opacity: 0; transition: opacity 0.12s; }
.pd-map-wrap:hover .pd-map-hint, .pd-map-wrap:focus-visible .pd-map-hint { opacity: 1; }

/* --- Carte de France plein écran (chantier « Emplacements & Carte », lot 4) --- */
.cf-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: var(--bg-deep); }
.cf-overlay[hidden] { display: none; }
body.cf-open { overflow: hidden; }
.cf-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.cf-title { font-weight: 800; color: var(--text); }
.cf-spacer { flex: 1; }
.cf-count { font-size: 13px; color: var(--text-muted); }
.cf-filter { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cf-filter button { border: 0; background: transparent; color: var(--text-body); padding: 6px 12px; font: inherit; cursor: pointer; }
.cf-filter button + button { border-left: 1px solid var(--border); }
.cf-filter button.is-active { background: var(--primary, #2563eb); color: #fff; }
/* Sous-onglets « Ventes par type de machine » : 2e rangée de la barre de la carte
   (puces par gamme + sélecteur Modèle, avec comptes). flex-basis:100% = la rangée
   passe SOUS la première (la .cf-bar est en flex-wrap). */
.cf-subbar { flex-basis: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--border-soft); }
.cf-filter--sub button { padding: 4px 10px; font-size: 12.5px; }
.cf-machine { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.cf-machine select { max-width: 240px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-elevation); color: var(--text-body); font: inherit; font-size: 12.5px; }
.cf-close { border: 1px solid var(--border); background: var(--bg-elevation); color: var(--text); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; }
.cf-close:hover { background: var(--bg-elevation-2, var(--bg-elevation)); }
.cf-map { flex: 1; min-height: 0; }
.cf-map .leaflet-container { width: 100%; height: 100%; background: var(--bg-deep); font: inherit; }
.cf-tt-addr { color: #cbd5e1; font-size: 11px; }
/* Repères colorés (divIcon) : Ventes = vert, Affaires en cours = bleu. */
.cf-pin { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.cf-pin--vente { background: #16a34a; }
.cf-pin--encours { background: #2563eb; }
/* Mobile (lot 6) : la barre de la carte de France s'empile proprement et se
   compacte ; la carte occupe tout le reste de l'écran (Leaflet gère le tactile). */
@media (max-width: 640px) {
  .cf-bar { gap: 6px 8px; padding: 6px 10px; }
  .cf-title { flex: 1 1 100%; font-size: 14px; }
  .cf-filter { flex: 1 1 auto; }
  .cf-filter button { flex: 1; padding: 8px 6px; font-size: 12px; }
  .cf-spacer { display: none; }
  .cf-count { order: 3; }
  .pd-map-hint { opacity: 1; }   /* pas de survol au doigt : l'invite reste visible */
}
.pd-title { min-width: 0; }
.pd-title .cell-edit-text { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.pd-contact { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pd-contact-ic { font-size: 12px; opacity: 0.7; }
.pd-contact .cell-edit-text { font-size: 13px; color: var(--text-body); }
.pd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pd-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pd-stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); }
.pd-stat-val .cell-edit-text { font-size: 15px; font-weight: 700; color: var(--text); }
.pd-sec-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.pd-ro { font-size: 13px; color: var(--text); font-weight: 600; word-break: break-word; }
/* Champ pleine largeur (Matériel, Commentaire) : libellé au-dessus, valeur dessous. */
.pd-field-full { grid-template-columns: 1fr; gap: 3px; }
/* Ligne « Message du prospect » repliable (clic) + panneau dépliable (Message / Dates). */
.pd-field-toggle { cursor: pointer; }
.pd-field-toggle:hover { background: var(--bg-elevation, rgba(148,163,184,0.10)); }
.pd-field-preview { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px;
  font-weight: 400; color: var(--text-body); }
.pd-caret { font-size: 10px; color: var(--text-muted); }
.pd-muted { color: var(--text-muted); font-style: italic; font-weight: 400; }
.pd-panel { margin-top: 8px; }
.pd-note-body .cell-edit-text { min-height: 40px; font-size: 13px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-deep); }
/* Affordance d'édition au clic sur les champs du volet + placeholder « à renseigner ». */
.pipe-detail .cell-edit-text { cursor: text; border-radius: 4px; padding: 1px 3px; transition: background 0.12s; }
.pipe-detail .cell-edit-text:hover { background: var(--bg-elevation, rgba(148,163,184,0.12)); }
.pipe-detail .cell-edit-text:empty::before { content: "à renseigner"; color: var(--text-muted); font-weight: 400; font-style: italic; }
.pd-stat-val .cell-edit-text:empty::before { content: "—"; font-style: normal; }
.pipe-detail .echeance-cell:empty::before { content: "à renseigner"; color: var(--text-muted); font-style: italic; font-size: 13px; }
/* Ligne sélectionnée dans la liste (affichée dans le volet). */
#table-pipeline tbody tr.pipe-row-selected { box-shadow: inset 3px 0 0 var(--primary); }
#table-pipeline tbody tr.pipe-row-selected td { background: color-mix(in srgb, var(--primary) 8%, transparent); }
/* Mobile : pas de volet côte-à-côte (écran trop étroit) — la liste reste en cartes. */
@media (max-width: 900px) {
  .pipe-detail, .pipe-detail-resizer { display: none !important; }
  .pipe-split { display: block; }
  /* Le volet étant masqué ici, on neutralise le scroll contenu (has-detail peut
     rester posé par le JS) : le tableau garde le comportement mobile plein écran. */
  #pipe-split.has-detail .table-wrapper { max-height: none; overflow: visible; }
}

/* ===== Jeu d'icones monochrome (SVG via mask + currentColor). Une seule source. */
.ds-ic{display:inline-block;width:1.05em;height:1.05em;flex:0 0 auto;
  background-color:currentColor;vertical-align:-0.16em;margin-right:6px;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain;
  -webkit-mask-image:var(--ds-ic);mask-image:var(--ds-ic);}
/* Dans un menu (item avec texte a gauche) ou seul, on garde la marge; a droite=0 si besoin via utilitaire. */
.ds-ic-add{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%2212%22%20y1%3D%225%22%20x2%3D%2212%22%20y2%3D%2219%22%2F%3E%3Cline%20x1%3D%225%22%20y1%3D%2212%22%20x2%3D%2219%22%20y2%3D%2212%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-edit{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2020h9%22%2F%3E%3Cpath%20d%3D%22M16.5%203.5a2.12%202.12%200%200%201%203%203L7%2019l-4%201%201-4Z%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-trash{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%223%206%205%206%2021%206%22%2F%3E%3Cpath%20d%3D%22M19%206v14a2%202%200%200%201-2%202H7a2%202%200%200%201-2-2V6m3%200V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-copy{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%229%22%20y%3D%229%22%20width%3D%2213%22%20height%3D%2213%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cpath%20d%3D%22M5%2015H4a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h9a2%202%200%200%201%202%202v1%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-import{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2015v4a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-4%22%2F%3E%3Cpolyline%20points%3D%227%2010%2012%2015%2017%2010%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%2215%22%20x2%3D%2212%22%20y2%3D%223%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-transfer{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2015v4a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2v-4%22%2F%3E%3Cpolyline%20points%3D%2217%208%2012%203%207%208%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%223%22%20x2%3D%2212%22%20y2%3D%2215%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-import-row{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15%203h4a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202h-4%22%2F%3E%3Cpolyline%20points%3D%2210%2017%2015%2012%2010%207%22%2F%3E%3Cline%20x1%3D%2215%22%20y1%3D%2212%22%20x2%3D%223%22%20y2%3D%2212%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-repeat{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2217%201%2021%205%2017%209%22%2F%3E%3Cpath%20d%3D%22M3%2011V9a4%204%200%200%201%204-4h14%22%2F%3E%3Cpolyline%20points%3D%227%2023%203%2019%207%2015%22%2F%3E%3Cpath%20d%3D%22M21%2013v2a4%204%200%200%201-4%204H3%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-doc{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8z%22%2F%3E%3Cpolyline%20points%3D%2214%202%2014%208%2020%208%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%2213%22%20x2%3D%228%22%20y2%3D%2213%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%2217%22%20x2%3D%228%22%20y2%3D%2217%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-mail{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%2220%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22m22%207-10%205L2%207%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-clipboard{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%204h2a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202H6a2%202%200%200%201-2-2V6a2%202%200%200%201%202-2h2%22%2F%3E%3Crect%20x%3D%228%22%20y%3D%222%22%20width%3D%228%22%20height%3D%224%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-undo{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%229%2014%204%209%209%204%22%2F%3E%3Cpath%20d%3D%22M20%2020v-7a4%204%200%200%200-4-4H4%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-ban{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cline%20x1%3D%224.9%22%20y1%3D%224.9%22%20x2%3D%2219.1%22%20y2%3D%2219.1%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-settings{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M19.4%2015a1.65%201.65%200%200%200%20.33%201.82l.06.06a2%202%200%201%201-2.83%202.83l-.06-.06a1.65%201.65%200%200%200-1.82-.33%201.65%201.65%200%200%200-1%201.51V21a2%202%200%200%201-4%200v-.09A1.65%201.65%200%200%200%209%2019.4a1.65%201.65%200%200%200-1.82.33l-.06.06a2%202%200%201%201-2.83-2.83l.06-.06a1.65%201.65%200%200%200%20.33-1.82%201.65%201.65%200%200%200-1.51-1H3a2%202%200%200%201%200-4h.09A1.65%201.65%200%200%200%204.6%209a1.65%201.65%200%200%200-.33-1.82l-.06-.06a2%202%200%201%201%202.83-2.83l.06.06a1.65%201.65%200%200%200%201.82.33H9a1.65%201.65%200%200%200%201-1.51V3a2%202%200%200%201%204%200v.09a1.65%201.65%200%200%200%201%201.51%201.65%201.65%200%200%200%201.82-.33l.06-.06a2%202%200%201%201%202.83%202.83l-.06.06a1.65%201.65%200%200%200-.33%201.82V9a1.65%201.65%200%200%200%201.51%201H21a2%202%200%200%201%200%204h-.09a1.65%201.65%200%200%200-1.51%201z%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-zap{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolygon%20points%3D%2213%202%203%2014%2012%2014%2011%2022%2021%2010%2012%2010%2013%202%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-paperclip{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21.44%2011.05l-9.19%209.19a6%206%200%200%201-8.49-8.49l9.19-9.19a4%204%200%200%201%205.66%205.66l-9.2%209.19a2%202%200%200%201-2.83-2.83l8.49-8.48%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-search{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22%2F%3E%3Cline%20x1%3D%2221%22%20y1%3D%2221%22%20x2%3D%2216.65%22%20y2%3D%2216.65%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-trending-up{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2223%206%2013.5%2015.5%208.5%2010.5%201%2018%22%2F%3E%3Cpolyline%20points%3D%2217%206%2023%206%2023%2012%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-user{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2021v-2a4%204%200%200%200-4-4H8a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-clock{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpolyline%20points%3D%2212%206%2012%2012%2016%2014%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-check{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2220%206%209%2017%204%2012%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-restore{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%221%204%201%2010%207%2010%22%2F%3E%3Cpath%20d%3D%22M3.51%2015a9%209%200%201%200%202.13-9.36L1%2010%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-history{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v5h5%22%2F%3E%3Cpath%20d%3D%22M3.05%2013A9%209%200%201%200%206%205.3L3%208%22%2F%3E%3Cpath%20d%3D%22M12%207v5l4%202%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-refresh{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%2223%204%2023%2010%2017%2010%22%2F%3E%3Cpolyline%20points%3D%221%2020%201%2014%207%2014%22%2F%3E%3Cpath%20d%3D%22M3.51%209a9%209%200%200%201%2014.85-3.36L23%2010M1%2014l4.64%204.36A9%209%200%200%200%2020.49%2015%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-save{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M19%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h11l5%205v11a2%202%200%200%201-2%202z%22%2F%3E%3Cpolyline%20points%3D%2217%2021%2017%2013%207%2013%207%2021%22%2F%3E%3Cpolyline%20points%3D%227%203%207%208%2015%208%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-archive{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2220%22%20height%3D%225%22%20x%3D%222%22%20y%3D%223%22%20rx%3D%221%22%2F%3E%3Cpath%20d%3D%22M4%208v11a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8%22%2F%3E%3Cpath%20d%3D%22M10%2012h4%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic--solo{margin-right:0;}
.ds-ic-calendar{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%224%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M3%2010h18M8%202v4M16%202v4%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-key{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2215%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M10.85%2012.15%2020%203%22%2F%3E%3Cpath%20d%3D%22m18%205%202%202%22%2F%3E%3Cpath%20d%3D%22m15%208%202%202%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-lock{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%2211%22%20width%3D%2218%22%20height%3D%2211%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%2011V7a5%205%200%200%201%2010%200v4%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-calculator{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%222%22%20width%3D%2216%22%20height%3D%2220%22%20rx%3D%222%22%2F%3E%3Cline%20x1%3D%228%22%20y1%3D%226%22%20x2%3D%2216%22%20y2%3D%226%22%2F%3E%3Cpath%20d%3D%22M8%2010h.01M12%2010h.01M16%2010h.01M8%2014h.01M12%2014h.01M8%2018h.01M12%2018h.01%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%2214%22%20x2%3D%2216%22%20y2%3D%2218%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-eraser{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m7%2021-4.3-4.3c-1-1-1-2.5%200-3.4l9.6-9.6c1-1%202.5-1%203.4%200l5.6%205.6c1%201%201%202.5%200%203.4L13%2021%22%2F%3E%3Cpath%20d%3D%22M22%2021H7%22%2F%3E%3Cpath%20d%3D%22m5%2011%209%209%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-palette{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2213.5%22%20cy%3D%226.5%22%20r%3D%22.8%22%2F%3E%3Ccircle%20cx%3D%2217.5%22%20cy%3D%2210.5%22%20r%3D%22.8%22%2F%3E%3Ccircle%20cx%3D%228.5%22%20cy%3D%227.5%22%20r%3D%22.8%22%2F%3E%3Ccircle%20cx%3D%226.5%22%20cy%3D%2212.5%22%20r%3D%22.8%22%2F%3E%3Cpath%20d%3D%22M12%202C6.5%202%202%206.5%202%2012s4.5%2010%2010%2010c.9%200%201.6-.7%201.6-1.7%200-.4-.2-.8-.4-1.1-.3-.3-.4-.7-.4-1.1a1.6%201.6%200%200%201%201.6-1.7H16c3%200%205.5-2.5%205.5-5.5C22%206%2017.5%202%2012%202z%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-users{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17%2021v-2a4%204%200%200%200-4-4H5a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M23%2021v-2a4%204%200%200%200-3-3.87%22%2F%3E%3Cpath%20d%3D%22M16%203.13a4%204%200%200%201%200%207.75%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-map{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolygon%20points%3D%221%206%201%2022%208%2018%2016%2022%2023%2018%2023%202%2016%206%208%202%201%206%22%2F%3E%3Cline%20x1%3D%228%22%20y1%3D%222%22%20x2%3D%228%22%20y2%3D%2218%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%226%22%20x2%3D%2216%22%20y2%3D%2222%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-star{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolygon%20points%3D%2212%202%2015.09%208.26%2022%209.27%2017%2014.14%2018.18%2021.02%2012%2017.77%205.82%2021.02%207%2014.14%202%209.27%208.91%208.26%2012%202%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-palmtree{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13%208c0-2.76-2.46-5-5.5-5S2%205.24%202%208h2l1-1%201%201h4%22%2F%3E%3Cpath%20d%3D%22M13%207.14A5.82%205.82%200%200%201%2016.5%206c3.04%200%205.5%202.24%205.5%205h-3l-1-1-1%201h-3%22%2F%3E%3Cpath%20d%3D%22M5.89%209.71c-2.15%202.15-2.3%205.47-.35%207.43l4.24-4.25.71-.71%202.12-2.12c-1.95-1.96-5.27-1.8-7.42.35%22%2F%3E%3Cpath%20d%3D%22M11%2015.5c.5%202.5-.17%204.5-1%206.5h4c2-5.5-.5-12-1-14%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-alert{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M10.29%203.86%201.82%2018a2%202%200%200%200%201.71%203h16.94a2%202%200%200%200%201.71-3L13.71%203.86a2%202%200%200%200-3.42%200z%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%229%22%20x2%3D%2212%22%20y2%3D%2213%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%2217%22%20x2%3D%2212.01%22%20y2%3D%2217%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-download{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2015V3%22%2F%3E%3Cpath%20d%3D%22m6%2011%206%206%206-6%22%2F%3E%3Cpath%20d%3D%22M4%2021h16%22%2F%3E%3C%2Fsvg%3E");}
.ds-ic-upload{--ds-ic:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%203h16%22%2F%3E%3Cpath%20d%3D%22m6%2010%206-6%206%206%22%2F%3E%3Cpath%20d%3D%22M12%204v12%22%2F%3E%3C%2Fsvg%3E");}
