/* ============================================================
   TCRM — Top Chrono Design System v1.0.0 (feuille partagée)
   Portée depuis la maquette Claude Design « TCRM ».
   Base réutilisable pour la migration progressive des écrans.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
:root {
  --primary: #DC143C;
  --primary-hover: #C71236;
  --primary-active: #B0102E;
  --primary-subtle: #FCE8EC;

  --white: #FFFFFF;
  --gray-100: #F8F9FA;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #CED4DA;
  --gray-500: #ADB5BD;
  --gray-600: #6C757D;
  --gray-700: #495057;
  --gray-800: #343A40;
  --gray-900: #212529;

  --success: #28A745;
  --success-subtle: #E6F4EA;
  --success-strong: #1C7A33;   /* texte vert lisible sur --success-subtle */
  --warning: #F39C12;
  --warning-subtle: #FDF3E2;
  --warning-strong: #9A6A12;   /* texte ambre lisible sur --warning-subtle */
  --danger: var(--primary-active);   /* le rouge de la marque, plus foncé : jamais un second rouge */
  --danger-subtle: #FBE2E7;

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

  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 12px;

  --shadow-sm: 0 1px 2px rgba(33,37,41,.06);
  --shadow-md: 0 4px 14px rgba(33,37,41,.09);
  --shadow-lg: 0 18px 48px -12px rgba(33,37,41,.22);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); color: var(--gray-900); background: var(--gray-100); -webkit-font-smoothing: antialiased; }

/* ---------- Brand wordmark (C = pivot Chrono/Customer) ---------- */
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand .name { font-weight: 800; font-size: 26px; letter-spacing: -.02em; line-height: 1; display: inline-flex; align-items: center; gap: 0; color: var(--gray-900); }
.brand .name .lc { display: inline; color: inherit; background: none; border: none; width: auto; height: auto; margin: 0; font-size: inherit; font-weight: inherit; border-radius: 0; box-shadow: none; }
.brand .sub { font-size: 10.5px; font-weight: 600; letter-spacing: .15em; margin-top: 7px; color: var(--gray-500); }
.brand.compact .name { font-size: 20px; }
.brand.compact .name .lc { font-size: inherit; }

/* ---------- Form pieces ---------- */
.field { position: relative; }
.field .lbl { display: block; font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: var(--space-2); }
.field .inp {
  width: 100%; height: 48px; border-radius: var(--radius-lg); border: 1px solid var(--gray-300);
  background: var(--white); padding: 0 var(--space-4) 0 44px; font-family: var(--font); font-size: 15px; color: var(--gray-900);
  transition: border-color .16s, box-shadow .16s;
}
.field .inp::placeholder { color: var(--gray-500); }
.field .inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220,20,60,.18); }
.field.error .inp { border-color: var(--primary); background: var(--primary-subtle); }
.field.error .ficon { color: var(--primary); }
.field .ficon { position: absolute; left: 14px; top: 38px; color: var(--gray-500); pointer-events: none; }
.field .toggle { position: absolute; right: 10px; top: 32px; width: 32px; height: 32px; border: none; background: none; cursor: pointer; color: var(--gray-500); border-radius: var(--radius-md); display: grid; place-items: center; }
.field .toggle:hover { background: var(--gray-100); color: var(--gray-700); }
.field .err-msg { display: none; font-size: 12.5px; font-weight: 500; color: var(--primary); margin-top: 6px; }
.field.error .err-msg { display: block; }

.ico { width: 18px; height: 18px; display: block; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 15px; height: 15px; }

