/* =========================================================================
   Mairies de France — feuille de style
   Thème clair/sombre automatique, mobile d'abord.
   ========================================================================= */

:root {
  color-scheme: light;

  --fond:          #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #f0f2f5;
  --surface-3:     #e6e9ee;
  --bord:          #dfe3ea;
  --bord-fort:     #c7cdd8;

  --texte:         #14171c;
  --texte-2:       #575e6b;
  --texte-3:       #7b8494;

  /* Charte ED COLLECTIVITÉS : marine #00243D, rouge #EC2B3A */
  --marine:        #00243d;
  --marine-clair:  #0a3a5c;

  --accent:        #1565a8;   /* liens et boutons — 6,1:1 sur blanc */
  --accent-fort:   #0f4c80;
  --accent-doux:   #e7f0f8;
  --accent-contour:#b3d0e6;

  --chaud:         #ec2b3a;   /* rouge de la marque */
  --chaud-texte:   #c41f2b;   /* même rouge, lisible en texte */
  --chaud-doux:    #fdecee;

  --serie:         #1565a8;   /* couleur des graphiques (validée) */

  --barre-fond:    #00243d;
  --barre-texte:   #ffffff;
  --barre-texte-2: #a9c4d8;
  --sur-accent:    #ffffff;

  --ombre-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --ombre-2: 0 4px 12px rgba(16,24,40,.07), 0 2px 4px rgba(16,24,40,.04);

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;

  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --fond:        #0f1115;
    --surface:     #171a20;
    --surface-2:   #1e222a;
    --surface-3:   #262b35;
    --bord:        #2a2f3a;
    --bord-fort:   #3a4150;

    --texte:       #f2f4f7;
    --texte-2:     #a8b0be;
    --texte-3:     #7a8394;

    --marine:      #00243d;
    --marine-clair:#0a3a5c;

    --accent:      #5aa3e8;
    --accent-fort: #8bbef0;
    --accent-doux: #10263b;
    --accent-contour:#24486e;

    --chaud:       #f2646f;
    --chaud-texte: #f2646f;
    --chaud-doux:  #2a1418;

    --serie:       #2f83cc;

    --barre-fond:  #00243d;
    --barre-texte: #ffffff;
    --barre-texte-2: #a9c4d8;

    /* sur le bleu clair du thème sombre, le texte doit être foncé */
    --sur-accent:  #00243d;

    --ombre-1: 0 1px 2px rgba(0,0,0,.4);
    --ombre-2: 0 6px 18px rgba(0,0,0,.45);
  }
}

/* ---------------------------------------------------------------- base -- */

*, *::before, *::after { box-sizing: border-box; }

/* l'attribut hidden doit toujours l'emporter sur un display: de classe */
[hidden] { display: none !important; }

/* Les enfants de grille ont min-width:auto par défaut, ce qui laisse un tableau
   large déborder toute la page sur mobile. On neutralise systématiquement. */
