/* C.R Terrain — pensé pour un GSM en plein air : contraste fort, grandes cibles tactiles. */
:root {
  --sapin: #173a2b;      /* texte, en-tête */
  --sapin-doux: #4d6457; /* texte secondaire */
  --papier: #f6f7f3;     /* fond */
  --blanc: #ffffff;
  --trait: #d9ded6;
  --jaune: #f5c518;      /* action principale, couleur des machines */
  --jaune-fonce: #d9a900;
  --rouge: #c0392b;
  --orange: #d4870a;
  --vert: #3f8f3a;
  --pp: #1d4f91;         /* Pulinckx */
  --gm: #5b3b8c;         /* Green Machine */
  --nav-h: 64px;
  color-scheme: light;
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  color: var(--sapin);
  background: var(--papier);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--jaune-fonce); outline-offset: 2px; }
.titre, h1, h2 { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; line-height: 1.1; margin: 0; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; margin: 1.6rem 0 .6rem; }

/* ---------- En-tête et navigation ---------- */
.entete {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: var(--sapin); color: var(--blanc);
}
.marque { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.35rem; text-decoration: none; color: var(--jaune); }
.qui { font-weight: 500; }
.qui select {
  background: transparent; color: var(--blanc); border: 1px solid rgba(255,255,255,.5);
  border-radius: 8px; padding: 6px 28px 6px 10px; min-height: 40px;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.qui select option { color: var(--sapin); }

main { padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 32px); max-width: 640px; margin: 0 auto; outline: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(var(--nb-onglets, 5), 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--blanc); border-top: 1px solid var(--trait);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-size: .7rem; font-weight: 600; color: var(--sapin-doux); text-align: center;
}
.nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.nav a[aria-current="page"] { color: var(--sapin); }
.nav a[aria-current="page"]:not(.nav-cr) svg { stroke: var(--vert); }
.nav .nav-cr { margin: 8px 6px; border-radius: 14px; background: var(--jaune); color: var(--sapin); }

/* ---------- Bilan de l'objectif ---------- */
.bilan { margin: 0 0 16px; }
.bilan-grand { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 3.2rem; line-height: 1; }
.bilan-grand small { font-size: 1.4rem; color: var(--sapin-doux); font-weight: 600; }
.bilan p { margin: .3rem 0 0; color: var(--sapin-doux); }
.jauge { height: 10px; border-radius: 5px; background: var(--trait); margin-top: 10px; overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--vert); border-radius: 5px; }