.button-block {
  width: 100%; height: 50px; border: none; border-radius: var(--radius-lg); cursor: pointer;
  background: var(--primary); color: var(--white); font-family: var(--font); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: background .16s, transform .1s;
}
.button-block { text-decoration: none; }
.button-block:hover { background: var(--primary-hover); }
.button-block:active { background: var(--primary-active); transform: translateY(1px); }
.button-block[disabled] { opacity: .7; cursor: progress; }
.button-block .ico { transition: transform .16s; }
.button-block:not([disabled]):hover .ico { transform: translateX(3px); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.row-between { display: flex; align-items: center; justify-content: space-between; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--gray-700); user-select: none; }
.check input { position: absolute; opacity: 0; }
.check .box { width: 18px; height: 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-400); display: grid; place-items: center; transition: all .14s; }
.check .box svg { opacity: 0; stroke: var(--white); }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .box svg { opacity: 1; }
/* Lot F3a-bis : choix étendu du thème de formulaire (form/tcrm_theme.html.twig) ; radios en case ronde. */
.choix { display: flex; flex-direction: column; gap: var(--space-2); }
.choix-rond .box { border-radius: 50%; }
.choix-rond .box svg { display: none; }
.link { color: var(--primary); font-size: 14px; font-weight: 600; text-decoration: none; }
.link:hover { color: var(--primary-hover); text-decoration: underline; }

.badge-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; padding: 5px 11px; border-radius: 999px; }
.badge-status .g { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* ---------- Bandeau (.notice) ----------
   Visible par défaut ; masqué par l'attribut HTML hidden. */
.notice { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-lg); font-size: 13.5px; font-weight: 500; margin-top: var(--space-5); }
.notice[hidden] { display: none; }
.notice.danger { background: var(--primary-subtle); color: var(--primary-active); }
.notice .ico { flex: none; color: var(--primary); }
/* ---------- Messages flash : variantes du bandeau (.notice) ----------
   Bandeau rendu par le serveur en haut du contenu (shell/base.html.twig).
   « danger » est la variante ci-dessus. « info » est l'encart neutre
   (.notice.neutral, lot DS1) : le système n'a plus de bleu. */
.notice.success { background: var(--success-subtle); color: var(--gray-900); }
.notice.success .ico { color: var(--success); }
.notice.warning { background: var(--warning-subtle); color: var(--gray-900); }
.notice.warning .ico { color: var(--warning); }
.notice.neutral, .notice.info { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.notice.neutral .ico, .notice.info .ico { color: var(--gray-600); }

/* ---------- Modale ----------
   Structure attendue par le JavaScript de Bootstrap (.modal, .modal-dialog,
   .modal-backdrop, .fade, .show), sur les variables du système. .fade et
   .show, qu'il pose lui-même, ne servent qu'ici. Seules les
   propriétés que Bootstrap 5.3 pose lui-même sur ces sélecteurs : une page
   qui charge encore Bootstrap après cette feuille (le wizard de réception)
   garde exactement ses modales. */
.modal.fade, .modal-backdrop.fade { transition: opacity .15s linear; }
.modal.fade:not(.show) { opacity: 0; }
.modal { position: fixed; top: 0; left: 0; z-index: 1055; display: none; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal-dialog { position: relative; width: auto; margin: var(--space-2); pointer-events: none; }
.modal.fade .modal-dialog { transition: transform .3s ease-out; transform: translate(0, -50px); }
.modal.show .modal-dialog { transform: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - var(--space-2) * 2); }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; color: var(--gray-900); pointer-events: auto; background-color: var(--white); background-clip: padding-box; border: 1px solid var(--gray-200); border-radius: var(--radius-xl); outline: 0; }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 1050; width: 100vw; height: 100vh; background-color: var(--gray-900); }
.modal-backdrop.fade { opacity: 0; }
.modal-backdrop.show { opacity: .5; }
.modal-header { display: flex; flex-shrink: 0; align-items: center; padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--gray-200); }
.modal-title { margin-bottom: 0; line-height: 1.5; }
.modal-body { position: relative; flex: 1 1 auto; padding: var(--space-6); }
.modal-footer { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: var(--space-4) var(--space-6); border-top: 1px solid var(--gray-200); }
@media (min-width: 576px) {
  .modal-dialog { max-width: 500px; margin-right: auto; margin-left: auto; margin-top: var(--space-6); margin-bottom: var(--space-6); }
  .modal-dialog-centered { min-height: calc(100% - var(--space-6) * 2); }
}
@media (min-width: 992px) { .modal-lg { max-width: 800px; } }
@media (prefers-reduced-motion: reduce) { .modal.fade, .modal-backdrop.fade, .modal.fade .modal-dialog { transition: none; } }