.fiche-corps > *, .colonne-principale > *, .colonne-laterale > *,
.deux-colonnes > *, .resultats > *, .tuiles > *, .filtres > *,
.bloc, .carte { min-width: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -.011em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.ic { width: 17px; height: 17px; flex: 0 0 auto; }
.ic-mini { width: 13px; height: 13px; }
.mono { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.droite { text-align: right; }
.tronque { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------- barre --- */

.barre {
  position: sticky; top: 0; z-index: 50;
  background: var(--barre-fond);
  border-bottom: 3px solid var(--chaud);
  /* En application installée sur iPhone, la vue passe SOUS la barre d'état.
     On réserve sa hauteur : le marine remonte derrière l'heure et le réseau,
     et le contenu du bandeau descend juste en dessous. */
  padding-top: env(safe-area-inset-top, 0px);
}
.barre-int {
  max-width: 1120px; margin: 0 auto;
  padding: 10px 20px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 20px;
}

.marque { display: flex; align-items: center; gap: 10px; color: inherit; }
.marque:hover { text-decoration: none; }
.marque-logo { height: 26px; width: auto; display: block; flex: 0 0 auto; }
.marque-txt {
  display: flex; flex-direction: column; line-height: 1.2;
  padding-left: 12px; margin-left: 2px;
  border-left: 1px solid rgba(255,255,255,.22);
}
.marque-txt strong { font-size: 14.5px; font-weight: 640; letter-spacing: -.01em;
                     color: var(--barre-texte); }
.marque-txt small { font-size: 11.5px; color: var(--barre-texte-2); }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r-s);
  color: var(--barre-texte-2); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.actif { background: rgba(255,255,255,.14); color: #fff; }

.compte { display: flex; align-items: center; gap: 8px; padding-left: 14px;
          border-left: 1px solid rgba(255,255,255,.22); }
.compte-nom { font-size: 13.5px; color: var(--barre-texte-2); max-width: 150px;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-ic {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-s); color: var(--barre-texte-2);
}
.btn-ic:hover { background: rgba(255,255,255,.12); color: #fff; }

@media (max-width: 720px) {
  .barre-int { gap: 10px; padding: 9px 14px; }
  .marque-txt small { display: none; }
  .nav a span { display: none; }
  .nav a { padding: 8px 10px; }
  .compte-nom { display: none; }
  .compte { padding-left: 6px; }
}

/* Sur les écrans les plus étroits encore en service (320 px), le bandeau
   dépassait de 3 px : logo, nom du site, trois onglets et le bouton de
   déconnexion ne tiennent plus. On resserre plutôt que de laisser la page
   entière défiler latéralement. */
@media (max-width: 360px) {
  .barre-int { gap: 6px; padding: 9px 10px; }
  .marque-txt { padding-left: 8px; }
  .marque-txt strong { font-size: 13px; }
  .marque-logo { height: 22px; }
  .nav { gap: 0; }
  .nav a { padding: 8px; }
  .compte { padding-left: 4px; }
}

/* --------------------------------------------------------------- page --- */

.page {
  max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 720px) {
  .page {
    padding: 16px 14px 48px;
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }
}

.titre-page { font-size: 24px; letter-spacing: -.02em; }
.sous-titre-page { color: var(--texte-3); font-size: 13.5px; margin-top: 4px; }

.pied {
  max-width: 1120px; margin: 0 auto; padding: 0 20px 32px;
  color: var(--texte-3); font-size: 12.5px; text-align: center;
}

/* ------------------------------------------------------------ boutons --- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-s);
  border: 1px solid var(--bord-fort); background: var(--surface);
  color: var(--texte); font: inherit; font-size: 14px; font-weight: 520;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-principal {
  background: var(--accent); border-color: var(--accent); color: var(--sur-accent);
  font-weight: 600;
}
.btn-principal:hover { background: var(--accent-fort); border-color: var(--accent-fort);
                       color: var(--sur-accent); }
.btn-discret { background: transparent; color: var(--texte-2); }
.btn-large { width: 100%; justify-content: center; padding: 11px 16px; font-size: 15px; }
.btn.desactive { opacity: .4; pointer-events: none; }

.lien-discret { color: var(--texte-3); font-size: 12.5px; }
.lien-discret:hover { color: var(--accent); }

/* ----------------------------------------------------------- connexion -- */

.connexion {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.connexion-carte {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r-l); padding: 32px 28px;
  box-shadow: var(--ombre-2);
}
.connexion-marque { text-align: center; margin-bottom: 26px; }
.connexion-logo { width: 190px; max-width: 70%; height: auto; margin: 0 auto 20px; display: block; }
.connexion-marque h1 { font-size: 17px; font-weight: 620; }
.connexion-marque p { color: var(--texte-3); font-size: 13.5px; margin-top: 3px; }
.connexion { background:
   radial-gradient(1100px 520px at 50% -10%, var(--accent-doux), transparent 70%); }

.connexion-carte label {
  display: block; font-size: 13px; font-weight: 560;
  color: var(--texte-2); margin: 14px 0 6px;
}
.connexion-carte input[type=text], .connexion-carte input[type=password] {
  width: 100%; padding: 10px 12px; font: inherit;
  background: var(--surface-2); color: var(--texte);
  border: 1px solid var(--bord); border-radius: var(--r-s);
}
.connexion-carte input:focus { border-color: var(--accent); background: var(--surface); }
.connexion-carte button { margin-top: 22px; }
.connexion-aide { margin-top: 18px; text-align: center; color: var(--texte-3); font-size: 12.5px; }

.alerte {
  background: var(--chaud-doux); color: var(--chaud);
  border: 1px solid color-mix(in srgb, var(--chaud) 30%, transparent);
  border-radius: var(--r-s); padding: 10px 12px; font-size: 13.5px;
}

/* ---------------------------------------------------------- recherche --- */

.chercher { margin-bottom: 18px; display: grid; gap: 10px;
            grid-template-columns: 1fr auto; align-items: start; }

.chercher-champ { position: relative; }
.chercher-ic {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--texte-3); width: 18px; height: 18px; pointer-events: none;
}
.chercher input[type=search] {
  width: 100%; padding: 13px 40px 13px 42px;
  font: inherit; font-size: 15.5px;
  background: var(--surface); color: var(--texte);
  border: 1px solid var(--bord); border-radius: var(--r-m);
  box-shadow: var(--ombre-1);
  -webkit-appearance: none; appearance: none;
}
.chercher input[type=search]::-webkit-search-cancel-button { display: none; }
.chercher input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-doux); }

.chercher-vider {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--texte-2);
  font-size: 17px; line-height: 1; cursor: pointer;
}

