/* =====================================================================
   CRM — v3 « Moteur d'action Ontario »
   Design tokens propres (--crm-*) dérivés du shell GANDALF : thème clair
   (signature Chanv crème) + sombre via body[data-gtheme="dark"].
   Tout est scopé .crm- ; aucune fuite vers le reste du hub.
   ===================================================================== */

/* .crm-rt-notepop est ancré au <body> (hors #crm-view) comme .crm-sheet-ov :
   sans lui dans cette liste, tous ses var(--crm-*) seraient indéfinis. */
#crm-view, #agriculture-view, #ambassadeurs-view, #diffusions-view, #ligne-du-temps-view, .crm-sheet-ov, .crm-rt-notepop {
  /* thème clair (défaut) */
  --crm-ground: transparent;
  --crm-card: #FFFFFF;
  --crm-card-2: #FAF6EC;
  --crm-line: rgba(40, 34, 24, .09);
  --crm-line-strong: rgba(40, 34, 24, .16);
  --crm-ink: #282521;
  --crm-ink-2: rgba(40, 38, 34, .62);
  --crm-ink-3: rgba(40, 38, 34, .42);
  --crm-accent: #A8863F;
  --crm-accent-ink: #FFFFFF;
  --crm-accent-soft: rgba(168, 134, 63, .10);
  --crm-shadow: 0 1px 2px rgba(40, 34, 24, .04), 0 8px 24px -12px rgba(40, 34, 24, .10);
  --crm-shadow-lift: 0 2px 4px rgba(40, 34, 24, .05), 0 16px 32px -16px rgba(40, 34, 24, .18);
  --crm-ok-ink: #256B43;      --crm-ok-bg: #E3F2E8;      --crm-ok-dot: #34A264;
  --crm-warn-ink: #8A5A12;    --crm-warn-bg: #F9EED9;    --crm-warn-dot: #D08A2A;
  --crm-crit-ink: #93443B;    --crm-crit-bg: #F7E9E6;    --crm-crit-dot: #C0574E;
  --crm-info-ink: #31518E;    --crm-info-bg: #E8EDF8;    --crm-info-dot: #4A76C4;
  --crm-chart-a: #B99653;     --crm-chart-b: #DDCBA4;
  /* Sentiments (Ambassadeurs) — échelle DIVERGENTE : deux teintes + un point
     neutre, luminosité en escalier vers chaque pôle (vérifiée en OKLab). Le
     vert et le rouge ne se touchent jamais : le neutre les sépare toujours. */
  --amb-s-tres-positif: #256B43;
  --amb-s-positif: #34A264;
  --amb-s-mitige: #A89F8D;
  --amb-s-negatif: #C0574E;
  --amb-s-tres-negatif: #8F3A31;
  --amb-s-aucun: #CFC8B8;
}
body[data-gtheme="dark"] #crm-view, body[data-gtheme="dark"] #agriculture-view,
body[data-gtheme="dark"] #ambassadeurs-view, body[data-gtheme="dark"] #diffusions-view,
body[data-gtheme="dark"] #ligne-du-temps-view,
body[data-gtheme="dark"] .crm-sheet-ov,
body[data-gtheme="dark"] .crm-rt-notepop {
  --crm-card: #2b2823;
  --crm-card-2: #332f28;
  --crm-line: rgba(221, 203, 164, .13);
  --crm-line-strong: rgba(221, 203, 164, .26);
  --crm-ink: rgba(255, 255, 255, .92);
  --crm-ink-2: rgba(255, 255, 255, .58);
  --crm-ink-3: rgba(255, 255, 255, .36);
  --crm-accent: #DDCBA4;
  --crm-accent-ink: #241f16;
  --crm-accent-soft: rgba(221, 203, 164, .12);
  --crm-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 28px -14px rgba(0, 0, 0, .5);
  --crm-shadow-lift: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 38px -16px rgba(0, 0, 0, .55);
  --crm-ok-ink: #96C7A8;      --crm-ok-bg: rgba(84, 160, 116, .16);   --crm-ok-dot: #64B586;
  --crm-warn-ink: #E5B573;    --crm-warn-bg: rgba(208, 138, 42, .15); --crm-warn-dot: #DA9A44;
  --crm-crit-ink: #DE9A90;    --crm-crit-bg: rgba(192, 87, 78, .16);  --crm-crit-dot: #CC6B5A;
  --crm-info-ink: #A3BCE8;    --crm-info-bg: rgba(74, 118, 196, .17); --crm-info-dot: #7B9BD6;
  --crm-chart-a: #DDCBA4;     --crm-chart-b: #8a7347;
  /* Sentiments en thème sombre : mêmes teintes, escalier INVERSÉ — sur fond
     sombre, « plus fort » = plus clair. Jamais un simple recopiage du clair. */
  --amb-s-tres-positif: #96C7A8;
  --amb-s-positif: #5FA97F;
  --amb-s-mitige: #7A7264;
  --amb-s-negatif: #B95F50;
  --amb-s-tres-negatif: #E29C92;
  --amb-s-aucun: #4A443A;
}

.crm-list, .crm-fiche { max-width: 980px; margin: 0 auto; color: var(--crm-ink); }

/* --- Animations partagées ------------------------------------------- */
@keyframes crm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes crm-sheet-up { from { opacity: .4; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes crm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes crm-shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }
@keyframes crm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 162, 100, .45); } 60% { box-shadow: 0 0 0 5px rgba(52, 162, 100, 0); } }
@media (prefers-reduced-motion: reduce) {
  /* .crm-rt-notepop est ancré au <body> : il échappe à `#crm-view *`, exactement
     comme .crm-sheet-ov. Sans lui ici, le panneau de note continuerait de glisser
     alors que « Réduire les animations » est actif. */
  #crm-view *, #crm-view *::before, #crm-view *::after,
  .crm-sheet-ov, .crm-sheet, .crm-rt-notepop { animation: none !important; transition: none !important; }
}

/* --- Squelettes de chargement --------------------------------------- */
.crm-skel { border-radius: 10px; background: linear-gradient(100deg, var(--crm-card-2) 40%, var(--crm-card) 50%, var(--crm-card-2) 60%) 0 0 / 200% 100%; animation: crm-shimmer 1.4s linear infinite; }
.crm-skel-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.crm-skel-row + .crm-skel-row { border-top: 1px solid var(--crm-line); }
.crm-skel--av { width: 42px; height: 42px; border-radius: 13px; flex: none; }
.crm-skel--l1 { height: 13px; width: 46%; margin-bottom: 7px; }
.crm-skel--l2 { height: 11px; width: 28%; }
.crm-skel--pill { width: 74px; height: 24px; border-radius: 999px; margin-left: auto; flex: none; }

/* --- En-tête de la liste --------------------------------------------- */
.crm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; animation: crm-in .3s ease both; }
.crm-head__title { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.crm-head__sub { font-size: 13px; color: var(--crm-ink-2); margin-top: 3px; }
.crm-head__new { display: inline-flex; align-items: center; gap: 7px; background: var(--crm-accent); color: var(--crm-accent-ink); border: none; border-radius: 12px; font: inherit; font-size: 13.5px; font-weight: 550; padding: 10px 16px; cursor: pointer; box-shadow: var(--crm-shadow); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.crm-head__new:hover { transform: translateY(-1px); box-shadow: var(--crm-shadow-lift); filter: brightness(1.04); }
.crm-head__new:active { transform: none; }

/* KPI cliquables = filtres de statut */
.crm-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.crm-kpi { position: relative; text-align: left; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 16px; padding: 13px 16px 12px; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--crm-shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; animation: crm-in .34s ease both; }
.crm-kpi:nth-child(2) { animation-delay: .03s; } .crm-kpi:nth-child(3) { animation-delay: .06s; }
.crm-kpi:nth-child(4) { animation-delay: .09s; } .crm-kpi:nth-child(5) { animation-delay: .12s; }
.crm-kpi:hover { transform: translateY(-2px); box-shadow: var(--crm-shadow-lift); }
.crm-kpi:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
.crm-kpi__n { font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.crm-kpi__l { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--crm-ink-2); margin-top: 3px; }
.crm-kpi__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--crm-ink-3); }
.crm-kpi--actif .crm-kpi__dot { background: var(--crm-ok-dot); }
.crm-kpi--ralentit .crm-kpi__dot { background: var(--crm-warn-dot); }
.crm-kpi--dormant .crm-kpi__dot { background: var(--crm-crit-dot); }
.crm-kpi--prospect .crm-kpi__dot { background: var(--crm-info-dot); }
.crm-kpi.on { border-color: var(--crm-accent); box-shadow: 0 0 0 1px var(--crm-accent) inset, var(--crm-shadow); }
.crm-kpi.on::after { content: ''; position: absolute; inset: 0; border-radius: 16px; background: var(--crm-accent-soft); pointer-events: none; }

/* --- Barre d'outils --------------------------------------------------- */
.crm-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; animation: crm-in .38s ease both; }
.crm-search { flex: 1 1 240px; min-width: 170px; display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 13px; transition: border-color .15s ease, box-shadow .15s ease; }
.crm-search:focus-within { border-color: var(--crm-accent); box-shadow: 0 0 0 3px var(--crm-accent-soft); }
.crm-search svg { color: var(--crm-ink-3); flex: none; }
.crm-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 14px; color: var(--crm-ink); }
.crm-search input::placeholder { color: var(--crm-ink-3); }
.crm-filter { height: 42px; padding: 0 34px 0 13px; border: 1px solid var(--crm-line); border-radius: 13px; font: inherit; font-size: 13px; background: var(--crm-card); color: var(--crm-ink); cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23968a70' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; transition: border-color .15s ease; }
.crm-filter:hover { border-color: var(--crm-line-strong); }
.crm-count { font-size: 12.5px; color: var(--crm-ink-3); margin: 2px 2px 8px; }

/* --- Table des magasins (desktop) / cards (mobile) -------------------- */
.crm-listwrap { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 18px; overflow: hidden; box-shadow: var(--crm-shadow); animation: crm-in .42s ease both; }
.crm-thead { display: grid; grid-template-columns: 42px minmax(160px, 2fr) 76px minmax(78px, 1fr) minmax(78px, 1fr) 104px 96px 104px 100px; gap: 13px; align-items: center; padding: 10px 18px; background: var(--crm-card-2); border-bottom: 1px solid var(--crm-line); }
.crm-th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--crm-ink-3); text-align: left; }
button.crm-th { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px; transition: color .12s ease; }
button.crm-th:hover { color: var(--crm-ink); }
button.crm-th.on { color: var(--crm-accent); }
.crm-th__arrow { font-size: 9px; line-height: 1; }
.crm-row { display: grid; grid-template-columns: 42px minmax(160px, 2fr) 76px minmax(78px, 1fr) minmax(78px, 1fr) 104px 96px 104px 100px; gap: 13px; align-items: center; padding: 11px 18px; cursor: pointer; transition: background .12s ease; }
.crm-row + .crm-row { border-top: 1px solid var(--crm-line); }
.crm-row:hover { background: var(--crm-accent-soft); }

/* Mode sélection (export ShipStation) — réservé aux gestionnaires. La piste
   de cases n'existe que sous .crm-list--sel : la grille à 9 pistes reste
   intacte pour les autres. */