/* ============================================================
   Composants des écrans (étape 2 du chantier de la fiche contact)
   Remontés des feuilles de l'accueil, où ils étaient écrits (et pour
   certains, écrits deux fois) : la version la plus générale est ici ; une
   page qui la spécialise le fait dans sa feuille, sous un nom à elle.
   Catalogue et alias provisoires : docs/DESIGN_SYSTEM_TCRM.md
   ============================================================ */

/* ---------- En-tête de page ---------- */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.pagehead .titlewrap { display: flex; align-items: center; gap: 12px; }
.pagehead .tic { width: 34px; height: 34px; border-radius: var(--radius-lg); background: var(--primary-subtle); color: var(--primary); display: grid; place-items: center; }
.pagehead h1 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
/* Sur le fond de page (gray-100) : gray-600 n'y atteint que 4,45:1, d'où gray-700. */
.pagehead .sub { font-size: 13px; color: var(--gray-700); margin-top: 3px; }
.pagehead .sub b { color: var(--gray-700); font-weight: 700; }

/* ---------- Panneau (carte) ---------- */
/* Relief (lot DS1) : deux niveaux. La carte de page ressort du fond (gray-100)
   par shadow-md ; un bloc intérieur est en creux (.creux), sans ombre. */
.panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
.panel .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: var(--space-5) var(--space-5) 0; }
.panel .hd h3 { font-size: 15.5px; font-weight: 700; }
.panel .hd .sub { font-size: 13px; color: var(--gray-600); margin-top: 2px; }
.panel .hd .lk { font-size: 13px; }

/* ---------- Bloc en creux (lot DS1) ----------
   Bloc intérieur d'une carte : zone de case à cocher, groupe de champs,
   encart. Fond gray-100, sans ombre. gray-600 n'y atteint que 4,45:1 : les
   textes gris y passent en gray-700. */
.creux, .panel.creux { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: none; }
.creux .aide, .creux thead th { color: var(--gray-700); }

/* ---------- Pied de carte (lot DS1) ----------
   Actions au bas d'une carte (Précédent / Suivant), sous un trait gray-200. */
.panel-pied { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--gray-200); }

/* ---------- Indicateur ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.kpi { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-xl); padding: var(--space-5); box-shadow: var(--shadow-md); }
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ic { width: 40px; height: 40px; border-radius: var(--radius-lg); display: grid; place-items: center; }
.kpi .ic.primary { background: var(--primary-subtle); color: var(--primary); }
.kpi .ic.success { background: var(--success-subtle); color: var(--success-strong); }
.kpi .ic.warning { background: var(--warning-subtle); color: var(--warning-strong); }
.kpi .ic.neutral { background: var(--gray-100); color: var(--gray-700); }
.kpi .delta { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; }
.kpi .delta.up { color: var(--success-strong); background: var(--success-subtle); }
.kpi .delta.down { color: var(--primary); background: var(--primary-subtle); }
.kpi .delta.good.down { color: var(--success-strong); background: var(--success-subtle); }
.kpi .val { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: 13.5px; color: var(--gray-700); margin-top: 8px; }
.kpi .spark { margin-top: 12px; height: 30px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Pastille de statut : une tonalité par sens ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.neutral { background: var(--gray-200); color: var(--gray-700); }
.pill.success { background: var(--success-subtle); color: var(--success-strong); }
.pill.warning { background: var(--warning-subtle); color: var(--warning-strong); }
.pill.primary { background: var(--primary-subtle); color: var(--primary-active); }
.pill.danger { background: var(--danger-subtle); color: var(--danger); }

/* ---------- Tableau (dans son conteneur) ----------
   :where() limite les règles au conteneur sans hausser leur spécificité :
   une classe de cellule (.ref, .r…) garde la main, comme avant. */
