/* Tournées commercial — Voglio Bene
   Feuille de style « façon Apple » (22/10/2026) : couleurs système iOS/macOS, typographie San Francisco,
   cartes en groupes arrondis, contrôles segmentés, barre d'onglets en bas sur iPhone, mode sombre automatique.
   Les noms de classes sont inchangés : app.js n'a pas besoin de les connaître autrement. */

/* Palette « joyeuse mais pas criarde » (22/10/2026, demande de Pascal) : fond crème, corail pour l'action,
   sarcelle = client actif, ambre = à réactiver, prune = prospect, vert = visité / départ. Mode sombre chaud. */
:root {
  --accent: #E8613F;            /* corail : action principale, onglet actif, numéros d'étapes, tracé */
  --accent-texte: #C9471F;      /* corail foncé : liens et boutons texte (lisible sur fond clair) */
  --c-actif: #1FA394;           /* sarcelle : client actif */
  --c-dormant: #F0A33B;         /* ambre : à réactiver */
  --c-prospect: #9D6BD6;        /* prune : prospect */
  --vert: #2FAA6B; --orange: #F0A33B; --rouge: #D9483B; --violet: #9D6BD6; --jaune: #F5C542; --gris-sys: #9A9087;
  --fond: #FAF6F0;              /* crème : fond groupé */
  --fond-2: #FFFFFF;            /* cartes, listes */
  --fond-3: #FFFFFF;            /* champs */
  --texte: #2A231F;
  --texte-2: rgba(70,55,45,.62);
  --texte-3: rgba(70,55,45,.34);
  --sep: rgba(90,70,55,.16);
  --remplissage: rgba(150,120,95,.12);
  --remplissage-2: rgba(150,120,95,.2);
  --teinte-accent: rgba(232,97,63,.12);
  --teinte-vert: rgba(47,170,107,.13);
  --teinte-orange: rgba(240,163,59,.16);
  --teinte-rouge: rgba(217,72,59,.12);
  --teinte-jaune: rgba(245,197,66,.2);
  --barre-fond: rgba(252,249,244,.9);
  --rayon: 12px; --rayon-s: 9px;
  --ombre: 0 1px 2px rgba(60,40,20,.06), 0 8px 24px rgba(60,40,20,.08);
  --ombre-forte: 0 12px 40px rgba(40,25,10,.22);
  /* Alias historiques */
  --bleu: var(--accent); --teinte-bleu: var(--teinte-accent);
  --navy: var(--accent); --navy-clair: var(--accent-texte); --client: var(--c-actif); --prospect: var(--c-dormant);
  --prospect-manuel: var(--c-prospect); --visite: var(--vert); --carte-bord: var(--sep); --gris: var(--texte-2); --gris-clair: var(--texte-3);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #FF7F5C; --accent-texte: #FF9B7E;
    --c-actif: #3DC9B8; --c-dormant: #FFB85C; --c-prospect: #B98AF0;
    --vert: #4CCB85; --orange: #FFB85C; --rouge: #FF6B5E; --violet: #B98AF0; --jaune: #FFD666;
    --fond: #171311; --fond-2: #241F1C; --fond-3: #2E2824;
    --texte: #F6F1EC; --texte-2: rgba(240,228,216,.62); --texte-3: rgba(240,228,216,.34);
    --sep: rgba(255,230,210,.14); --remplissage: rgba(255,220,190,.12); --remplissage-2: rgba(255,220,190,.2);
    --teinte-accent: rgba(255,127,92,.2); --teinte-vert: rgba(76,203,133,.18); --teinte-orange: rgba(255,184,92,.18);
    --teinte-rouge: rgba(255,107,94,.18); --teinte-jaune: rgba(255,214,102,.16);
    --barre-fond: rgba(30,25,22,.86);
    --ombre: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* L'attribut hidden doit toujours gagner, même sur un élément en display:flex (bug corrigé le 22/10/2026). */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.4; color: var(--texte); background: var(--fond);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; height: 100vh; height: 100dvh;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-texte); text-decoration: none; }
a:hover { text-decoration: underline; }
h2, h3, h4 { letter-spacing: -0.01em; }
code { background: var(--remplissage); padding: 1px 6px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ─────────── Barre du haut ─────────── */
.barre {
  display: flex; align-items: center; gap: 20px; padding: 10px 20px;
  background: var(--barre-fond); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep); z-index: 5; position: relative;
}
.marque { display: flex; align-items: center; gap: 12px; }
.pastille {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(150deg, #FFA06B 0%, #E8613F 55%, #D43F6A 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 1px 3px rgba(0,0,0,.18);
  position: relative;
}
.pastille::after {   /* glyphe « itinéraire » : deux points reliés */
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background:
    radial-gradient(circle at 22% 78%, #fff 0 3.2px, transparent 3.6px),
    radial-gradient(circle at 78% 22%, #fff 0 3.2px, transparent 3.6px),
    linear-gradient(135deg, transparent 44%, #fff 46%, #fff 54%, transparent 56%);
}
.titre { font-weight: 700; font-size: 17px; line-height: 1.15; letter-spacing: -0.01em; }
.sous-titre { font-size: 12px; color: var(--texte-2); }

/* Onglets : contrôle segmenté sur grand écran */
.onglets { display: flex; gap: 2px; margin-left: 8px; background: var(--remplissage); border-radius: 9px; padding: 2px; }
.onglet {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  padding: 5px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--texte); line-height: 1.2;
  transition: background .15s ease, box-shadow .15s ease;
}
.onglet .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.onglet:hover { color: var(--texte); }
.onglet.actif { background: var(--fond-2); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .onglet.actif { background: #636366; } }
.synchro-etat { margin-left: auto; font-size: 12px; color: var(--texte-2); }

/* ─────────── Vues ─────────── */
main { flex: 1; min-height: 0; position: relative; }
.vue { display: none; height: 100%; }
.vue.active { display: block; }

/* ─────────── Contrôles communs ─────────── */
.btn {
  border: 0; background: var(--remplissage); color: var(--accent-texte);
  padding: 8px 16px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; line-height: 1.25;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  transition: background .12s ease, transform .08s ease; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--remplissage-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primaire { background: var(--accent); color: #fff; }
.btn-primaire:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { background: var(--teinte-rouge); color: var(--rouge); }
.btn-danger:hover { background: rgba(217,72,59,.2); }
.pleine { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-lien { border: 0; background: transparent; border-radius: 8px; padding: 5px 10px; font-size: 14px; font-weight: 500; color: var(--accent-texte); cursor: pointer; }
.btn-lien:hover { background: var(--teinte-accent); }
.mini-btn {
  border: 0; background: var(--remplissage); border-radius: 7px; cursor: pointer;
  width: 28px; height: 24px; font-size: 12px; line-height: 1; color: var(--texte-2);
}
.mini-btn:hover { background: var(--remplissage-2); color: var(--texte); }
.mini-btn:disabled { opacity: .3; cursor: default; }
.mini-btn.suppr:hover { color: var(--rouge); background: var(--teinte-rouge); }

input[type=text], input[type=search], input[type=date], input[type=tel], input[type=email], input[type=number], select, textarea {
  background: var(--fond-3); color: var(--texte); border: 1px solid var(--sep); border-radius: 10px;
  padding: 8px 12px; font-size: 15px; line-height: 1.3; outline: none;
  transition: box-shadow .12s ease, border-color .12s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,97,63,.25); }
input::placeholder, textarea::placeholder { color: var(--texte-3); }
input[type=search] { -webkit-appearance: none; appearance: none; background: var(--remplissage); border-color: transparent; border-radius: 10px; }
input[type=search]:focus { background: var(--fond-3); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
select { -webkit-appearance: none; appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--texte-2) 50%), linear-gradient(135deg, var(--texte-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.filtre { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; color: var(--texte); }
.aide { font-size: 13px; color: var(--texte-2); margin: 6px 0; line-height: 1.5; }
.pt { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.pt-actif { background: var(--c-actif); }
.pt-dormant { background: var(--c-dormant); }
.pt-prospect { background: var(--c-prospect); }

/* ─────────── Carte ─────────── */
#vue-carte { display: none; flex-direction: column; }
#vue-carte.active { display: flex; }
.carte-outils {
  display: flex; align-items: center; gap: 10px 14px; padding: 10px 20px; flex-wrap: wrap;
  background: var(--barre-fond); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sep); z-index: 4; position: relative;
}
.carte-outils input[type=search] { flex: 1; min-width: 200px; max-width: 340px; }
.carte-outils select { background-color: var(--remplissage); border-color: transparent; font-weight: 500; padding: 7px 30px 7px 12px; font-size: 14px; border-radius: 9px; max-width: 260px; }
.carte-outils select:focus { background-color: var(--fond-3); }
.compteur { font-size: 13px; color: var(--texte-2); margin-left: auto; }
.carte-conteneur { position: relative; flex: 1; min-height: 0; }
#carte { position: absolute; inset: 0; background: var(--fond); }
/* Les encarts posés sur la carte passent au-dessus des calques et contrôles Leaflet (z 400 à 1000). */
.carte-bandeau, .carte-tournee-info, .carte-legende, .carte-vide { z-index: 1100 !important; }
.carte-bandeau {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: calc(100% - 24px);
  background: rgba(28,28,30,.88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; box-shadow: var(--ombre);
}
.carte-bandeau a { color: #FFD60A; }
.carte-vide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--fond); text-align: center; padding: 40px;
}
.carte-vide p { max-width: 460px; color: var(--texte-2); font-size: 15px; line-height: 1.5; }
.carte-tournee-info {
  position: absolute; left: 12px; bottom: 28px; z-index: 6; max-width: calc(100% - 24px);
  background: var(--barre-fond); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  padding: 12px 16px; border-radius: 14px; box-shadow: var(--ombre); font-size: 13px; line-height: 1.5;
}
.carte-tournee-info .cti-nom { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.carte-tournee-info .cti-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.carte-tournee-info a { font-weight: 500; }
.info-fiche a { color: var(--accent-texte); }

/* Leaflet : contrôles et bulles aux formes du système */
.leaflet-container { font-family: inherit; font-size: 13px; }
.leaflet-bar { border: 0 !important; border-radius: 10px !important; box-shadow: var(--ombre) !important; overflow: hidden; }
.leaflet-bar a { background: var(--barre-fond) !important; color: var(--texte) !important; border-bottom: 1px solid var(--sep) !important; width: 32px !important; height: 32px !important; line-height: 32px !important; font-weight: 400 !important; }
.leaflet-bar a:last-child { border-bottom: 0 !important; }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--ombre-forte); background: var(--fond-2); color: var(--texte); }
.leaflet-popup-tip { background: var(--fond-2); }
.leaflet-popup-content { margin: 12px 14px; line-height: 1.45; }
.leaflet-popup-close-button { color: var(--texte-3) !important; font-size: 18px !important; padding: 6px 8px 0 0 !important; }
.leaflet-tooltip { border-radius: 8px; border: 0; box-shadow: var(--ombre); background: var(--fond-2); color: var(--texte); font-weight: 500; }
.leaflet-control-attribution { background: rgba(255,255,255,.7) !important; font-size: 10px !important; color: var(--texte-2) !important; }
.leaflet-control-attribution a { color: var(--texte-2) !important; }
.pt-marker, .num-marker { background: transparent; border: none; }
.pt-marker span {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-sizing: border-box; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.num-marker span {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  border: 2px solid #fff; box-sizing: border-box; font-size: 12px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.num-marker.visitee span { background: var(--vert); }
.flag-marker { background: transparent; border: none; }
.flag-marker span { display: block; width: 30px; height: 30px; line-height: 30px; text-align: center; font-size: 18px; background: #fff; border: 2px solid var(--vert); border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.marker-cluster { background-clip: padding-box; }

/* Fiche client (bulle) */
.info-fiche { font-size: 13px; line-height: 1.5; max-width: 250px; }
.info-fiche .info-nom { font-weight: 700; font-size: 15px; color: var(--texte); letter-spacing: -0.01em; }
.info-fiche .badge, .sel-ligne .badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; color: #fff; margin-left: 4px; vertical-align: 1px; flex-shrink: 0;
}
.badge.actif { background: var(--c-actif); }
.badge.dormant { background: var(--c-dormant); }
.badge.prospect { background: var(--c-prospect); }
.info-fiche .badge.commercial { background: var(--gris-sys); }
.info-fiche a { font-weight: 500; }
.popup-retirer { width: auto; height: auto; padding: 6px 10px; margin-top: 8px; font-size: 13px; color: var(--rouge); background: var(--teinte-rouge); }

/* ─────────── Tournées ─────────── */
.colonnes { display: flex; height: 100%; }
.liste-tournees {
  width: 300px; min-width: 300px; background: var(--fond); border-right: 1px solid var(--sep);
  overflow-y: auto; padding: 16px;
}
.liste-tournees h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500;
  color: var(--texte-2); margin: 22px 0 8px 14px;
}
.liste-tournees .btn-lien { width: 100%; margin-top: 8px; }
.tournee-items { list-style: none; margin: 0; padding: 0; background: var(--fond-2); border-radius: var(--rayon); overflow: hidden; }
.tournee-items:empty { display: none; }
.tournee-item { padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--sep); transition: background .12s ease; }
.tournee-item:last-child { border-bottom: 0; }
.tournee-item:hover { background: var(--remplissage); }
.tournee-item.actif { background: var(--teinte-accent); }
.tournee-item .ti-nom { font-weight: 600; font-size: 15px; }
.tournee-item .ti-meta { font-size: 13px; color: var(--texte-2); margin-top: 2px; display: flex; gap: 8px; }
.tournee-item .ti-etapes { color: var(--texte-3); }
.tournee-items .aide { padding: 10px 14px; }
.liste-tournees.repliee h3, .liste-tournees.repliee .tournee-items { display: none; }

.editeur { flex: 1; min-width: 0; overflow-y: auto; padding: 24px; }
.editeur-vide { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--texte-2); }
.editeur-tete { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.editeur-tete input.nom-tournee {
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; border: 0; border-radius: 8px;
  padding: 4px 6px; margin-left: -6px; flex: 1; min-width: 200px; background: transparent; box-shadow: none;
}
.editeur-tete input.nom-tournee:focus { background: var(--fond-2); box-shadow: 0 0 0 3px rgba(232,97,63,.25); }
.meta-champs { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.meta-champs label { display: flex; flex-direction: column; font-size: 12px; color: var(--texte-2); gap: 4px; font-weight: 500; }
.meta-champs input, .meta-champs select { padding: 7px 12px; font-size: 14px; }
.meta-champs select { padding-right: 30px; }
.editeur-grille { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.editeur-grille > * { min-width: 0; }
@media (max-width: 900px) { .editeur-grille { grid-template-columns: 1fr; } }

.bloc-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }
.bloc-entete h4, .selection h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--texte-2); }
.navigation { margin-bottom: 8px; padding: 12px 14px; background: var(--fond-2); border-radius: var(--rayon); box-shadow: 0 0 0 0.5px var(--sep); }
.navigation .bloc-entete { margin: 0 0 6px; }
.nav-prochaine { font-size: 15px; }
.nav-fini { color: var(--vert); font-weight: 600; }
.nav-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

.trajet-barre, .depart-barre {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 8px; padding: 10px 14px;
  background: var(--fond-2); border-radius: var(--rayon); box-shadow: 0 0 0 0.5px var(--sep); font-size: 14px;
}
.etape.point-ctl .et-corps { display: flex; flex-direction: column; gap: 6px; }
.etape .ligne-point { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.etape .ligne-point label.mini { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--texte-2); }
.etape .ligne-point select { padding: 6px 30px 6px 12px; font-size: 14px; max-width: 100%; }
.etape .adresse-saisie { display: flex; gap: 8px; }
.etape .adresse-saisie input { flex: 1; min-width: 0; }
.etape.arrivee { background: var(--teinte-vert); }
.etape.arrivee .num { background: var(--vert); }
.trajet-barre label.mini, .depart-barre label.mini, .champ label.mini { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--texte-2); }
.trajet-barre select, .depart-barre select { padding: 6px 30px 6px 12px; font-size: 14px; max-width: 100%; }
.segment { display: inline-flex; background: var(--remplissage); border-radius: 9px; padding: 2px; gap: 2px; }
.segment .seg { border: 0; background: transparent; padding: 5px 14px; font-size: 13px; font-weight: 600; border-radius: 7px; cursor: pointer; color: var(--texte); }
.segment .seg.actif { background: var(--fond-2); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .segment .seg.actif { background: #636366; } }
.trajet-question { width: 100%; font-size: 13px; color: var(--texte-2); }
.trajet-question b { color: var(--texte); }
.peage { color: var(--orange); }

.etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; background: var(--fond-2); border-radius: var(--rayon); box-shadow: 0 0 0 0.5px var(--sep); overflow: hidden; }
.etapes:empty { display: none; }
.etapes > .aide { padding: 12px 14px; }
.etape { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--sep); }
.etape:last-child { border-bottom: 0; }
.etape.visitee { background: var(--teinte-vert); }
.etape.depart { background: var(--teinte-vert); }
.etape .num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.etape.visitee .num, .etape.depart .num { background: var(--vert); }
.etape .et-check { display: flex; }
.etape .et-corps { flex: 1; min-width: 0; }
.etape .et-nom { font-weight: 600; font-size: 15px; }
.etape .et-ville { font-size: 13px; color: var(--texte-2); }
.etape .et-cr { width: 100%; margin-top: 6px; border-radius: 8px; font-size: 13px; padding: 6px 10px; resize: vertical; background: var(--remplissage); border-color: transparent; }
.etape .et-cr:focus { background: var(--fond-3); }
.etape .et-actions { display: flex; flex-direction: column; gap: 3px; }
.etape-inter { list-style: none; padding: 6px 14px 6px 52px; font-size: 13px; color: var(--texte-2); background: var(--fond-2); border-bottom: 1px solid var(--sep); }
.etapes-total { margin-top: 10px; padding: 12px 14px; background: var(--fond-2); border-radius: var(--rayon); box-shadow: 0 0 0 0.5px var(--sep); font-size: 14px; line-height: 1.5; }

.optim { margin: 0 0 10px; padding: 12px 14px; background: var(--teinte-jaune); border-radius: var(--rayon); font-size: 14px; line-height: 1.5; }
.optim.optim-ok { background: var(--teinte-vert); }
.optim.optim-erreur { background: var(--teinte-rouge); }
.optim .optim-titre { font-weight: 700; }
.optim .optim-gain { color: var(--vert); font-weight: 600; }
.optim .optim-pire { color: var(--rouge); }
.optim ol { margin: 6px 0 8px 18px; padding: 0; }
.optim ol li { font-size: 13px; }
.optim .optim-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.ajout-etape { position: relative; margin-top: 14px; }
.ajout-etape input { width: 100%; padding: 10px 14px; border-radius: 10px; background: var(--fond-2); border: 1px dashed var(--accent); font-size: 15px; }
.ajout-etape input:focus { border-style: solid; }
.propositions {
  position: absolute; top: 100%; left: 0; right: 0; background: var(--fond-2); border-radius: 12px; box-shadow: var(--ombre-forte);
  max-height: 45vh; overflow-y: auto; z-index: 1200; margin-top: 6px; padding: 4px;
}
.propositions div { padding: 9px 12px; cursor: pointer; font-size: 14px; border-radius: 8px; }
.propositions div:hover, .propositions div.survol { background: var(--remplissage); }
.propositions .p-ville { color: var(--texte-2); font-size: 12px; }

.selection { margin-top: 14px; padding-top: 14px; border-top: 0; }
.tuile { padding: 14px 16px; margin-bottom: 12px; }
.tuile > h4, .selection-entete h4 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--texte-2); }
.tuile > h4 { width: 100%; margin-bottom: 10px; }
.tuile-infos .meta-champs { margin-bottom: 0; }
.selection-entete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.selection-filtres { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.selection-filtres select { padding: 7px 30px 7px 12px; font-size: 14px; background-color: var(--remplissage); border-color: transparent; font-weight: 500; }
.selection-filtres input[type=search] { flex: 1; min-width: 160px; }
.selection-info { margin-top: 8px; }
.selection-liste { margin-top: 8px; max-height: 46vh; overflow-y: auto; background: var(--fond-2); border-radius: var(--rayon); box-shadow: 0 0 0 0.5px var(--sep); }
.sel-ligne { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--sep); cursor: pointer; font-size: 14px; }
.sel-ligne:last-child { border-bottom: 0; }
.sel-ligne:hover { background: var(--remplissage); }
.sel-ligne.choisi { background: var(--teinte-accent); }
.sel-ligne.sans-coord { opacity: .55; }
.sel-ligne input[type=checkbox] { pointer-events: none; }
.sel-ligne .sel-nom { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-ligne .sel-ville { font-size: 12px; color: var(--texte-2); white-space: nowrap; }
.sel-ligne .sel-ordre {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.selection-liste .aide { padding: 10px 12px; }

.editeur-carte { position: sticky; top: 0; }
.carte-tournee-cadre { position: relative; }
#carteTournee { width: 100%; height: 340px; border-radius: var(--rayon); background: var(--fond); box-shadow: 0 0 0 0.5px var(--sep); }
.btn-carte-plein {
  position: absolute; top: 10px; right: 10px; z-index: 1500; border: 0; background: var(--barre-fond);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--accent-texte); cursor: pointer; box-shadow: var(--ombre);
}
.carte-tournee-cadre.plein { position: fixed; inset: 0; z-index: 3000; background: var(--fond-2); display: flex; flex-direction: column; }
.carte-tournee-cadre.plein #carteTournee { width: 100%; height: auto; flex: 1; min-height: 0; border-radius: 0; box-shadow: none; }
.carte-barre {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--barre-fond); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sep); z-index: 2; touch-action: manipulation;
}
.carte-barre .btn { padding: 11px 16px; font-size: 16px; }
.carte-barre-info { font-size: 13px; color: var(--texte-2); }
body.carte-pleine { overflow: hidden; }
.editeur-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

/* ─────────── Navigation : confirmation d'arrivée (feuille en bas) ─────────── */
.nav-confirm { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.nav-confirm-carte { background: var(--fond-2); border-radius: 18px; padding: 20px; width: 100%; max-width: 420px; box-shadow: var(--ombre-forte); }
.nav-confirm-titre { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.nav-confirm-nom { font-size: 15px; margin: 4px 0 2px; }
.nav-confirm-actions { display: flex; gap: 10px; margin-top: 14px; }
.nav-confirm-actions .btn { flex: 1; padding: 13px; font-size: 16px; }

/* ─────────── Réglages ─────────── */
#vue-reglages { overflow-y: auto; padding: 24px; }
#vue-reglages.active { display: block; }
.panneau { background: var(--fond-2); border-radius: var(--rayon); box-shadow: 0 0 0 0.5px var(--sep); padding: 18px 20px; max-width: 640px; margin: 0 auto 18px; }
.panneau.discret { background: transparent; box-shadow: none; text-align: center; }
.panneau h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.panneau h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--texte-2); margin: 22px 0 6px; }
.champ { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.champ > input { flex: 1; min-width: 160px; }
.champ label.mini input { width: 90px; padding: 7px 10px; font-size: 14px; }
.ligne-synchro { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.progression { margin-top: 14px; }
.barre-fond { height: 6px; background: var(--remplissage); border-radius: 999px; overflow: hidden; }
.barre-remplie { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.progression-txt { font-size: 12px; color: var(--texte-2); margin-top: 6px; }
.vehicules { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.vehicule-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vehicule-ligne .v-nom { width: 170px; padding: 7px 12px; font-size: 14px; }
.vehicule-ligne label.mini input { width: 70px; }
.btn-fichier { display: inline-flex; cursor: pointer; }
.btn-fichier input { display: none; }
.import-grille, .import-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.import-grille label, .import-options label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 500; color: var(--texte-2); }
.import-grille select, .import-options select, .import-options input { padding: 7px 12px; font-size: 14px; width: 100%; }
.import-grille select { padding-right: 30px; }
.import-grille label.devine select { border-color: var(--accent); }
.import-apercu { overflow-x: auto; border-radius: 10px; box-shadow: 0 0 0 0.5px var(--sep); max-height: 220px; }
.import-apercu table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.import-apercu th, .import-apercu td { padding: 6px 10px; border-bottom: 1px solid var(--sep); text-align: left; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.import-apercu th { background: var(--fond); font-weight: 600; position: sticky; top: 0; }
.import-resume { font-size: 13px; margin: 8px 0; }

/* ─────────── Formulaire client (fenêtre) ─────────── */
.modal { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-fond { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-boite {
  position: relative; background: var(--fond-2); border-radius: 16px; box-shadow: var(--ombre-forte);
  padding: 20px 22px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-boite h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.modal-boite label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--texte-2); margin-top: 10px; }
.modal-boite input, .modal-boite select, .modal-boite textarea { width: 100%; }
.modal-boite textarea { resize: vertical; }
.modal-boite .deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.modal-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .espace { flex: 1; }

/* ─────────── Toast ─────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: rgba(28,28,30,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--ombre-forte); z-index: 5000;
}

/* ─────────── iPhone et petite fenêtre ─────────── */
@media (max-width: 820px) {
  /* Pas de flou sur la barre du haut : un backdrop-filter ferait de .barre le repère du menu fixé en bas. */
  .barre { padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); gap: 8px 12px; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--fond-2); }
  .synchro-etat { margin-left: auto; text-align: right; max-width: 55%; }
  /* Barre d'onglets en bas, comme une app iPhone */
  .onglets {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; margin: 0; padding: 4px 0 0; border-radius: 0; gap: 0;
    height: calc(50px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--barre-fond); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--sep); justify-content: space-around;
  }
  .onglet { flex: 1; flex-direction: column; gap: 2px; padding: 2px 0; border-radius: 0; font-size: 10px; font-weight: 500; color: var(--gris-sys); background: transparent !important; box-shadow: none !important; }
  .onglet .ico { width: 26px; height: 26px; stroke-width: 1.7; }
  .onglet.actif { color: var(--accent); }
  main { padding-bottom: calc(50px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .carte-outils { padding: 8px 12px; gap: 8px 10px; }
  .carte-outils input[type=search] { flex: 1 1 100%; max-width: none; min-width: 0; }
  .carte-outils select { max-width: 100%; flex: 1 1 42%; }
  .carte-outils #filtreTournee { flex: 1 1 100%; }
  .carte-outils .filtre { font-size: 14px; }
  .carte-outils .compteur { width: 100%; text-align: right; margin: 0; }
  .carte-tournee-info { left: 8px; right: 8px; bottom: 20px; max-width: none; }
  .colonnes { flex-direction: column; }
  .liste-tournees { width: auto; min-width: 0; max-height: 36vh; border-right: 0; border-bottom: 1px solid var(--sep); padding: 12px; }
  .liste-tournees.repliee { max-height: none; }
  .liste-tournees h3 { margin-top: 14px; }
  .editeur { padding: 14px; -webkit-overflow-scrolling: touch; }
  .editeur-vide { height: auto; min-height: 30vh; padding: 24px; text-align: center; }
  .editeur-grille { grid-template-columns: 1fr; gap: 14px; }
  .editeur-carte { position: static; }
  #carteTournee { height: 240px; }
  .editeur-tete input.nom-tournee { font-size: 22px; }
  /* 16 px minimum : évite le zoom automatique d'iOS à la saisie */
  input, select, textarea, .segment .seg, .depart-barre button { font-size: 16px; }
  .carte-outils select, .selection-filtres select, .meta-champs select, .trajet-barre select, .etape .ligne-point select { font-size: 16px; }
  .propositions div { padding: 11px 12px; font-size: 16px; }
  .etape .mini-btn { width: 34px; height: 30px; font-size: 15px; }
  .nav-actions .btn { padding: 12px 16px; font-size: 16px; }
  .selection-liste { max-height: 40vh; }
  .sel-ligne { padding: 10px; font-size: 16px; }
  .sel-ligne .sel-ville { white-space: normal; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-boite { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .modal-boite .deux, .import-grille, .import-options { grid-template-columns: 1fr; }
  #vue-reglages { padding: 14px; }
  .panneau { padding: 16px; }
}

/* Groupes de points (markercluster) aux couleurs de la palette : sarcelle, ambre, corail selon la taille */
.marker-cluster div { font-family: inherit; font-weight: 600; color: #fff; }
.marker-cluster-small { background: rgba(31,163,148,.3); }
.marker-cluster-small div { background: rgba(31,163,148,.88); }
.marker-cluster-medium { background: rgba(240,163,59,.3); }
.marker-cluster-medium div { background: rgba(240,163,59,.9); }
.marker-cluster-large { background: rgba(232,97,63,.3); }
.marker-cluster-large div { background: rgba(232,97,63,.9); }

/* ─────────── Style « tuiles » (22/10/2026, d'après la capture du tableau de bord Aeris) ───────────
   Fond en dégradé doux, blocs en tuiles très arrondies et légèrement translucides, chiffres en grand,
   barre d'onglets flottante sur iPhone. */
:root { --rayon: 22px; --tuile: rgba(255,255,255,.78); --tuile-ombre: 0 2px 4px rgba(70,45,25,.04), 0 12px 32px rgba(70,45,25,.09); }
@media (prefers-color-scheme: dark) { :root { --tuile: rgba(40,34,30,.78); --tuile-ombre: 0 2px 4px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.45); } }
body { background: radial-gradient(circle at 12% -4%, rgba(232,97,63,.14), transparent 42%), radial-gradient(circle at 100% 18%, rgba(31,163,148,.10), transparent 38%), linear-gradient(180deg, #FBF5EE 0%, #F4ECE2 100%); background-attachment: fixed; }
@media (prefers-color-scheme: dark) { body { background: radial-gradient(circle at 12% -4%, rgba(255,127,92,.16), transparent 42%), radial-gradient(circle at 100% 18%, rgba(61,201,184,.10), transparent 38%), linear-gradient(180deg, #1B1613 0%, #120F0D 100%); } }
.liste-tournees, .editeur, #vue-reglages { background: transparent; }
.liste-tournees { border-right: 0; }
.tuile, .panneau, .navigation, .trajet-barre, .etapes, .etapes-total, .selection-liste, .carte-tournee-info, .propositions, .modal-boite, .nav-confirm-carte {
  background: var(--tuile); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: var(--rayon); box-shadow: var(--tuile-ombre);
}
.etapes-total { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
.optim { border-radius: var(--rayon); box-shadow: var(--tuile-ombre); }
.tuile.selection .selection-liste { box-shadow: none; background: rgba(255,255,255,.55); }
@media (prefers-color-scheme: dark) { .tuile.selection .selection-liste { background: rgba(0,0,0,.2); } }
#carteTournee { border-radius: var(--rayon); box-shadow: var(--tuile-ombre); }
.btn { border-radius: 12px; }
.btn-primaire { box-shadow: 0 6px 16px rgba(232,97,63,.28); }
.btn-primaire:hover { box-shadow: 0 8px 20px rgba(232,97,63,.34); }
input[type=text], input[type=search], input[type=date], input[type=tel], input[type=email], select, textarea { border-radius: 12px; }

/* Tournées : tuiles carrées, deux par ligne */
.tournee-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
.tournee-item {
  background: var(--tuile); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 20px; box-shadow: var(--tuile-ombre);
  border: 0; padding: 14px; aspect-ratio: 1 / 1; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tournee-item:hover { background: var(--tuile); transform: translateY(-1px); }
.tournee-item.actif { background: var(--tuile); box-shadow: var(--tuile-ombre), 0 0 0 2.5px var(--accent); }
.tournee-item .ti-haut { display: flex; align-items: baseline; gap: 6px; }
.tournee-item .ti-nb { font-size: 32px; font-weight: 800; line-height: 1; color: var(--accent); letter-spacing: -0.02em; }
.tournee-item .ti-lbl { font-size: 12px; color: var(--texte-2); line-height: 1.2; }
.tournee-item .ti-nom { margin-top: auto; font-weight: 700; font-size: 14px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tournee-item .ti-meta { font-size: 12px; color: var(--texte-2); margin: 0; }
.tournee-items .aide { grid-column: 1 / -1; padding: 6px 2px; }
.liste-tournees h3 { margin-left: 4px; }

/* Totaux de la tournée : trois tuiles chiffrées */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.kpi { background: var(--tuile); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 18px; box-shadow: var(--tuile-ombre); padding: 12px 12px 10px; min-width: 0; }
.kpi-val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-lbl { font-size: 12px; color: var(--texte-2); margin-top: 2px; }
.etapes-total .aide { margin: 8px 2px 0; }

@media (max-width: 820px) {
  /* Barre d'onglets flottante, comme sur la capture */
  .onglets {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); height: 64px; padding: 6px 6px 6px;
    border-radius: 26px; border-top: 0; background: var(--tuile); box-shadow: var(--tuile-ombre); gap: 4px;
  }
  .onglet { border-radius: 20px; padding: 4px 0; }
  .onglet.actif { background: var(--teinte-accent) !important; }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .carte-tournee-info { bottom: 12px; }
  .liste-tournees { max-height: 42vh; }
  .liste-tournees.repliee { max-height: none; }
  .kpi-val { font-size: 18px; }
}
.vehicule-ligne .v-suppr { width: 34px; height: 30px; font-size: 15px; color: var(--rouge); background: var(--teinte-rouge); }

/* ─────────── Module Suivi clients, fiche complète, carte par département (22/10/2026) ─────────── */
#vue-suivi { overflow-y: auto; padding: 20px 24px; }
#vue-suivi.active { display: block; }
.suivi { max-width: 760px; margin: 0 auto; }
.suivi-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.suivi-kpis .kpi { cursor: default; }
.suivi-kpis .kpi.alerte .kpi-val { color: var(--rouge); }
.suivi-filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.suivi-filtres select, .suivi-filtres input { flex: 1 1 200px; min-width: 0; font-size: 14px; }
.suivi-info { margin: 4px 2px 8px; }
.suivi-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.suivi-client {
  background: var(--tuile); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 18px; box-shadow: var(--tuile-ombre);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer;
}
.suivi-client:hover { transform: translateY(-1px); }
.suivi-client .sc-nom { font-weight: 700; font-size: 15px; line-height: 1.2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.suivi-client .sc-ville { font-size: 12px; color: var(--texte-2); }
.suivi-client .sc-chiffres { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin-top: 4px; }
.suivi-client .sc-chiffres b { font-weight: 700; }
.suivi-client .sc-alerte { color: var(--rouge); font-weight: 600; }
.suivi-client .sc-ok { color: var(--vert); font-weight: 600; }
.suivi-client .sc-actions { display: flex; gap: 8px; margin-top: 6px; }
.suivi-client .sc-actions .btn { padding: 5px 10px; font-size: 13px; }
.suivi-liste .aide { grid-column: 1 / -1; }
.fiche-boite { max-width: 560px; }
.fiche-boite h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fiche-boite .fiche-adr { color: var(--texte-2); font-size: 14px; margin: 2px 0 10px; }
.fiche-boite .kpis { margin: 6px 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fiche-boite .fiche-contacts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-bottom: 8px; }
.fiche-boite .fiche-notes { white-space: pre-line; font-size: 14px; background: var(--remplissage); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.fiche-boite h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; font-weight: 500; color: var(--texte-2); margin: 14px 0 6px; }
.visites { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.visite { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--remplissage); border-radius: 10px; font-size: 14px; }
.visite .v-date { font-weight: 700; white-space: nowrap; }
.visite .v-src { font-size: 12px; color: var(--texte-2); }
.visite .v-note { flex: 1; min-width: 0; white-space: pre-line; }
.visite .mini-btn { flex-shrink: 0; }
.visite-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.visite-form input[type=date] { flex: 0 0 150px; }
.visite-form input[type=text] { flex: 1 1 200px; min-width: 0; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.carte-legende {
  position: absolute; top: 12px; left: 12px; z-index: 6; background: var(--tuile); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 14px; box-shadow: var(--tuile-ombre); padding: 10px 12px; font-size: 12px; max-width: 230px;
}
.carte-legende .lg-titre { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.carte-legende .lg-chips { display: flex; gap: 3px; margin-bottom: 3px; }
.carte-legende .lg-chips span { flex: 1; height: 12px; border-radius: 4px; }
.carte-legende .lg-bornes { display: flex; justify-content: space-between; color: var(--texte-2); }
.carte-legende .lg-aide { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--sep); color: var(--texte-2); }
.carte-dept-info { max-height: 45%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.carte-dept-info .cdi-liste { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.carte-dept-info .cdi-client { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--sep); font-size: 13px; }
.carte-dept-info .cdi-client .cdi-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.carte-dept-info .cdi-client .cdi-meta { color: var(--texte-2); white-space: nowrap; }
.carte-dept-info .cdi-client .mini-btn { flex-shrink: 0; width: 30px; height: 26px; color: var(--accent-texte); }
.dept-tooltip { font-size: 12px; }
@media (max-width: 820px) {
  #vue-suivi { padding: 12px; }
  .suivi-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suivi-liste { grid-template-columns: 1fr; }
  .suivi-filtres select, .suivi-filtres input { font-size: 16px; flex-basis: 100%; }
  .carte-legende { top: 8px; left: 8px; max-width: 200px; padding: 8px 10px; }
  .carte-dept-info { max-height: 50%; }
  .fiche-boite .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visite-form input[type=date] { flex-basis: 100%; }
}

/* Barre d'outils de la carte : filtres repliés derrière un bouton sur iPhone (22/10/2026) */
.carte-filtres { display: contents; }
.btn-filtres { display: none; }
@media (max-width: 820px) {
  .btn-filtres { display: inline-flex; flex: 0 0 auto; padding: 8px 14px; }
  .carte-outils input[type=search] { flex: 1 1 auto; }
  .carte-filtres { display: none; width: 100%; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
  .carte-outils.ouvert .carte-filtres { display: flex; }
  .carte-outils.ouvert .btn-filtres { background: var(--teinte-accent); }
  .carte-filtres select { flex: 1 1 42%; max-width: 100%; }
  .carte-filtres #filtreTournee { flex: 1 1 100%; }
}