.crm-list--sel .crm-thead,
.crm-list--sel .crm-row { grid-template-columns: 26px 42px minmax(160px, 2fr) 76px minmax(78px, 1fr) minmax(78px, 1fr) 104px 96px 104px 100px; }
.crm-sel-cb { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--crm-accent); }
.crm-selbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 2px 8px; padding: 9px 13px; border: 1px solid var(--crm-accent); border-radius: 12px; background: var(--crm-accent-soft); animation: crm-in .2s ease both; }
.crm-selbar__n { font-size: 13px; font-weight: 600; }
.crm-selbar__sp { flex: 1; }
.crm-selbar button { font-family: inherit; font-size: 12.5px; border-radius: 9px; padding: 6px 12px; cursor: pointer; border: 1px solid var(--crm-line); background: var(--crm-card); color: var(--crm-ink); transition: filter .12s ease; }
.crm-selbar button:hover:not(:disabled) { filter: brightness(.97); }
.crm-selbar button:disabled { opacity: .55; cursor: default; }
.crm-selbar__go { background: var(--crm-accent); border-color: var(--crm-accent); color: #fff; font-weight: 600; }
.crm-selbar__msg { font-size: 12.5px; color: var(--crm-ink-3); }
.crm-selbar__msg a { color: var(--crm-accent); font-weight: 600; }
.crm-row:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: -2px; }
.crm-row__main { min-width: 0; }
.crm-row__name { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-row__sub, .crm-row__cell { color: var(--crm-ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-row__num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   Pastilles de tags. Discrètes par construction : la liste va jusqu'à 1896
   lignes actives, une pastille ne doit ni changer la hauteur d'une ligne ni
   tirer l'œil avant le nom du magasin — d'où 11 px, l'encre secondaire et
   l'absence de fond plein.
   Toutes les couleurs sortent des jetons --crm-* définis en clair ET en sombre
   au sommet du fichier : aucune valeur n'est posée dans un seul thème.
   --------------------------------------------------------------------------- */
.crm-tag {
  display: inline-flex; align-items: center; max-width: 130px;
  font: inherit; font-size: 11px; font-weight: 550; line-height: 1.55;
  padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--crm-line-strong); background: var(--crm-card-2);
  color: var(--crm-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.crm-tag:hover { color: var(--crm-accent); border-color: var(--crm-accent); background: var(--crm-accent-soft); }
/* Ce qui ne se clique pas ne fait pas semblant : « +N » (simple report) et une
   pastille désactivée (fiche sans navigation) gardent leur apparence au survol. */
.crm-tag--more, .crm-tag:disabled { cursor: default; }
.crm-tag--more:hover, .crm-tag:disabled:hover { color: var(--crm-ink-2); border-color: var(--crm-line-strong); background: var(--crm-card-2); }
/* Variante bouton (fiche, formulaire) : focus clavier visible, état « posé ». */
.crm-tag--btn:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 1px; }
.crm-tag--btn.on { background: var(--crm-accent); border-color: var(--crm-accent); color: var(--crm-accent-ink); }

/* Dans une ligne de liste, c'est la VILLE qui cède la place, pas les tags : la
   colonne « Magasin » tombe à son minimum de 160 px et les points de suspension
   mangeaient les pastilles — un tag qu'on ne voit pas ne sert à rien.
   `:not(.crm-row__mob)` : la sous-ligne MOBILE n'a pas de `__subtxt`, son texte
   y serait un item de flex anonyme sur lequel text-overflow: ellipsis ne
   s'applique pas — elle se ferait couper net au lieu de finir en « … ». */
.crm-row__sub:not(.crm-row__mob) { display: flex; align-items: center; }
.crm-row__subtxt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-tags { display: inline-flex; gap: 4px; flex: none; vertical-align: middle; }
.crm-tags:not(:empty) { margin-left: 7px; }
.crm-row .crm-tag { max-width: 76px; }

/* Le <select> de tags prend la largeur de sa plus longue option, et ces
   libellés sont du texte libre tapé par les reps : sans borne, la largeur du
   filtre serait pilotée par les données — ce qui n'était pas le cas pour
   rep/région (valeurs courtes et contrôlées). Même valeur que le cockpit, qui
   avait déjà anticipé le problème. */
#crm-tag { max-width: 190px; }

/* Tags de la fiche : sous la ligne ville · région, ils peuvent respirer. La
   boîte du héros fait ~678 px et passe déjà à la ligne, donc un tag de 40
   caractères — la borne d'écriture — y tient EN ENTIER. Le plafonner ici
   couperait le seul endroit censé tout montrer, y compris le repli du « +N »
   de la liste. */
.crm-hero__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.crm-hero__tags .crm-tag { font-size: 11.5px; max-width: none; padding: 1px 9px; }

/* Suggestions sous le champ « Tags » du formulaire. */
.crm-tagsug { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; max-height: 84px; overflow-y: auto; }
.crm-tagsug:empty { display: none; }
.crm-tagsug__l { font-size: 11.5px; color: var(--crm-ink-3); margin-right: 2px; }
.crm-row__date { color: var(--crm-ink-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Cellule sell-through (part de marché + présence Bleuh) */
.crm-st-cell { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.crm-st-cell--none { color: var(--crm-ink-3); }
.crm-st-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.crm-st-dot--ours { background: var(--crm-ok-dot); }
.crm-st-dot--zero { background: var(--crm-ink-3); opacity: .5; }
.crm-st-val { color: var(--crm-ink); }
.crm-st-cell .crm-st-opp { font-size: 12px; line-height: 1; }

/* Dernière activité : 2 lignes (date · heure + initiales) + pastille d'ancienneté */
.crm-lastact { display: inline-flex; flex-direction: column; gap: 1px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.crm-lastact--none { color: var(--crm-ink-3); }
.crm-lastact__d { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.crm-lastact__t { font-size: 12px; color: var(--crm-ink-3); }
.crm-lastact__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.crm-lastact--fresh .crm-lastact__dot { background: var(--crm-ok-dot); }
.crm-lastact--ok .crm-lastact__dot { background: var(--crm-ok-dot); opacity: .55; }
.crm-lastact--warn .crm-lastact__dot { background: #e0a83c; }
.crm-lastact--cold .crm-lastact__dot { background: #d06b57; }
#crm-fixed-remove { padding: 6px 9px; color: var(--crm-ink-3); }

/* --- Monogramme ------------------------------------------------------- */
.crm-mono { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13.5px; flex: none; letter-spacing: .01em; }
.crm-mono--lg { width: 58px; height: 58px; border-radius: 17px; font-size: 19px; }
.crm-mono--actif { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.crm-mono--ralentit { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.crm-mono--dormant { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }
.crm-mono--prospect { background: var(--crm-info-bg); color: var(--crm-info-ink); }

/* --- Pastille de statut ------------------------------------------------ */
.crm-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 4px 11px; border-radius: 999px; white-space: nowrap; justify-self: start; }
.crm-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.crm-pill--actif { background: var(--crm-ok-bg); color: var(--crm-ok-ink); } .crm-pill--actif .crm-dot { background: var(--crm-ok-dot); animation: crm-pulse 2.4s ease-out infinite; }
.crm-pill--ralentit { background: var(--crm-warn-bg); color: var(--crm-warn-ink); } .crm-pill--ralentit .crm-dot { background: var(--crm-warn-dot); }
.crm-pill--dormant { background: var(--crm-crit-bg); color: var(--crm-crit-ink); } .crm-pill--dormant .crm-dot { background: var(--crm-crit-dot); }
.crm-pill--prospect { background: var(--crm-info-bg); color: var(--crm-info-ink); } .crm-pill--prospect .crm-dot { background: var(--crm-info-dot); }

/* --- Pastille de segment ABCD -------------------------------------------- */
.crm-seg-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; font-size: 11px; font-weight: 650; border-radius: 999px; padding: 2px 8px; white-space: nowrap; letter-spacing: .02em; }
.crm-seg-badge--success { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.crm-seg-badge--accent { background: var(--crm-accent-soft); color: var(--crm-accent); }
.crm-seg-badge--muted { background: var(--crm-card-2); color: var(--crm-ink-2); border: 1px solid var(--crm-line); }
.crm-seg-badge--warning { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.crm-seg-badge--prospect { background: var(--crm-info-bg); color: var(--crm-info-ink); }

/* Filtre segments A/B/C/D/P (barre d'outils) */
.crm-segrow { display: inline-flex; gap: 2px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 13px; padding: 3px; height: 42px; box-sizing: border-box; align-items: stretch; }
.crm-segrow button { border: none; background: transparent; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--crm-ink-2); padding: 0 12px; border-radius: 10px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.crm-segrow button:hover { color: var(--crm-ink); }
.crm-segrow button.on { background: var(--crm-card); color: var(--crm-ink); box-shadow: var(--crm-shadow); }

/* --- États ------------------------------------------------------------- */
.crm-loading, .crm-empty, .crm-error { padding: 40px 24px; text-align: center; color: var(--crm-ink-2); animation: crm-fade .2s ease both; }
.crm-empty__ic { font-size: 26px; margin-bottom: 8px; opacity: .8; }
.crm-empty__hint { font-size: 12.5px; color: var(--crm-ink-3); margin-top: 4px; }
.crm-error { color: var(--crm-crit-ink); }

/* --- Fiche : hero ------------------------------------------------------- */
.crm-fiche__back { background: none; border: none; color: var(--crm-ink-2); font: inherit; font-size: 13.5px; cursor: pointer; padding: 6px 2px; margin-bottom: 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; transition: color .12s ease; }
.crm-fiche__back:hover { color: var(--crm-ink); }
.crm-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 20px; padding: 20px 22px; box-shadow: var(--crm-shadow); animation: crm-in .3s ease both; }
.crm-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--crm-chart-a), var(--crm-chart-b), transparent 85%); opacity: .9; }
.crm-hero__main { flex: 1; min-width: 0; }
.crm-hero__name { font-size: 19px; font-weight: 650; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-hero__sub { font-size: 13px; color: var(--crm-ink-2); margin-top: 3px; }
.crm-hero__side { display: flex; align-items: center; gap: 10px; flex: none; }
.crm-hero__badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.crm-hero__seg { display: flex; align-items: center; gap: 8px; }
.crm-hero__score { font-size: 12px; color: var(--crm-ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.crm-hero__menu { position: relative; }
.crm-hero__more { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--crm-line); border-radius: 10px; color: var(--crm-ink-2); font-size: 17px; line-height: 1; cursor: pointer; transition: background .12s ease, color .12s ease; }
.crm-hero__more:hover { background: var(--crm-accent-soft); color: var(--crm-ink); }
.crm-hero__dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 12px; box-shadow: var(--crm-shadow-lift); min-width: 160px; z-index: 30; overflow: hidden; }
.crm-hero__dropdown.on { display: flex; flex-direction: column; animation: crm-in .14s ease both; }
.crm-hero__dropdown button { background: none; border: none; text-align: left; padding: 10px 14px; font: inherit; font-size: 13.5px; color: var(--crm-ink); cursor: pointer; }
.crm-hero__dropdown button:hover { background: var(--crm-accent-soft); }
.crm-hero__dropdown button.danger { color: var(--crm-crit-ink); }

/* Actions rapides */
.crm-actions { display: flex; gap: 8px; margin: 12px 0; animation: crm-in .34s ease both; }
.crm-action { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--crm-ink); text-decoration: none; padding: 11px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 13px; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; cursor: pointer; }
.crm-action:hover { background: var(--crm-accent-soft); transform: translateY(-1px); box-shadow: var(--crm-shadow); }
.crm-action svg { color: var(--crm-ink-2); }

/* Bandeau KPI de la fiche */
.crm-fkpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; animation: crm-in .38s ease both; }
.crm-fkpi { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 15px; padding: 12px 15px; box-shadow: var(--crm-shadow); }
.crm-fkpi__n { font-size: 18px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.crm-fkpi__l { font-size: 11.5px; color: var(--crm-ink-2); margin-top: 2px; }

/* --- Onglets de la fiche ------------------------------------------------ */
.crm-tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 2px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 14px; padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; animation: crm-in .42s ease both; }
.crm-tabs::-webkit-scrollbar { display: none; }
.crm-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; background: transparent; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--crm-ink-2); padding: 9px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; transition: background .14s ease, color .14s ease; }
.crm-tab:hover { color: var(--crm-ink); }
.crm-tab.on { background: var(--crm-card); color: var(--crm-ink); font-weight: 600; box-shadow: var(--crm-shadow); }
.crm-tab__badge { font-size: 11px; font-weight: 600; background: var(--crm-accent-soft); color: var(--crm-accent); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
body[data-gtheme="dark"] #crm-view .crm-tab__badge { color: var(--crm-accent); }
.crm-tabpane { animation: crm-in .24s ease both; }

/* --- Cartes ------------------------------------------------------------- */
.crm-card { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 18px; padding: 18px 20px; margin-bottom: 12px; box-shadow: var(--crm-shadow); }
.crm-section__label { font-size: 11px; color: var(--crm-ink-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: 12px; }
.crm-help-i { cursor: help; opacity: .5; font-weight: 700; text-transform: none; }
.crm-help-i:hover, .crm-help-i:focus { opacity: .9; outline: none; }

/* Coordonnées (aperçu) */
.crm-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; }
.crm-info--dense { grid-template-columns: repeat(3, 1fr); gap: 9px 18px; }
.crm-info__item { min-width: 0; }
.crm-info__k { font-size: 11px; color: var(--crm-ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.crm-info__v { font-size: 14px; color: var(--crm-ink); overflow-wrap: anywhere; }
.crm-info__v a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--crm-line-strong); transition: border-color .12s ease; }
.crm-info__v a:hover { border-color: var(--crm-accent); }
.crm-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.crm-flag { font-size: 11.5px; font-weight: 550; padding: 3px 10px; border-radius: 999px; background: var(--crm-accent-soft); color: var(--crm-accent); border: 1px solid transparent; }
body[data-gtheme="dark"] #crm-view .crm-flag { border-color: var(--crm-line); }

/* Top produits (aperçu) */
.crm-top { display: flex; flex-direction: column; gap: 9px; }
.crm-top__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.crm-top__name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-top__city { color: var(--crm-ink-3); font-size: 12px; }
/* Format (« 3.5 g », « 5 × 0.5 g ») — la seule donnée qui distingue deux
   produits homonymes. Il est donc À CÔTÉ du nom, pas dans la ligne grise.
   Le modificateur reste LOCAL : .crm-top__name est partagé par 7 écrans. */
.crm-top__name--fmt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; min-width: 0; }
/* Priorité au NOM. Première tentative avec la pastille protégée : à 250 px le
   nom tombait à « O. », et sur une ligne il disparaissait complètement — on
   avait sauvé le complément en détruisant l'essentiel.
   Le plancher (min-width) empêche le nom de s'abréger au-delà du lisible ;
   quand la place manque vraiment, c'est la PASTILLE qui passe à la ligne. */
/* `flex: 0 1 auto` (et non 1 1) : le nom ne s'ÉTIRE pas, donc la pastille reste
   collée à lui. Étiré, le nom repoussait la pastille contre la colonne des
   unités, où elle se lisait comme un attribut du chiffre et non du produit. */
.crm-top__name--fmt .crm-top__nm { flex: 0 1 auto; min-width: 11ch;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-top__fmt { flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
    padding: 1.5px 6px; border-radius: 5px; white-space: nowrap;
    color: var(--crm-ink); background: var(--crm-card-2); border: 1px solid var(--crm-line); }
.crm-top__units { font-size: 12.5px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Qualification du produit (sous-catégorie · catégorie · marque, + SKU quand
   le nom seul ne distingue plus). Discrète : elle départage, elle ne concurrence
   pas le nom. Sur toute la largeur, au-dessus de la barre. */
.crm-top__meta { grid-column: 1 / -1; font-size: 11.5px; color: var(--crm-ink-3, #9a927f);
    line-height: 1.35; margin-top: -1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-top__bar { grid-column: 1 / -1; height: 5px; border-radius: 4px; background: var(--crm-card-2); overflow: hidden; }
.crm-top__bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--crm-chart-a), var(--crm-chart-b)); }

/* --- Sell-through (marché) ------------------------------------------------ */
.crm-st-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.crm-st-kpi { background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 13px; padding: 12px 14px; }
.crm-st-kpi__n { font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.crm-st-kpi__l { font-size: 11px; color: var(--crm-ink-2); margin-top: 3px; }
.crm-trend { font-size: 12px; margin-left: 2px; }
.crm-trend--up { color: var(--crm-ok-ink); } .crm-trend--down { color: var(--crm-crit-ink); } .crm-trend--flat { color: var(--crm-ink-3); }
.crm-insight { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--crm-warn-ink); background: var(--crm-warn-bg); border-radius: 11px; padding: 10px 13px; }
.crm-st-legend { display: flex; gap: 16px; margin: 14px 0 2px; font-size: 11.5px; color: var(--crm-ink-2); }
.crm-st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.crm-st-legend span::before { content: ''; width: 14px; height: 3px; border-radius: 2px; }
.crm-st-legend__cat::before { background: var(--crm-chart-b); opacity: .6; }
.crm-st-legend__ours::before { background: var(--crm-accent); }

/* --- Contacts ------------------------------------------------------------ */
.crm-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.crm-contact { display: flex; align-items: center; gap: 12px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 14px; padding: 12px 14px; transition: transform .14s ease, box-shadow .14s ease; }
.crm-contact:hover { transform: translateY(-1px); box-shadow: var(--crm-shadow); }
.crm-contact__av { width: 36px; height: 36px; border-radius: 50%; background: var(--crm-info-bg); color: var(--crm-info-ink); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; flex: none; }
.crm-contact__name { font-weight: 550; font-size: 14px; }
.crm-contact__role { font-size: 12px; color: var(--crm-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-contact a { color: var(--crm-ink-2); display: inline-flex; padding: 5px; border-radius: 8px; transition: background .12s ease, color .12s ease; }
.crm-contact a:hover { background: var(--crm-accent-soft); color: var(--crm-ink); }
.crm-contact__edit, .crm-contact__del { background: none; border: none; color: var(--crm-ink-3); cursor: pointer; padding: 5px; border-radius: 8px; display: inline-flex; font-size: 13px; transition: background .12s ease, color .12s ease; }
.crm-contact__edit:hover { background: var(--crm-accent-soft); color: var(--crm-ink); }
.crm-contact__del:hover { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }

/* --- Graphique hebdo (SVG) ------------------------------------------------ */
.crm-chart { margin: 2px 0 6px; }
.crm-chart svg { display: block; width: 100%; height: auto; }
.crm-chart .bar { transition: opacity .12s ease; }
.crm-chart .bar:hover { opacity: .75; }
.crm-chart .bar--peak { fill: var(--crm-accent); }
.crm-chart .bar--partial { fill-opacity: .38; stroke: var(--crm-ink-3); stroke-dasharray: 3 3; }
.crm-chart .lbl--partial { font-style: italic; opacity: .7; }
.crm-chart .grid { stroke: var(--crm-line); stroke-width: 1; }
.crm-chart .lbl { fill: var(--crm-ink-3); font-size: 9.5px; font-family: inherit; }
.crm-chart .val { fill: var(--crm-ink-2); font-size: 9.5px; font-weight: 600; font-family: inherit; }
/* Fiche : barres/dates cliquables → filtre les produits de la semaine */
#crm-fiche-orderchart .crm-chart .bar, #crm-fiche-orderchart .crm-chart .lbl, #crm-fiche-orderchart .crm-chart .val,
#crm-orders-chart .crm-chart .bar, #crm-orders-chart .crm-chart .lbl, #crm-orders-chart .crm-chart .val { cursor: pointer; }
.crm-chart .bar--sel { stroke: var(--crm-accent); stroke-width: 2.5; paint-order: stroke; }
.crm-chart-hint { font-size: 12px; color: var(--crm-ink-3); margin-top: 8px; }
.crm-week-clear { margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--crm-accent); background: var(--crm-accent-soft); border: none; border-radius: 999px; padding: 2px 9px; cursor: pointer; vertical-align: middle; }
.crm-week-clear:hover { background: var(--crm-accent); color: var(--crm-accent-ink); }

/* Score : lignes cliquables + pop-up d'explication */
.crm-signal-hint { font-size: 11px; font-weight: 500; color: var(--crm-ink-3); text-transform: none; letter-spacing: 0; }
.crm-signal-row { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding: 4px 6px; transition: background .12s ease; }
.crm-signal-row:hover { background: var(--crm-card-2); }
.crm-signal-row:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 1px; }
.crm-signal-i { font-size: 11px; color: var(--crm-ink-3); }
.crm-signal-row:hover .crm-signal-i { color: var(--crm-accent); }
.crm-explain-weight { font-size: 12.5px; color: var(--crm-ink-2); background: var(--crm-accent-soft); border-radius: 999px; padding: 4px 12px; display: inline-block; margin-bottom: 12px; }
.crm-explain-weight b { color: var(--crm-accent); }
.crm-explain-how { font-size: 14px; line-height: 1.55; color: var(--crm-ink); margin: 0 0 12px; }
.crm-explain-val { font-size: 13.5px; font-weight: 550; color: var(--crm-ink); background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 12px; padding: 11px 14px; }
.crm-explain-total { font-size: 12px; color: var(--crm-ink-3); margin-top: 14px; line-height: 1.5; }

/* --- Table des commandes --------------------------------------------------- */
.crm-table-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.crm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.crm-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--crm-ink-3); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--crm-line); white-space: nowrap; }
.crm-table th.num, .crm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.crm-table td { padding: 9px 10px; border-bottom: 1px solid var(--crm-line); color: var(--crm-ink); }
.crm-table tr:last-child td { border-bottom: none; }
.crm-table tbody tr { transition: background .1s ease; }
.crm-table tbody tr:hover { background: var(--crm-accent-soft); }
.crm-table .dim { color: var(--crm-ink-2); font-size: 12.5px; white-space: nowrap; }
.crm-more { display: block; width: 100%; margin-top: 10px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 11px; font: inherit; font-size: 13px; font-weight: 500; color: var(--crm-ink-2); padding: 9px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.crm-more:hover { background: var(--crm-accent-soft); color: var(--crm-ink); }

/* --- Activités : timeline --------------------------------------------------- */
.crm-act-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.crm-act-add { display: inline-flex; align-items: center; gap: 6px; background: var(--crm-accent); color: var(--crm-accent-ink); border: none; border-radius: 11px; font: inherit; font-size: 13px; font-weight: 550; padding: 8px 14px; cursor: pointer; box-shadow: var(--crm-shadow); transition: transform .14s ease, filter .14s ease; }
.crm-act-add:hover { transform: translateY(-1px); filter: brightness(1.05); }
.crm-tl__month { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--crm-ink-3); margin: 18px 0 10px 2px; }
.crm-tl__month:first-child { margin-top: 0; }
.crm-act { position: relative; display: flex; gap: 13px; padding: 2px 0 16px 0; }
.crm-act::before { content: ''; position: absolute; left: 17px; top: 40px; bottom: -2px; width: 2px; border-radius: 2px; background: var(--crm-line); }
.crm-act:last-child::before, .crm-act--last::before { display: none; }
.crm-act__ic { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.crm-act__ic--accent { background: var(--crm-info-bg); color: var(--crm-info-ink); }
.crm-act__ic--success { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.crm-act__ic--warning { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.crm-act__ic--prospect { background: var(--crm-info-bg); color: var(--crm-info-ink); }
.crm-act__ic--muted { background: var(--crm-card-2); color: var(--crm-ink-2); border: 1px solid var(--crm-line); }
.crm-act__body { flex: 1; min-width: 0; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 14px; padding: 11px 14px; }
.crm-act__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.crm-act__type { font-weight: 600; font-size: 13.5px; }
.crm-act__when { font-size: 12px; color: var(--crm-ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.crm-act__src { font-size: 10.5px; font-weight: 650; color: var(--crm-ink-2); background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 999px; padding: 1px 8px; margin-left: 8px; margin-right: auto; letter-spacing: .03em; }
.crm-act__right { display: flex; align-items: center; gap: 4px; }
.crm-act__menu { position: relative; }
.crm-act__more { background: none; border: none; color: var(--crm-ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 3px 7px; border-radius: 7px; transition: background .12s ease, color .12s ease; }
.crm-act__more:hover { background: var(--crm-accent-soft); color: var(--crm-ink); }
.crm-act__dropdown { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 11px; box-shadow: var(--crm-shadow-lift); min-width: 136px; z-index: 10; overflow: hidden; }
.crm-act__dropdown.on { display: flex; flex-direction: column; animation: crm-in .13s ease both; }
.crm-act__dropdown button { background: none; border: none; text-align: left; padding: 9px 13px; font: inherit; font-size: 13px; color: var(--crm-ink); cursor: pointer; width: 100%; }
.crm-act__dropdown button:hover { background: var(--crm-accent-soft); }
.crm-act__note { font-size: 13.5px; color: var(--crm-ink); opacity: .92; line-height: 1.55; margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-act__note--clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.crm-act__expand { background: none; border: none; padding: 2px 0; margin-top: 2px; font: inherit; font-size: 12px; font-weight: 550; color: var(--crm-accent); cursor: pointer; }
.crm-act__photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.crm-act__photobtn { background: none; border: none; padding: 0; cursor: zoom-in; display: inline-flex; }
.crm-act__photo { width: 68px; height: 68px; object-fit: cover; border-radius: 10px; border: 1px solid var(--crm-line); transition: transform .14s ease; }
.crm-act__photo:hover { transform: scale(1.04); }
.crm-act__audio { width: 100%; max-width: 300px; height: 36px; margin-top: 9px; }
.crm-act__author { font-size: 11px; color: var(--crm-ink-3); margin-top: 7px; }

/* --- Feuille (bottom sheet / modale) ----------------------------------------- */
.crm-sheet-ov { position: fixed; inset: 0; background: rgba(24, 20, 14, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; z-index: 1000; animation: crm-fade .18s ease both; }
.crm-sheet { background: var(--crm-card, #FBF8F2); color: var(--crm-ink, #282521); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; max-height: 92dvh; overflow-y: auto; box-shadow: 0 -8px 40px rgba(0, 0, 0, .18); animation: crm-sheet-up .26s cubic-bezier(.32, .72, .33, 1) both; }
.crm-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--crm-line, rgba(40,34,24,.14)); margin: 10px auto 0; }
@media (min-width: 560px) {
  .crm-sheet-ov { align-items: center; padding: 24px; }
  .crm-sheet { border-radius: 20px; }
  .crm-sheet::before { display: none; }
}
.crm-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--crm-line, rgba(40,34,24,.09)); font-weight: 600; font-size: 15px; position: sticky; top: 0; background: inherit; z-index: 2; }
.crm-sheet__x { background: none; border: none; font-size: 17px; cursor: pointer; color: var(--crm-ink-3, #9a927f); padding: 4px 8px; border-radius: 8px; transition: background .12s ease, color .12s ease; }
.crm-sheet__x:hover { background: var(--crm-accent-soft, rgba(168,134,63,.1)); color: var(--crm-ink, #282521); }
.crm-sheet__body { padding: 16px 20px calc(22px + env(safe-area-inset-bottom)); }
.crm-sheet__label { font-size: 11px; color: var(--crm-ink-3, #9a927f); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 8px; }
.crm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.crm-chips button { font: inherit; font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--crm-line, #ece4d6); background: var(--crm-card, #fff); color: var(--crm-ink-2, #6f6857); cursor: pointer; transition: all .13s ease; }
.crm-chips button:hover { border-color: var(--crm-line-strong, #d9cfba); }
.crm-chips button.on { background: var(--crm-accent, #A8863F); color: var(--crm-accent-ink, #fff); border-color: var(--crm-accent, #A8863F); }
.crm-sheet__note { width: 100%; border: 1px solid var(--crm-line, #ece4d6); border-radius: 13px; padding: 11px 13px; font-size: 14px; font-family: inherit; color: var(--crm-ink, #282521); background: var(--crm-card, #fff); resize: vertical; box-sizing: border-box; margin-bottom: 14px; transition: border-color .13s ease, box-shadow .13s ease; }
.crm-sheet__note:focus { outline: none; border-color: var(--crm-accent, #A8863F); box-shadow: 0 0 0 3px var(--crm-accent-soft, rgba(168,134,63,.1)); }
.crm-sheet__actions { display: flex; gap: 8px; margin-bottom: 12px; }
.crm-sheet__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 500; padding: 11px; border: 1px solid var(--crm-line, #ece4d6); border-radius: 12px; background: var(--crm-card, #fff); cursor: pointer; color: var(--crm-ink, #4a4438); transition: background .13s ease; }
.crm-sheet__btn:hover { background: var(--crm-accent-soft, rgba(168,134,63,.08)); }
.crm-sheet__thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.crm-sheet__thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 11px; border: 1px solid var(--crm-line, #efe9dd); }
.crm-rec { font-size: 13px; padding: 10px 13px; border-radius: 11px; background: var(--crm-info-bg, #eef1f8); color: var(--crm-info-ink, #2f4d86); margin-bottom: 12px; }
.crm-rec--live .crm-rec__dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--crm-crit-dot, #c0574e); margin-right: 6px; vertical-align: middle; animation: crm-pulse 1.4s ease-out infinite; }
.crm-rec--done { background: var(--crm-ok-bg, #e6f4ea); color: var(--crm-ok-ink, #1f6b3a); }
.crm-sheet__err { color: var(--crm-crit-ink, #8a3b34); font-size: 13px; margin-bottom: 10px; min-height: 4px; }
/* Indice desktop seulement (le collage n'existe pas vraiment sur mobile). */
.crm-sheet__hint { display: none; color: var(--crm-muted, #8a8577); font-size: 12px; margin: -2px 0 8px; }
@media (hover: hover) and (pointer: fine) { .crm-sheet__hint { display: block; } }
.crm-sheet__save { width: 100%; background: var(--crm-accent, #A8863F); color: var(--crm-accent-ink, #fff); border: none; border-radius: 13px; padding: 13px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: filter .13s ease, transform .13s ease; }
.crm-sheet__save:hover { filter: brightness(1.05); }
.crm-sheet__save:active { transform: scale(.99); }
.crm-sheet__save:disabled { opacity: .55; cursor: default; }

/* --- Échantillons laissés (traçabilité des lots) --------------------------------- */
.crm-samples__check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--crm-ink, #282521); margin-bottom: 10px; cursor: pointer; }
.crm-samples__check input { width: 18px; height: 18px; accent-color: var(--crm-accent, #A8863F); cursor: pointer; }
.crm-samples__check input:disabled { cursor: default; }
.crm-samples { border: 1px solid var(--crm-line, #ece4d6); border-radius: 13px; padding: 10px; margin-bottom: 12px; }
.crm-samples__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-samples__chips:not(:empty) { margin-bottom: 8px; }
.crm-samples__chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 5px 8px 5px 12px; border-radius: 999px; background: var(--crm-accent, #A8863F); color: var(--crm-accent-ink, #fff); }
.crm-samples__chip button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0 2px; opacity: .85; }
.crm-samples__chip button:hover { opacity: 1; }
.crm-samples__q { width: 100%; box-sizing: border-box; border: 1px solid var(--crm-line, #ece4d6); border-radius: 11px; padding: 9px 11px; font-size: 14px; font-family: inherit; background: var(--crm-card, #fff); color: var(--crm-ink, #282521); transition: border-color .13s ease, box-shadow .13s ease; }
.crm-samples__q:focus { outline: none; border-color: var(--crm-accent, #A8863F); box-shadow: 0 0 0 3px var(--crm-accent-soft, rgba(168,134,63,.1)); }
.crm-samples__list { max-height: 220px; overflow-y: auto; margin-top: 8px; }
.crm-samples__grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--crm-ink-3, #9a927f); padding: 8px 4px 4px; }
.crm-samples__opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: none; border: none; border-radius: 9px; padding: 8px; font: inherit; cursor: pointer; color: var(--crm-ink, #282521); }
.crm-samples__opt:hover { background: var(--crm-accent-soft, rgba(168,134,63,.1)); }
.crm-samples__lot { font-size: 14px; font-weight: 600; }
.crm-samples__meta { font-size: 12px; color: var(--crm-ink-3, #9a927f); }
/* Le grammage sort du gris de la ligne : c'est LUI qui départage deux lots au
   même nom de produit, il doit s'attraper à l'œil sans être lu. */
.crm-samples__fmt { font-weight: 600; color: var(--crm-ink, #282521); }
.crm-samples__empty { font-size: 13px; color: var(--crm-ink-3, #9a927f); padding: 10px 4px; }
/* Visible AUSSI sur mobile (contrairement à .crm-sheet__hint) : les reps sont sur téléphone. */
.crm-samples__hint { font-size: 12px; color: var(--crm-muted, #8a8577); margin-top: 8px; }
.crm-samples__down { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 13px; color: var(--crm-crit-ink, #8a3b34); padding: 8px 4px; }
.crm-samples__retry, .crm-samples__add { flex: none; font: inherit; font-size: 12px; font-weight: 500; padding: 6px 12px; border: 1px solid var(--crm-line, #ece4d6); border-radius: 999px; background: var(--crm-card, #fff); color: var(--crm-ink, #282521); cursor: pointer; }
.crm-samples__retry:hover, .crm-samples__add:hover { background: var(--crm-accent-soft, rgba(168,134,63,.1)); }
.crm-samples__manual { display: flex; align-items: center; gap: 10px; justify-content: space-between; font-size: 12px; color: var(--crm-ink-3, #9a927f); border-top: 1px solid var(--crm-line, #ece4d6); padding: 8px 4px 2px; }
.crm-act__lots { font-size: 13px; color: var(--crm-ink-2, #6f6857); margin-top: 4px; }

/* --- Formulaires (magasin / contact) ------------------------------------------ */
.crm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.crm-form-grid .crm-field--full { grid-column: 1 / -1; }
.crm-field { margin-bottom: 11px; }
.crm-field label { display: block; font-size: 12px; font-weight: 500; color: var(--crm-ink-2, #6f6857); margin-bottom: 4px; }
.crm-field input, .crm-field textarea, .crm-field select { width: 100%; box-sizing: border-box; border: 1px solid var(--crm-line, #ece4d6); border-radius: 11px; padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--crm-ink, #282521); background: var(--crm-card, #fff); transition: border-color .13s ease, box-shadow .13s ease; }
.crm-field input:focus, .crm-field textarea:focus, .crm-field select:focus { outline: none; border-color: var(--crm-accent, #A8863F); box-shadow: 0 0 0 3px var(--crm-accent-soft, rgba(168,134,63,.1)); }
/* « Autre adresse… » ouvre un champ SOUS le sélecteur : les deux se suivent. */
.crm-field select + input[type="email"] { margin-top: 7px; }

/* ---- Pièces jointes du composeur (ticket David, 20/08) ---- */
.crm-mail-attach { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.crm-mail-attach .crm-sheet__btn { flex: 0 0 auto; padding: 8px 14px; }
.crm-mail-weight { font-size: 12px; color: var(--crm-ink-3, #9a927f); }
.crm-mail-weight.over { color: var(--crm-crit-ink, #8a3b34); font-weight: 600; }
.crm-mail-files { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.crm-mail-file { display: flex; align-items: center; gap: 9px; padding: 6px 8px 6px 6px; border: 1px solid var(--crm-line, #ece4d6); border-radius: 11px; background: var(--crm-card, #fff); }
.crm-mail-file__vig { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.crm-mail-file__ic { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--crm-accent-soft, rgba(168,134,63,.1)); font-size: 15px; flex: 0 0 auto; }
/* min-width:0 — sans lui, un nom long pousse la croix hors de la carte. */
.crm-mail-file__nom { flex: 1 1 auto; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-mail-file__poids { flex: 0 0 auto; font-size: 11.5px; color: var(--crm-ink-3, #9a927f); }
.crm-mail-file__x { flex: 0 0 auto; background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1; color: var(--crm-ink-3, #9a927f); padding: 6px; border-radius: 8px; transition: background .12s ease, color .12s ease; }
.crm-mail-file__x:hover { background: var(--crm-accent-soft, rgba(168,134,63,.1)); color: var(--crm-ink, #282521); }

/* --- Confirmation --------------------------------------------------------------- */
.crm-confirm__msg { font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.crm-confirm__actions { display: flex; gap: 8px; }
.crm-confirm__actions .crm-sheet__save { width: auto; flex: 1; margin: 0; }
.crm-confirm__actions .crm-sheet__btn { flex: 1; }

/* --- Rapport hebdo ------------------------------------------------------------------ */
.crm-head__btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crm-head__report { display: inline-flex; align-items: center; gap: 7px; background: var(--crm-card); color: var(--crm-ink); border: 1px solid var(--crm-line); border-radius: 12px; font: inherit; font-size: 13.5px; font-weight: 550; padding: 10px 16px; cursor: pointer; box-shadow: var(--crm-shadow); transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.crm-head__report:hover { transform: translateY(-1px); box-shadow: var(--crm-shadow-lift); background: var(--crm-accent-soft); }
.crm-delta { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 7px; margin-left: 6px; white-space: nowrap; }
.crm-delta--up { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.crm-delta--down { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }
/* Synthèse markdown */
.crm-md__h { font-size: 13px; font-weight: 650; margin: 12px 0 6px; letter-spacing: -.01em; }
.crm-md__h:first-child { margin-top: 0; }
.crm-md__p { font-size: 13.5px; line-height: 1.6; margin: 0 0 8px; color: var(--crm-ink); opacity: .94; }
.crm-md__ul { margin: 0 0 8px; padding-left: 20px; }
.crm-md__ul li { font-size: 13.5px; line-height: 1.6; margin-bottom: 3px; }
/* Mouvements */
.crm-mv__group + .crm-mv__group { margin-top: 12px; }
.crm-mv__label { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.crm-mv__label--ok { color: var(--crm-ok-ink); } .crm-mv__label--crit { color: var(--crm-crit-ink); }
.crm-mv__label--accent { color: var(--crm-accent); } .crm-mv__label--warn { color: var(--crm-warn-ink); }
.crm-mv__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-mv__pill { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--crm-ink); background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: background .12s ease, transform .12s ease; }
.crm-mv__pill:hover { background: var(--crm-accent-soft); transform: translateY(-1px); }
.crm-mv__delta { font-size: 11px; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
/* Priorités */
.crm-rep + .crm-rep { margin-top: 16px; }
.crm-rep__name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; margin-bottom: 10px; }
.crm-prio { background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.crm-prio__head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.crm-prio__name { background: none; border: none; padding: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--crm-ink); cursor: pointer; }
.crm-prio__name:hover { color: var(--crm-accent); }
.crm-prio__score { font-size: 11.5px; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
.crm-prio__seen { font-size: 10.5px; font-weight: 600; color: var(--crm-ink-3); background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.crm-prio__channel { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--crm-accent); background: var(--crm-accent-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.crm-prio__why { font-size: 13px; color: var(--crm-ink-2); margin-top: 6px; line-height: 1.5; }
.crm-prio__how { font-size: 13px; font-weight: 550; margin-top: 4px; }
.crm-prio__warn { font-size: 12px; color: var(--crm-warn-ink); margin-top: 7px; }
/* Brouillon de courriel */
.crm-draft { margin-top: 10px; border-top: 1px dashed var(--crm-line); padding-top: 9px; }
.crm-draft__toggle { background: none; border: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--crm-accent); cursor: pointer; }
.crm-draft__body { margin-top: 9px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 11px; padding: 11px 13px; }
.crm-draft__subject { font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.crm-draft__text { font-size: 13px; line-height: 1.6; white-space: pre-wrap; color: var(--crm-ink); opacity: .92; }
.crm-draft__copy { margin-top: 9px; }

/* --- File d'approbation des courriels ---------------------------------------------- */
.crm-appr { padding: 14px 0; }
.crm-appr + .crm-appr { border-top: 1px solid var(--crm-line); margin-top: 6px; }
.crm-appr__head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.crm-appr__store { background: none; border: none; padding: 0; font: inherit; font-size: 14px; font-weight: 650; color: var(--crm-ink); cursor: pointer; }
.crm-appr__store:hover { color: var(--crm-accent); }
.crm-appr__to { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--crm-ink-2); }
.crm-appr__to svg { color: var(--crm-ink-3); }
.crm-appr__rep { font-size: 11.5px; color: var(--crm-ink-3); }
.crm-appr__status { margin-left: auto; font-size: 11px; font-weight: 650; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.crm-appr__status--accent { background: var(--crm-accent-soft); color: var(--crm-accent); }
.crm-appr__status--ok { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.crm-appr__status--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }
.crm-appr__status--muted { background: var(--crm-card-2); color: var(--crm-ink-2); border: 1px solid var(--crm-line); }
.crm-appr__subject { width: 100%; box-sizing: border-box; border: 1px solid var(--crm-line); border-radius: 11px; padding: 9px 12px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--crm-ink); background: var(--crm-card); margin-bottom: 8px; }
.crm-appr__body { width: 100%; box-sizing: border-box; border: 1px solid var(--crm-line); border-radius: 11px; padding: 10px 12px; font: inherit; font-size: 13.5px; line-height: 1.55; color: var(--crm-ink); background: var(--crm-card); resize: vertical; }
.crm-appr__subject:focus, .crm-appr__body:focus { outline: none; border-color: var(--crm-accent); box-shadow: 0 0 0 3px var(--crm-accent-soft); }
.crm-appr__subject:disabled, .crm-appr__body:disabled { background: var(--crm-card-2); color: var(--crm-ink-2); }
.crm-appr__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.crm-appr__send { display: inline-flex; align-items: center; gap: 7px; background: var(--crm-accent); color: var(--crm-accent-ink); border: none; border-radius: 12px; font: inherit; font-size: 13.5px; font-weight: 600; padding: 10px 16px; cursor: pointer; transition: filter .13s ease, transform .13s ease; }
.crm-appr__send:hover { filter: brightness(1.05); } .crm-appr__send:active { transform: scale(.99); }
.crm-appr__send:disabled { opacity: .55; cursor: default; }
.crm-appr__err { margin-top: 9px; font-size: 12.5px; color: var(--crm-crit-ink); background: var(--crm-crit-bg); border-radius: 9px; padding: 8px 11px; }
.crm-appr__ok { margin-top: 9px; font-size: 13px; font-weight: 600; color: var(--crm-ok-ink); background: var(--crm-ok-bg); border-radius: 9px; padding: 8px 11px; }
.crm-appr__meta { font-size: 11.5px; color: var(--crm-ink-3); margin-top: 8px; }

/* --- Lightbox photo ---------------------------------------------------------------- */

/* --- Agriculture -------------------------------------------------------------------- */
.agri-late { font-style: italic; color: var(--crm-ink-2); opacity: .85; }

/* --- Divers ----------------------------------------------------------------------- */
.crm-soon { color: var(--crm-ink-3); font-size: 13px; padding: 6px 0; }

/* =====================================================================
   Responsive — mobile d'abord pour les reps sur la route
   ===================================================================== */
@media (max-width: 860px) {
  .crm-thead { display: none; }
  .crm-row { grid-template-columns: 42px 1fr auto; gap: 12px; padding: 12px 16px; }
  .crm-list--sel .crm-row { grid-template-columns: 26px 42px 1fr auto; }
  .crm-row__cell, .crm-row__num { display: none; }
  .crm-row__mob { display: block !important; }
  .crm-info { grid-template-columns: 1fr; }
}
@media (min-width: 861px) {
  .crm-row__mob { display: none !important; }
}
@media (max-width: 640px) {
  .crm-head__title { font-size: 21px; }
  .crm-kpis { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px 12px; padding: 4px; }
  .crm-kpis::-webkit-scrollbar { display: none; }
  .crm-kpi { flex: 0 0 auto; min-width: 96px; padding: 11px 14px 10px; }
  .crm-kpi__n { font-size: 19px; }
  .crm-toolbar { gap: 6px; }
  .crm-filter { flex: 1; min-width: 0; }
  .crm-segrow { width: 100%; }
  .crm-segrow button { flex: 1; }
  .crm-hero { padding: 16px; gap: 13px; }
  .crm-hero__name { white-space: normal; font-size: 17px; }
  .crm-mono--lg { width: 50px; height: 50px; font-size: 16px; border-radius: 15px; }
  .crm-fkpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .crm-actions { flex-wrap: wrap; }
  .crm-action { flex: 1 1 40%; }
  .crm-card { padding: 15px 16px; border-radius: 16px; }
  .crm-table-scroll { margin: 0 -16px; padding: 0 16px; }
  .crm-table th.opt, .crm-table td.opt { display: none; }
  .crm-tab { padding: 9px 10px; font-size: 12.5px; }
  .crm-contacts { grid-template-columns: 1fr; }
  .crm-form-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   COCKPIT REP — accueil mobile-first (§ « Mon territoire »)
   ===================================================================== */
.crm-ck { max-width: 980px; margin: 0 auto; color: var(--crm-ink); }

/* Barre du haut : marque + sélecteur rep */
.crm-ck-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.crm-ck-brand { display: inline-flex; align-items: center; gap: 9px; }
.crm-ck-brand__ic { font-size: 22px; }
.crm-ck-brand__t { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.crm-ck-top__r { display: flex; align-items: center; gap: 8px; }

/* Chips de navigation (défilement horizontal sur mobile) */
.crm-ck-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px 14px; padding: 2px 4px; }
.crm-ck-chips::-webkit-scrollbar { display: none; }
.crm-ck-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 999px; font: inherit; font-size: 13px; font-weight: 550; color: var(--crm-ink); padding: 8px 14px; cursor: pointer; box-shadow: var(--crm-shadow); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.crm-ck-chip:hover { transform: translateY(-1px); box-shadow: var(--crm-shadow-lift); border-color: var(--crm-line-strong); }

/* Héros : salutation + pouls du territoire */
.crm-ck-hero { background: linear-gradient(150deg, var(--crm-card) 60%, var(--crm-accent-soft)); border: 1px solid var(--crm-line); border-radius: 20px; padding: 18px 20px; box-shadow: var(--crm-shadow); margin-bottom: 14px; animation: crm-in .3s ease both; }
.crm-ck-hero__hi { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.crm-ck-hero__sub { font-size: 13px; color: var(--crm-ink-2); margin-top: 4px; }
.crm-ck-segs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.crm-ck-seg { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.crm-ck-seg b { color: var(--crm-ink); font-weight: 650; }

/* Fraîcheur des données (sous les classes A/B/C/D/P).
   Discret par défaut : c'est un gage de confiance, pas une alerte. Il ne monte
   en visibilité que lorsqu'il a quelque chose à signaler — sinon il deviendrait
   du bruit qu'on cesse de lire, et il ne servirait plus le jour où ça casse. */
.crm-ck-fresh { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.crm-ck-fresh__i {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--crm-ink-3);
    cursor: pointer;   /* infobulle au survol, toast au toucher — le détail doit rester atteignable sur téléphone */
}
.crm-ck-fresh__i b { font-size: 9px; line-height: 1; }
.crm-ck-fresh__i--vieilli { color: var(--crm-warning, #a86b00); font-weight: 600; }
.crm-ck-fresh__i--echec { color: var(--crm-danger, #b42318); font-weight: 650; }
.crm-ck-fresh__i--inconnu { opacity: .65; font-style: italic; }

/* Recherche rapide (collante sous la barre) */
.crm-ck-search { position: sticky; top: 8px; z-index: 20; display: flex; align-items: center; gap: 9px; background: var(--crm-card); border: 1px solid var(--crm-line-strong); border-radius: 14px; padding: 0 14px; height: 48px; box-shadow: var(--crm-shadow); color: var(--crm-ink-3); margin-bottom: 6px; }
.crm-ck-search:focus-within { border-color: var(--crm-accent); }
.crm-ck-search input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; font: inherit; font-size: 15px; color: var(--crm-ink); outline: none; }
.crm-ck-results { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 14px; box-shadow: var(--crm-shadow-lift); overflow: hidden; margin-bottom: 14px; }
.crm-ck-res { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--crm-line); }
.crm-ck-res:first-child { border-top: none; }
.crm-ck-res--none { padding: 14px; color: var(--crm-ink-3); font-size: 13px; }
.crm-ck-res__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; background: none; border: none; font: inherit; color: var(--crm-ink); text-align: left; padding: 12px 14px; cursor: pointer; }
.crm-ck-res__main:hover { background: var(--crm-card-2); }
.crm-ck-res__name { font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-ck-res__city { font-size: 12px; color: var(--crm-ink-3); margin-left: auto; white-space: nowrap; }
.crm-ck-res__add { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; align-self: stretch; background: var(--crm-accent-soft); border: none; border-left: 1px solid var(--crm-line); color: var(--crm-accent); cursor: pointer; }
.crm-ck-res__add:hover { background: var(--crm-accent); color: var(--crm-accent-ink); }

/* KPI cliquables → liste filtrée */
.crm-ck-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-bottom: 16px; }
.crm-ck-kpi { text-align: left; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 15px; padding: 13px 14px; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--crm-shadow); transition: transform .15s ease, box-shadow .15s ease; }
.crm-ck-kpi:hover { transform: translateY(-2px); box-shadow: var(--crm-shadow-lift); }
.crm-ck-kpi__n { font-size: 22px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.crm-ck-kpi__l { font-size: 11.5px; color: var(--crm-ink-2); margin-top: 3px; }
.crm-ck-kpi--actif .crm-ck-kpi__n { color: var(--crm-ok-ink); }
.crm-ck-kpi--ralentit .crm-ck-kpi__n { color: var(--crm-warn-ink); }
.crm-ck-kpi--dormant .crm-ck-kpi__n { color: var(--crm-crit-ink); }
.crm-ck-kpi--prospect .crm-ck-kpi__n { color: var(--crm-ink-3); }
.crm-ck-kpi--opp .crm-ck-kpi__n { color: var(--crm-warn-ink); }

/* Sections */
.crm-ck-sec { margin-bottom: 18px; }
.crm-ck-sec__h { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 620; margin-bottom: 11px; }
.crm-ck-sec__badge { font-size: 11px; font-weight: 600; background: var(--crm-accent-soft); color: var(--crm-accent); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }

/* Cartes d'action */
.crm-ck-acts { display: grid; gap: 10px; }
.crm-ck-act { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 15px; padding: 13px 15px; box-shadow: var(--crm-shadow); animation: crm-in .3s ease both; }
.crm-ck-act__head { display: flex; align-items: center; gap: 9px; }
.crm-ck-act__name { background: none; border: none; font: inherit; font-size: 14.5px; font-weight: 620; color: var(--crm-ink); cursor: pointer; padding: 0; text-align: left; }
.crm-ck-act__name:hover { color: var(--crm-accent); text-decoration: underline; }
.crm-ck-act__tag { margin-left: auto; font-size: 11px; color: var(--crm-ink-2); background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.crm-ck-act__why { font-size: 13px; color: var(--crm-ink); margin-top: 7px; line-height: 1.45; }
.crm-ck-act__how { font-size: 12.5px; color: var(--crm-ink-2); margin-top: 3px; }
.crm-ck-act__warn { font-size: 12px; color: var(--crm-warn-ink); margin-top: 6px; }
.crm-ck-act__ctas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.crm-ck-act__cta { display: inline-flex; align-items: center; gap: 6px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 10px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--crm-ink); padding: 8px 12px; cursor: pointer; text-decoration: none; transition: transform .14s ease, border-color .14s ease; }
.crm-ck-act__cta:hover { transform: translateY(-1px); border-color: var(--crm-line-strong); }
.crm-ck-act__cta--go { background: var(--crm-accent); color: var(--crm-accent-ink); border-color: transparent; }
.crm-ck-act__cta--go:hover { filter: brightness(1.05); }

/* Carte */
.crm-ck-maplegend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; font-size: 12px; color: var(--crm-ink-2); }
.crm-ck-maplegend span { display: inline-flex; align-items: center; gap: 5px; }
.crm-ck-maplegend i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--crm-line-strong); }
.crm-ck-map { height: 320px; border-radius: 16px; overflow: hidden; border: 1px solid var(--crm-line); box-shadow: var(--crm-shadow); background: var(--crm-card-2); }
.crm-ck-map .leaflet-container { height: 100%; width: 100%; background: var(--crm-card-2); font: inherit; }
.crm-map__err { padding: 24px; text-align: center; color: var(--crm-ink-3); font-size: 13px; background: var(--crm-card-2); border-radius: 16px; }
.crm-map__clip { background: rgba(0,0,0,.62); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 8px; }

/* Popup de la carte */
.crm-mapp { min-width: 150px; }
.crm-mapp__seg { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 6px; }
.crm-mapp__name { font-size: 14px; font-weight: 650; margin-top: 6px; color: #282521; }
.crm-mapp__city { font-size: 12px; color: #6b6355; }
.crm-mapp__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.crm-mapp__btn, .crm-mapp__dir { display: inline-flex; align-items: center; gap: 4px; background: #A8863F; color: #fff; border: none; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 550; padding: 6px 10px; cursor: pointer; text-decoration: none; }
.crm-mapp__btn--soft { background: #f0e9d8; color: #6b5320; }
/* Leaflet colore les <a> de popup en bleu (.leaflet-container a) : on reprend la main (spécificité classe+classe+élément). */
.crm-mapp a.crm-mapp__dir, .crm-mapp a.crm-mapp__dir:hover { color: #fff; text-decoration: none; }

/* Toast */
/* Même réserve que le toast global (#toast, style.css) : sans elle le texte de
   confirmation est rogné par la barre gestuelle en PWA. */
.crm-toast { position: fixed; left: 50%; bottom: max(26px, calc(env(safe-area-inset-bottom) + 14px)); transform: translate(-50%, 12px); background: var(--crm-ink); color: var(--crm-card); font-size: 13.5px; font-weight: 550; padding: 11px 18px; border-radius: 12px; box-shadow: var(--crm-shadow-lift); opacity: 0; z-index: 9999; transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.crm-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 861px) {
  .crm-ck-map { height: 440px; }
}
@media (max-width: 640px) {
  .crm-ck-brand__t { font-size: 18px; }
  .crm-ck-hero { padding: 16px; border-radius: 18px; }
  .crm-ck-hero__hi { font-size: 20px; }
  .crm-ck-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .crm-ck-map { height: 280px; }
  .crm-ck-top__r .crm-filter { max-width: 190px; }
}

/* =====================================================================
   ADMIN REPS + ROUTES DE VISITE
   ===================================================================== */
/* — Champs de formulaire partagés (sheet large) — */
.crm-sheet--wide { max-width: 620px; }
.crm-fld { display: flex; flex-direction: column; gap: 4px; }
.crm-fld > span { font-size: 12px; color: var(--crm-ink-2); font-weight: 550; }
.crm-fld--wide { grid-column: 1 / -1; }
.crm-fld input { height: 42px; border: 1px solid var(--crm-line); border-radius: 11px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--crm-ink); background: var(--crm-card); box-sizing: border-box; transition: border-color .13s ease; }
.crm-fld input:focus { outline: none; border-color: var(--crm-accent); }
.crm-check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--crm-ink); margin: 12px 0 2px; cursor: pointer; }
.crm-check input { width: 17px; height: 17px; accent-color: var(--crm-accent); }
.crm-rep-pinmap { height: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--crm-line); margin-top: 10px; background: var(--crm-card-2); }
.crm-rep-pinmap .leaflet-container { height: 100%; width: 100%; font: inherit; }
.crm-mappin { background: none; border: none; font-size: 22px; line-height: 1; text-align: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* — Cartes rep — */
.crm-rep-card { display: flex; align-items: center; gap: 14px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 15px; padding: 14px 16px; box-shadow: var(--crm-shadow); margin-bottom: 10px; animation: crm-in .3s ease both; }
.crm-rep-card__main { flex: 1; min-width: 0; }
.crm-rep-card__name { font-size: 15px; font-weight: 620; display: flex; align-items: center; gap: 8px; }
.crm-rep-card__off { font-size: 11px; font-weight: 550; color: var(--crm-ink-3); background: var(--crm-card-2); border-radius: 999px; padding: 1px 8px; }
.crm-rep-card__sub { font-size: 12.5px; color: var(--crm-ink-2); margin-top: 2px; }
.crm-rep-card__meta { font-size: 12px; color: var(--crm-ink-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-rep-card__meta b { color: var(--crm-ink); }
.crm-rep-home { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.crm-rep-home--ok { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.crm-rep-home--no { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.crm-rep-card__acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.crm-rep-btn { display: inline-flex; align-items: center; gap: 5px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 10px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--crm-ink); padding: 7px 11px; cursor: pointer; transition: transform .13s ease, border-color .13s ease; }
.crm-rep-btn:hover { transform: translateY(-1px); border-color: var(--crm-line-strong); }
.crm-rep-btn--go { background: var(--crm-accent); color: var(--crm-accent-ink); border-color: transparent; }
.crm-rep-btn--del { color: var(--crm-crit-ink); }

/* — Assignation par rayon — */
.crm-radius { background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 13px; padding: 12px 14px; margin-bottom: 12px; }
.crm-radius__label { font-size: 12.5px; font-weight: 600; color: var(--crm-ink); margin-bottom: 9px; }
.crm-radius__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.crm-radius__row input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--crm-accent); }
.crm-radius__km { font-size: 13px; color: var(--crm-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.crm-radius__km b { color: var(--crm-ink); font-size: 15px; }
.crm-radius__count { font-size: 12.5px; font-weight: 600; color: var(--crm-accent); background: var(--crm-accent-soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.crm-radius__opt { margin: 9px 0 0; font-size: 12.5px; }

/* — Assignation — */
.crm-assign-hint { font-size: 12px; color: var(--crm-ink-2); margin: 4px 0 8px; }
.crm-assign-list { display: flex; flex-direction: column; }
.crm-assign-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--crm-line); cursor: pointer; }
.crm-assign-row:first-child { border-top: none; }
.crm-assign-row input { width: 18px; height: 18px; accent-color: var(--crm-accent); flex: none; }
.crm-assign-row__name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-assign-row__city { font-size: 12px; color: var(--crm-ink-3); white-space: nowrap; }
.crm-assign-row__cur { font-size: 11px; color: var(--crm-warn-ink); background: var(--crm-warn-bg); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }

/* — Planificateur de routes — */
.crm-rt-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.crm-rt-num { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--crm-ink-2); }
.crm-rt-num input { width: 56px; height: 40px; border: 1px solid var(--crm-line); border-radius: 10px; padding: 0 8px; font: inherit; font-size: 14px; color: var(--crm-ink); background: var(--crm-card); box-sizing: border-box; }
.crm-rt-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.crm-rt-map { height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--crm-line); box-shadow: var(--crm-shadow); background: var(--crm-card-2); margin-bottom: 16px; }
.crm-rt-map .leaflet-container { height: 100%; width: 100%; font: inherit; background: var(--crm-card-2); }
.crm-rt-tip { background: transparent !important; border: none !important; box-shadow: none !important; color: #fff; font-weight: 700; font-size: 11px; }
.crm-rt-warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); border-radius: 14px; padding: 16px 18px; font-size: 14px; line-height: 1.5; }
.crm-rt-days { display: grid; gap: 12px; }
.crm-rt-day { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 15px; padding: 13px 15px; box-shadow: var(--crm-shadow); }
.crm-rt-day__h { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.crm-rt-day__dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.crm-rt-day__meta { font-size: 12.5px; color: var(--crm-ink-2); }
.crm-rt-day__maps { margin-left: auto; font-size: 12.5px; font-weight: 550; color: var(--crm-accent); text-decoration: none; background: var(--crm-accent-soft); border-radius: 9px; padding: 5px 10px; }
.crm-rt-day__maps:hover { background: var(--crm-accent); color: var(--crm-accent-ink); }
.crm-rt-day__clip { font-size: 11px; color: var(--crm-warn-ink); background: var(--crm-warn-bg); border-radius: 999px; padding: 1px 8px; }

/* =====================================================================
   TABLEAU DE STATS
   ===================================================================== */
.crm-stats-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-stats-kpis { margin-bottom: 16px; }
.crm-fkpi--btn { cursor: pointer; text-align: left; font: inherit; color: inherit; transition: transform .14s ease, box-shadow .14s ease; }
.crm-fkpi--btn:hover { transform: translateY(-2px); box-shadow: var(--crm-shadow-lift); }
.crm-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.crm-stats-toggle { flex: none; }
.crm-stats-hint { font-size: 12px; color: var(--crm-ink-3); margin: 6px 0 11px; }
.crm-stats-segs { display: flex; flex-direction: column; gap: 9px; }
.crm-stats-seg { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.crm-stats-seg b { min-width: 34px; font-variant-numeric: tabular-nums; }
.crm-stats-seg__bar { flex: 1; height: 8px; border-radius: 5px; background: var(--crm-card-2); overflow: hidden; }
.crm-stats-seg__bar > i { display: block; height: 100%; border-radius: 5px; opacity: .85; }
.crm-stats-trow[data-rep] { cursor: pointer; }
.crm-stats-trow[data-rep]:hover { background: var(--crm-card-2); }
.crm-rt-stops { list-style: none; margin: 11px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.crm-rt-stop { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
.crm-rt-stop:hover { background: var(--crm-card-2); }
.crm-rt-stop__n { flex: none; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
/* Le nom est un <button> dans les deux modes (aperçu + figé) → reset de bouton ici. */
.crm-rt-stop__name { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: none; font-family: inherit; color: var(--crm-ink); cursor: pointer; text-align: left; padding: 0; }
.crm-rt-stop__name:hover { color: var(--crm-accent); }
.crm-rt-day__date { font-size: 12px; color: var(--crm-ink-2); font-weight: 500; }
.crm-rt-stop__info { flex: none; background: none; border: none; cursor: pointer; font-size: 12.5px; line-height: 1; padding: 3px 5px; border-radius: 6px; opacity: .55; }
.crm-rt-stop__info:hover { opacity: 1; background: var(--crm-card-2); }
.crm-rt-extra { margin-top: 16px; }

/* --- Notes de visite (« insights ») : consigne AVANT la visite --------------
   Le nom passe dans une colonne pour que la note se lise SOUS lui, dans la ligne,
   sans repousser ↑ ↓ ✕ hors de l'écran. Palette --crm-info-* et non de nouveaux
   jetons : elle existe déjà en clair ET en sombre, réglée pour le contraste, et
   se distingue de l'or de l'accent (qui, lui, veut dire « action »). */
.crm-rt-stop__main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.crm-rt-stop__main > .crm-rt-stop__name { flex: none; width: 100%; }
/* Plus appuyé que ✕ et ↑↓ (--crm-ink-3, opacité .42/.55) : c'est l'affordance
   NEUVE de la ligne. Au banc, --crm-ink-3 × .5 disparaissait en thème sombre. */
.crm-rt-stop__note { flex: none; background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1; color: var(--crm-ink-2); padding: 3px 6px; border-radius: 6px; opacity: .6; }
.crm-rt-stop__note:hover { opacity: 1; background: var(--crm-card-2); color: var(--crm-accent); }
/* État VISIBLE quand la ligne porte une consigne : sur tactile, aucun `title`
   ne s'affiche jamais — sans ce contraste il faudrait cliquer pour savoir. */
.crm-rt-stop__note.is-on { opacity: 1; font-size: 12.5px; font-weight: 400; background: var(--crm-info-bg); color: var(--crm-info-ink); }
.crm-rt-note { display: flex; align-items: flex-start; gap: 6px; width: 100%; box-sizing: border-box; text-align: left; font-family: inherit; cursor: pointer; background: var(--crm-info-bg); color: var(--crm-info-ink); border: 1px solid transparent; border-left: 3px solid var(--crm-info-dot); border-radius: 7px; padding: 4px 8px; }
.crm-rt-note:hover { border-color: var(--crm-info-dot); }
.crm-rt-note__ic { flex: none; font-size: 10.5px; line-height: 1.5; }
.crm-rt-note__b { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* Bornée à 2 lignes : un jour compte jusqu'à 9 arrêts et une note peut faire
   500 caractères — le texte entier reste dans le `title` et dans l'éditeur.
   `anywhere` : une chaîne de 500 caractères sans espace ne doit pas élargir la ligne. */
.crm-rt-note__t { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.7em; }
.crm-rt-note__m { font-size: 10.5px; color: var(--crm-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-rt-stop--check.is-done .crm-rt-note { opacity: .8; }
/* Notes ORPHELINES (bloc « sans arrêt cette semaine ») : même vignette que dans
   la ligne, avec en plus le nom du magasin — il n'y a plus d'arrêt pour le dire. */
/* Écrans très étroits (iPhone SE 1re gén., écran de couverture d'un pliable,
   Android en écran partagé). MESURÉ au banc : le budget INCOMPRESSIBLE d'une
   ligne de jour figé est de 275 px ; avec les 20 px de `.container-dashboard` et
   les 16 px de `.crm-rt-day` de chaque côté, la ligne déborde de sa carte sous
   ~347 px de fenêtre. Avant le bouton « + » de note elle tenait tout juste
   (248/248 à 320 px) — c'est donc bien ce bouton qui fait basculer. On laisse la
   ligne passer à deux rangées plutôt que de sortir ✕ et ↓ hors de la carte ;
   aucune affordance n'est perdue. */
@media (max-width: 360px) {
  .crm-rt-stop { flex-wrap: wrap; }
  .crm-rt-stop__main { flex: 1 0 100%; }
}
.crm-rt-orphans { display: flex; flex-direction: column; gap: 6px; }
.crm-rt-note__n { font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* L'éditeur : ancré à la ligne, jamais une modale — la route doit rester
   lisible pendant qu'on écrit la consigne. z-index sous .crm-toast (9999) et
   au-dessus de la feuille (.crm-sheet-ov, 1000) : un toast d'erreur reste vu. */
.crm-rt-notepop { position: fixed; z-index: 1200; box-sizing: border-box; width: min(340px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 7px; background: var(--crm-card); color: var(--crm-ink); border: 1px solid var(--crm-line-strong); border-radius: 13px; box-shadow: var(--crm-shadow-lift); padding: 11px; animation: crm-in .16s ease both; }
.crm-rt-notepop__h { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; font-weight: 650; }
.crm-rt-notepop__store { min-width: 0; flex: 1; font-size: 11.5px; font-weight: 500; color: var(--crm-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-rt-notepop__ta { width: 100%; box-sizing: border-box; resize: vertical; min-height: 62px; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 9px; font: inherit; font-size: 13px; line-height: 1.4; color: var(--crm-ink); padding: 8px 10px; }
.crm-rt-notepop__ta:focus { outline: none; border-color: var(--crm-accent); }
.crm-rt-notepop__hint { font-size: 11px; color: var(--crm-ink-3); line-height: 1.35; }
.crm-rt-notepop__err { font-size: 12px; font-weight: 550; color: var(--crm-crit-ink); background: var(--crm-crit-bg); border-radius: 8px; padding: 6px 9px; }
.crm-rt-notepop__f { display: flex; align-items: center; gap: 7px; }
.crm-rt-notepop__f > button { flex: none; font: inherit; font-size: 12.5px; font-weight: 550; border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.crm-rt-notepop__f > button:disabled { opacity: .55; cursor: default; }
.crm-rt-notepop__del { margin-right: auto; background: var(--crm-crit-bg); color: var(--crm-crit-ink); border: 1px solid transparent; }
.crm-rt-notepop__del:hover:not(:disabled) { border-color: var(--crm-crit-dot); }
.crm-rt-notepop__cancel { margin-left: auto; background: var(--crm-card-2); color: var(--crm-ink); border: 1px solid var(--crm-line); }
.crm-rt-notepop__save { background: var(--crm-accent); color: var(--crm-accent-ink); border: none; }
.crm-rt-notepop__save:hover:not(:disabled) { filter: brightness(1.05); }

/* Routes figées : figer + progression + cases à cocher */
.crm-rt-freezebtn { display: inline-flex; align-items: center; gap: 8px; background: var(--crm-accent); color: var(--crm-accent-ink); border: none; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; padding: 12px 18px; cursor: pointer; box-shadow: var(--crm-shadow); margin-bottom: 16px; width: 100%; justify-content: center; transition: filter .14s ease, transform .14s ease; }
.crm-rt-freezebtn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.crm-rt-freeze { display: flex; align-items: center; gap: 12px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--crm-shadow); margin-bottom: 16px; }
.crm-rt-prog { flex: 1; min-width: 0; }
.crm-rt-prog__bar { height: 9px; border-radius: 6px; background: var(--crm-card-2); overflow: hidden; }
.crm-rt-prog__bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--crm-ok-dot), var(--crm-accent)); transition: width .3s ease; }
.crm-rt-prog__lbl { display: inline-block; margin-top: 5px; font-size: 12.5px; font-weight: 550; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.crm-rt-regen { flex: none; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 10px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--crm-ink); padding: 8px 12px; cursor: pointer; }
.crm-rt-regen:hover { border-color: var(--crm-line-strong); }
.crm-rt-stop--check { align-items: center; }
.crm-rt-check { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
.crm-rt-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.crm-rt-checkbox { width: 21px; height: 21px; border: 2px solid var(--crm-line-strong); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; background: var(--crm-card); transition: background .12s, border-color .12s; }
.crm-rt-check:hover .crm-rt-checkbox { border-color: var(--crm-ok-dot); }
.crm-rt-check input:checked + .crm-rt-checkbox { background: var(--crm-ok-dot); border-color: var(--crm-ok-dot); }
.crm-rt-check input:checked + .crm-rt-checkbox::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.crm-rt-stop--check.is-done .crm-rt-stop__name { text-decoration: line-through; color: var(--crm-ink-3); }
.crm-rt-stop--check.is-done { opacity: .72; }
.crm-rt-stop--check .crm-rt-stop__name { background: none; border: none; font: inherit; color: var(--crm-ink); cursor: pointer; text-align: left; padding: 0; }
.crm-rt-stop--check .crm-rt-stop__name:hover { color: var(--crm-accent); }

/* Figeage par jour + édition d'un jour figé (v2) */
.crm-rt-day.is-frozen { border-color: var(--crm-ok-dot); box-shadow: inset 3px 0 0 var(--crm-ok-dot), var(--crm-shadow); }
.crm-rt-lock { font-size: 12px; }
.crm-rt-daybtn { margin-left: 8px; flex: none; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 9px; font: inherit; font-size: 12px; font-weight: 550; color: var(--crm-ink); padding: 5px 10px; cursor: pointer; }
.crm-rt-daybtn:hover { border-color: var(--crm-line-strong); }
.crm-rt-daybtn--freeze { background: var(--crm-accent-soft); color: var(--crm-accent); border-color: transparent; }
.crm-rt-daybtn--freeze.is-dirty { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.crm-rt-dirty { font-size: 11px; color: var(--crm-warn-ink); background: var(--crm-warn-bg); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.crm-rt-drag { flex: none; cursor: grab; color: var(--crm-ink-3); font-size: 14px; line-height: 1; user-select: none; padding: 0 2px; }
.crm-rt-stop.is-dragging { opacity: .45; }
.crm-rt-stop--over { box-shadow: inset 0 2px 0 var(--crm-accent); }
.crm-rt-stop__rm { flex: none; background: none; border: none; cursor: pointer; font-size: 12px; color: var(--crm-ink-3); padding: 3px 5px; border-radius: 6px; }
.crm-rt-stop__rm:hover { color: var(--crm-danger-ink, #c0574e); background: var(--crm-card-2); }
.crm-rt-add { display: flex; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--crm-line); }
.crm-rt-add__in { flex: 1; min-width: 0; background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 9px; font: inherit; font-size: 13px; color: var(--crm-ink); padding: 7px 10px; }
.crm-rt-add__btn { flex: none; background: var(--crm-accent-soft); color: var(--crm-accent); border: none; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 13px; cursor: pointer; }
.crm-rt-add__btn:hover { background: var(--crm-accent); color: var(--crm-accent-ink); }
.crm-rt-freeze__hint { flex: 1; font-size: 12.5px; color: var(--crm-ink-2); }
.crm-rt-past { display: flex; align-items: center; gap: 8px; background: var(--crm-warn-bg); color: var(--crm-warn-ink); border-radius: 12px; padding: 9px 14px; font-size: 13px; font-weight: 550; margin-bottom: 14px; }
.crm-rt-hist { display: flex; flex-direction: column; gap: 8px; }
.crm-rt-hist__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 13px; padding: 13px 16px; cursor: pointer; font: inherit; text-align: left; box-shadow: var(--crm-shadow); }
.crm-rt-hist__row:hover { border-color: var(--crm-accent); }
.crm-rt-hist__wk { font-size: 14px; font-weight: 600; color: var(--crm-ink); }
.crm-rt-hist__meta { font-size: 12.5px; color: var(--crm-ink-2); }

@media (max-width: 640px) {
  .crm-rt-map { height: 300px; }
  .crm-rt-kpis { gap: 8px; }
  .crm-rep-card { flex-direction: column; align-items: stretch; gap: 10px; }
  .crm-rep-card__acts { justify-content: flex-start; }
  .crm-sheet--wide .crm-form-grid { grid-template-columns: 1fr; }
}

/* ═══════════ Suivi de classification (onglet + fiche) ═══════════ */
.crm-classif { display: flex; flex-direction: column; gap: 14px; padding: 0 clamp(18px, 2.5vw, 44px); box-sizing: border-box; }
.crm-classif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crm-classif-title { font-size: 1.15rem; font-weight: 800; color: var(--crm-ink); }
.crm-classif-sub { font-size: .85rem; color: var(--crm-ink-3); margin-top: -8px; }
.crm-classif-pers { display: inline-flex; gap: 6px; }
.crm-classif-per { border: 1px solid var(--crm-line); background: var(--crm-card); color: var(--crm-ink-2); border-radius: 999px; padding: 5px 11px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.crm-classif-per.on { background: var(--crm-accent-soft); color: var(--crm-accent); border-color: transparent; }
.crm-classif-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.crm-classif-kpi { background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 14px; padding: 12px 14px; text-align: center; }
.crm-classif-kpi__n { font-size: 1.35rem; font-weight: 800; color: var(--crm-ink); font-variant-numeric: tabular-nums; }
.crm-classif-kpi__l { font-size: .72rem; color: var(--crm-ink-3); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.crm-classif-kpi--up .crm-classif-kpi__n { color: var(--crm-ok-ink); }
.crm-classif-kpi--down .crm-classif-kpi__n { color: var(--crm-warn-ink); }
@media (max-width: 640px) { .crm-classif-kpis { grid-template-columns: repeat(2, 1fr); } }
.crm-classif-dist { display: flex; flex-direction: column; gap: 9px; }
.crm-classif-seg { display: flex; flex-direction: column; gap: 4px; }
.crm-classif-seg__head { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--crm-ink-2); }
.crm-classif-seg__head b { color: var(--crm-ink); }
.crm-classif-seg__pct { margin-left: auto; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
.crm-classif-seg__bar { height: 8px; border-radius: 5px; background: var(--crm-card-2); overflow: hidden; }
.crm-classif-seg__bar > i { display: block; height: 100%; border-radius: 5px; opacity: .9; }
.crm-classif-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: .78rem; color: var(--crm-ink-3); }
.crm-classif-legend span { display: inline-flex; align-items: center; gap: 5px; }
.crm-classif-legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.crm-classif-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .crm-classif-cols { grid-template-columns: 1fr; } }
.crm-hint { font-weight: 500; color: var(--crm-ink-3); font-size: .8em; }
/* Lignes de mouvement */
.crm-mv-list { display: flex; flex-direction: column; gap: 2px; }
.crm-mv { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--crm-ink); }
.crm-mv:hover { background: var(--crm-card-2); }
.crm-mv__segs { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.crm-mv__arr { font-weight: 800; }
.crm-mv__arr--up { color: var(--crm-ok-ink); }
.crm-mv__arr--down { color: var(--crm-warn-ink); }
.crm-mv__arr--set { color: var(--crm-ink-3); }
.crm-mv__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.crm-mv__date { flex: 0 0 auto; font-size: .76rem; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
/* Timeline fiche */
.crm-timeline { display: flex; flex-direction: column; gap: 2px; }
.crm-tl-row { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--crm-line); }
.crm-tl-row:last-child { border-bottom: none; }
.crm-tl-ic { flex: 0 0 auto; font-size: 1rem; line-height: 1.4; }
.crm-tl-main { min-width: 0; }
.crm-tl-t { font-size: .9rem; color: var(--crm-ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-tl-meta { font-size: .76rem; color: var(--crm-ink-3); margin-top: 2px; }
/* Légende carte = filtre par classe (boutons cliquables) */
.crm-ck-legbtn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid transparent; border-radius: 999px; padding: 3px 9px; cursor: pointer; color: var(--crm-ink-2); font-size: .8rem; font-weight: 600; }
.crm-ck-legbtn i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.crm-ck-legbtn:hover { background: var(--crm-card-2); }
.crm-ck-legbtn.off { opacity: .38; }
.crm-ck-legbtn.off i { filter: grayscale(1); }

/* --- Agriculture --------------------------------------------------------- */
#agriculture-view { color: var(--crm-ink); }
#agriculture-view > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.crm-cockpit { display: flex; flex-direction: column; gap: 12px; animation: crm-in .3s ease both; }
/* Ligne simple champ/section (≠ .crm-row, la grille 8 colonnes de la table clients CRM) */
.agri-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; border-top: 1px solid var(--crm-line); font: inherit; color: var(--crm-ink); text-align: left; padding: 12px 4px; cursor: pointer; border-radius: 0; }
.agri-row:first-child { border-top: none; }
.agri-row:hover { background: var(--crm-card-2); }
.agri-row b { font-size: 14.5px; font-weight: 620; white-space: nowrap; }
.agri-row span { font-size: 12.5px; color: var(--crm-ink-2); margin-left: auto; text-align: right; }
/* ── Agriculture : tâches terrain ── */
.agri-task { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--crm-line); }
.agri-task:first-of-type { border-top: none; }
.agri-task__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agri-task__main b { font-size: 14.5px; font-weight: 620; }
.agri-task__detail { font-size: 12.5px; color: var(--crm-ink-2); }
.agri-task__meta { font-size: 11.5px; color: var(--crm-ink-2); opacity: 0.8; }
.agri-task__done { margin-left: auto; flex-shrink: 0; font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--crm-line); background: var(--crm-card-2); color: var(--crm-ink); cursor: pointer; }
.agri-task__add { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--crm-line); background: none; color: var(--crm-ink); cursor: pointer; float: right; }
.agri-act__task { font-size: 12.5px; color: var(--crm-ink-2); margin: 2px 0; }
.agri-log__row { display: flex; align-items: baseline; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--crm-line); font-size: 13px; flex-wrap: wrap; }
.agri-log__row:first-of-type { border-top: none; }
.agri-log__when { color: var(--crm-ink-2); font-size: 12px; white-space: nowrap; }
.agri-log__what { min-width: 0; }
.agri-log__by { margin-left: auto; color: var(--crm-ink-2); font-size: 12px; }
.agri-log__more { display: block; margin: 10px auto 0; font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--crm-line); background: var(--crm-card-2); color: var(--crm-ink); cursor: pointer; }
.agri-row--task b { color: var(--crm-ink); }
/* Modal « Nouvelle activité » — vignette photo avec bouton de suppression (crm-sheet__thumb seul n'a pas ce besoin côté CRM). */
.agri-thumb { position: relative; display: inline-block; line-height: 0; }
.agri-thumb__rm { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--crm-crit-ink, #8a3b34); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
/* ── Agriculture V1.1 : onglets cockpit/fiche ── */
.agri-tabs { margin: 10px 0; }
.agri-tabs .crm-ck-chip.on { background: var(--crm-ink); color: var(--crm-card, #fff); border-color: var(--crm-ink); }
.agri-map { height: min(70vh, 520px); border-radius: 12px; overflow: hidden; }
.agri-sec-label { background: rgba(255,255,255,.85); border: none; box-shadow: none; font-size: 11px; font-weight: 650; color: #2b2b2b; padding: 1px 4px; border-radius: 4px; }
.agri-fiche-chips { margin: 10px 0 4px; }
.agri-apercu div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--crm-line); }
.agri-apercu div:first-child { border-top: none; }
.agri-apercu b { font-size: 13px; font-weight: 620; }
.agri-apercu span { font-size: 13px; color: var(--crm-ink-2); text-align: right; }
/* ═══════════════════════════════════════════════════════════════════
   Agriculture V1.5 — accueil du module
   Bandeau météo, KPIs, champs dépliables et colonne « aujourd'hui ».
   Couleurs prises au thème CRM (--crm-*) : l'écran suit clair/sombre
   sans règle dédiée. Seule la courbe de température a sa propre teinte,
   validée via le skill dataviz (contraste + CVD, light et dark).
   ═══════════════════════════════════════════════════════════════════ */

/* ── Bandeau : salutation à gauche, météo à droite ── */
.agri-hero { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.6fr); gap: 18px; align-items: center; }
.agri-hero__hello { display: flex; align-items: center; gap: 13px; min-width: 0; }
.agri-hero__leaf { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.agri-hero__leaf svg { width: 22px; height: 22px; }
.agri-hero__hello h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.agri-hero__hello p { margin: 2px 0 0; font-size: 13px; color: var(--crm-ink-2); }
.agri-hero__wx { display: flex; flex-direction: column; gap: 7px; min-width: 0; border-left: 1px solid var(--crm-line); padding-left: 18px; }
.agri-wx-now { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.agri-wx-ic { font-size: 21px; line-height: 1; }
.agri-wx-now b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.agri-wx-desc { font-size: 13px; color: var(--crm-ink-2); }
.agri-wx-strip { --agri-temp: #d2691e; }
body[data-gtheme="dark"] .agri-wx-strip { --agri-temp: #e8894a; }
.agri-wx-hs { display: grid; grid-template-columns: repeat(var(--agri-wx-n, 6), 1fr); }
.agri-wx-h { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.agri-wx-h span { font-size: 11px; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
.agri-wx-h b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agri-wx-curve { display: block; width: 100%; height: 26px; margin-top: 2px; }
.agri-wx-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--crm-ink-2); }
.agri-wx-range { font-weight: 600; color: var(--crm-ink); font-variant-numeric: tabular-nums; }
.agri-wx-bit { display: inline-flex; align-items: center; gap: 5px; }
.agri-wx-bit svg { width: 15px; height: 15px; opacity: .75; }

/* ── KPIs : pastille d'icône + chiffre + sous-ligne factuelle ── */
.agri-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.agri-kpi { display: flex; align-items: flex-start; gap: 11px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 16px; padding: 14px 15px; box-shadow: var(--crm-shadow); animation: crm-in .34s ease both; }
.agri-kpi:nth-child(2) { animation-delay: .03s; } .agri-kpi:nth-child(3) { animation-delay: .06s; }
.agri-kpi:nth-child(4) { animation-delay: .09s; } .agri-kpi:nth-child(5) { animation-delay: .12s; }
.agri-kpi__ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; }
.agri-kpi__ic svg { width: 18px; height: 18px; }
.agri-kpi__ic--ok { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.agri-kpi__ic--warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.agri-kpi__body { min-width: 0; }
.agri-kpi__n { font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.agri-kpi__l { font-size: 12px; color: var(--crm-ink-2); margin-top: 2px; }
.agri-kpi__sub { display: block; font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.agri-kpi__sub--warn { color: var(--crm-warn-ink); }
.agri-kpi__sub--ok { color: var(--crm-ok-ink); }

/* ── En-tête de l'onglet Sections ── */
.agri-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.agri-sec-head h3 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.agri-sec-head p { margin: 3px 0 0; font-size: 13px; color: var(--crm-ink-2); }
.agri-sec-head .crm-search { flex: 0 1 340px; }
.agri-results { margin-bottom: 12px; }

/* ── Deux colonnes : les champs / ce qu'il faut faire ── */
.agri-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.agri-aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.agri-card-h { margin: 0 0 4px; font-size: 15.5px; font-weight: 650; }

/* ── Champ dépliable ── */
.agri-field { border-top: 1px solid var(--crm-line); }
.agri-field:first-of-type { border-top: none; }
.agri-field__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 2px; cursor: pointer; list-style: none; }
.agri-field__head::-webkit-details-marker { display: none; }
.agri-field__head:hover { background: var(--crm-card-2); }
.agri-field__head:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: -2px; border-radius: 8px; }
.agri-field__chev { display: grid; place-items: center; width: 18px; height: 18px; flex: none; color: var(--crm-ink-3); transition: transform .18s ease; }
.agri-field__chev svg { width: 16px; height: 16px; }
.agri-field[open] .agri-field__chev { transform: rotate(90deg); }
.agri-field__head b { font-size: 15px; font-weight: 650; }
.agri-field__sub { font-size: 12.5px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.agri-field__pills { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.agri-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--crm-ink-2); white-space: nowrap; }
.agri-pill > i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.agri-pill--ok > i { background: var(--crm-ok-dot); }
.agri-pill--warn > i { background: var(--crm-warn-dot); }
.agri-pill--crit > i { background: var(--crm-crit-dot); }

/* ── Tableau des sections ── */
.agri-tb-wrap { overflow-x: auto; padding-bottom: 2px; }
.agri-tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.agri-tb th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--crm-ink-3); text-transform: none; padding: 7px 10px; border-bottom: 1px solid var(--crm-line); white-space: nowrap; }
.agri-tb td { padding: 10px; border-bottom: 1px solid var(--crm-line); white-space: nowrap; }
.agri-tb tbody tr:last-child td { border-bottom: none; }
.agri-tb tbody tr { cursor: pointer; }
.agri-tb tbody tr:hover { background: var(--crm-card-2); }
.agri-tb tbody tr:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: -2px; }
.agri-tb__b { font-weight: 620; }
.agri-tb__n { text-align: right; font-variant-numeric: tabular-nums; }
.agri-tb__d { color: var(--crm-ink-2); }
.agri-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.agri-state > i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--crm-ink-3); }
.agri-state--ok > i { background: var(--crm-ok-dot); }
.agri-state--warn > i { background: var(--crm-warn-dot); }
.agri-state--crit > i { background: var(--crm-crit-dot); }
.agri-state--muted { color: var(--crm-ink-3); }

/* ── Colonne de droite : priorités et alertes ── */
.agri-side__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.agri-side__head h3 { margin: 0; font-size: 15.5px; font-weight: 650; }
.agri-side__count { font-size: 12px; color: var(--crm-ink-2); white-space: nowrap; }
.agri-prog__bar { height: 6px; border-radius: 6px; background: var(--crm-line); overflow: hidden; margin-bottom: 12px; }
.agri-prog__bar > i { display: block; height: 100%; border-radius: 6px; background: var(--crm-ok-dot); transition: width .3s ease; }
.agri-prio { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-top: 1px solid var(--crm-line); }
.agri-prio:first-of-type { border-top: none; }
.agri-prio__main { min-width: 0; flex: 1; }
.agri-prio__t { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.agri-prio__t b { font-size: 14px; font-weight: 620; }
.agri-badge { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--crm-info-bg); color: var(--crm-info-ink); }
.agri-prio__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--crm-ink-2); margin-top: 3px; }
.agri-prio__where { display: inline-flex; align-items: center; gap: 4px; }
.agri-prio__where svg { width: 13px; height: 13px; opacity: .7; }
.agri-prio__go { flex: none; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 10px; border: none; background: var(--crm-ok-ink); color: #fff; cursor: pointer; transition: filter .15s ease; }
.agri-prio__go:hover { filter: brightness(1.12); }
.agri-prio__x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: none; background: none; color: var(--crm-ink-3); cursor: pointer; }
.agri-prio__x:hover { background: var(--crm-card-2); color: var(--crm-ink); }
.agri-prio__x svg { width: 16px; height: 16px; }
.agri-more { display: flex; align-items: center; gap: 5px; margin-top: 12px; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 2px; border: none; background: none; color: var(--crm-ok-ink); cursor: pointer; }
.agri-more svg { width: 15px; height: 15px; }
.agri-alert { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--crm-line); cursor: pointer; }
.agri-alert:first-of-type { border-top: none; }
.agri-alert--flat { cursor: default; }
.agri-alert:not(.agri-alert--flat):hover { background: var(--crm-card-2); }
.agri-alert__ic { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 9px; }
.agri-alert__ic svg { width: 15px; height: 15px; }
.agri-alert__ic--info { background: var(--crm-info-bg); color: var(--crm-info-ink); }
.agri-alert__ic--warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.agri-alert__ic--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }
.agri-alert__main { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.agri-alert__main b { font-size: 13.5px; font-weight: 620; }
.agri-alert__where { font-size: 12px; color: var(--crm-ink-2); }
.agri-alert__when { font-size: 11.5px; color: var(--crm-ink-3); white-space: nowrap; }

/* ── Adaptations écran étroit ──
   Sous 1080 px la colonne de droite passe SOUS les champs plutôt que de
   comprimer le tableau ; sous 720 px on masque les colonnes secondaires
   (le tableau reste défilable, mais l'essentiel tient sans geste). */
@media (max-width: 1080px) {
  .agri-cols { grid-template-columns: 1fr; }
  .agri-hero { grid-template-columns: 1fr; }
  .agri-hero__wx { border-left: none; padding-left: 0; border-top: 1px solid var(--crm-line); padding-top: 14px; }
}
@media (max-width: 900px) {
  .agri-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .agri-tb th:nth-child(2), .agri-tb td:nth-child(2),
  .agri-tb th:nth-child(4), .agri-tb td:nth-child(4) { display: none; }
  .agri-field__pills { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .agri-kpis { grid-template-columns: repeat(2, 1fr); }
  .agri-sec-head .crm-search { flex: 1 1 100%; }
  .agri-prio { flex-wrap: wrap; }
  .agri-prio__go { margin-left: auto; }
}

/* ── Agriculture V1.4 : flux « Activités » (journal + panneau de détail) ──
   L'onglet Activités est le seul écran à deux colonnes du module : le cockpit
   reçoit .agri-wide pour desserrer le gabarit 980 px commun (règle ci-dessus). */
#agriculture-view > .crm-cockpit.agri-wide { max-width: 1340px; }
.agri-feed { display: flex; flex-direction: column; }
.agri-check { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px; border: 1px solid var(--crm-line); border-radius: 13px; background: var(--crm-card); font-size: 13px; color: var(--crm-ink); cursor: pointer; white-space: nowrap; }
.agri-check input { accent-color: var(--crm-accent); width: 15px; height: 15px; cursor: pointer; }
/* Sans sélection, le journal prend toute la largeur : pas de colonne vide. */
.agri-feed__split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.agri-feed__split.on { grid-template-columns: minmax(0, 1fr) 350px; }
.agri-feed__list { min-width: 0; }

/* Journal : un jour = un intertitre collant, puis les observations. */
.agri-obs__day { position: sticky; top: 0; z-index: 2; background: var(--crm-card); font-size: 11.5px; font-weight: 650; letter-spacing: .04em; color: var(--crm-ink-2); padding: 8px 2px 8px 12px; margin: 0 -2px; }
.agri-obs { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 16px; padding: 14px 4px 15px 12px; border-top: 1px solid var(--crm-line); cursor: pointer; transition: background .12s ease; }
.agri-obs:hover { background: var(--crm-card-2); }
.agri-obs:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: -2px; border-radius: 10px; }
.agri-obs.on { background: var(--crm-card-2); }
.agri-obs.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--crm-accent); }
.agri-obs__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.agri-obs__time { font-size: 12.5px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.agri-obs__badge { font-size: 11px; font-weight: 620; color: var(--crm-warn-ink); background: var(--crm-warn-bg); border-radius: 7px; padding: 2px 7px; white-space: nowrap; }
.agri-obs__place { background: none; border: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--crm-ink-2); cursor: pointer; text-align: left; }
.agri-obs__place:hover { color: var(--crm-ink); text-decoration: underline; }
.agri-obs__who { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--crm-ink-2); min-width: 0; }
.agri-obs__av { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--crm-accent-soft); color: var(--crm-accent); font-size: 10px; font-weight: 700; }
.agri-obs__main { min-width: 0; }
.agri-obs__plant { margin: 0 0 4px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.agri-obs__lead { margin: 0 0 6px; font-size: 14px; font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
.agri-obs__text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--crm-ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.agri-obs__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.agri-tag { font-size: 11.5px; font-weight: 550; color: var(--crm-ok-ink); background: var(--crm-ok-bg); border-radius: 7px; padding: 3px 9px; }
.agri-tag--more { color: var(--crm-ink-2); background: var(--crm-card-2); border: 1px solid var(--crm-line); }
.agri-obs__media { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.agri-obs__thumb { width: 122px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--crm-line); }

/* Lecteur vocal : barres décoratives, progression et durée réelles. */
.agri-audio { display: flex; align-items: center; gap: 9px; box-sizing: border-box; width: 200px; padding: 6px 11px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 12px; }
.agri-audio audio { display: none; }
.agri-audio__play { width: 26px; height: 26px; flex: none; border: none; border-radius: 50%; background: var(--crm-ink); color: var(--crm-card); font-size: 10px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.agri-audio__play:hover { filter: brightness(1.2); }
.agri-audio__wave { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; height: 22px; cursor: pointer; }
.agri-audio__wave i { flex: 1 1 0; min-width: 1px; border-radius: 1px; background: var(--crm-ink-3); opacity: .5; transition: background .1s linear, opacity .1s linear; }
.agri-audio__wave i.on { background: var(--crm-accent); opacity: 1; }
.agri-audio__t { font-size: 11.5px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agri-audio--lg { width: 100%; margin: 12px 0 4px; }

/* Panneau de détail (colonne de droite en desktop, feuille en mobile). */
.agri-feed__detail { position: sticky; top: 10px; background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 18px; box-shadow: var(--crm-shadow); overflow: hidden; max-height: calc(100dvh - 30px); display: flex; flex-direction: column; animation: crm-in .2s ease both; }
.agri-detail__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--crm-line); }
.agri-detail__head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.agri-detail__body { padding: 14px 16px 18px; overflow-y: auto; }
.agri-detail__photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.agri-detail__photo { width: 100%; max-height: 190px; object-fit: cover; border-radius: 12px; border: 1px solid var(--crm-line); }
.agri-detail__line { display: flex; align-items: baseline; gap: 9px; font-size: 13px; color: var(--crm-ink-2); padding: 4px 0; }
.agri-detail__line span { color: var(--crm-ink); min-width: 0; overflow-wrap: anywhere; }
.agri-detail__sec { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--crm-ink-3); margin: 14px 0 6px; }
.agri-detail__tr { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--crm-ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.agri-detail__acts { display: flex; gap: 8px; margin-top: 16px; }
.agri-detail__acts .crm-sheet__save { flex: 2; }
.agri-detail__acts .crm-sheet__btn { flex: 1; }
.agri-pick { max-height: 52dvh; overflow-y: auto; }

@media (max-width: 980px) {
  #agriculture-view > .crm-cockpit.agri-wide { max-width: 980px; }
  .agri-feed__split, .agri-feed__split.on { grid-template-columns: minmax(0, 1fr); }
  .agri-feed__detail { position: fixed; inset: auto 0 0 0; top: auto; z-index: 900; max-height: 88dvh; border-radius: 20px 20px 0 0; border-bottom: none; box-shadow: 0 -8px 40px rgba(0, 0, 0, .18); }
  .agri-detail__body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  /* Sans base explicite, les deux <select> se réduisent à leur contenu tronqué. */
  .agri-feed .crm-filter { flex: 1 1 42%; min-width: 0; }
  .agri-feed .agri-check { flex: 1 1 100%; }
  .agri-obs { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .agri-obs__meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .agri-obs__media { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
  .agri-obs__thumb { width: 92px; height: 70px; }
  .agri-audio { width: 100%; }
}

/* Fournisseurs (lot 1 : consultation du référentiel FormAchat) */
.crm-sup-notes { margin-top: 6px; font-size: 12.5px; color: var(--crm-ink-3); white-space: pre-wrap; }
/* Provenance des données : le dire évite de croire que l'information manque
   alors qu'elle se saisit simplement ailleurs. */
.crm-sup-src { margin-top: 16px; font-size: 12px; color: var(--crm-ink-3); font-style: italic; line-height: 1.5; }

/* Fournisseurs — lot 2 : profil d'enrichissement */
.crm-sup-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.crm-sup-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 550; padding: 3px 8px; border-radius: 999px;
    background: var(--crm-accent-soft, rgba(168,134,63,.1)); color: var(--crm-ink-2, #6b6455);
    white-space: nowrap;
}
.crm-sup-card--off { opacity: .55; }
/* Case à cocher « Fournisseur actif ».
   Deux règles GLOBALES du hub s'appliquaient ici et cassaient la rangée :
   `input { width:100% }` étirait la case sur toute la largeur en repoussant le
   texte à droite (même piège que le <select> à 872 px des grandeurs
   d'uniforme), et `label { text-transform:uppercase; font-weight:700 }` mettait
   l'intitulé en capitales comme un titre de champ — alors que c'est une phrase
   qu'on lit, pas une étiquette. On les neutralise explicitement. */
.crm-sup-check { display: flex; align-items: center; gap: 9px; font-size: 14px;
    margin: 4px 0 16px; cursor: pointer;
    text-transform: none; font-weight: 500; color: var(--crm-ink, #4a4438); letter-spacing: 0; }
.crm-sup-check input[type="checkbox"] {
    width: 17px; height: 17px; min-width: 17px; margin: 0; padding: 0;
    flex: 0 0 auto; accent-color: var(--crm-accent, #A8863F); cursor: pointer;
}
.crm-field__hint { font-size: 11.5px; color: var(--crm-ink-3, #9a927f); margin-top: 4px; line-height: 1.4; }
/* Profil dont le fournisseur a disparu côté FormAchat (suppression définitive,
   sans journal) : c'est le seul indice qu'une fiche a été détruite. */
.crm-sup-orph {
    margin-top: 14px; padding: 10px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.5;
    background: var(--crm-warning-soft, rgba(200,140,0,.09)); color: var(--crm-warning, #a86b00);
}

/* Fiche fournisseur — contacts, fermetures, hausses de prix */
.crm-sup-open { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.crm-sup-open:hover { text-decoration: underline; }
.crm-sup-contact { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--crm-line, #ece4d6); }
.crm-sup-contact:last-of-type { border-bottom: 0; }
.crm-sup-contact__n { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.crm-sup-contact__c { font-size: 12.5px; color: var(--crm-ink-2, #6b6455); margin-top: 2px; }
.crm-sup-vac { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--crm-line, #ece4d6); }
.crm-sup-vac:last-of-type { border-bottom: 0; }
.crm-sup-tag--warn { background: var(--crm-warning-soft, rgba(200,140,0,.14)); color: var(--crm-warning, #a86b00); }
/* La « séquence » : la lecture qui transforme un journal en information. */
.crm-sup-seq { margin: 8px 0 12px; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5; background: var(--crm-accent-soft, rgba(168,134,63,.1)); }
.crm-sup-seq--thin { background: none; padding: 4px 0; color: var(--crm-ink-3, #9a927f); font-style: italic; }
.crm-sup-price { display: grid; grid-template-columns: minmax(90px, auto) minmax(64px, auto) 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--crm-line, #ece4d6); font-size: 13.5px; }
.crm-sup-price:last-of-type { border-bottom: 0; }
.crm-sup-price__d { color: var(--crm-ink-2, #6b6455); font-variant-numeric: tabular-nums; }
.crm-sup-price__p { font-weight: 650; font-variant-numeric: tabular-nums; }
.crm-sup-price__nopct { font-weight: 400; font-style: italic; color: var(--crm-ink-3, #9a927f); }
.crm-sup-price__m { color: var(--crm-ink-2, #6b6455); min-width: 0; }
@media (max-width: 560px) { .crm-sup-price { grid-template-columns: 1fr auto; } .crm-sup-price__m { grid-column: 1 / -1; } }

/* =====================================================================
   Ambassadeurs MDH — espacement et champs du module
   Une SEULE échelle verticale (--amb-gap), pour que le rythme entre
   cartes ne dépende plus d'un style inline posé au jugé. Rappel :
   .crm-card porte déjà margin-bottom:12px — n'ajouter une marge ici
   que pour SÉPARER des blocs, jamais pour recréer celle de la carte.
   Tout est scopé #ambassadeurs-view ; hérite des tokens --crm-* (clair
   ET sombre, cf. les deux sélecteurs en tête de fichier).
   ===================================================================== */
#ambassadeurs-view {
  --amb-gap: 14px;          /* respiration entre sections d'une même vue */
  --amb-gap-s: 8px;         /* entre éléments d'un même groupe */
  --amb-field-h: 42px;      /* hauteur commune des contrôles */
  --amb-radius: 11px;
}

/* --- Rythme vertical -------------------------------------------------- */
.amb-sec { margin-top: var(--amb-gap); }
.amb-sec:first-child { margin-top: 0; }
.amb-gap-s { margin-top: var(--amb-gap-s); }
/* Titre de section : h3 sans marge propre, l'espacement vient du parent. */
.amb-h { margin: 0 0 var(--amb-gap-s); font-size: 18px; font-weight: 650; color: var(--crm-ink); }
.amb-h--row { display: flex; align-items: center; gap: var(--amb-gap-s); }
.amb-h--row .amb-h { margin-bottom: 0; flex: 1; min-width: 0; }

/* --- Micro-utilitaires (remplacent les inline répétés) ---------------- */
.amb-right { margin-left: auto; white-space: nowrap; }   /* méta en bout de ligne */
.amb-fix { flex: 0 0 auto; }
.amb-click { cursor: pointer; }
.amb-quote { font-style: italic; color: var(--crm-ink-2); }
/* Message court DANS un formulaire. .crm-error / .crm-empty sont des états
   PLEINE PAGE (padding 40px, texte centré) : sans ce correctif, une erreur
   de saisie s'affiche centrée au milieu d'un grand vide sous le champ. */
.amb-msg { padding: var(--amb-gap-s) 0; text-align: left; }
.amb-crit { color: var(--crm-crit-ink); }                /* couleur seule, sans l'état pleine page */
.amb-card--warn { border-color: var(--crm-warn-dot); }
.amb-card--accent { border-color: var(--crm-accent); }

/* --- Contrôles de formulaire ----------------------------------------- */
/* Un seul jeu de règles : avant, chaque select/textarea portait sa copie
   de border/radius/padding en inline, avec des valeurs qui divergeaient. */
.amb-input, .amb-select, .amb-ta {
  font: inherit; color: var(--crm-ink); background: var(--crm-card);
  border: 1px solid var(--crm-line); border-radius: var(--amb-radius);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.amb-input, .amb-select { height: var(--amb-field-h); padding: 0 10px; }
.amb-ta { padding: 10px; line-height: 1.45; resize: vertical; min-height: 76px; }
.amb-input:focus, .amb-select:focus, .amb-ta:focus {
  outline: none; border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px var(--crm-accent-soft);
}
.amb-file { font: inherit; font-size: 13px; color: var(--crm-ink-2); }
.amb-grow { flex: 1; min-width: 180px; }

/* .crm-fld habille `input` mais PAS `select` ni `textarea` : sans ces deux
   règles, un select apparaît à la taille native du navigateur à côté d'un
   input de 42 px. C'est ce qui rendait les formulaires bancals. */
#ambassadeurs-view .crm-fld select {
  height: var(--amb-field-h); border: 1px solid var(--crm-line);
  border-radius: var(--amb-radius); padding: 0 10px; font: inherit; font-size: 14px;
  color: var(--crm-ink); background: var(--crm-card); box-sizing: border-box;
  transition: border-color .13s ease;
}
#ambassadeurs-view .crm-fld textarea {
  border: 1px solid var(--crm-line); border-radius: var(--amb-radius);
  padding: 10px; font: inherit; font-size: 14px; line-height: 1.45;
  color: var(--crm-ink); background: var(--crm-card); box-sizing: border-box;
  resize: vertical; transition: border-color .13s ease;
}
#ambassadeurs-view .crm-fld select:focus,
#ambassadeurs-view .crm-fld textarea:focus { outline: none; border-color: var(--crm-accent); }
/* .crm-form-grid porte `gap: 0 12px` : aucun espace VERTICAL entre les
   rangées, les champs se touchent. On rétablit le rythme dans le module. */
#ambassadeurs-view .crm-form-grid { gap: var(--amb-gap-s) 12px; }

/* --- Grilles de KPI (le module en a 3 ou 4, pas les 5 du CRM) --------- */
.amb-kpis--3 { grid-template-columns: repeat(3, 1fr); }
.amb-kpis--4 { grid-template-columns: repeat(4, 1fr); }

/* --- Écran de validation : captures | champs -------------------------- */
.amb-split { display: flex; gap: var(--amb-gap); flex-wrap: wrap; align-items: flex-start; }
.amb-split__shots { flex: 1 1 260px; min-width: 220px; }
.amb-split__form { flex: 2 1 380px; min-width: 300px; }
.amb-shot {
  width: 100%; display: block; border: 1px solid var(--crm-line);
  border-radius: 12px; margin-bottom: 10px; background: var(--crm-card-2);
}

/* --- Choix d'un candidat / d'un thème --------------------------------- */
.amb-pick { display: flex; align-items: center; gap: var(--amb-gap-s); cursor: pointer; padding: 7px 0; }
.amb-pick + .amb-pick { border-top: 1px solid var(--crm-line); }
.amb-pick input { flex: 0 0 auto; accent-color: var(--crm-accent); }
.amb-check {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0 10px 6px 0; font-size: 13px; color: var(--crm-ink-2); cursor: pointer;
}
.amb-check input { accent-color: var(--crm-accent); }

/* --- Barre empilée des sentiments ------------------------------------- */
.amb-bar { display: flex; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; background: var(--crm-card-2); }

/* --- Squelettes de chargement ----------------------------------------- */
.amb-skel--list { height: 200px; }
.amb-skel--fiche { height: 220px; }
.amb-skel--kpi { height: 120px; }

/* --- Salve dépliée ---------------------------------------------------- */
.amb-sub { margin: 6px 0 var(--amb-gap) 26px; }

/* ── Graphiques du cockpit (HTML/CSS pur, aucune lib) ────────────────────
   Le principe : des empilements de <span> dimensionnés en %, séparés par un
   interstice de 2px COULEUR DE SURFACE (le gap du conteneur) — jamais un
   contour dessiné autour des segments. Les couleurs viennent des variables
   --amb-s-* : elles changent avec le thème sans une ligne de JS. */
.amb-hbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.amb-hbar .amb-seg { display: block; min-width: 3px; }

.amb-filtres { display: flex; gap: var(--amb-gap-s); flex-wrap: wrap; align-items: center; }
.amb-filtres .amb-filtre { max-width: 220px; flex: 1 1 140px; font-size: 13px; }

.amb-cols { display: flex; gap: 6px; align-items: flex-end; height: 150px; padding-top: 4px; }
.amb-col { flex: 1 1 0; min-width: 0; max-width: 40px; display: flex; flex-direction: column;
  align-items: stretch; height: 100%; }
.amb-col__n { font-size: 11px; color: var(--crm-ink-3); text-align: center; height: 16px;
  font-variant-numeric: tabular-nums; }
.amb-col__stack { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 2px; border-bottom: 1px solid var(--crm-line-strong); }
.amb-col__stack .amb-seg { display: block; border-radius: 3px 3px 0 0; min-height: 3px; }
.amb-col__l { font-size: 11px; color: var(--crm-ink-3); text-align: center; padding-top: 3px;
  font-variant-numeric: tabular-nums; }

.amb-prod { margin-top: var(--amb-gap-s); }
.amb-prod:first-child { margin-top: 0; }
.amb-prod__t { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.amb-prod__n { font-size: 14px; font-weight: 600; color: var(--crm-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amb-prod__b { min-width: 40px; margin-top: 3px; }

.amb-metre { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.amb-metre__l { flex: 0 0 88px; font-size: 13px; color: var(--crm-ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amb-metre__t { flex: 1; height: 10px; border-radius: 5px; background: var(--crm-card-2); overflow: hidden; }
.amb-metre__b { display: block; height: 100%; border-radius: 5px; background: var(--crm-accent); }
.amb-metre__n { flex: 0 0 auto; font-size: 13px; color: var(--crm-ink-2);
  font-variant-numeric: tabular-nums; }

/* ── Chips (produits, thèmes) ─────────────────────────────────────────────
   L'identité d'un produit est portée par le TEXTE de la chip, pas par une
   couleur : 73 produits, aucune palette catégorielle ne tiendrait. */
.amb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.amb-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border: 1px solid var(--crm-line); border-radius: 999px; background: var(--crm-card-2);
  font-size: 12.5px; color: var(--crm-ink-2); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; }
.amb-chip--ghost { border-style: dashed; background: transparent; font-style: italic; }

/* Jours d'attente (file de relance) — l'urgence est doublée par le nombre. */
.amb-days { flex: 0 0 auto; align-self: center; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--crm-card-2); color: var(--crm-ink-2); }
.amb-days--warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.amb-days--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }

/* Badge de source du sentiment : ✨ IA conservée / ✎ humain. */
.amb-src { font-size: 12px; color: var(--crm-ink-3); white-space: nowrap; }

/* ── Fiche : identité compacte en grille, actions dans l'en-tête ────────── */
.amb-ident { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--amb-gap-s) 16px; }
.amb-ident__l { font-size: 12px; color: var(--crm-ink-3); }
.amb-ident__v { font-size: 14px; color: var(--crm-ink); overflow-wrap: anywhere; }
.amb-shot--mini { width: 72px; height: 72px; object-fit: cover; margin: 0;
  border-radius: 8px; cursor: zoom-in; }
.amb-histo { display: inline-flex; gap: 3px; align-items: center; font-size: 15px;
  letter-spacing: 1px; }

@media (max-width: 720px) {
  .amb-kpis--3, .amb-kpis--4 { grid-template-columns: repeat(2, 1fr); }
  .amb-split__shots, .amb-split__form { flex-basis: 100%; min-width: 0; }
}

/* =====================================================================
   DIFFUSIONS — demandes d'annonces traduites à toute l'équipe
   Hérite des tokens --crm-* (sélecteurs en tête de fichier, clair ET
   sombre). Tout est scopé .diff-* ou #diffusions-view.
   ===================================================================== */

/* --- Entrée de rail : fermée par défaut (deny-by-default) -------------
   Ses quatre sœurs (crm, plan, agriculture, ambassadeurs) vivent dans
   public/style.css:8439-8442. Celle-ci est ici parce que style.css était
   en cours de modification par un autre chantier au moment de l'écriture
   — la règle est identique et fonctionne à l'identique, mais si vous
   cherchiez les cinq au même endroit : c'est cette ligne qui manque.
   La déplacer auprès des autres est une amélioration, pas un correctif. */
body:not(.diff-access) [data-gs-route="diffusions"]{display:none !important}

#diffusions-view {
  --diff-gap: 14px;
  --diff-gap-s: 8px;
  --diff-radius: 11px;
}

/* --- Rythme vertical --------------------------------------------------- */
.diff-gap { margin-top: var(--diff-gap); }
.diff-gap-s { margin-top: var(--diff-gap-s); }
.diff-intro { margin-bottom: var(--diff-gap); line-height: 1.5; }
.diff-hint { margin-top: var(--diff-gap-s); }
.diff-msg { margin-top: var(--diff-gap-s); }
.diff-right { flex: 0 0 auto; align-self: center; white-space: nowrap; }
.diff-fix { flex: 0 0 auto; }

/* --- Champs de saisie (le shell ne stylise que les <input type=text>) --- */
#diffusions-view .crm-fld select,
#diffusions-view .crm-fld input[type="date"],
#diffusions-view .crm-fld input[type="time"] {
  width: 100%; height: 38px; border: 1px solid var(--crm-line);
  border-radius: var(--diff-radius); padding: 0 10px; font: inherit; font-size: 14px;
  color: var(--crm-ink); background: var(--crm-card); box-sizing: border-box;
  transition: border-color .13s ease;
}
#diffusions-view .crm-fld textarea {
  width: 100%; border: 1px solid var(--crm-line); border-radius: var(--diff-radius);
  padding: 10px; font: inherit; font-size: 14px; line-height: 1.5;
  color: var(--crm-ink); background: var(--crm-card); box-sizing: border-box;
  resize: vertical; transition: border-color .13s ease;
}
#diffusions-view .crm-fld textarea[readonly] { background: var(--crm-card-2); color: var(--crm-ink-2); }
#diffusions-view .crm-fld select:focus,
#diffusions-view .crm-fld input:focus,
#diffusions-view .crm-fld textarea:focus { outline: none; border-color: var(--crm-accent); }
/* .crm-form-grid porte `gap: 0 12px` : aucun espace VERTICAL entre les
   rangées. On rétablit le rythme, comme le fait le module Ambassadeurs. */
#diffusions-view .crm-form-grid { gap: var(--diff-gap-s) 12px; }
.diff-fld--lang { max-width: 260px; }
.diff-fld--text { display: block; margin-top: var(--diff-gap-s); }
.diff-when { margin-top: var(--diff-gap); max-width: 460px; }

/* --- Compteur de caractères -------------------------------------------- */
.diff-count { text-align: right; margin-top: 3px; font-variant-numeric: tabular-nums; }
/* Au-delà de ~600 caractères personne ne lit sur un téléphone : on avertit
   sans interdire — la limite dure reste MAX_DIFFUSION côté serveur. */
.diff-count--long { color: var(--crm-warn-ink); font-weight: 600; }

/* --- Pastilles de statut ----------------------------------------------- */
/* La couleur ne porte JAMAIS l'information seule : l'icône et le libellé
   sont toujours affichés avec elle (accessibilité, impression N&B). */
.diff-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--crm-card-2); color: var(--crm-ink-2);
}
.diff-pill--ok { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
.diff-pill--attente { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.diff-pill--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }

/* `.dim` sert de « texte secondaire » dans les trois modules à onglets, mais
   n'est stylée NULLE PART hors de .crm-table : dans une ligne de liste elle ne
   fait donc rien du tout, et les dates s'affichent au même poids que le reste.
   On la définit ici pour cette vue seulement — la corriger globalement
   changerait l'apparence du CRM et des Ambassadeurs, ce qui n'appartient pas à
   ce chantier. */
#diffusions-view .dim {
  color: var(--crm-ink-3); font-size: 12.5px; font-weight: 400; white-space: nowrap;
}

/* --- Étiquettes fines (langue de rédaction, repli, vide) ---------------- */
.diff-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--crm-accent-soft); color: var(--crm-ink-2);
}
.diff-tag--warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }

/* --- Lignes de liste ---------------------------------------------------- */
.diff-click { cursor: pointer; }
.diff-row { cursor: default; }
.diff-excerpt {
  margin-top: 3px; font-size: 13px; color: var(--crm-ink-2); line-height: 1.45;
  overflow-wrap: anywhere;
}
.diff-verdict {
  margin-top: 6px; padding: 6px 10px; border-radius: var(--diff-radius);
  font-size: 13px; line-height: 1.45; background: var(--crm-card-2); color: var(--crm-ink-2);
  overflow-wrap: anywhere;
}
.diff-verdict--ok { background: var(--crm-ok-bg); color: var(--crm-ok-ink); }
/* Un refus n'est notifié NULLE PART ailleurs (décision du 18 août) : c'est
   le seul endroit où il se lit. Il ne doit pas se lire comme une note. */
.diff-verdict--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); font-weight: 500; }

/* --- Relecture des trois traductions ------------------------------------ */
/* Côte à côte sur un écran large — c'est tout l'intérêt de l'écran : voir
   d'un coup si l'espagnol dit bien ce que dit le français. Sur téléphone,
   auto-fit les empile plutôt que de rendre trois colonnes illisibles. */
.diff-tr-grid, .diff-trs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--diff-gap);
}
.diff-tr {
  border: 1px solid var(--crm-line); border-radius: var(--diff-radius);
  padding: 10px; background: var(--crm-card-2);
}
.diff-tr__h { font-size: 13px; font-weight: 650; color: var(--crm-ink); margin-bottom: 6px; }
.diff-tr__b { font-size: 13px; line-height: 1.5; color: var(--crm-ink-2); white-space: pre-wrap;
  overflow-wrap: anywhere; }
.diff-tr-fld { display: block; }
.diff-src { margin-bottom: var(--diff-gap); }
.diff-src .crm-action { margin-top: var(--diff-gap-s); }
.diff-editor { margin: 6px 0 var(--diff-gap) 26px; }
.diff-reject { margin-top: var(--diff-gap); padding-top: var(--diff-gap);
  border-top: 1px solid var(--crm-line); }
/* La barre de filtres réutilise .crm-tabs pour son allure — mais PAS son
   `position: sticky; top: 0`. L'écran du valideur porte déjà une barre
   d'onglets collante : deux éléments épinglés au même `top` se recouvrent dès
   qu'on fait défiler la file. Le filtre défile donc avec la page. */
.diff-filters { position: static; z-index: auto; margin-bottom: var(--diff-gap-s); }

/* --- Bandeau d'audience ------------------------------------------------- */
/* La raison d'être du lot 2 : dire ce qu'on SUPPOSE, pas seulement ce qu'on
   compte. Un écran qui n'affiche que « 107 destinataires » ment par omission. */
.diff-audience {
  margin-top: var(--diff-gap); padding: 10px 12px; border-radius: var(--diff-radius);
  border: 1px solid var(--crm-line); background: var(--crm-card-2);
}
.diff-audience__h { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline;
  font-size: 15px; color: var(--crm-ink); }
.diff-audience__langs { font-size: 14px; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
.diff-note {
  margin-top: 6px; padding: 5px 9px; border-radius: 8px; font-size: 12.5px;
  line-height: 1.45; overflow-wrap: anywhere;
  background: var(--crm-info-bg); color: var(--crm-info-ink);
}
.diff-note--warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.diff-note--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }

/* --- Compte rendu de dépôt ---------------------------------------------- */
.diff-card--accent { border-left: 3px solid var(--crm-accent); }

/* --- Squelette de chargement -------------------------------------------- */
.diff-skel--list { height: 200px; }

@media (max-width: 720px) {
  .diff-editor { margin-left: 0; }
  .diff-fld--lang { max-width: none; }
}

/* =====================================================================
   LIGNE DU TEMPS SQDC / OCS — vue Horizons
   =====================================================================
   Trois piles, pas une frise : le Gantt a été rejeté par David (« ingérable
   dès 6 produits par Product Call »). L'ordre des colonnes EST l'information —
   gauche = urgent, droite = lointain.

   Aucune couleur propre au module. Les trois horizons empruntent les jetons de
   statut du hub (crit / warn / ok), déjà réglés pour le thème sombre : une
   quatrième palette maison aurait divergé au premier ajustement. La couleur ne
   porte jamais le sens seule — chaque colonne écrit son titre et son délai en
   toutes lettres, chaque retard est doublé d'un ⚠️ et du mot « échu ».
   ===================================================================== */

/* --- Barre de filtres ---------------------------------------------------- */
.ldt-bar {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  background: var(--crm-card); border: 1px solid var(--crm-line);
  border-radius: 15px; padding: .55rem .7rem; box-shadow: var(--crm-shadow);
  margin-bottom: 1.1rem;
}
.ldt-search { flex: 1 1 260px; min-width: 200px; max-width: 380px; }

/* Le <select> portait `crm-search`, qui est un conteneur flex — sur un select
   ça ne donne ni chevron ni cadre cohérent. Il se style donc pour lui-même,
   en annulant au passage `select{width:100%;padding:12px 15px}` de style.css. */
.ldt-select {
  width: auto; max-width: 220px; height: 38px;
  padding: 0 1.9rem 0 .75rem;
  border: 1px solid var(--crm-line); border-radius: 11px;
  background: var(--crm-card-2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'><path d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23837c6e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right .7rem center;
  font: inherit; font-size: .78rem; font-weight: 500; color: var(--crm-ink);
  appearance: none; -webkit-appearance: none; cursor: pointer;
}

/* Les puces d'un même filtre vivent sur un rail : sans lui, trois boutons
   fantômes flottent côte à côte et rien ne dit qu'ils s'excluent. */
.ldt-chips {
  display: inline-flex; gap: 2px; padding: 3px; flex-wrap: wrap;
  background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 11px;
}
.ldt-chip { white-space: nowrap; }
.ldt-moi { margin-left: auto; }

/* Compteur dans une puce. Le second, en rouge, ne s'affiche que s'il y a du
   retard : un « 0 » permanent finirait par ne plus être lu. */
.ldt-col-n {
  display: inline-block; min-width: 1.35em; padding: .15em .5em; margin-left: .35em;
  border-radius: 99px; background: var(--crm-card-2); border: 1px solid var(--crm-line);
  color: var(--crm-ink-2); font-size: .68rem; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
}
.ldt-col-n--retard { background: var(--crm-crit-bg); border-color: transparent; color: var(--crm-crit-ink); }

/* --- Colonnes ------------------------------------------------------------ */
.ldt-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; align-items: start; }

/* Chaque horizon est un PANNEAU, pas une colonne nue : on voit où finit une
   pile et où commence la suivante, y compris quand elle est vide. */
.ldt-col {
  background: rgba(255, 255, 255, .46);
  border: 1px solid var(--crm-line);
  border-radius: 16px;
  padding: 0 .6rem .6rem;
}
body[data-gtheme="dark"] .ldt-col { background: rgba(255, 255, 255, .03); }

.ldt-col-head {
  position: relative;
  margin: 0 -.6rem .6rem; padding: .8rem .85rem .7rem;
  border-bottom: 1px solid var(--crm-line);
}
/* Le filet de couleur coiffe le panneau au lieu de flotter au-dessus du texte. */
.ldt-col-head::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--crm-line-strong); border-radius: 16px 16px 0 0;
}
.ldt-col-t { font-weight: 600; font-size: .87rem; letter-spacing: -.005em; display: flex; align-items: center; gap: .45rem; color: var(--crm-ink); }
.ldt-col-t .ldt-col-n { margin-left: auto; }
.ldt-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; background: var(--crm-ink-3); flex: 0 0 auto; }
.ldt-col-s { font-size: .72rem; color: var(--crm-ink-2); margin-top: .3rem; font-weight: 500; }
.ldt-col-q { font-size: .72rem; color: var(--crm-ink-3); font-style: italic; }

.ldt-col--crit   .ldt-col-head::before { background: var(--crm-crit-dot); }
.ldt-col--crit   .ldt-dot { background: var(--crm-crit-dot); }
.ldt-col--warn   .ldt-col-head::before { background: var(--crm-warn-dot); }
.ldt-col--warn   .ldt-dot { background: var(--crm-warn-dot); }
.ldt-col--ok     .ldt-col-head::before { background: var(--crm-ok-dot); }
.ldt-col--ok     .ldt-dot { background: var(--crm-ok-dot); }
.ldt-col--neutre .ldt-col-head::before { background: var(--crm-line-strong); }

.ldt-col-body { display: flex; flex-direction: column; gap: .6rem; }

/* La pile « sans échéance » est mise à part, en pleine largeur, APRÈS les trois
   horizons : ces jalons existent (le moteur refuse d'inventer une date quand
   l'ancre du cycle est inconnue) mais ils ne sont datables par personne. Les
   glisser dans « à faire là » serait leur donner une urgence qu'ils n'ont pas. */
.ldt-sansdate { margin-top: 1.4rem; }
.ldt-sansdate .ldt-col-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }

/* --- Carte --------------------------------------------------------------- */
.ldt-card {
  position: relative;
  background: var(--crm-card); border: 1px solid var(--crm-line); border-radius: 13px;
  padding: .8rem .9rem .75rem; box-shadow: var(--crm-shadow);
  animation: crm-in .18s ease both;
}
.ldt-card--fini { opacity: .68; }

/* Liseré d'urgence. Il ne porte JAMAIS l'information seul : la pastille
   d'échéance en dessous écrit « échu depuis 2 j » en toutes lettres. */
.ldt-card--retard::before {
  content: ''; position: absolute; left: 0; top: .7rem; bottom: .7rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--crm-crit-dot);
}

.ldt-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.ldt-card-title { font-weight: 600; font-size: .88rem; line-height: 1.32; letter-spacing: -.012em; margin: 0; color: var(--crm-ink); }

.ldt-frac {
  flex: 0 0 auto;
  font-weight: 600; font-size: .68rem;
  background: var(--crm-card-2); border: 1px solid var(--crm-line); color: var(--crm-ink-2);
  padding: .22rem .45rem; border-radius: 99px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ldt-frac--plein { background: var(--crm-ok-bg); border-color: transparent; color: var(--crm-ok-ink); }

/* Rail d'avancement : le chiffre reste exact, mais on n'a plus à le lire pour
   savoir où en est la carte. Purement redondant, donc jamais seul porteur. */
.ldt-rail { height: 3px; border-radius: 99px; background: var(--crm-card-2); margin-top: .55rem; overflow: hidden; }
.ldt-rail > i { display: block; height: 100%; border-radius: 99px; background: var(--crm-accent); }
.ldt-rail--plein > i { background: var(--crm-ok-dot); }

/* --- Cases à cocher, une par SKU ---------------------------------------- */

/* ATTENTION — ce qui suit ANNULE `style.css`. Ce n'est pas de la décoration.
   `style.css` (547 ko, chargée AVANT celle-ci) pose deux sélecteurs d'élément
   nus qui traversent tout le hub :

     input, select { width: 100%; padding: 12px 15px; }                (L1053)
     label { display:block; font-size:12px; font-weight:700;
             text-transform:uppercase; color:#666; margin-bottom:8px } (L1042)

   Les autres modules CRM y échappent par accident : aucun n'écrit de <label>
   porteur de texte, et tous enveloppent leur champ de recherche dans
   `<label class="crm-search">…<input></label>`. La Ligne du temps fait
   exactement les deux choses qu'ils évitent — une vraie <input type=checkbox>
   par SKU et un <label> par nom de produit — donc elle les prend de plein
   fouet :

     · la case s'étire sur 100 % de la ligne. Le carré se dessine au MILIEU de
       la carte et le nom du produit est éjecté hors du cadre, écrasé à la
       largeur de son mot le plus long ;
     · le nom sort en MAJUSCULES GRASSES GRISES. Preuve : la donnée dit
       « 1x0.5g », l'écran affichait « 1X0.5G » ;
     · `margin-bottom:8px` sur chaque libellé fait tripler la hauteur des
       cartes, d'où les colonnes 2 et 3 rejetées loin sous le pli.

   C'est ça, le « full broken » — pas un écart de maquette. Le hub connaît
   déjà ce piège : `.dup-modal input[type=checkbox]`, `.bcm-row
   input[type=checkbox]` et `.rn-meet-opt input[type=checkbox]` posent tous le
   même antidote. Ce module ne l'avait jamais posé.

   Ne pas « nettoyer » ces annulations sans avoir d'abord retiré les sélecteurs
   nus de style.css — sinon le défaut revient tel quel. */
.ldt-skus { list-style: none; margin: .55rem 0 0; padding: 0; font-size: .78rem; }
.ldt-sku { display: flex; gap: .55rem; align-items: flex-start; padding: .18rem 0; color: var(--crm-ink); }

/* Au-delà de cinq SKU la carte cesse d'être lisible d'un coup d'œil. Le reste
   n'est pas retiré du DOM — il est masqué, donc ni tabulable ni lu à voix
   haute tant qu'il est replié, et les cases restent branchées au dépliage. */
.ldt-sku--cache { display: none; }
.ldt-skus--tout .ldt-sku--cache { display: flex; }
.ldt-plus {
  margin: .35rem 0 0 1.55rem; padding: 0; border: 0; background: none;
  font: inherit; font-size: .74rem; font-weight: 500; color: var(--crm-ink-2);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.ldt-skus--tout ~ .ldt-plus { display: none; }

.ldt-bx {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 auto;
  width: 16px; height: 16px;   /* contre input{width:100%} */
  min-width: 0;
  padding: 0;                  /* contre input{padding:12px 15px} */
  margin: .12rem 0 0;
  border: 1.5px solid var(--crm-line-strong); border-radius: 5px;
  background: var(--crm-card);
  cursor: pointer;
}
.ldt-bx:checked {
  background: var(--crm-ok-dot) no-repeat center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'><path d='M1 4l2.6 2.6L9 1.2' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  border-color: var(--crm-ok-dot);
}
.ldt-bx:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
.ldt-bx:disabled { cursor: progress; opacity: .5; }

.ldt-sku label {
  min-width: 0;             /* le nom se replie DANS la carte */
  margin: 0;                /* contre label{margin-bottom:8px} */
  font: inherit;            /* contre label{font-size:12px;font-weight:700} */
  line-height: 1.38;        /* après `font:`, qui réinitialise line-height */
  text-transform: none;     /* un nom de SKU n'est pas un cri */
  letter-spacing: normal;
  color: inherit;           /* contre label{color:#666} */
  overflow-wrap: anywhere;  /* un code sans espace ne perce pas la carte */
  cursor: pointer;
}
/* Le format se détache du nom sans quitter la ligne : même taille, encre plus
   douce. Deux lignes coûteraient la moitié de la hauteur de la carte. */
.ldt-sku label em { font-style: normal; color: var(--crm-ink-3); }
.ldt-sku--fait { color: var(--crm-ink-3); }
.ldt-sku--fait label { text-decoration: line-through; text-decoration-color: var(--crm-ink-3); }

/* --- Pied de carte ------------------------------------------------------- */
.ldt-card-foot {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  margin-top: .7rem; font-size: .74rem; color: var(--crm-ink-2);
}

/* Responsable ET échéance sur la même ligne — point ⑤ de l'anatomie validée.
   Les deux étaient empilés, ce qui donnait deux pieds de carte pour un. */
.ldt-meta {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-top: .65rem; padding-top: .6rem; border-top: 1px solid var(--crm-line);
}
.ldt-who { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; font-weight: 500; color: var(--crm-ink-2); }
.ldt-who > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldt-av {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; letter-spacing: .02em; font-style: normal;
  background: var(--crm-accent-soft); color: var(--crm-accent);
}

.ldt-tag { padding: .28rem .5rem; border-radius: 6px; font-size: .68rem; font-weight: 600; letter-spacing: .01em; }
.ldt-tag--ocs { background: var(--crm-info-bg); color: var(--crm-info-ink); }
.ldt-tag--sqdc { background: var(--crm-accent-soft); color: var(--crm-accent); }
/* Le cycle est un CONTOUR, le réseau un aplat : deux pastilles côte à côte qui
   se ressemblent se lisent comme une seule information. */
.ldt-tag--cyc { background: transparent; color: var(--crm-ink-2); border: 1px solid var(--crm-line-strong); font-weight: 500; }

.ldt-due {
  flex: 0 0 auto; white-space: nowrap;
  padding: .22rem .5rem; border-radius: 99px;
  background: var(--crm-card-2); color: var(--crm-ink-2); font-weight: 500;
}
.ldt-due--retard { background: var(--crm-crit-bg); color: var(--crm-crit-ink); font-weight: 600; }

/* Refus d'écriture (403 : le jalon n'est pas le vôtre). Message sur la carte
   elle-même, pas en bandeau global — on doit voir QUELLE case a refusé. */
.ldt-card-msg:empty { display: none; }
.ldt-card-msg {
  margin-top: .5rem; padding: .35rem .5rem; border-radius: 6px;
  background: var(--crm-crit-bg); color: var(--crm-crit-ink); font-size: .72rem;
}

/* --- Vides et notes ------------------------------------------------------ */
/* Une pile vide dit ce qu'elle ATTEND. « Rien ici. » se lit comme une panne ;
   « dès que l'ancre du cycle sera posée » se lit comme une file d'attente. */
.ldt-vide {
  border: 1px dashed var(--crm-line-strong); border-radius: 11px;
  padding: 1.2rem .9rem; text-align: center;
  font-size: .74rem; line-height: 1.5; color: var(--crm-ink-3);
}
.ldt-vide b { display: block; font-weight: 600; font-size: .78rem; color: var(--crm-ink-2); margin-bottom: .15rem; }
.ldt-note { font-size: .74rem; color: var(--crm-ink-3); margin-top: 1rem; text-align: center; }
.ldt-skel { height: 260px; }
.ldt-erreur {
  border: 1px solid var(--crm-danger, #B4402F); border-radius: 11px;
  padding: .9rem; font-size: .78rem; color: var(--crm-danger, #B4402F);
}

/* =====================================================================
   LIGNE DU TEMPS — onglet Produits (fiche SKU + journal), lot 4
   ===================================================================== */
/* Une ligne par SKU, dépliable. Pas de tableau : sur téléphone une grille à
   cinq colonnes se replie en bouillie, alors qu'une ligne souple garde son
   sens en s'enroulant. Aucun token nouveau — tout vient des --crm-* déjà
   posés en tête de ce fichier. */
.ldt-fiches { display: flex; flex-direction: column; gap: 6px; }

.ldt-fiche-row {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--crm-card); border: 1px solid var(--crm-line);
  border-radius: 11px; padding: .6rem .75rem;
  font: inherit; color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.ldt-fiche-row:hover { border-color: var(--crm-line-strong); background: var(--crm-card-2); }
.ldt-fiche-row[aria-expanded="true"] {
  border-color: var(--crm-accent, var(--crm-line-strong));
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.ldt-fiche-nom { font-weight: 600; font-size: .82rem; flex: 1 1 12rem; min-width: 0; }
.ldt-fiche-sku { font-size: .7rem; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }
.ldt-fiche-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.ldt-fiche-date { font-size: .72rem; color: var(--crm-ink-2); font-variant-numeric: tabular-nums; }
/* Une date de lancement absente n'est pas un détail : c'est elle qui manque
   pour que tout le rétroplanning marketing existe. On l'affiche en creux
   plutôt que de laisser un blanc qui se lit comme « rien à signaler ». */
.ldt-fiche-date--vide { color: var(--crm-ink-3); font-style: italic; }

/* Pastille de macro-statut. Le texte accompagne TOUJOURS la couleur — un
   code couleur seul est muet pour qui ne distingue pas les teintes. */
.ldt-tag--st { font-weight: 600; }
.ldt-st--selection        { background: #E4EEF7; color: #2C5A82; }
.ldt-st--soumis           { background: #EBE4F7; color: #5A3E86; }
.ldt-st--attente_decision { background: #F5EEDC; color: #7A6224; }
.ldt-st--execution        { background: #F7E7D8; color: #8A4B18; }
.ldt-st--pret             { background: #E1F0E2; color: #2F6B36; }
.ldt-st--lance            { background: #DCEBF5; color: #1F5B7A; }
.ldt-st--evaluation       { background: #EDEAE3; color: #55503F; }
.ldt-st--refuse           { background: #F6E0DC; color: #8C3323; }
.ldt-st--retire           { background: #E8E5E0; color: #5B564E; }
/* Le point discret qui signale « statut déduit, aucune porte franchie ».
   Le titre du <span> porte l'explication complète. */
.ldt-deduit { opacity: .55; font-weight: 400; }

.ldt-fiche-detail {
  border: 1px solid var(--crm-accent, var(--crm-line-strong)); border-top: 0;
  border-radius: 0 0 11px 11px; padding: .8rem .9rem;
  background: var(--crm-card-2);
}
.ldt-fiche-corps { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
.ldt-fiche-corps h4 {
  margin: 0 0 .5rem; font-size: .76rem; font-weight: 600;
  color: var(--crm-ink-2); display: flex; align-items: baseline; gap: .4rem;
}
.ldt-compte { font-size: .7rem; color: var(--crm-ink-3); font-variant-numeric: tabular-nums; }

.ldt-jalons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ldt-jalon { display: flex; align-items: baseline; gap: .45rem; font-size: .75rem; }
.ldt-jalon--fait { opacity: .55; }
.ldt-jalon--fait .ldt-jalon-titre { text-decoration: line-through; }
.ldt-jalon-etat { color: var(--crm-ink-3); width: 1em; flex: none; }
.ldt-jalon-titre { flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }
.ldt-jalon-titre:hover { text-decoration: underline; }
.ldt-jalon-date { color: var(--crm-ink-3); font-variant-numeric: tabular-nums; flex: none; }

.ldt-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.ldt-journal-ligne {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline;
  font-size: .73rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--crm-line);
}
.ldt-journal-ligne:last-child { border-bottom: 0; padding-bottom: 0; }
.ldt-journal-date { color: var(--crm-ink-3); font-variant-numeric: tabular-nums; flex: none; }
.ldt-journal-type { font-weight: 600; }
.ldt-journal-delta { flex: 1 1 100%; color: var(--crm-ink-2); }
.ldt-journal-qui { color: var(--crm-ink-3); }
.ldt-journal-motif { flex: 1 1 100%; color: var(--crm-ink-3); font-style: italic; }

/* Sous 720 px, les deux colonnes du détail s'empilent : jalons puis journal,
   dans cet ordre — on veut savoir ce qui reste à faire avant de lire ce qui
   s'est passé. */
@media (max-width: 720px) {
  .ldt-fiche-corps { grid-template-columns: 1fr; }
  .ldt-fiche-sku { flex: 1 1 100%; }
}

/* --- Téléphone : trois panneaux qu'on fait glisser ------------------------ */
/* Le plan ne décrit QUE l'écran large. Empiler les trois horizons — ce que
   faisait `grid-template-columns: 1fr` — détruit l'idée entière de la vue :
   gauche = urgent, droite = lointain. Sur un téléphone ça donnait une liste
   rouge sans fin, et il fallait dépasser 26 cartes pour découvrir que les deux
   autres horizons existaient et étaient vides.

   On garde donc les colonnes côte à côte et on les fait défiler du doigt, avec
   accrochage. Même patron que le kanban des Tâches (`.tasks-kanban-wrap`), qui
   règle déjà ce problème ailleurs dans l'app — deux mécaniques différentes pour
   un même geste, c'est une de trop.

   La largeur à 87 % est le seul indice qui dit « glisse » : le bord de
   l'horizon suivant dépasse toujours. Des points de pagination demanderaient du
   JS et un état à tenir à jour ; un débordement visible ne peut pas se
   désynchroniser. */
@media (max-width: 900px) {
  .ldt-cols {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
    gap: .7rem;
    /* Les marges négatives laissent le panneau suivant toucher le bord de
       l'écran : sans ça, le débordement s'arrête sur la marge et ne se lit plus
       comme « il y a autre chose à droite ». */
    margin-inline: -.2rem;
    padding: 0 .2rem .4rem;
    scrollbar-width: none;
  }
  .ldt-cols::-webkit-scrollbar { display: none; }

  /* Portée `.ldt-cols >` OBLIGATOIRE : la pile « sans échéance » est aussi un
     `.ldt-col`, mais elle vit hors du tableau glissant, en pleine largeur. Sans
     cette portée elle hériterait des 87 % et du plafond de hauteur, et se
     retrouverait tronquée en bas de page. */
  .ldt-cols > .ldt-col {
    flex: 0 0 87%;
    min-width: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    /* dvh d'abord si le navigateur sait : sur iOS, 100vh compte la barre
       d'adresse rétractée et le bas du panneau passe sous le pouce. */
    max-height: 66vh;
    max-height: 66dvh;
  }
  .ldt-cols > .ldt-col > .ldt-col-head { flex: 0 0 auto; }

  /* Les cartes défilent DANS le panneau, pas avec la page. L'en-tête d'horizon
     reste donc toujours visible — on sait ce qu'on lit — et glisser vers un
     horizon vide n'affiche plus 3 000 px de blanc parce qu'on était descendu
     dans la 26ᵉ carte du précédent. */
  .ldt-cols > .ldt-col > .ldt-col-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-right: .15rem;
  }

  .ldt-sansdate .ldt-col-body { grid-template-columns: 1fr; }
  .ldt-moi { margin-left: 0; }
}

/* =====================================================================
   Onglet « Tâches » de la fiche magasin
   Aucune couleur en dur autre que le blanc du ✓ posé sur une pastille
   pleine : tout vient des jetons --crm-*, qui existent DANS LES DEUX
   thèmes (cf. les deux blocs en tête de fichier). Un bloc sombre dédié
   serait donc une redite — et le jour où l'on en ajouterait une seule
   couleur ici, elle manquerait à l'autre thème.
   ===================================================================== */
.crm-taches { display: flex; flex-direction: column; gap: 8px; }
.crm-tache {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--crm-card-2); border: 1px solid var(--crm-line);
  border-radius: 14px; padding: 11px 13px;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.crm-tache:hover { transform: translateY(-1px); box-shadow: var(--crm-shadow); }

/* Case à cocher : bouton pour qui peut écrire, simple pastille sinon —
   même règle que le reste de la fiche (« Consulter » lit, n'écrit pas). */
.crm-tache__ck {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--crm-line-strong); border-radius: 50%;
  background: transparent; color: transparent;
  font-size: 12px; font-weight: 800; line-height: 1;
  cursor: pointer; padding: 0;
  transition: background .13s ease, border-color .13s ease;
}
.crm-tache__ck:hover { border-color: var(--crm-ok-dot); background: var(--crm-ok-bg); }
.crm-tache__ck.on { background: var(--crm-ok-dot); border-color: var(--crm-ok-dot); color: #fff; }
.crm-tache__ck:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
span.crm-tache__ck { cursor: default; }

.crm-tache__main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.crm-tache__main:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 3px; border-radius: 8px; }
/* `anywhere` et pas `break-word` : un titre collé sans espace (une URL, un
   code produit) déborderait sinon de la carte sur mobile. */
.crm-tache__title { font-size: 14px; font-weight: 550; line-height: 1.35; color: var(--crm-ink); overflow-wrap: anywhere; }
.crm-tache__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--crm-ink-2); }
.crm-tache__statut { color: var(--crm-ink-2); }

.crm-tache__prio { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.crm-tache__prio--crit { background: var(--crm-crit-bg); color: var(--crm-crit-ink); }
.crm-tache__prio--warn { background: var(--crm-warn-bg); color: var(--crm-warn-ink); }
.crm-tache__prio--info { background: var(--crm-info-bg); color: var(--crm-info-ink); }
.crm-tache__prio--low { background: var(--crm-line); color: var(--crm-ink-2); }

.crm-tache__due { display: inline-flex; align-items: center; gap: 4px; }
/* Le retard ne se dit pas qu'en rouge : le libellé porte « en retard ». */
.crm-tache__due--late { background: var(--crm-crit-bg); color: var(--crm-crit-ink); border-radius: 999px; padding: 1px 8px; font-weight: 600; }

.crm-tache__avs { display: inline-flex; flex: none; padding-left: 6px; }
.crm-tache__av {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--crm-info-bg); color: var(--crm-info-ink);
  border: 1.5px solid var(--crm-card-2);
  font-size: 10.5px; font-weight: 650; margin-left: -7px;
}
.crm-tache__av:first-child { margin-left: 0; }

.crm-tache--done { opacity: .62; }
.crm-tache--done .crm-tache__title { text-decoration: line-through; }

/* Ligne en cours d'enregistrement : le retour visuel se joue SUR LA LIGNE
   qu'on vient de cocher — la liste entière ne clignote plus en squelette
   pendant l'aller-retour (cf. tachesPane, `charge({ squelette: false })`). */
.crm-tache[aria-busy="true"] { opacity: .5; pointer-events: none; }

.crm-taches-done { margin-top: 12px; }
.crm-taches-done > summary { cursor: pointer; font-size: 12.5px; color: var(--crm-ink-2); padding: 6px 2px; list-style-position: inside; }
.crm-taches-done > summary:hover { color: var(--crm-ink); }
.crm-taches-done[open] > summary { margin-bottom: 8px; }

/* --- Création rapide (le formulaire complet reste dans le module Tâches) --- */
.crm-tache-formzone:empty { display: none; }
.crm-tache-form {
  display: flex; flex-direction: column; gap: 9px;
  background: var(--crm-card-2); border: 1px solid var(--crm-line);
  border-radius: 14px; padding: 12px 13px; margin-bottom: 12px;
}
.crm-tache-form input, .crm-tcom-form textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px;
  color: var(--crm-ink); background: var(--crm-card);
  border: 1px solid var(--crm-line); border-radius: 11px; padding: 9px 11px;
  transition: border-color .13s ease, box-shadow .13s ease;
}
.crm-tache-form input:focus, .crm-tcom-form textarea:focus {
  outline: none; border-color: var(--crm-accent); box-shadow: 0 0 0 3px var(--crm-accent-soft);
}
.crm-tache-form input::placeholder, .crm-tcom-form textarea::placeholder { color: var(--crm-ink-3); }
.crm-tache-form__row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.crm-tache-form__lab { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--crm-ink-3); }
.crm-tache-form__lab--grow { flex: 1 1 200px; min-width: 0; }
.crm-tache-form__cancel {
  background: none; border: 1px solid var(--crm-line-strong); border-radius: 11px;
  font: inherit; font-size: 13px; color: var(--crm-ink-2); padding: 8px 14px; cursor: pointer;
}
.crm-tache-form__cancel:hover { color: var(--crm-ink); border-color: var(--crm-accent); }
/* Message d'erreur DANS le formulaire : .crm-error est un état pleine page
   (40 px de padding, texte centré) — il s'afficherait au milieu d'un vide. */
.crm-tache-form__msg { font-size: 12.5px; color: var(--crm-crit-ink); }
.crm-tache-retry { text-align: center; margin-top: 12px; }

/* --- Sélecteur de personnes (assignés) ---------------------------------
   Toutes les couleurs sortent des jetons --crm-* définis pour les DEUX
   thèmes en tête de fichier : rien ici n'est peint dans un seul thème. */
/* Le bloc du sélecteur compte une rangée de plus que le champ « Échéance »
   d'à côté (libellé, pastilles, champ). La rangée est en `align-items: center`
   — qu'on ne touche PAS, la même classe porte la rangée « Créer / Annuler »,
   qui doit rester centrée : on aligne donc ces deux blocs-ci par le BAS, pour
   que les deux champs de la rangée retrouvent la même ligne de base. */
.crm-tache-form__row > .crm-tache-form__lab { align-self: flex-end; }
.crm-pick { position: relative; }
.crm-pick__lab { font-size: 11.5px; color: var(--crm-ink-3); }
.crm-pick__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 20px; }
.crm-pick__vide { font-size: 12px; color: var(--crm-ink-3); font-style: italic; }
/* `align-items: center` et non `baseline` : la pastille peut porter DEUX
   lignes (nom + courriel) quand deux homonymes sont choisis, et le × doit
   rester en regard du bloc entier. */
.crm-pick__chip {
  display: inline-flex; align-items: center; gap: 3px;
  max-width: 100%; min-width: 0;
  font-size: 12px; line-height: 1.2; color: var(--crm-ink);
  background: var(--crm-accent-soft); border: 1px solid var(--crm-line-strong);
  border-radius: 999px; padding: 3px 4px 3px 9px;
  overflow-wrap: anywhere;
}
.crm-pick__cw { display: flex; flex-direction: column; min-width: 0; }
.crm-pick__cnom { overflow-wrap: anywhere; }
/* Le courriel d'une pastille : montré SEULEMENT quand le nom ne suffit plus à
   distinguer deux personnes choisies (deux « Melissa Roy »). */
.crm-pick__cml { font-size: 10.5px; color: var(--crm-ink-3); overflow-wrap: anywhere; }
.crm-pick__x {
  background: none; border: none; cursor: pointer; font: inherit; font-size: 14px; line-height: 1;
  color: var(--crm-ink-3); padding: 0 3px; border-radius: 999px;
}
.crm-pick__x:hover { color: var(--crm-crit-ink); }
.crm-pick__x:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 1px; }

/* La liste flotte : le formulaire est court, la pousser vers le bas ferait
   sauter le bouton « Créer » sous le doigt au moment de le viser. */
.crm-pick__list {
  position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin-top: 4px;
  max-height: 244px; overflow-y: auto;
  background: var(--crm-card); border: 1px solid var(--crm-line-strong);
  border-radius: 12px; box-shadow: var(--crm-shadow-lift); padding: 4px;
}
.crm-pick__list[hidden] { display: none; }
.crm-pick__opt {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 9px; cursor: pointer;
}
/* Le survol et la ligne visée au clavier se ressemblent VOLONTAIREMENT :
   c'est la même « ligne sur laquelle Entrée agit ». */
.crm-pick__opt:hover, .crm-pick__opt.is-active { background: var(--crm-accent-soft); }
.crm-pick__opt.is-active { box-shadow: inset 0 0 0 1px var(--crm-accent); }
.crm-pick__ph {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; background: var(--crm-card-2);
}
.crm-pick__ph--ltr {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--crm-ink-2);
  border: 1px solid var(--crm-line);
}
.crm-pick__who { min-width: 0; display: flex; flex-direction: column; }
/* Un nom ou un courriel long ne doit pas élargir la liste : il se coupe. */
.crm-pick__nom { font-size: 13px; color: var(--crm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-pick__ml { font-size: 11.5px; color: var(--crm-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-pick__aucun { font-size: 12.5px; color: var(--crm-ink-3); padding: 8px 9px; }
/* Repli quand la liste des membres ne répond pas (Clavardage éteint). */
.crm-pick__note { font-size: 11.5px; color: var(--crm-warn-ink); }

/* --- Détail d'une tâche --- */
.crm-tdet__back {
  background: none; border: none; font: inherit; font-size: 13px;
  color: var(--crm-ink-2); cursor: pointer; padding: 4px 0;
}
.crm-tdet__back:hover { color: var(--crm-ink); }
.crm-tdet__link { font-size: 13px; color: var(--crm-accent); text-decoration: none; font-weight: 550; }
.crm-tdet__link:hover { text-decoration: underline; }
.crm-tdet__title { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--crm-ink); overflow-wrap: anywhere; }
.crm-tdet__meta { margin: 8px 0 14px; }
/* pre-wrap : une description et un commentaire sont saisis avec des retours
   à la ligne ; les écraser change le sens du texte. */
.crm-tdet__desc { font-size: 13.5px; line-height: 1.55; color: var(--crm-ink); white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 16px; }
.crm-tdet__desc--none { color: var(--crm-ink-3); font-style: italic; }

.crm-tcoms { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.crm-tcom { background: var(--crm-card-2); border: 1px solid var(--crm-line); border-radius: 13px; padding: 10px 12px; }
.crm-tcom__head { font-size: 11.5px; color: var(--crm-ink-3); margin-bottom: 4px; }
.crm-tcom__body { font-size: 13.5px; line-height: 1.5; color: var(--crm-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
/* Un commentaire supprimé garde sa place : un trou dans le fil laisserait
   croire qu'on n'a jamais répondu. */
.crm-tcom--del .crm-tcom__body { color: var(--crm-ink-3); font-style: italic; }
.crm-tcom-form { display: flex; flex-direction: column; gap: 9px; }
.crm-tcom-form textarea { resize: vertical; min-height: 62px; line-height: 1.45; }

@media (max-width: 560px) {
  .crm-tache { padding: 10px 11px; gap: 9px; }
  .crm-tache__avs { padding-left: 0; }
  .crm-tache-form__lab--grow { flex-basis: 100%; }
}

/* =====================================================================
   Écran de contrôle avant la feuille ShipStation
   =====================================================================
   Hiérarchie voulue : ce qui demande une décision est en haut et coloré,
   ce qui est propre est replié et gris. Un écran où tout se ressemble ne
   serait qu'un tableau de plus — et c'est un tableau de plus qui a laissé
   passer 71 mauvaises adresses le 24 août 2026. */
.crm-sheet--wide { max-width: 680px; }
.crm-ship__loading { padding: 28px 0; text-align: center; color: var(--crm-ink-3, #9a927f); font-size: 14px; }
.crm-ship__sum { font-size: 14px; color: var(--crm-ink-2, #6f6857); margin-bottom: 14px; }
.crm-ship__k--bloq { color: #b3261e; }
.crm-ship__k--warn { color: #8a6d1f; }

.crm-ship__parcel { border: 1px solid var(--crm-line, #ece4d6); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.crm-ship__parcel-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--crm-ink-3, #9a927f); margin-bottom: 10px; }
.crm-ship__parcel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .crm-ship__parcel-grid { grid-template-columns: repeat(4, 1fr); } }
.crm-ship__parcel-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--crm-ink-2, #6f6857); }
.crm-ship__parcel-grid input { font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--crm-line, #ece4d6); border-radius: 11px; background: var(--crm-card, #fff); color: var(--crm-ink, #282521); box-sizing: border-box; width: 100%; }
.crm-ship__parcel-grid input:focus { outline: none; border-color: var(--crm-accent, #A8863F); box-shadow: 0 0 0 3px var(--crm-accent-soft, rgba(168,134,63,.1)); }
.crm-ship__hint { font-size: 12px; color: var(--crm-ink-3, #9a927f); margin-top: 9px; }

/* Import d'envois d'échantillons (ticket eADlWN8X). Trois champs empilés plutôt
   qu'une grille : ils se lisent dans l'ordre où on les remplit — lot, type,
   fichier — et le libellé d'un lot (« EE60603E-S — BLANH INDICA (3.5 g) ») est
   trop long pour une colonne étroite. */
.crm-simp__f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--crm-ink-2, #6f6857); margin-bottom: 10px; }
.crm-simp__f select,
.crm-simp__f input[type="file"] { font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--crm-line, #ece4d6); border-radius: 11px; background: var(--crm-card, #fff); color: var(--crm-ink, #282521); box-sizing: border-box; width: 100%; }
.crm-simp__f select:focus,
.crm-simp__f input[type="file"]:focus { outline: none; border-color: var(--crm-accent, #A8863F); box-shadow: 0 0 0 3px var(--crm-accent-soft, rgba(168,134,63,.1)); }

.crm-ship__list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.crm-ship__row { border: 1px solid var(--crm-line, #ece4d6); border-left: 3px solid #d8b34a; border-radius: 12px; padding: 11px 13px; }
.crm-ship__row--bloq { border-left-color: #b3261e; }
.crm-ship__title { font-size: 14px; font-weight: 600; color: var(--crm-ink, #282521); }
.crm-ship__num { font-variant-numeric: tabular-nums; color: var(--crm-ink-3, #9a927f); font-weight: 500; }
.crm-ship__addr { font-size: 13px; color: var(--crm-ink-2, #6f6857); margin: 3px 0 7px; }
.crm-ship__flag { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; padding: 7px 9px; border-radius: 9px; margin-top: 6px; background: var(--crm-accent-soft, rgba(168,134,63,.07)); }
.crm-ship__flag b { font-weight: 600; color: var(--crm-ink, #282521); }
.crm-ship__flag span { color: var(--crm-ink-2, #6f6857); }
.crm-ship__flag--bloquant { background: rgba(179, 38, 30, .07); }
.crm-ship__flag--info { background: var(--crm-line, rgba(40,34,24,.05)); }

.crm-ship__more { font: inherit; font-size: 13px; background: none; border: none; cursor: pointer; color: var(--crm-ink-2, #6f6857); padding: 8px 0; text-align: left; }
.crm-ship__more:hover { color: var(--crm-ink, #282521); }
.crm-ship__clean { margin-bottom: 12px; }
.crm-ship__cleanrow { font-size: 13px; color: var(--crm-ink-2, #6f6857); padding: 5px 0; border-bottom: 1px solid var(--crm-line, rgba(40,34,24,.06)); }
.crm-ship__cleanrow i { display: block; font-style: normal; font-size: 12px; color: var(--crm-ink-3, #9a927f); }
.crm-ship__note { font-size: 12.5px; color: var(--crm-ink-2, #6f6857); background: var(--crm-line, rgba(40,34,24,.05)); border-radius: 10px; padding: 9px 11px; margin-bottom: 12px; }