.tablewrap { padding: var(--space-2) var(--space-5) var(--space-5); overflow-x: auto;
  background: radial-gradient(farthest-side at 100% 50%, rgba(33, 37, 41, .22), transparent) right center / 14px 100% no-repeat; }
/* Ombre interne à droite quand le tableau défile dans son conteneur : il y a
   plus. Là où le navigateur suit le défilement (animation-timeline), elle part
   de zéro (sans débordement, la chronologie est inactive et l'animation ne
   joue pas : pas d'ombre pour une suite qui n'existe pas) et s'efface en bout
   de course ; ailleurs, elle reste. */
@supports (animation-timeline: scroll()) {
  .tablewrap { background-size: 0 100%; animation: tablewrap-ombre-droite linear both; animation-timeline: scroll(self inline); }
}
@keyframes tablewrap-ombre-droite { 0%, 80% { background-size: 14px 100%; } 100% { background-size: 0 100%; } }
:where(.tablewrap) table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
:where(.tablewrap) thead th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--gray-600); padding: 11px 12px; border-bottom: 1px solid var(--gray-200); }
:where(.tablewrap) thead th.r, :where(.tablewrap) tbody td.r { text-align: right; }
:where(.tablewrap) tbody td { padding: 12px; border-bottom: 1px solid var(--gray-200); color: var(--gray-800); }
:where(.tablewrap) tbody tr:last-child td { border-bottom: none; }
:where(.tablewrap) tbody tr:hover { background: var(--gray-100); }
.ref { font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; }
/* Lien dans un tableau (lot C1) : du texte qu'on peut ouvrir, pas une
   action. Couleur du texte (--gray-900), souligné au survol et au focus,
   jamais --primary : le rouge reste aux actions et aux alertes. Les boutons
   (.button) et les entrées de menu (.actions-lien) gardent leur style ;
   :where() laisse la main à une classe de cellule (.ref…). */
:where(td) a:where(:not(.button, .actions-lien)) { color: var(--gray-900); text-decoration: none; }
:where(td) a:where(:not(.button, .actions-lien)):hover, :where(td) a:where(:not(.button, .actions-lien)):focus-visible { text-decoration: underline; }

/* ---------- Sélecteur segmenté ---------- */
.seg { display: inline-flex; gap: 4px; background: var(--white); border: 1px solid var(--gray-200); padding: 4px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.seg button { border: none; background: none; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--gray-600); padding: 8px 14px; border-radius: var(--radius-md); cursor: pointer; }
/* Bouton enfoncé (aria-pressed) en teinte subtile (charte : « jamais deux rouges pleins côte à côte ») */
.seg button[aria-pressed="true"] { background: var(--primary-subtle); color: var(--primary-active); }
/* Lot R2-bis : le même sélecteur sur des boutons radio d'un formulaire
   (.seg-choix : <label> contenant le radio puis son libellé). Le radio reste
   dans le formulaire et au clavier, invisible ; l'option cochée prend la
   teinte de l'option enfoncée. */
.seg-choix { position: relative; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--gray-600); padding: 7px 13px; border-radius: var(--radius-md); cursor: pointer; user-select: none; white-space: nowrap; }
.seg-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-choix:has(input:checked) { background: var(--primary-subtle); color: var(--primary-active); }
.seg-choix:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ---------- Champ de formulaire ----------
   Remonté du registre des opérations (filtres) ; message d'erreur et état en
   erreur repris de l'écran de connexion. Thème Symfony :
   templates/form/tcrm_theme.html.twig. .fields empile des champs pleine
   largeur (formulaires des modales). */