.btn-filtres { position: relative; padding: 13px 16px; }
.btn-filtres .point {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-left: 2px; vertical-align: 2px;
}

.suggestions {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r-m); box-shadow: var(--ombre-2);
  overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.suggestion {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; color: inherit; border-bottom: 1px solid var(--bord);
}
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion.survol { background: var(--surface-2); text-decoration: none; }
.suggestion-txt { min-width: 0; flex: 1; }
.suggestion-titre { font-weight: 560; font-size: 14.5px; display: block; }
.suggestion-detail { color: var(--texte-3); font-size: 12.5px; display: block;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filtres {
  grid-column: 1 / -1;
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r-m); padding: 16px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.filtre label {
  display: block; font-size: 12px; font-weight: 580; text-transform: uppercase;
  letter-spacing: .03em; color: var(--texte-3); margin-bottom: 5px;
}
.filtre select, .filtre input[type=text], .filtre input[type=number] {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px;
  background: var(--surface-2); color: var(--texte);
  border: 1px solid var(--bord); border-radius: var(--r-s);
}
/* Le filtre « Commercial » affiche des noms entiers suivis d'un compteur —
   « Jean-Philippe COLONNA (844) ». Dans une colonne de 180 px la liste fermée
   coupe le nom en plein milieu, alors on lui en donne deux dès que la grille
   en compte assez. Sur une seule colonne, la largeur pleine suffit déjà. */
@media (min-width: 620px) { .filtre-large { grid-column: span 2; } }

.paire { display: flex; align-items: center; gap: 6px; }
.paire span { color: var(--texte-3); }
.filtre-cases { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.case { display: flex !important; align-items: center; gap: 8px;
        font-size: 14px; text-transform: none; letter-spacing: 0;
        color: var(--texte); font-weight: 450; margin: 0; cursor: pointer; }
.case input { width: 16px; height: 16px; accent-color: var(--accent); }
/* « Appliquer » et « Réinitialiser » occupaient une colonne de la grille des
   filtres, large de 181 px sur téléphone et de 215 px sur grand écran, alors
   qu'il leur en faut 238 côte à côte : le second débordait de la carte. Ils
   prennent désormais leur propre ligne, sur toute la largeur, comme le pied
   d'un formulaire — la place ne manque plus à aucune taille d'écran. */
.filtre-actions {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 8px;
  padding-top: 14px; border-top: 1px solid var(--bord);
}
.filtre-actions .btn { white-space: nowrap; }
@media (max-width: 620px) {
  /* sur téléphone, deux boutons pleine largeur valent mieux que deux boutons
     serrés dans le coin droit */
  .filtre-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 620px) {
  .chercher { grid-template-columns: 1fr; }
  .btn-filtres { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------- résultats --- */

.barre-resultats {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 4px 0 14px;
}
.compte-resultats { color: var(--texte-2); font-size: 14px; }
.compte-resultats strong { color: var(--texte); }
.duree { color: var(--texte-3); font-size: 12px; margin-left: 6px; }
.barre-resultats-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tri { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--texte-3); }
.tri select {
  padding: 7px 10px; font: inherit; font-size: 13.5px;
  background: var(--surface); color: var(--texte);
  border: 1px solid var(--bord); border-radius: var(--r-s);
}

.resultats { display: grid; gap: 10px; }

.carte {
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r-m); box-shadow: var(--ombre-1);
  transition: border-color .12s, box-shadow .12s, transform .12s;
  overflow: hidden;
}
.carte:hover { border-color: var(--bord-fort); box-shadow: var(--ombre-2); }
.carte-lien { display: block; padding: 14px 16px 10px; color: inherit; }
.carte-lien:hover { text-decoration: none; }
.carte-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.carte-titre { font-size: 16.5px; letter-spacing: -.012em; }
.carte-lieu { color: var(--texte-3); font-size: 13px; margin-top: 2px; }
.carte-maire {
  display: flex; align-items: center; gap: 6px;
  color: var(--texte-2); font-size: 13.5px; margin-top: 7px;
}
.carte-maire .ic { width: 15px; height: 15px; color: var(--texte-3); }

.carte-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 16px 13px;
}
.action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 7px; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--bord);
  color: var(--texte-2); font-size: 13px; font-variant-numeric: tabular-nums;
}
a.action:hover { background: var(--accent-doux); border-color: var(--accent-contour);
                 color: var(--accent-fort); text-decoration: none; }