/* ---------- Recherche et filtres ---------- */
.recherche input {
  width: 100%; min-height: 52px; padding: 12px 16px; font-size: 1.05rem;
  border: 2px solid var(--trait); border-radius: 12px; background: var(--blanc);
}
.recherche input:focus { border-color: var(--sapin); outline: none; }
.filtres { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.filtres .filtre { padding: 0 15px; }

/* Pastilles : boutons radio stylés, utilisées partout (filtres et formulaire) */
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille input { position: absolute; opacity: 0; pointer-events: none; }
.pastille span, .filtre {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px;
  border: 2px solid var(--trait); border-radius: 24px; background: var(--blanc);
  font-weight: 600; cursor: pointer; user-select: none;
}
.pastille input:checked + span, .filtre[aria-pressed="true"] { background: var(--sapin); border-color: var(--sapin); color: var(--blanc); }
.pastille input:focus-visible + span { outline: 3px solid var(--jaune-fonce); outline-offset: 2px; }

/* ---------- Liste des clients ---------- */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ligne { display: flex; align-items: stretch; background: var(--blanc); border-radius: 12px; border: 1px solid var(--trait); overflow: hidden; }
.client { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 12px 14px 12px 16px; text-decoration: none; border-left: 6px solid var(--trait); }
.client.u-rouge { border-left-color: var(--rouge); }
.client.u-orange { border-left-color: var(--orange); }
.client.u-vert { border-left-color: var(--vert); }
.client-haut { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.client-nom { font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.client-lieu, .client-suivi { color: var(--sapin-doux); font-size: .92rem; }
.client-suivi.alerte { color: var(--rouge); font-weight: 600; }
.appel { flex: 0 0 60px; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--trait); color: var(--vert); }
.appel svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.badge { flex: none; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; color: var(--blanc); }
.badge.PP { background: var(--pp); }
.badge.GM { background: var(--gm); }

/* ---------- Rappels ---------- */
.rappels { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.rappel { display: block; padding: 12px 14px; border-radius: 12px; background: #fff7d6; border: 1px solid #f0dc8c; text-decoration: none; }
.rappel.retard { background: #fbe9e6; border-color: #eab9b1; }
.rappel strong { display: block; }
.rappel span { color: var(--sapin-doux); font-size: .92rem; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 12px; border: 2px solid var(--sapin);
  background: var(--blanc); font-weight: 600; text-decoration: none; cursor: pointer;
}
.bouton.principal { width: 100%; min-height: 60px; font-size: 1.15rem; background: var(--jaune); border-color: var(--jaune); color: var(--sapin); }
.bouton.principal:active { background: var(--jaune-fonce); }
.bouton:disabled { opacity: .5; cursor: default; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 16px 0; }

/* ---------- Fiche client ---------- */
.fiche-tete { display: grid; gap: 6px; }
.fiche-tete .client-haut { flex-wrap: wrap; }
.fiche-infos { color: var(--sapin-doux); margin: 0; }
.encart { margin: 16px 0; padding: 14px 16px; border-radius: 12px; background: var(--blanc); border: 1px solid var(--trait); }
.encart p { margin: 0; }
.encart .bouton { margin-top: 10px; }
.historique { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--trait); margin-left: 6px; }
.historique li { position: relative; padding: 0 0 18px 18px; }
.historique li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--vert); border: 2px solid var(--papier); }
.historique .quand { font-weight: 600; }
.historique .quoi { color: var(--sapin-doux); font-size: .92rem; }
.historique p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Formulaire C.R ---------- */
.formulaire { display: grid; gap: 22px; }
.formulaire fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.formulaire legend, .formulaire .etiquette { display: block; font-weight: 600; margin-bottom: 8px; padding: 0; }
.formulaire textarea, .formulaire input[type="date"] {
  width: 100%; padding: 12px 14px; border: 2px solid var(--trait); border-radius: 12px; background: var(--blanc); font-size: 1.05rem;
}
.formulaire input[type="date"] { min-height: 52px; }
.formulaire textarea { min-height: 150px; resize: vertical; }
.formulaire textarea:focus, .formulaire input[type="date"]:focus { border-color: var(--sapin); outline: none; }
.aide { font-size: .88rem; color: var(--sapin-doux); margin: 6px 0 0; }
.offre { border: 2px dashed var(--trait); border-radius: 12px; padding: 4px 14px; }
.offre summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.offre[open] { padding-bottom: 14px; }
.offre fieldset + fieldset { margin-top: 14px; }
.cr-client { margin: 6px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.envoi { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px); }

/* ---------- Fin d'année ---------- */
.compteurs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.compteur { padding: 12px 14px; border-radius: 12px; background: var(--blanc); border: 1px solid var(--trait); }
.compteur b { display: block; font-family: "Barlow Condensed", sans-serif; font-size: 2rem; line-height: 1; }
.compteur span { color: var(--sapin-doux); font-size: .9rem; }
.tournee { display: grid; gap: 10px; padding: 12px 14px; background: var(--blanc); border-radius: 12px; border: 1px solid var(--trait); }
.tournee a { text-decoration: none; }
.tournee .cadeau { font-size: .92rem; color: var(--sapin-doux); }
.tournee .boutons { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.tournee .bouton { min-height: 48px; }
.tournee .depose { background: var(--vert); border-color: var(--vert); color: var(--blanc); }
.tournee.fait { opacity: .75; }

/* ---------- États ---------- */
.chargement, .vide { color: var(--sapin-doux); padding: 24px 4px; }
.squelette { height: 72px; border-radius: 12px; background: linear-gradient(90deg, #eceee9, #f4f5f1, #eceee9); background-size: 200% 100%; animation: brille 1.2s infinite; }
@keyframes brille { to { background-position: -200% 0; } }
.erreur { padding: 16px; border-radius: 12px; background: #fbe9e6; border: 1px solid #eab9b1; }
.erreur p { margin: 0 0 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--sapin); color: var(--blanc); font-weight: 600; transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.echec { background: var(--rouge); }

@media (prefers-reduced-motion: reduce) {
  .squelette { animation: none; }
  .toast { transition: none; }
}

.pied { margin: 28px 0 0; font-size: .88rem; color: var(--sapin-doux); text-align: center; }

/* ---------- Page de connexion ---------- */
.connexion { min-height: 100vh; display: grid; place-content: center; gap: 18px; padding: 24px; max-width: 420px; margin: 0 auto; }
.connexion .marque { font-size: 2.6rem; }
.connexion p { margin: 0; color: var(--sapin-doux); }
.connexion .bouton.google { width: 100%; min-height: 60px; background: var(--blanc); border-color: var(--trait); font-size: 1.1rem; }
.connexion .bouton.google svg { width: 22px; height: 22px; }
.connexion .erreur { margin: 0; }

/* ---------- Mes C.R ---------- */
.compteurs.trois { grid-template-columns: repeat(3, 1fr); }
.compteurs.trois .compteur { padding: 10px 12px; }
.jour { margin: 20px 0 8px; font-size: .95rem; font-weight: 600; color: var(--sapin-doux); }
.jour::first-letter { text-transform: uppercase; }
.cr-item { display: grid; gap: 3px; padding: 12px 14px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; text-decoration: none; }
.cr-item + .cr-item { margin-top: 8px; }
.cr-item .quoi { color: var(--sapin-doux); font-size: .92rem; }
.cr-item .remarque { margin: 4px 0 0; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cr-item .rappel-prevu { font-size: .88rem; color: var(--orange); font-weight: 600; }
.cr-item .sans-fiche { font-size: .82rem; color: var(--sapin-doux); font-style: italic; }

.badge.PR { background: #8a5a14; }
.badge.pro { background: var(--sapin); }
.bouton.secondaire { width: 100%; margin: 10px 0 0; border-style: dashed; border-color: var(--sapin-doux); }
.bouton.danger { width: 100%; background: transparent; border-color: var(--rouge); color: var(--rouge); }
.formulaire .champ {
  width: 100%; min-height: 52px; padding: 12px 14px; border: 2px solid var(--trait); border-radius: 12px; background: var(--blanc); font-size: 1.05rem;
}
.formulaire .champ:focus { border-color: var(--sapin); outline: none; }

/* Fiche : informations, machines, demandes */
.infos { margin: 16px 0; padding: 4px 16px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; }
.infos .info { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.infos .info:last-child { border-bottom: 0; }
.infos dt { color: var(--sapin-doux); font-size: .92rem; }
.infos dd { margin: 0; overflow-wrap: anywhere; }
.machines, .demandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.machines li, .demandes li { padding: 10px 14px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; display: grid; gap: 2px; }
.machines span { color: var(--sapin-doux); font-size: .9rem; }
.demandes .quand { font-weight: 600; font-size: .9rem; }
.demandes p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.historique .modifier, .cr-item .modifier { font-weight: 600; font-size: .9rem; color: var(--vert); }
.historique .modifier { margin-left: 8px; }

/* Mes C.R : carte avec lien vers la fiche + lien de modification */
.cr-item { display: grid; gap: 8px; }
.cr-lien { display: grid; gap: 3px; text-decoration: none; }
.cr-item .modifier { justify-self: start; padding: 6px 0; }

/* Bascule Mon portefeuille / Toute l'équipe */
.bascule { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--trait); border-radius: 14px; }
.bascule a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 11px; text-decoration: none; font-weight: 600; color: var(--sapin-doux); }
.bascule a[aria-current="page"] { background: var(--blanc); color: var(--sapin); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.bandeau { display: block; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #efe6f7; border: 1px solid #d8c6ea; text-decoration: none; }
.bandeau strong { display: block; }
.bandeau span { color: var(--sapin-doux); font-size: .92rem; }
.lien-bas { display: block; text-align: center; margin: 18px 0 0; font-weight: 600; color: var(--vert); }
.masque { color: var(--sapin-doux); font-style: italic; }

/* Agenda */
.rdv { display: grid; grid-template-columns: 4.2em 1fr; gap: 10px; padding: 12px 14px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; text-decoration: none; }
.rdv + .rdv { margin-top: 8px; }
.rdv .heure { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.rdv .titre { font-weight: 600; overflow-wrap: anywhere; }
.rdv .type { font-size: .82rem; font-weight: 600; color: var(--vert); }
.rdv p { margin: 3px 0 0; color: var(--sapin-doux); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.jour.aujourdhui { color: var(--vert); }
.deux-champs { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.case { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.case input { width: 22px; height: 22px; accent-color: var(--sapin); }

/* Bons de commande */
.bon { display: grid; gap: 3px; padding: 12px 14px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; }
.bon + .bon { margin-top: 8px; }
.bon .ligne-haut { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bon .montant { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.bon .quoi { color: var(--sapin-doux); font-size: .92rem; }
.bon .etat { justify-self: start; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--trait); }
.bon .etat.attente { background: #fff1d6; }
.bon .etat.facturer { background: #fbe0dc; }
.bon .etat.fait { background: #dff0dc; }
.bon .liens { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: .9rem; font-weight: 600; }
.bon .liens a { color: var(--vert); }
.bon .remarque { margin: 4px 0 0; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.bon .admin { font-size: .85rem; color: var(--sapin-doux); }
.compteurs.trois .compteur b { font-size: 1.55rem; }

button.client.choix { width: 100%; text-align: left; background: none; border: 0; border-left: 6px solid var(--trait); font: inherit; color: inherit; cursor: pointer; }

.client-meta { color: var(--sapin-doux); font-size: .88rem; overflow-wrap: anywhere; }
.lien-details { display: inline-block; margin: 8px 2px 0; padding: 4px 0; background: none; border: 0; color: var(--vert); font-weight: 600; font-size: .92rem; cursor: pointer; }
.details { display: grid; gap: 8px; margin-top: 8px; }
.details .crit { width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--trait); border-radius: 12px; background: var(--blanc); font-size: 1rem; }
.details .crit:focus { border-color: var(--sapin); outline: none; }
#resultats > .aide, #res-client > .aide { margin: 12px 2px 8px; }

/* Chiffre d'affaires */
.ca { padding: 12px 14px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; }
.ca-resume { margin: 0 0 6px; font-weight: 600; }
.ca-liste { list-style: none; margin: 0; padding: 0; }
.ca-annee { padding: 10px 0; border-bottom: 1px solid var(--trait); display: grid; gap: 6px; }
.ca-annee:last-child { border-bottom: 0; }
.ca-annee.vide-annee { opacity: .55; }
.ca-haut { display: flex; align-items: baseline; gap: 10px; }
.ca-an { font-weight: 600; min-width: 4.5em; }
.ca-an small { font-weight: 500; color: var(--sapin-doux); font-size: .78rem; }
.ca-total { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.25rem; margin-left: auto; }
.ca-evol { font-size: .82rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.ca-evol.hausse { background: #dff0dc; color: #2d6a2e; }
.ca-evol.baisse { background: #fbe0dc; color: #9c2b20; }
.ca-barre { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #eef0ec; }
.ca-barre span { display: block; height: 100%; }
.ca-detail, .ca-legende { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .86rem; color: var(--sapin-doux); }
.ca-detail i, .ca-legende i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.ca-legende { margin-top: 8px; }

.lien-modifier { background: none; border: 0; padding: 0 0 0 6px; color: var(--vert); font-weight: 600; font-size: .9rem; cursor: pointer; }
.attente-carfac { display: inline-block; margin-left: 6px; font-size: .78rem; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: #fff1d6; color: #8a5a14; }
#info-type .pastilles { margin: 4px 0 6px; }
#info-type .pastille span { min-height: 42px; padding: 0 14px; }
.deux-boutons { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 8px; }
.deux-boutons .bouton.principal { min-height: 52px; font-size: 1rem; }
#info-type { grid-template-columns: 1fr; }
#info-type:has(.pastilles) dt { margin-bottom: 4px; }

/* Parc machines groupé par marque */
.marques { display: grid; gap: 8px; }
.marque-machine { background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; }
.marque-machine summary { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.marque-machine summary::-webkit-details-marker { display: none; }
.marque-machine summary::after { content: "▾"; grid-column: 2; grid-row: 2; justify-self: end; color: var(--sapin-doux); transition: transform .15s; }
.marque-machine[open] summary::after { transform: rotate(180deg); }
.marque-nom { font-weight: 700; }
.marque-nb { justify-self: end; min-width: 28px; text-align: center; font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: 10px; background: var(--sapin); color: var(--blanc); }
.marque-resume { color: var(--sapin-doux); font-size: .88rem; }
.marque-machine .machines { padding: 0 10px 10px; }
.marque-machine .machines li { background: var(--papier); }

.bon a.client-nom { text-decoration: none; color: var(--sapin); }
.bon a.client-nom::after { content: " ›"; color: var(--vert); }
.liens .a-relier { color: #8a5a14; }
.machines li .etat { justify-self: start; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--trait); }
.machines li .etat.attente { background: #fff1d6; }
.machines li .etat.facturer { background: #fbe0dc; }
.machines li .etat.fait { background: #dff0dc; }
select.champ, .filtres-annuaire select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sapin) 50%), linear-gradient(135deg, var(--sapin) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.bandeau.fusion { background: #fff1d6; border-color: #f0dc8c; }
button.client.choix:disabled { opacity: .5; cursor: not-allowed; }

.comptes ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: .93rem; }
.comptes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.client-haut .badge + .badge { margin-left: -4px; }

.encart.dedie { margin: 12px 0 0; }
.dedie-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.dedie-titre span { color: var(--sapin-doux); font-size: .92rem; }
.dedie .filtre { min-height: 42px; padding: 0 14px; }

/* Contacts */
.contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact { padding: 10px 14px; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; display: grid; gap: 4px; }
.contact-haut { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.contact-fonction { font-size: .8rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: #e6efe3; color: #2d6a2e; }
.contact-liens { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.contact-liens a { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; color: var(--vert); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact-liens svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.contact-plus { font-size: .85rem; color: var(--sapin-doux); }
.plus-contacts { margin-top: 8px; }
.plus-contacts summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--vert); cursor: pointer; }
.via-contact { font-size: .86rem; font-weight: 600; color: #8a5a14; }

.cr-item.non-relie { border-left: 6px solid var(--rouge); }
.relie-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pastille-alerte { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #fbe0dc; color: #9c2b20; }
.filtre.alerte-filtre { border-color: #eab9b1; color: #9c2b20; }
.filtre.alerte-filtre[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }

.bascule.trois { grid-template-columns: repeat(3, 1fr); }
.filtres-annuaire { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.filtres-annuaire label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--sapin-doux); }
.filtres-annuaire .champ { min-height: 46px; padding: 8px 34px 8px 12px; border: 2px solid var(--trait); border-radius: 12px; background-color: var(--blanc); font-size: .98rem; width: 100%; color: var(--sapin); }
#resume { margin: 10px 2px 8px; font-weight: 600; color: var(--sapin); }
.filtres-annuaire .large { grid-column: 1 / -1; }

.resume-ligne { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.resume-ligne #resume { margin: 10px 2px 8px; }
.filtres-annuaire .case { font-size: .95rem; color: var(--sapin); font-weight: 500; }
.filtres-annuaire label.case { display: flex; align-items: center; gap: 10px; }

.maj-etat { display: block; margin-top: 8px; font-weight: 600; color: var(--sapin); }
.maj-etat:empty { display: none; }
.erreur-texte { color: var(--rouge); }

/* Bouton Retour (fiches et écrans secondaires) */
.retour { display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0 6px -4px; padding: 0 8px; background: none; border: 0;
  font: inherit; font-weight: 600; color: var(--vert); cursor: pointer; }
/* Les zones repliées restent cachées même si leur style impose un affichage */
.details[hidden], .zone-choix[hidden], [hidden] { display: none !important; }

.badge.AMR { background: #1f8a7a; color: #fff; }
.facture-par { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--sapin-doux); margin-bottom: 4px; }

/* Carte et tournée */
.carte { height: 62vh; min-height: 320px; border-radius: 12px; border: 1px solid var(--trait); margin-top: 8px; z-index: 0; }
.legende-carte { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; color: var(--sapin-doux); align-items: center; }
.legende-carte i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: -6px; }
.legende-carte i.approx { background: #fff; border: 2px dashed #555; }
.popup-client { font-family: Barlow, system-ui, sans-serif; font-size: .95rem; line-height: 1.35; }
.popup-actions { display: flex; gap: 10px; margin-top: 8px; }
.popup-actions a, .popup-actions button { flex: 1; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px;
  border: 2px solid var(--sapin); background: #fff; color: var(--sapin); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.popup-actions button { background: var(--jaune); border-color: var(--jaune); }
.tournee { list-style: none; counter-reset: arret; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.tournee li { counter-increment: arret; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 44px;
  position: relative; background: var(--blanc); border: 1px solid var(--trait); border-radius: 12px; }
.tournee li::before { content: counter(arret); position: absolute; left: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--sapin);
  color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.tournee-boutons { display: flex; gap: 6px; }
.tournee-boutons button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--trait); background: #fff; font-size: 1.05rem; cursor: pointer; }
.tournee-boutons button:disabled { opacity: .35; }

.lien-fichier { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--vert); cursor: pointer; }
.lien-fichier:disabled { color: var(--sapin-doux); }

/* Administration */
.lien-admin { color: var(--jaune); font-weight: 700; text-decoration: none; margin-right: 10px; font-size: .95rem; }
.qui { display: flex; align-items: center; }
.vues-actives { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .85rem; }
.vues-actives .oui { color: #2d6a2e; }
.vues-actives .non { color: #9c2b20; opacity: .7; }
.lien-modifier.supprimer { color: var(--rouge); }
.formulaire .case { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 1rem; }
.formulaire .case input { width: 22px; height: 22px; }
.liste-acces { display: grid; gap: 10px; }
#nav a[hidden] { display: none !important; }