.fld { display: flex; flex-direction: column; gap: 6px; }
/* Lisibilité (lot DS1) : l'étiquette se lit, foncée, sans majuscules
   espacées (réservées aux titres de section, gray-600 en 11 px). */
.fld label { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.fld input, .fld select, .fld textarea { height: 40px; border-radius: var(--radius-lg); border: 1px solid var(--gray-300); background: var(--white); padding: 0 12px; font-family: var(--font); font-size: 14px; color: var(--gray-900); }
.fld textarea { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.fld input[type=date] { padding-right: 8px; }
.fld.grow { flex: 1; min-width: 200px; }
.fld.grow .srch { position: relative; }
.fld.grow .srch .ico { position: absolute; left: 11px; top: 11px; color: var(--gray-500); }
.fld.grow .srch input { width: 100%; padding-left: 36px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.fld.error input, .fld.error select, .fld.error textarea { border-color: var(--primary); background: var(--primary-subtle); }
.fld .err-msg, .fields > .err-msg { font-size: 12.5px; font-weight: 500; color: var(--primary); }
/* Aide sous un champ : gray-600, jamais plus clair (4,69:1 sur blanc). */
.aide { font-size: 12.5px; color: var(--gray-600); }
.fields { display: flex; flex-direction: column; gap: var(--space-4); }
.fields .fld input, .fields .fld select, .fields .fld textarea { width: 100%; }

/* ---------- Boutons ----------
   .button : bouton plein (action principale). Variantes : .outline (contour
   crimson), .neutral, .danger, .ghost (discret) ; tailles .sm et .lg ;
   .icon pour un bouton à icône seule.
   Alias PROVISOIRES, le temps que les écrans migrent (liste dans
   docs/DESIGN_SYSTEM_TCRM.md) : .btn-cta = .button, .btn-search = .button.outline.sm,
   .btn-reset = .button.neutral.sm. */
.button, .btn-cta, .btn-search, .btn-reset { height: 44px; border: none; border-radius: var(--radius-lg); background: var(--primary); color: var(--white); font-family: var(--font); font-weight: 600; font-size: 14px; padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .14s; }
.button { text-decoration: none; }
.button:hover, .btn-cta:hover { background: var(--primary-hover); }
.button.lg, .btn-cta.lg { height: 46px; font-size: 14.5px; }
.button.sm, .btn-search, .btn-reset { height: 40px; padding: 0 16px; gap: 7px; }
.button.outline, .btn-search { border: 1px solid var(--primary); background: var(--white); color: var(--primary); }
.button.outline:hover, .btn-search:hover { background: var(--primary-subtle); }
.button.neutral, .btn-reset { border: 1px solid var(--gray-300); background: var(--white); color: var(--gray-700); }
.button.neutral:hover, .btn-reset:hover { background: var(--gray-100); }
.btn-reset { padding: 0 14px; }
.button.danger { border: 1px solid var(--danger); background: var(--white); color: var(--danger); }
.button.danger:hover { background: var(--danger-subtle); }
.button.ghost { background: none; color: var(--gray-700); }
.button.ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.button.icon { width: 44px; padding: 0; justify-content: center; }
.button.icon.sm { width: 40px; }
.button.icon.lg { width: 46px; }
.button[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Onglets ----------
   Repris des onglets de l'ancienne fiche contact (components/hub-tabs.css,
   supprimée à la bascule de la fiche, étape 8).
   L'onglet sélectionné porte aria-selected="true" (motif onglets, role="tab"). */
/* Le trait de base est une ombre intérieure : l'onglet actif le recouvre sans
   déborder du conteneur, qui peut défiler à l'horizontale sur écran étroit. */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--gray-200); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--gray-600); font-family: var(--font); font-size: 12.5px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: color .15s, border-color .15s, background .15s; }