.action .ic { width: 14px; height: 14px; }
.action-mail span { max-width: 190px; }
.action-ca { background: transparent; border-style: dashed; }
.action-ca-negatif { color: var(--chaud-texte); border-color: var(--chaud-texte); }

.pastille {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 620; letter-spacing: .015em;
  border: 1px solid transparent; white-space: nowrap;
}
.pastille-client { background: var(--accent-doux); color: var(--accent-fort);
                   border-color: var(--accent-contour); }
.pastille-prospect { background: var(--surface-2); color: var(--texte-3);
                     border-color: var(--bord); }
.pastille-ca { background: transparent; color: var(--texte-2); border-color: var(--bord-fort); }
.pastille-ancien { background: transparent; color: var(--texte-3);
                   border-color: var(--bord-fort); border-style: dashed;
                   font-weight: 500; margin-left: 6px; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 22px;
}
.pagination-etat { color: var(--texte-3); font-size: 13.5px; }

.vide {
  background: var(--surface); border: 1px dashed var(--bord-fort);
  border-radius: var(--r-m); padding: 40px 24px; text-align: center;
  color: var(--texte-2);
}
.vide p + p { margin-top: 6px; font-size: 14px; color: var(--texte-3); }

/* -------------------------------------------------------------- fiche --- */

.retour {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--texte-3); font-size: 13.5px; margin-bottom: 14px;
}
.retour:hover { color: var(--accent); text-decoration: none; }

.fiche-tete {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.fiche-tete h1 { font-size: 27px; letter-spacing: -.022em; }
.fiche-sous { color: var(--texte-3); font-size: 14px; margin-top: 3px; }
.fiche-tete-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.fiche-corps { display: grid; gap: 16px; grid-template-columns: minmax(0,1fr) 320px; align-items: start; }
@media (max-width: 900px) { .fiche-corps { grid-template-columns: 1fr; } }

.colonne-principale, .colonne-laterale { display: grid; gap: 16px; }

.bloc {
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r-m); padding: 18px; box-shadow: var(--ombre-1);
}
.bloc-compact { padding: 16px; }
/* Deux blocs qui se suivent directement dans la page (CA par année, classement
   2026, hall of fame) : même respiration que la grille .deux-colonnes. */
.page > .bloc + .bloc { margin-top: 16px; }
.bloc-titre {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 640; text-transform: uppercase;
  letter-spacing: .045em; color: var(--texte-3); margin-bottom: 14px;
}
.bloc-titre .ic { width: 15px; height: 15px; }
.compteur {
  margin-left: auto; background: var(--surface-2); border: 1px solid var(--bord);
  border-radius: 99px; padding: 1px 8px; font-size: 11.5px;
  letter-spacing: 0; color: var(--texte-2);
}
.bloc-intro { color: var(--texte-3); font-size: 13px; margin: -8px 0 12px; }

.ligne-info { display: grid; grid-template-columns: 108px 1fr; gap: 12px;
              padding: 9px 0; border-top: 1px solid var(--bord); }
