/* Maquette SALTI · Espace commercial
   Charte : jaune #FFDD00, noir, blanc, surfaces #F5F5F5, police Lato.
   Les seules autres couleurs sont celles des statuts (pins et pastilles). */
:root {
  --jaune: #FFDD00;
  --jaune-survol: #F0CF00;
  --jaune-pale: #FFF8CC;
  --noir: #000000;
  --blanc: #FFFFFF;
  --surface: #F5F5F5;
  --trait: #DDDDDD;
  --texte-2: #444444;
  --danger: #C62828;
  --alerte: #F08A00;
  --ombre: 0 2px 10px rgba(0, 0, 0, 0.08);
  --ombre-forte: 0 12px 40px rgba(0, 0, 0, 0.22);
  --rayon: 4px;
  --rayon-bloc: 8px;
  --barre-h: 64px;
  --police: 'Lato', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--police); font-size: 15px; line-height: 1.5; background: var(--surface); color: var(--noir); }
body.couche-ouverte { overflow: hidden; }
h1 { font-size: 26px; font-weight: 900; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 900; }
h3 { font-size: 14px; font-weight: 900; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
small { display: block; font-size: 13px; font-weight: 400; color: var(--texte-2); }
.ic { flex: none; }
:focus-visible { outline: 3px solid var(--noir); outline-offset: 2px; border-radius: var(--rayon); }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lien-evitement { position: absolute; left: 8px; top: -60px; z-index: 3000; background: var(--jaune); padding: 10px 16px; font-weight: 700; border-radius: var(--rayon); }
.lien-evitement:focus { top: 8px; }
.discret { color: var(--texte-2); }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ Barre du haut */
.barre { position: sticky; top: 0; z-index: 1100; height: var(--barre-h); display: flex; align-items: center; gap: 24px; padding: 0 24px; background: var(--noir); color: var(--blanc); }
.barre :focus-visible { outline-color: var(--jaune); }
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 900; font-size: 16px; white-space: nowrap; }
.marque img { display: block; border: 1px solid #333; border-radius: 9px; }
.onglets { display: flex; align-self: stretch; gap: 4px; }
.onglets a { display: flex; align-items: center; gap: 8px; padding: 0 16px; text-decoration: none; font-weight: 700; border-bottom: 4px solid transparent; border-top: 4px solid transparent; transition: background 0.15s ease-out; }
.onglets a:hover { background: #1F1F1F; }
.onglets a[aria-current="page"] { color: var(--jaune); border-bottom-color: var(--jaune); }
.recherche-globale { position: relative; flex: 1; min-width: 200px; max-width: 440px; margin-left: auto; }
.recherche-globale input { width: 100%; height: 40px; padding: 0 12px 0 40px; background: #1F1F1F; border: 1px solid #3A3A3A; border-radius: var(--rayon); color: var(--blanc); }
.recherche-globale input::placeholder { color: #BDBDBD; }
.recherche-globale input:focus { outline: 2px solid var(--jaune); border-color: var(--jaune); }
.recherche-ic { position: absolute; left: 12px; top: 11px; color: #BDBDBD; pointer-events: none; }
.recherche-resultats { position: absolute; top: 46px; left: 0; right: 0; z-index: 1200; background: var(--blanc); color: var(--noir); border-radius: var(--rayon-bloc); box-shadow: var(--ombre-forte); padding: 8px; max-height: 70vh; overflow: auto; }
.recherche-resultats :focus-visible { outline-color: var(--noir); }
.recherche-titre { padding: 8px 8px 4px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-2); }
.recherche-resultats a { display: flex; align-items: center; gap: 12px; padding: 8px; min-height: 44px; border-radius: var(--rayon); text-decoration: none; font-weight: 700; }
.recherche-resultats a:hover, .recherche-resultats a:focus { background: var(--jaune-pale); }
.recherche-vide { padding: 12px 8px; }
.profil { display: flex; align-items: center; gap: 12px; }
.profil-bouton { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 3px 10px 3px 3px; background: none; border: 1px solid transparent; border-radius: 999px; color: inherit; text-align: left; transition: background 0.15s ease-out, border-color 0.15s ease-out; }
.profil-bouton:hover { background: #1F1F1F; border-color: #5A5A5A; }
.profil-pastille { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--jaune); color: var(--noir); font-weight: 900; font-size: 14px; }
.profil-texte { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; white-space: nowrap; }
.profil-texte span { color: #D0D0D0; }
.btn-reinit { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: none; border: 1px solid #5A5A5A; border-radius: var(--rayon); color: var(--blanc); font-size: 13px; font-weight: 700; }
.btn-reinit[hidden] { display: none; }
.btn-reinit:hover { border-color: var(--jaune); color: var(--jaune); }

/* ------------------------------------------------------------ Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--rayon); font-weight: 700; text-decoration: none; white-space: nowrap; transition: background 0.15s ease-out, transform 0.1s ease-out; }
.btn:active { transform: scale(0.98); }
.btn-primaire { background: var(--jaune); color: var(--noir); }
.btn-primaire:hover { background: var(--jaune-survol); }
.btn-secondaire { background: var(--blanc); border-color: var(--noir); }
.btn-secondaire:hover { background: var(--surface); }
.btn-texte { background: none; text-decoration: underline; padding: 10px 12px; }
.btn-danger { background: var(--danger); color: var(--blanc); }
.btn-bloc { width: 100%; }
.btn-icone { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; background: none; border: none; border-radius: var(--rayon); }
.btn-icone:hover { background: var(--surface); }
.btn-lien { background: none; border: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.btn-lien:hover { text-decoration-color: var(--jaune); text-decoration-thickness: 3px; }

/* ------------------------------------------------------------ Petits composants */
.code { display: inline-block; padding: 3px 8px; background: var(--jaune); border-radius: var(--rayon); font-size: 12px; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap; }
.code-grand { font-size: 16px; padding: 6px 12px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 8px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge-point { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.etiquette { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--noir); color: var(--blanc); border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.etiquette-fine { padding: 2px 8px; font-size: 12px; margin-left: 6px; }
.etiquette-alerte { background: #FFE9CC; color: var(--noir); border: 1px solid var(--alerte); }
.etiquette .ic { width: 14px; height: 14px; }
.compte-pastille { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; background: var(--surface); border-radius: 999px; font-size: 12px; font-weight: 900; }
.compteur { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.compteur i, .client-comptes i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.sous-titre { color: var(--texte-2); margin-top: 2px; }
.vide { padding: 40px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.vide strong { font-size: 17px; font-weight: 900; }
.vide p { color: var(--texte-2); max-width: 46ch; }
.vide .btn { margin-top: 8px; }

/* Cases à cocher de filtre : la forme et la couleur reprennent celles des marqueurs de la carte */
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filtres-lib { width: 72px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; }
.case-filtre { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 10px; background: var(--surface); border: 1.5px solid var(--trait); border-radius: 999px; cursor: pointer; user-select: none; transition: background 0.15s ease-out, border-color 0.15s ease-out; }
.case-filtre input { width: 18px; height: 18px; accent-color: var(--noir); cursor: pointer; }
.case-filtre .case-forme { display: grid; place-items: center; opacity: 0.35; }
.case-filtre .case-texte { font-weight: 700; }
.case-filtre .case-compte { min-width: 22px; padding: 0 6px; background: var(--blanc); border-radius: 999px; font-size: 12px; font-weight: 900; text-align: center; }
.case-filtre:hover { border-color: var(--noir); }
.case-filtre:has(input:checked) { background: var(--blanc); border-color: var(--noir); }
.case-filtre:has(input:checked) .case-forme { opacity: 1; }
.case-filtre:has(input:checked) .case-compte { background: var(--surface); }
.case-filtre:has(input:focus-visible) { outline: 3px solid var(--noir); outline-offset: 2px; }
.case-filtre input:focus-visible { outline: none; }

.segment { display: inline-flex; border: 1.5px solid var(--noir); border-radius: var(--rayon); overflow: hidden; background: var(--blanc); }
.segment button { min-height: 40px; padding: 0 16px; background: none; border: none; font-weight: 700; }
.segment button + button { border-left: 1.5px solid var(--noir); }
.segment button[aria-pressed="true"] { background: var(--jaune); }
.segment button:focus-visible { outline-offset: -3px; }

.champ-recherche { position: relative; display: block; flex: 1; min-width: 220px; }
.champ-recherche .ic { position: absolute; left: 12px; top: 13px; pointer-events: none; }
.champ-recherche input { width: 100%; height: 44px; padding: 0 12px 0 40px; background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); }
.tri { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
select { height: 44px; padding: 0 12px; background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); }
input:focus, select:focus { outline: 2px solid var(--jaune); border-color: var(--noir); }
.interrupteur { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; cursor: pointer; }
.interrupteur input { width: 20px; height: 20px; accent-color: var(--noir); }

/* ------------------------------------------------------------ Page carte */
.page-carte { display: grid; grid-template-columns: 400px 1fr; height: calc(100dvh - var(--barre-h)); background: var(--blanc); }
.panneau { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--trait); }
.panneau-tete { display: grid; gap: 14px; padding: 20px; border-bottom: 1px solid var(--trait); }
.panneau-tete h1 { font-size: 22px; }
.panneau-tete .segment { display: grid; grid-template-columns: 1fr 1fr; }
.liste-clients { list-style: none; overflow-y: auto; flex: 1; }
.client-ligne { display: flex; align-items: center; border-bottom: 1px solid #EDEDED; padding-right: 8px; }
.client-ligne:hover { background: var(--jaune-pale); }
.client-lien { flex: 1; min-width: 0; display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px; padding: 10px 8px 10px 20px; min-height: 60px; text-decoration: none; }
.client-lien .code { justify-self: start; }
.client-nom { font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.client-comptes { display: flex; gap: 10px; font-weight: 900; font-size: 14px; }
.client-comptes span { display: inline-flex; align-items: center; gap: 5px; }

.carte-zone { position: relative; min-height: 0; }
.carte { width: 100%; height: 100%; background: #E9E9E9; }
.legende { position: absolute; left: 16px; bottom: 16px; z-index: 800; display: flex; gap: 16px; padding: 8px 14px; background: var(--blanc); border-radius: var(--rayon-bloc); box-shadow: var(--ombre); font-size: 13px; font-weight: 700; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.carte-vide { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 800; padding: 12px 20px; background: var(--blanc); border-radius: var(--rayon-bloc); box-shadow: var(--ombre); font-weight: 700; text-align: center; }
.carte-vide[hidden] { display: none; }

/* Marqueurs et bulles Leaflet */
.leaflet-container { font-family: var(--police); font-size: 14px; }
.leaflet-tile-pane { filter: grayscale(1) contrast(0.92) brightness(1.04); }
.pin { background: none; border: none; }
.pin svg { display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.grappe { background: none; }
.grappe-anneau { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--blanc); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35); }
.grappe-anneau span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blanc); font-weight: 900; font-size: 13px; }
.leaflet-popup-content-wrapper { border-radius: var(--rayon-bloc); box-shadow: var(--ombre-forte); }
.leaflet-popup-content { margin: 16px; line-height: 1.45; }
.leaflet-container a.leaflet-popup-close-button { width: 32px; height: 32px; font-size: 22px; line-height: 32px; color: var(--noir); }
.bulle { display: grid; gap: 10px; color: var(--noir); }
.bulle-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 900; padding-right: 20px; }
.leaflet-container a.bulle-client { color: var(--noir); font-size: 16px; font-weight: 900; text-decoration: underline; text-decoration-color: var(--jaune); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.bulle p { margin: 0; }
.bulle-lignes { list-style: none; display: grid; gap: 6px; padding: 8px 10px; background: var(--surface); border-radius: var(--rayon); }
.bulle-lignes span, .bulle-vide { color: var(--texte-2); }
.bulle-infos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.bulle-infos dt { font-size: 12px; color: var(--texte-2); }
.bulle-infos dd { font-weight: 700; }
.leaflet-container a.btn { color: var(--noir); min-height: 40px; padding: 8px 16px; }

/* ------------------------------------------------------------ Chantiers prévus */
.page-previsions { grid-template-columns: 500px 1fr; }
.note-outil { display: flex; gap: 10px; padding: 10px 12px; background: var(--jaune-pale); border-left: 4px solid var(--jaune); border-radius: var(--rayon); font-size: 13px; }
.note-outil .ic { margin-top: 2px; }
.segment-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.panneau-tete .segment-3 { grid-template-columns: repeat(3, 1fr); }
.panneau-tete .outils .tri select { max-width: 190px; }
/* Ici tout le panneau défile (filtres compris) : la liste reste lisible même sur un écran peu haut */
.page-previsions .panneau { overflow-y: auto; }
.liste-previsions { list-style: none; flex: 1 0 auto; display: grid; gap: 10px; align-content: start; padding: 12px; background: var(--surface); }
.prevision { display: grid; gap: 10px; padding: 14px 16px; background: var(--blanc); border: 1px solid var(--trait); border-left: 6px solid var(--jaune); border-radius: var(--rayon-bloc); transition: border-color 0.15s ease-out, background 0.15s ease-out; }
.prevision:hover { border-color: var(--noir); }
.prevision-choisie { border-color: var(--noir); background: var(--jaune-pale); }
.prevision-corps { display: grid; gap: 8px; width: 100%; padding: 0; background: none; border: none; text-align: left; }
.prevision-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.prevision-tete strong { font-size: 15px; font-weight: 900; line-height: 1.3; }
.prevision-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--texte-2); }
.prevision-ligne > span { display: inline-flex; align-items: center; gap: 5px; }
.prevision-ligne .ic { width: 14px; height: 14px; }
.prevision-client { color: var(--noir); font-weight: 700; }
.prevision-pied { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; border-top: 1px solid var(--trait); font-size: 13px; color: var(--texte-2); }
.prevision-pied strong { font-size: 16px; font-weight: 900; color: var(--noir); white-space: nowrap; }
.badge-confiance { gap: 6px; padding-left: 6px; }
/* Veille : date de démarrage, groupes par période, détails de la bulle */
.page-previsions .filtres-lib { width: 88px; }
.page-previsions .panneau { overflow-x: hidden; }
.liste-previsions { grid-template-columns: minmax(0, 1fr); }
.prevision-pied > span { flex: 1 1 180px; min-width: 0; }
.prevision-pied strong { font-size: 14px; white-space: normal; }
.prevision-tete strong { overflow-wrap: anywhere; }
.panneau-tete .segment-dates { display: grid; grid-template-columns: repeat(4, auto); }
.segment-dates button { padding: 0 8px; font-size: 14px; white-space: nowrap; }
.segment-dates button span { display: inline-block; min-width: 22px; margin-left: 2px; padding: 0 6px; background: var(--surface); border-radius: 999px; font-size: 12px; font-weight: 900; }
.segment-dates button[aria-pressed="true"] span { background: var(--blanc); }
.tri-large { display: grid; grid-template-columns: auto 1fr; }
.tri-large select { min-width: 0; width: 100%; }
.plus-filtres summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.plus-filtres[open] { display: grid; gap: 12px; }
.plus-filtres summary span { font-weight: 400; color: var(--texte-2); }
.panneau-tete h1 .etiquette { vertical-align: middle; margin-left: 6px; font-size: 12px; }
.groupe-periode { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 4px 2px; border-bottom: 2px solid var(--noir); }
.groupe-periode:first-child { padding-top: 0; }
.groupe-periode h2 { font-size: 18px; }
.groupe-periode span { font-size: 13px; color: var(--texte-2); }
.prevision-ligne > .date-debut { gap: 6px; padding: 3px 10px; background: var(--noir); color: var(--jaune); border-radius: 999px; font-weight: 900; white-space: nowrap; }
.prevision-ligne > .date-debut-vide { background: var(--blanc); color: var(--noir); border: 1.5px dashed var(--noir); }
.prevision-texte { font-size: 13px; }
.etiquette-nouveau { margin-left: 0; background: var(--jaune); color: var(--noir); }
.bulle-infos .large { grid-column: 1 / -1; }
.bulle-liens { font-size: 13px; color: var(--texte-2); }
.leaflet-container .bulle-liens a { color: var(--noir); font-weight: 700; text-decoration: underline; }
.leaflet-popup-scrolled { border: none; padding-right: 6px; }

/* Tournée : sélection des visites puis itinéraire */
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-sombre { background: transparent; color: var(--blanc); border-color: var(--blanc); }
.btn-sombre:hover:not(:disabled) { background: #2A2A2A; }
.btn[hidden] { display: none; }
.tournee-barre { position: sticky; top: 0; z-index: 5; display: grid; gap: 10px; padding: 14px 20px; background: var(--noir); color: var(--blanc); }
.tournee-barre :focus-visible { outline-color: var(--jaune); }
.tournee-texte { display: grid; }
.tournee-texte strong { font-size: 16px; font-weight: 900; }
.tournee-texte span { font-size: 13px; color: #D0D0D0; }
.tournee-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.tournee-boutons .btn-primaire { margin-left: auto; }
.tournee-chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tournee-chiffres div { display: grid; align-content: start; padding: 10px 12px; background: var(--surface); border-left: 4px solid var(--jaune); border-radius: var(--rayon); }
.tournee-chiffres strong { font-size: 18px; font-weight: 900; white-space: nowrap; }
.tournee-chiffres span { font-size: 12px; color: var(--texte-2); }
.btn-retour { display: inline-flex; align-items: center; gap: 4px; justify-self: start; text-decoration: none; }
.etapes { list-style: none; display: grid; padding: 18px 12px 4px 20px; }
.etape { position: relative; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding-bottom: 18px; }
.etape::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--noir); } /* trait qui relie les étapes */
.etape:last-child::before { display: none; }
.etape-num { z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--noir); color: var(--jaune); font-weight: 900; }
.etape-agence { background: var(--jaune); color: var(--noir); }
.etape-corps { display: grid; gap: 2px; min-width: 0; padding: 6px 0; background: none; border: none; text-align: left; }
.etape-corps strong { font-weight: 900; line-height: 1.3; }
.etape-corps > span { font-size: 13px; color: var(--texte-2); }
.etape-corps > .etape-trajet { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--noir); }
.etape-trajet .ic { width: 15px; height: 15px; }
button.etape-corps:hover strong { text-decoration: underline; text-decoration-color: var(--jaune); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.tournee-actions { display: grid; gap: 10px; padding: 8px 20px 24px; }
.etape-pin { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--noir); color: var(--jaune); border: 2px solid var(--blanc); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); font: 900 14px var(--police); }
.etape-pin-petit { display: inline-grid; width: 20px; height: 20px; font-size: 11px; border-width: 1px; box-shadow: none; }
.etiquette-prospect { margin-left: 0; background: var(--blanc); color: var(--noir); border: 1px solid var(--noir); }
.btn-petit { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.bulle-titre { font-size: 15px; font-weight: 900; line-height: 1.3; }
.bulle-adresse span, .bulle-prospect { color: var(--texte-2); }
.bulle-prospect strong { color: var(--noir); }
.bulle-sur-titre { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; }

/* ------------------------------------------------------------ Pages classiques */
.page { max-width: 1440px; margin: 0 auto; padding: 24px 24px 64px; display: grid; gap: 16px; }
.page-tete, .fiche-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.outils { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.carte-bloc { background: var(--blanc); border-radius: var(--rayon-bloc); box-shadow: var(--ombre); padding: 20px; min-width: 0; }
.bloc-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.table-zone { padding: 0; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { position: sticky; top: 0; padding: 12px 14px; background: var(--surface); text-align: left; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; border-bottom: 2px solid var(--noir); }
.table td { padding: 12px 14px; border-bottom: 1px solid #EDEDED; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; white-space: nowrap; }
.table-cliquable tbody tr { cursor: pointer; transition: background 0.12s ease-out; }
.table-cliquable tbody tr:hover, .table-cliquable tbody tr:focus-visible { background: var(--jaune-pale); }
.table-cliquable tbody tr:focus-visible { outline-offset: -3px; }
.table .chevron { width: 44px; text-align: center; color: var(--texte-2); }
.table td a { font-weight: 700; text-decoration: none; }
.table td a:hover { text-decoration: underline; text-decoration-color: var(--jaune); text-decoration-thickness: 3px; }
.cellule-client { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; }
.cellule-client .code { justify-self: start; }
.materiel { display: block; white-space: nowrap; }
.cellule-chantier { min-width: 210px; }
.table-pied { padding: 16px; text-align: center; border-top: 1px solid #EDEDED; }
.table-compacte td { padding: 10px 0; }
.table-compacte td + td { padding-left: 12px; }
.table-compacte tr.total td { font-weight: 900; font-size: 16px; border-top: 2px solid var(--noir); border-bottom: none; }

/* ------------------------------------------------------------ Fiche client */
.fil { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.fil a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-weight: 700; text-decoration: none; }
.fil a:hover { text-decoration: underline; }
.fil span::before { content: '/'; margin-right: 8px; color: var(--texte-2); }
.fiche-identite { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; background: var(--blanc); border-radius: var(--rayon-bloc); box-shadow: var(--ombre); border-left: 6px solid var(--jaune); }
.kpi-fort { background: var(--jaune); border-left-color: var(--noir); }
.kpi-lib { font-size: 13px; font-weight: 700; }
.kpi strong { font-size: 26px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); }
.kpi-fort .kpi-note { color: var(--noir); }
.kpi-danger { color: var(--danger); font-weight: 700; }
.kpi-danger .ic { width: 16px; height: 16px; }
.jauge { display: block; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.jauge span { display: block; height: 100%; background: var(--noir); border-radius: 3px; }

.fiche-grille { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fiche-carte { scroll-margin-top: calc(var(--barre-h) + 12px); }
.filtres-groupes { display: grid; gap: 8px; margin-bottom: 14px; }
.fiche-carte .carte-zone { height: 440px; border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--trait); }

.echeances { list-style: none; display: grid; gap: 8px; }
.echeance { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: var(--surface); border: none; border-left: 4px solid var(--trait); border-radius: var(--rayon); text-align: left; text-decoration: none; }
a.echeance:hover, button.echeance:hover { background: var(--jaune-pale); }
.echeance-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; background: var(--blanc); border-radius: 50%; }
.echeance-texte { flex: 1; min-width: 0; display: grid; }
.echeance-texte strong { font-weight: 700; }
.echeance-texte span { font-size: 13px; color: var(--texte-2); }
.echeance > .ic { color: var(--texte-2); }
.echeance-danger { border-left-color: var(--danger); }
.echeance-danger .echeance-ic { color: var(--danger); }
.echeance-alerte { border-left-color: var(--alerte); }
.echeances + .btn-lien { margin-top: 8px; }

.infos { display: grid; gap: 10px; }
.infos div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.infos dt { font-size: 13px; color: var(--texte-2); padding-top: 1px; }
.infos dd { font-weight: 700; overflow-wrap: anywhere; }
.infos-titre { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--trait); text-transform: uppercase; font-size: 12px; letter-spacing: 0.06em; }
.contacts { list-style: none; display: grid; gap: 12px; }
.contacts li { display: grid; gap: 2px; }
.contacts li > span { font-size: 13px; color: var(--texte-2); }
.contacts a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.contacts a:hover { text-decoration: underline; }

.onglets-bloc { display: flex; gap: 4px; border-bottom: 1px solid var(--trait); margin: -4px -20px 0; padding: 0 20px; overflow-x: auto; }
.onglets-bloc button { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 48px; padding: 0 16px; background: none; border: none; border-bottom: 4px solid transparent; font-weight: 700; white-space: nowrap; }
.onglets-bloc button:hover { background: var(--surface); }
.onglets-bloc button[aria-selected="true"] { border-bottom-color: var(--jaune); font-weight: 900; }
.onglets-bloc + .table-zone { margin: 0 -20px -20px; }

/* Graphique */
.graphique-legende { display: flex; gap: 16px; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.graphique-legende span, .infobulle span { display: inline-flex; align-items: center; gap: 6px; }
.graphique-legende i, .infobulle i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.graphique-zone { position: relative; }
.graphique svg { display: block; width: 100%; height: auto; }
.graphique .grille { stroke: #E9E9E9; stroke-width: 1; }
.graphique .axe { font-family: var(--police); font-size: 11px; fill: var(--texte-2); }
.graphique .axe-fort { font-weight: 900; fill: var(--noir); }
.graphique .zone { fill: transparent; cursor: default; outline: none; }
.graphique .zone:hover, .graphique .zone:focus { fill: rgba(255, 221, 0, 0.28); }
.infobulle { position: absolute; top: 0; transform: translateX(-50%); display: grid; gap: 2px; padding: 8px 12px; background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); font-size: 13px; white-space: nowrap; pointer-events: none; }
.infobulle[hidden] { display: none; }
.infobulle-ecart { font-weight: 900; }

/* ------------------------------------------------------------ Fenêtres et panneau latéral */
.couche { position: fixed; inset: 0; z-index: 2000; display: grid; }
.couche-fond { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: fondu 0.2s ease-out; }
.couche-boite { position: relative; display: flex; flex-direction: column; background: var(--blanc); box-shadow: var(--ombre-forte); max-height: 100dvh; }
.couche-fenetre { place-items: center; padding: 16px; }
.couche-fenetre .couche-boite { width: min(600px, 100%); max-height: calc(100dvh - 32px); border-radius: var(--rayon-bloc); border-top: 6px solid var(--jaune); animation: monte 0.2s ease-out; }
.couche-panneau { justify-items: end; }
.couche-panneau .couche-boite { width: min(480px, 100%); height: 100dvh; border-left: 6px solid var(--jaune); animation: glisse 0.22s ease-out; }
.couche-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 16px 24px; border-bottom: 1px solid var(--trait); }
.couche-tete h2 { font-size: 20px; }
.couche-corps { padding: 20px 24px 24px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.panneau-statut { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panneau-client { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px; background: var(--surface); border-radius: var(--rayon); font-weight: 900; text-decoration: none; }
.panneau-client span:nth-child(2) { flex: 1; }
.panneau-client:hover { background: var(--jaune-pale); }
.panneau-actions { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--trait); }
.couche-corps .infos-titre { margin: 0; }
@keyframes fondu { from { opacity: 0; } }
@keyframes monte { from { opacity: 0; transform: translateY(12px); } }
@keyframes glisse { from { transform: translateX(40px); opacity: 0; } }

/* ------------------------------------------------------------ Formulaires */
form { display: grid; gap: 16px; }
.champ { display: grid; gap: 6px; min-width: 0; }
.champ label, .groupe legend { font-weight: 700; }
.facultatif { font-weight: 400; font-size: 13px; color: var(--texte-2); }
.champ input, .champ select { width: 100%; height: 46px; padding: 0 12px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
.champ select:disabled { opacity: 0.6; }
.champ [aria-invalid="true"] { border-color: var(--danger); background: #FFF4F4; }
.aide { font-size: 13px; color: var(--texte-2); }
.erreur { font-size: 13px; font-weight: 700; color: var(--danger); }
.erreur[hidden] { display: none; }
.champs-ligne { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.champs-2 { grid-template-columns: 1fr 1fr; }
.groupe { display: grid; gap: 12px; padding: 14px 16px 16px; border: 1px solid var(--trait); border-radius: var(--rayon); }
.groupe legend { padding: 0 6px; }
.adresse-zone { position: relative; }
.suggestions { position: absolute; top: 50px; left: 0; right: 0; z-index: 10; list-style: none; padding: 6px; background: var(--blanc); border: 1px solid var(--noir); border-radius: var(--rayon); box-shadow: var(--ombre-forte); }
.suggestions[hidden] { display: none; }
.suggestions button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; background: none; border: none; border-radius: var(--rayon); text-align: left; }
.suggestions button:hover, .suggestions button:focus { background: var(--jaune-pale); }
.total-estime { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-left: 6px solid var(--jaune); border-radius: var(--rayon); font-weight: 700; }
.total-estime strong { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding-top: 4px; }

/* ------------------------------------------------------------ Notifications */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 2100; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; max-width: min(480px, calc(100vw - 48px)); padding: 12px 16px; background: var(--noir); color: var(--blanc); border-radius: var(--rayon-bloc); border-left: 6px solid var(--jaune); box-shadow: var(--ombre-forte); font-weight: 700; animation: monte 0.2s ease-out; transition: opacity 0.2s ease-in; }
.toast.sort { opacity: 0; }
.toast-ic { color: var(--jaune); display: grid; }
.toast a { color: var(--jaune); white-space: nowrap; }

/* ------------------------------------------------------------ Écrans étroits */
@media (max-width: 1280px) {
  .profil-texte, .btn-reinit span { display: none; }
  .btn-reinit { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .barre { gap: 16px; }
}
@media (max-width: 1100px) {
  .fiche-grille { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .barre { height: auto; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px 0; }
  .marque span { display: none; }
  .onglets { order: 3; width: 100%; height: 48px; }
  .onglets a { flex: 1; justify-content: center; }
  .recherche-globale { max-width: none; }
  .page-carte { grid-template-columns: 1fr; height: auto; }
  .panneau { border-right: none; }
  .liste-clients { max-height: 38dvh; }
  .page-carte .carte-zone { height: 70dvh; order: -1; }
  .page { padding: 16px 16px 48px; }
  .champs-ligne, .champs-2 { grid-template-columns: 1fr; }
  .infos div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 560px) {
  .onglets a { padding: 0 4px; gap: 0; font-size: 14px; }
  .onglets a .ic { display: none; }
  .tournee-chiffres { grid-template-columns: 1fr 1fr; }
  .panneau-tete .outils .tri select { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