.tab:hover { color: var(--gray-900); background: var(--gray-100); }
.tab .ico { opacity: .75; }
.tab:hover .ico { opacity: 1; }
.tab[aria-selected="true"] { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); background: transparent; }
.tab[aria-selected="true"] .ico { opacity: 1; }
.tab .count { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px; background: var(--gray-200); color: var(--gray-700); font-size: 10px; font-weight: 700; line-height: 1; }
.tab[aria-selected="true"] .count { background: var(--primary); color: var(--white); }

/* ---------- Liste filtrable ----------
   Lot F2c (docs/facturation/2026-11-15-lot-f2c-onglets.md) : remontée des
   listes du module Commercial (.commercial-filtres, .commercial-pages).
   Gabarit : templates/shell/_liste_filtrable.html.twig. Barre de filtres en
   GET (.filtres, champs .fld, recherche élargie .filtre-recherche), liste
   vide (.liste-vide), pages (.pages, liens .pages-liens). */
.filtres { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-4) var(--space-5); }
.filtres .fld { flex: 1 1 150px; max-width: 220px; }
.filtres .fld select, .filtres .fld input { width: 100%; }
.filtres .filtre-recherche { flex: 2 1 260px; max-width: 360px; }
.filtres-boutons { display: flex; gap: 10px; }
.liste-vide { padding: var(--space-6, 32px) var(--space-5); text-align: center; color: var(--gray-600); }
.pages { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-5); border-top: 1px solid var(--gray-200); color: var(--gray-600); font-size: 13px; }
.pages-liens { display: flex; align-items: center; gap: var(--space-3); }

/* ---------- Liste libellé / valeur ----------
   Reprise de la grille de champs de l'ancienne fiche contact
   (.contact-field-grid, modules/contact/show-v2.css, supprimée à la bascule de
   la fiche, étape 8). */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px 22px; }
.kv { min-width: 0; }
.kv .kv-label { font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.kv .kv-value { font-size: 14px; color: var(--gray-900); font-weight: 500; word-break: break-word; }
.kv .kv-value.muted { color: var(--gray-600); font-weight: 400; font-style: italic; }

/* ---------- Menu d'actions d'une ligne (« actions », lot M2a) ----------
   Un bouton, une liste qui s'ouvre sous lui ; le contrôleur Stimulus
   « actions » l'ouvre, la place (position fixe, pour échapper au défilement
   d'un tableau) et la ferme au clic dehors, à Échap ou au défilement. Un
   seul menu ouvert à la fois. L'état se lit sur aria-expanded (bouton) et
   hidden (liste), jamais sur une classe. */
.actions { position: relative; display: inline-block; }
.actions-bouton { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--white); color: var(--gray-600); cursor: pointer; transition: color .12s, border-color .12s; }
.actions-bouton:hover, .actions-bouton[aria-expanded="true"] { color: var(--primary); border-color: var(--gray-400); }
.actions-bouton:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.actions-menu { position: fixed; z-index: 60; min-width: 230px; padding: 6px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); text-align: left; }
.actions-menu[hidden] { display: none; }
.actions-lien { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--gray-800); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
/* Une entrée qui ouvre une modale est un bouton (lot M2c) : même rendu qu'un lien. */
button.actions-lien { width: 100%; border: none; background: none; font-family: var(--font); text-align: left; cursor: pointer; }
a.actions-lien:hover, a.actions-lien:focus-visible, button.actions-lien:hover, button.actions-lien:focus-visible { background: var(--gray-100); color: var(--gray-900); outline: none; }
.actions-lien.actions-danger, .actions-lien.actions-danger .ico { color: var(--danger); }
.actions-lien .ico { color: var(--gray-500); }
.actions-lien.actions-inactif { color: var(--gray-400); cursor: default; }
.actions-lien.actions-inactif .ico { color: var(--gray-300); }
.actions-separateur { height: 1px; margin: 6px 0; background: var(--gray-200); }