.ligne-info:first-of-type { border-top: 0; padding-top: 0; }
.etiquette { color: var(--texte-3); font-size: 13px; }
.valeur { font-size: 14.5px; min-width: 0; }
.valeur-forte { font-weight: 600; font-size: 16px; }
.ligne-maire .valeur { color: var(--texte); }
@media (max-width: 520px) { .ligne-info { grid-template-columns: 1fr; gap: 2px; } }

.tels { display: grid; gap: 7px; }
.tel { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
       padding: 7px 10px; border-radius: var(--r-s); background: var(--surface-2); }
.tel-lib { color: var(--texte-3); font-size: 12.5px; }
.tel-num { font-family: var(--mono); font-size: 14.5px; font-weight: 560; white-space: nowrap; }
.tel-mairie { border-left: 3px solid var(--accent); }
.tel-mobile { border-left: 3px solid var(--chaud); }
.tel-autre, .tel-note { border-left: 3px solid var(--bord-fort); }

.note { font-size: 14px; line-height: 1.6; color: var(--texte-2);
        padding: 11px 13px; border-radius: var(--r-s); background: var(--surface-2);
        white-space: normal; overflow-wrap: anywhere; }
.note + .note { margin-top: 9px; }
.note-principale { background: var(--accent-doux); color: var(--texte);
                   border: 1px solid var(--accent-contour); }
.note-titre { display: block; font-size: 11.5px; font-weight: 640;
              text-transform: uppercase; letter-spacing: .04em;
              color: var(--texte-3); margin-bottom: 5px; }
.note-bas { color: var(--texte-3); font-size: 12.5px; margin-top: 9px; }

.defs { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.defs dt { color: var(--texte-3); font-size: 13px; }
.defs dd { text-align: right; }
.alerte-inline { color: var(--chaud); font-size: 12px; }

.puces { display: grid; gap: 6px; font-size: 14px; }
.puces li { display: flex; justify-content: space-between; gap: 10px;
            padding: 6px 0; border-bottom: 1px solid var(--bord); }
.puces li:last-child { border-bottom: 0; }
.puces em { font-style: normal; color: var(--texte-3); font-size: 12.5px; white-space: nowrap; }
.puces-liens a { display: flex; justify-content: space-between; gap: 10px;
                 width: 100%; color: inherit; }
.puces-liens a:hover { color: var(--accent); text-decoration: none; }

.liste-rdv { display: grid; gap: 2px; font-size: 14px; }
.liste-rdv li { display: flex; justify-content: space-between; gap: 12px;
                padding: 7px 0; border-bottom: 1px solid var(--bord); }
.liste-rdv li:last-child { border-bottom: 0; }
.rdv-date { font-variant-numeric: tabular-nums; }
.rdv-qui { color: var(--texte-3); font-size: 13px; }

/* ------------------------------------------------------------ tableaux -- */

.tableau-enveloppe { overflow-x: auto; -webkit-overflow-scrolling: touch;
                     margin: 0 -4px; padding: 0 4px; }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th {
  text-align: left; font-size: 11.5px; font-weight: 620; text-transform: uppercase;
  letter-spacing: .04em; color: var(--texte-3);
  padding: 0 10px 8px; border-bottom: 1px solid var(--bord); white-space: nowrap;
}
.tableau th.droite { text-align: right; }
.tableau td { padding: 9px 10px; border-bottom: 1px solid var(--bord); white-space: nowrap; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: var(--surface-2); }
.tableau tfoot td { padding: 10px; border-top: 1px solid var(--bord-fort);
                    color: var(--texte-2); font-size: 13.5px; }

/* La proportion du chiffre d'affaires se lit derrière la colonne CA :
   l'information visuelle du graphique, sans la liste en double. */
/* Barre de proportion : un soulignement fin sous le montant, calé à droite et
   proportionnel au premier du classement. Placé sous le texte plutôt que
   derrière, pour ne jamais couper les chiffres en deux. */
.classement .cell-ca { position: relative; padding-bottom: 12px; }
.classement .cell-ca::before {
  content: ""; position: absolute; right: 0; bottom: 7px; height: 3px;
  width: var(--part, 0%); min-width: 3px;
  background: color-mix(in srgb, var(--serie) 45%, transparent);
  border-radius: 2px;
  pointer-events: none;
}
.classement .podium-1 .cell-ca::before {
  background: var(--serie);
}

.classement { margin-top: 14px; }
.classement.replie .en-plus { display: none; }
.classement .rang { color: var(--texte-3); }
.classement .podium .rang { color: var(--texte); font-weight: 700; }
.classement .podium-1 td { background: color-mix(in srgb, var(--accent-doux) 60%, transparent); }
.classement .podium-1 .rang::after { content: " ★"; color: var(--chaud); }

.deplier {
  margin-top: 12px; width: 100%; justify-content: center;
  border-style: dashed; color: var(--texte-2);
}
.deplier:hover { color: var(--accent); border-color: var(--accent); }
.deplier-fleche { transition: transform .18s ease; }
.classement.replie .deplier-moins,
.classement:not(.replie) .deplier-plus { display: none; }
.classement:not(.replie) .deplier-fleche { transform: rotate(180deg); }

.tableau-alternatif { margin-top: 14px; }
.tableau-alternatif summary { cursor: pointer; color: var(--texte-3); font-size: 13px; }
.tableau-alternatif summary:hover { color: var(--accent); }
.tableau-alternatif[open] summary { margin-bottom: 10px; }

/* --------------------------------------------------- tableau de bord --- */

.chercher-accueil { grid-template-columns: 1fr; margin: 18px 0 0; }
.chercher-accueil input[type=search] { padding-top: 14px; padding-bottom: 14px; }

.tuiles {
  display: grid; gap: 12px; margin: 18px 0;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}
.tuile {
  background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--r-m); padding: 15px 16px; box-shadow: var(--ombre-1);
  display: flex; flex-direction: column; gap: 3px;
}
.tuile-lib { font-size: 12px; font-weight: 580; text-transform: uppercase;
             letter-spacing: .04em; color: var(--texte-3); }
.tuile-val { font-size: 25px; font-weight: 660; letter-spacing: -.025em;
             font-variant-numeric: tabular-nums; line-height: 1.15; }
.tuile-note { font-size: 12.5px; color: var(--texte-3); }
.tuile-accent { background: var(--accent-doux); border-color: var(--accent-contour); }
.tuile-accent .tuile-val { color: var(--accent-fort); }

a.tuile { color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.tuile:hover { text-decoration: none; border-color: var(--accent);
                box-shadow: var(--ombre-2); transform: translateY(-1px); }
a.tuile:hover .tuile-val { color: var(--accent-fort); }
.tuile-lien { display: flex; align-items: center; gap: 4px;
              font-size: 12px; color: var(--accent); margin-top: 2px; }
a.tuile:hover .tuile-lien { text-decoration: underline; }

.deux-colonnes { display: grid; gap: 16px; grid-template-columns: 1fr 1fr;
                 margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .deux-colonnes { grid-template-columns: 1fr; } }
/* un bloc seul en fin de rangée occupe toute la largeur plutôt que de laisser
   une demi-colonne vide */
.deux-colonnes > .bloc:only-child { grid-column: 1 / -1; }
/* ...et sa liste se répartit alors sur deux colonnes, sans quoi chaque ligne
   s'étirerait sur 1 100 px avec un trou au milieu. Colonnes CSS et non grille :
   la lecture reste de haut en bas, ce qu'attend une liste chronologique. */
@media (min-width: 720px) {
  .deux-colonnes > .bloc:only-child .liste-compacte {
    display: block; columns: 2; column-gap: 36px;
  }
  .deux-colonnes > .bloc:only-child .liste-compacte li { break-inside: avoid; }
}

.liste-compacte { display: grid; }
.liste-compacte li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--bord);
}
.liste-compacte li:last-child { border-bottom: 0; }
.liste-compacte a { display: flex; flex-direction: column; color: inherit; min-width: 0; }
.liste-compacte a:hover .lc-titre { color: var(--accent); }
.liste-compacte a:hover { text-decoration: none; }
.lc-titre { font-size: 14.5px; font-weight: 540; }
.lc-meta { font-size: 12.5px; color: var(--texte-3); }
.lc-val { font-family: var(--mono); font-size: 13.5px; color: var(--texte-2);
          white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc-val-baisse { color: var(--chaud-texte); }
.lc-vide { color: var(--texte-3); font-size: 13.5px; }

/* --- blocs de prospection --- */
.grand-chiffre {
  margin: 2px 0 12px; font-size: 30px; font-weight: 680; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--texte);
}
.grand-chiffre span {
  display: block; font-size: 12.5px; font-weight: 500; color: var(--texte-3);
  margin-top: 2px;
}
.bloc-lien { margin-top: 12px; width: 100%; justify-content: center; }