/* ---------- Gabarit d'assistant (lot DS2) ----------
   Deux colonnes : à gauche le stepper (260 px, collant sous la barre du
   haut), à droite l'étape, fluide. Champs plus hauts et plus lisibles.
   À 1024 px et moins, la colonne gauche se replie à 56 px (pastilles). */
.wizard-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.wizard-layout > :first-child { position: sticky; top: calc(64px + var(--space-6)); padding: var(--space-5); }
.wizard-layout .fld input, .wizard-layout .fld select { height: 44px; font-size: 15px; }
.wizard-layout .fld textarea { font-size: 15px; }

/* ---------- Stepper (lots DS1, DS2) ----------
   Vertical par défaut : pastille à gauche, ligne verticale entre les
   pastilles, libellé à droite et, sous lui, le résumé d'une étape faite.
   <ol class="stepper"><li class="todo"><span class="pastille"><span
   class="numero">2</span>{{ ico.icon('check') }}</span><span
   class="libelle">…</span><span class="stepper-resume">…</span></li>…</ol>
   .stepper.horizontal : pastilles en ligne, libellé centré dessous (DS1).
   États par classe : .todo (à faire), .done (faite : coche, cliquable),
   .current (courante). .done et .current l'emportent sur .todo, écrites
   après : une page qui pose .todo au rendu et laisse son JavaScript poser les
   deux autres reste juste. La ligne qui mène à une étape faite ou courante
   est --primary, les autres gray-300. */
.stepper { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.stepper > li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--space-3); align-content: start; padding-bottom: var(--space-6); min-width: 0; cursor: default; }
.stepper > li:last-child { padding-bottom: 0; }
.stepper > li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--gray-300); }
.stepper > li:has(+ li.done)::after, .stepper > li:has(+ li.current)::after { background: var(--primary); }
.stepper .pastille { grid-row: 1 / span 2; position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--gray-300); background: var(--white); color: var(--gray-600); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper .pastille .ico { display: none; width: 16px; height: 16px; stroke-width: 2.6; }
.stepper .libelle { grid-column: 2; padding-top: 7px; font-size: 13px; color: var(--gray-600); line-height: 1.3; }
.stepper .stepper-resume { grid-column: 2; display: none; margin-top: 2px; font-size: 13px; color: var(--gray-600); line-height: 1.35; overflow-wrap: anywhere; }
.stepper .todo .pastille { border-color: var(--gray-300); background: var(--white); color: var(--gray-600); }
.stepper .todo .libelle { color: var(--gray-600); font-weight: 400; }
.stepper .done { cursor: pointer; }
.stepper .done .pastille { border-color: var(--primary); background: var(--primary); color: var(--white); }
.stepper .done .pastille .numero { display: none; }
.stepper .done .pastille .ico { display: block; }
.stepper .done .libelle { color: var(--gray-700); font-weight: 400; }
.stepper .done .stepper-resume:not(:empty) { display: block; }
.stepper .current .pastille { border-color: var(--primary); background: var(--primary); color: var(--white); box-shadow: 0 0 0 4px var(--primary-subtle); }
.stepper .current .libelle { color: var(--gray-900); font-weight: 600; }

.stepper.horizontal { flex-direction: row; }
.stepper.horizontal > li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 0; text-align: center; }
.stepper.horizontal > li::after { content: none; }
.stepper.horizontal > li + li::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 2px; background: var(--gray-300); }
.stepper.horizontal > li.done::before, .stepper.horizontal > li.current::before { background: var(--primary); }
.stepper.horizontal .libelle { padding-top: 0; }
.stepper.horizontal .done .stepper-resume { display: none; }
@media (max-width: 720px) {
  .stepper.horizontal .libelle { display: none; }
  .stepper.horizontal .current .libelle { display: block; white-space: nowrap; }
}