.encart-methode {
  margin-top: 16px; border-left: 3px solid var(--accent-contour);
  background: var(--accent-doux);
}
.encart-methode p { margin: 0; font-size: 13.5px; color: var(--texte-2); line-height: 1.6; }

.barre-filtre {
  display: flex; flex-wrap: wrap; align-items: end; gap: 14px 20px;
  margin-top: 16px;
}
.barre-filtre-etat { margin: 0 0 6px; color: var(--texte-3); font-size: 13.5px; }
.barre-filtre-etat strong { color: var(--texte); font-variant-numeric: tabular-nums; }

.sous-cellule { display: block; font-size: 12px; color: var(--texte-3);
                font-variant-numeric: tabular-nums; }
.rien { color: var(--texte-3); }
.tronque-cellule { display: inline-block; max-width: 22ch; overflow: hidden;
                   text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.pastille-repasse { background: var(--chaud-doux); color: var(--chaud-texte);
                    border-color: color-mix(in srgb, var(--chaud) 35%, transparent);
                    margin-left: 6px; }
.ligne-repasse td:first-child { font-weight: 560; }

/* ---------------------------------------------------------- graphiques -- */

.graphe-boite { margin: 4px 0 0; }
.graphe { width: 100%; height: auto; display: block; overflow: visible; }

.g-grille { stroke: var(--bord); stroke-width: 1; }
.g-axe    { fill: var(--texte-3); font-size: 11px; font-family: var(--police);
            font-variant-numeric: tabular-nums; }
.g-etiq   { fill: var(--texte-3); font-size: 11.5px; font-family: var(--police); }
.g-etiq-h { fill: var(--texte-2); font-size: 11.5px; }
.g-valeur { fill: var(--texte); font-size: 12px; font-weight: 620;
            font-family: var(--police); font-variant-numeric: tabular-nums; }
.g-valeur-h { fill: var(--texte-2); font-weight: 560; }
.g-barre  { fill: var(--serie); transition: fill .12s; }
.g-cible  { fill: transparent; cursor: pointer; }
.g-cible:hover + .g-barre, .g-barre:hover { fill: var(--accent-fort); }
.vide-graphe { color: var(--texte-3); font-size: 13.5px; padding: 20px 0; }

/* --- anneau (répartition d'un tout) ---
   Quatre teintes contrôlées au contraste : chaque part se distingue de sa
   voisine (rapport ≥ 1,9) et du fond de carte. Le rouge de la marque est
   réservé à la part « à travailler », il porte un sens, pas une décoration. */
.anneau-boite {
  display: grid; grid-template-columns: 204px minmax(0, 1fr);
  gap: 20px; align-items: center; margin-top: 6px;
}
@media (max-width: 560px) {
  .anneau-boite { grid-template-columns: 1fr; gap: 12px; justify-items: center; }
  .anneau-boite .graphe-anneau { max-width: 216px; }
}
.g-part { stroke: var(--surface); stroke-width: 2; transition: opacity .12s; cursor: pointer; }
.g-part:hover { opacity: .78; }
.g-part-1 { fill: #00243d; }
.g-part-2 { fill: #1a6fb5; }
.g-part-3 { fill: #8cc0e6; }
.g-part-4 { fill: #ec2b3a; }
.g-part-5 { fill: #8a94a3; }
/* Part « à classer » : une trame, pas une couleur. Une sixième teinte se
   lirait comme une famille de plus ; des hachures se lisent comme un trou. */
.g-motif-fond  { fill: #eef1f5; }
.g-motif-trait { stroke: #9aa4b2; stroke-width: 2.6; }
.g-part-motif  { stroke: var(--surface); stroke-width: 2; }
.g-centre-val { fill: var(--texte); font-family: var(--police);
                font-weight: 680; font-variant-numeric: tabular-nums; }
.g-centre-lib { fill: var(--texte-3); font-family: var(--police); font-size: 11.5px; }

.legende-boite { width: 100%; min-width: 0; }
.legende-entete {
  display: grid; grid-template-columns: 11px minmax(0, 1fr) auto;
  gap: 9px; margin: 0 0 8px 0; padding-bottom: 6px;
  border-bottom: 1px solid var(--bord);
  font-size: 11px; font-weight: 620; text-transform: uppercase;
  letter-spacing: .045em; color: var(--texte-3);
}
.legende-entete span:first-child { grid-column: 2; }
.legende-entete span:last-child { text-align: right; }
.legende { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: 100%; }
.legende li {
  display: grid; grid-template-columns: 11px minmax(0, 1fr) auto;
  gap: 4px 9px; align-items: baseline; font-size: 13.5px;
}
.legende-puce { width: 11px; height: 11px; border-radius: 3px; align-self: center; }
.legende-puce-1 { background: #00243d; }
.legende-puce-2 { background: #1a6fb5; }
.legende-puce-3 { background: #8cc0e6; }
.legende-puce-4 { background: #ec2b3a; }
.legende-puce-5 { background: #8a94a3; }
.legende-puce-motif {
  background: repeating-linear-gradient(45deg, #eef1f5 0 3px, #9aa4b2 3px 5px);
  border: 1px solid #c3cbd6;
}
.legende-lib  { color: var(--texte-2); }
.legende-val  { color: var(--texte); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legende-val b { font-weight: 660; }
.legende-note { grid-column: 2 / -1; color: var(--texte-3); font-size: 12px; margin-top: -3px; }

@media (prefers-color-scheme: dark) {
  .g-part-1 { fill: #b9dcf7; }  .legende-puce-1 { background: #b9dcf7; }
  .g-part-2 { fill: #4a97dd; }  .legende-puce-2 { background: #4a97dd; }
  .g-part-3 { fill: #1d5384; }  .legende-puce-3 { background: #1d5384; }
  .g-part-4 { fill: #f2646f; }  .legende-puce-4 { background: #f2646f; }
  .g-part-5 { fill: #79839a; }  .legende-puce-5 { background: #79839a; }
  .g-motif-fond  { fill: #262b35; }
  .g-motif-trait { stroke: #5c6678; }
  .legende-puce-motif {
    background: repeating-linear-gradient(45deg, #262b35 0 3px, #5c6678 3px 5px);
    border-color: #3a4150;
  }
}

.infobulle {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--texte); color: var(--fond);
  padding: 6px 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 540; white-space: nowrap;
  box-shadow: var(--ombre-2);
  transform: translate(-50%, -130%);
}

.installer {
  position: fixed; z-index: 80; left: 16px; right: 16px; bottom: 16px;
  max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--bord);
  border-left: 4px solid var(--chaud);
  border-radius: var(--r-m); padding: 14px 16px; box-shadow: var(--ombre-2);
  opacity: 0; transform: translateY(14px);
  transition: opacity .25s ease, transform .25s ease;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.installer.visible { opacity: 1; transform: translateY(0); }
.installer-ic { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto;
                border: 1px solid var(--bord); background: #fff; }
.installer-txt { flex: 1 1 190px; min-width: 0; font-size: 13.5px; color: var(--texte-2); }
.installer-txt strong { display: block; color: var(--texte); font-size: 14.5px;
                        font-weight: 620; margin-bottom: 2px; }
.installer-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.installer-actions .btn { padding: 8px 13px; font-size: 13.5px; }
@media (max-width: 430px) {
  .installer-actions { width: 100%; }
  .installer-actions .btn { flex: 1; justify-content: center; }
}

@media print {
  .barre, .chercher, .pagination, .pied, .retour,
  .installer, .barre-resultats-actions { display: none !important; }
  .bloc, .carte { box-shadow: none; break-inside: avoid; }

  /* Le téléphone et l'e-mail sont justement ce qu'on vient chercher sur une
     liste imprimée : on les garde, débarrassés de leur habillage de bouton.
     L'adresse e-mail est écrite en entier — sur papier, une troncature à
     « mairie.saint-florent.corse@w… » ne sert à rien. */
  .action {
    background: none !important; border: 0 !important; padding: 0 14px 0 0 !important;
    color: #000 !important; font-size: 12px;
  }
  .action .ic { display: none; }
  .action-mail span, .tronque, .tronque-cellule {
    max-width: none !important; overflow: visible !important;
    text-overflow: clip !important; white-space: normal !important;
  }
  .carte-actions { padding: 0 16px 12px; gap: 0; }
  a { color: #000 !important; text-decoration: none !important; }
}