@media (max-width: 1024px) {
  .wizard-layout { grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-4); }
  .wizard-layout > :first-child { padding: var(--space-3) 0; }
  .wizard-layout .stepper > li { grid-template-columns: 32px; justify-content: center; }
  .wizard-layout .stepper > li:not(:last-child)::after { left: 50%; margin-left: -1px; }
  .wizard-layout .stepper .libelle, .wizard-layout .stepper .done .stepper-resume { display: none; }
}

/* ---------- Fiche de facture (lot F2d) ----------
   docs/facturation/2026-11-16-lot-f2d-fiche-unifiee.md. Gabarit
   facturation/facture.html.twig, composants templates/shell/facture/ :
   en-tête (.facture-identite, TTC en avant .facture-ttc), rangée d'actions
   (.facture-actions), deux colonnes (.facture-colonnes : .facture-principale,
   .facture-laterale), totaux (.facture-totaux, ligne forte .facture-total),
   certification DGI (.certification-dgi, QR .certification-qr, code
   .certification-code), validation (.facture-validation-corps, journal
   .facture-journal). */
.fiche-facture { display: flex; flex-direction: column; gap: var(--space-5); }
.facture-identite { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.facture-ttc { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.facture-ttc-libelle { font-size: 12px; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.facture-ttc strong { font-size: 26px; font-weight: 800; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.facture-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-3); }
.facture-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.facture-principale, .facture-laterale { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.facture-ligne-detail { display: block; margin-top: 2px; font-size: 12.5px; color: var(--gray-600); }
.facture-totaux { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); max-width: 340px; margin: var(--space-4) 0 0 auto; font-size: 14px; }
.facture-totaux dt { color: var(--gray-700); font-weight: 400; }
.facture-totaux dd { margin: 0; text-align: right; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.facture-totaux .facture-total { padding-top: var(--space-2); border-top: 1px solid var(--gray-200); font-weight: 700; }
/* Lot F3a : groupe de taxe de la facture de contrat et sa mention (A exonéré, D retenue à la source). */
.facture-mention { margin: var(--space-3) 0 0 auto; max-width: 340px; text-align: right; font-size: 13px; color: var(--gray-700); }
.certification-dgi { position: sticky; top: var(--space-5); }
.certification-dgi-corps, .facture-validation-corps { padding: var(--space-4) var(--space-5) var(--space-5); }
.certification-dgi-contenu { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.certification-dgi-contenu .kv-grid { width: 100%; margin: 0; }
.certification-dgi-contenu dd { margin: 0; }
.certification-qr { width: 148px; height: 148px; image-rendering: pixelated; border: 1px solid var(--gray-200); border-radius: var(--radius-md); }
.certification-code { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.facture-validation-corps dd { margin: 0; }
.facture-journal { list-style: none; margin: var(--space-5) 0 0; padding: 0; }
.facture-journal li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-2) 0; border-top: 1px solid var(--gray-200); font-size: 14px; color: var(--gray-800); }
.facture-journal-date { color: var(--gray-600); font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) {
  .facture-colonnes { grid-template-columns: minmax(0, 1fr); }
  .facture-ttc { align-items: flex-start; }
}

/* Lot R2-quater : le composant de prix (ChampPrixType, contrats ; prix d'un colis
   annoncé, enlèvement), déplacé tel quel de modules/contrat/contrat.css.
   Unité dans le champ, équivalent rendu par le serveur. */
.champ-prix { display: flex; flex-direction: column; gap: var(--space-2); }
.champ-prix-titre { display: flex; align-items: center; gap: var(--space-2); font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.champ-prix-titre label { margin: 0; }
.champ-prix-saisie { display: flex; align-items: stretch; max-width: 360px; }
.champ-prix-saisie input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.champ-prix-unite { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border: 1px solid var(--gray-300); border-left: none; border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--gray-100); font-size: 13px; color: var(--gray-700); white-space: nowrap; }
.champ-prix-equivalent:empty { display: none; }
