/* Intranet de l'Amicale des sapeurs-pompiers d'Ille-sur-Têt — charte du 2026-11-21.
   Feuille unique, sans dépendance. Ordre : polices, jetons (clair puis sombre),
   base, marque, coquille (ordinateur puis téléphone), briques, tableaux,
   formulaires, fenêtres, écrans particuliers, impression.

   Charte : rouge d'engin #c8102e (actions, accents), marine #1b2a4a (identité,
   avatars), gris froids pour le reste ; police Outfit ; rayons 14 / 10 px ;
   une seule action principale (rouge) par écran. Sur téléphone (≤ 960 px) :
   barre du haut + onglets en bas, action principale en bouton flottant,
   tableaux en cartes, fenêtres plein écran. */

@font-face { font-family: "Outfit"; src: url("../fonts/outfit-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Outfit"; src: url("../fonts/outfit-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ── Jetons ───────────────────────────────────────────────── */
:root {
  --rouge: #c8102e;
  --rouge-fonce: #a10d25;
  --rouge-pale: #fdecef;
  --marine: #1b2a4a;
  --marine-pale: #e8ecf4;
  --encre: #111827;
  --texte: #1f2937;
  --doux: #6b7280;
  --filet: #e6e8ec;
  --filet-fort: #d1d5db;
  --fond: #f4f5f7;
  --carte: #ffffff;
  --survol: #f8f9fb;
  --vert: #047857;
  --vert-pale: #ecfdf5;
  --ambre: #b45309;
  --ambre-pale: #fffbeb;
  --bleu: #1d4ed8;
  --bleu-pale: #eff6ff;
  --violet: #6d28d9;
  --violet-pale: #f5f3ff;
  --gris-pale: #f1f3f5;
  --ombre: 0 1px 2px rgba(17, 24, 39, .05), 0 1px 3px rgba(17, 24, 39, .07);
  --ombre-moyenne: 0 4px 14px rgba(17, 24, 39, .10);
  --ombre-haute: 0 12px 32px rgba(17, 24, 39, .20);
  --rayon: 14px;
  --rayon-petit: 10px;
  --menu: 256px;
  --barre: 56px;
  --onglets: 62px;
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --rouge: #f04461;
    --rouge-fonce: #ff6b82;
    --rouge-pale: #3a1219;
    --marine: #c7d2fe;
    --marine-pale: #1c2540;
    --encre: #f3f4f6;
    --texte: #e5e7eb;
    --doux: #9ca3af;
    --filet: #262d3a;
    --filet-fort: #3a4253;
    --fond: #0f131a;
    --carte: #171c25;
    --survol: #1d2330;
    --vert: #34d399;
    --vert-pale: #0f2a22;
    --ambre: #fbbf24;
    --ambre-pale: #2d2410;
    --bleu: #93c5fd;
    --bleu-pale: #132036;
    --violet: #c4b5fd;
    --violet-pale: #221a38;
    --gris-pale: #1f2531;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
    --ombre-moyenne: 0 4px 14px rgba(0, 0, 0, .45);
    --ombre-haute: 0 12px 32px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--fond); color: var(--texte);
  font: 400 15px/1.5 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
a { color: var(--rouge); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--encre); line-height: 1.2; margin: 0; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.08rem; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--rayon-petit); background: var(--carte); box-shadow: var(--ombre-haute); }
.evitement:focus { top: 12px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ic-sm { width: 16px; height: 16px; vertical-align: -3px; }

/* ── Marque ───────────────────────────────────────────────── */
.embleme { display: block; width: 100%; height: 100%; }
.marque { display: flex; gap: 11px; align-items: center; color: var(--encre); min-width: 0; }
.marque:hover { text-decoration: none; }
.marque__embleme { width: 38px; height: 42px; flex: none; filter: drop-shadow(0 2px 3px rgba(200, 16, 46, .22)); }
.marque__texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.marque__nom { font-weight: 700; font-size: .93rem; letter-spacing: -.005em; }
.marque__sous { color: var(--rouge); font-size: .74rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; margin-top: 3px; }
.marque--grande { flex-direction: column; text-align: center; gap: 12px; margin-bottom: 22px; }
.marque--grande .marque__embleme { width: 58px; height: 64px; }
.marque--grande .marque__texte { align-items: center; }
.marque--grande .marque__nom { font-size: 1.12rem; }

/* ── Coquille : ordinateur ────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--menu) minmax(0, 1fr); min-height: 100vh; }
.menu {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none;
  background: var(--carte); border-right: 1px solid var(--filet); display: flex; flex-direction: column; padding: 18px 14px 14px;
}
.menu::-webkit-scrollbar { display: none; }
.menu__haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 18px; }
.menu__haut .menu__fermer { display: none; }
.menu__groupe { margin: 16px 10px 6px; font-size: .68rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--doux); }
.menu__lien {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--rayon-petit); margin-bottom: 1px;
  color: var(--texte); font-weight: 520; font-size: .93rem;
}
.menu__lien:hover { background: var(--survol); text-decoration: none; }
.menu__lien .ic { color: var(--doux); }
.menu__lien[aria-current="page"] { background: var(--rouge-pale); color: var(--rouge); font-weight: 600; }
.menu__lien[aria-current="page"] .ic { color: var(--rouge); }
.menu__pied { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--filet); }
.utilisateur { display: flex; gap: 10px; align-items: center; padding: 6px 4px; }
.utilisateur__qui { display: flex; flex-direction: column; min-width: 0; flex: 1; color: inherit; }
.utilisateur__qui:hover { text-decoration: none; }
.utilisateur__nom { font-weight: 600; font-size: .9rem; color: var(--encre); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utilisateur__role { font-size: .78rem; color: var(--doux); }

.principal { min-width: 0; padding: 30px 36px 72px; max-width: 1320px; width: 100%; }
.entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.entete__sur { color: var(--doux); font-size: .84rem; font-weight: 500; margin-bottom: 4px; }
.entete__sur a { color: var(--doux); }
.entete__sur a:hover { color: var(--rouge); }
.entete__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entete__actions select { width: auto; }
.barre-mobile, .onglets-bas { display: none; }

/* ── Coquille : téléphone et tablette ─────────────────────── */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .barre-mobile {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px;
    min-height: calc(var(--barre) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 14px 0;
    background: color-mix(in srgb, var(--carte) 92%, transparent); border-bottom: 1px solid var(--filet);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  }
  .barre-mobile__embleme { width: 30px; height: 33px; flex: none; }
  .barre-mobile__titre { flex: 1; min-width: 0; font-weight: 650; font-size: 1.02rem; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .onglets-bas {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    height: calc(var(--onglets) + var(--bas)); padding-bottom: var(--bas);
    background: color-mix(in srgb, var(--carte) 94%, transparent); border-top: 1px solid var(--filet);
    -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  }
  .onglets-bas a, .onglets-bas button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
    border: 0; background: none; font: inherit; font-size: .69rem; font-weight: 600; color: var(--doux); cursor: pointer; padding: 6px 2px 4px;
  }
  .onglets-bas a:hover { text-decoration: none; }
  .onglets-bas .ic { width: 23px; height: 23px; }
  .onglets-bas [aria-current="page"] { color: var(--rouge); }
  .onglets-bas [aria-current="page"] .ic { stroke-width: 2.2; }
  .onglets-bas span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu {
    position: fixed; z-index: 50; inset: 0 0 0 auto; width: min(320px, 88vw); height: 100%;
    transform: translateX(102%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; box-shadow: var(--ombre-haute); border-right: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + var(--bas));
  }
  .menu.ouvert { transform: none; visibility: visible; transition: transform .22s ease; }
  .menu__haut .menu__fermer { display: inline-flex; }
  .menu__lien { padding: 11px 10px; font-size: .97rem; }
  .voile { position: fixed; inset: 0; z-index: 45; background: rgba(15, 19, 26, .42); }
  .principal { padding: 18px 16px calc(var(--onglets) + var(--bas) + 88px); }
  h1 { font-size: 1.4rem; }
  .entete { margin-bottom: 16px; align-items: flex-start; }
  .entete__sur:not(:has(a)) { display: none; }
  .carte__tete { flex-wrap: wrap; padding: 13px 16px; }
  .carte__corps { padding: 14px 16px; }
  .entete__actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; width: calc(100% + 32px); }
  .entete__actions::-webkit-scrollbar { display: none; }
  .entete__actions > * { flex: none; }
  /* L'action principale de l'écran devient un bouton flottant au-dessus des onglets. */
  .entete__actions > .btn--principal, .action-flottante {
    position: fixed; z-index: 29; right: 16px; bottom: calc(var(--onglets) + var(--bas) + 14px);
    min-height: 52px; padding: 0 20px 0 16px; border-radius: 999px; font-size: .98rem; box-shadow: 0 8px 22px rgba(200, 16, 46, .35);
  }
  .entete__actions > .btn--principal .ic { width: 22px; height: 22px; }
}

/* ── Briques ──────────────────────────────────────────────── */
.carte { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte__tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--filet); min-height: 54px; }
.carte__tete h2 { min-width: 0; }
.carte__corps { padding: 16px 18px; }
.carte__corps--serre { padding: 0; }
.carte + .carte, .carte + .grille, .grille + .carte, .grille + .grille, .bandeau + .carte, .indicateurs + .grille { margin-top: 18px; }
.grille { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grille > * { min-width: 0; }
.grille > .carte + .carte { margin-top: 0; }
.pile > * + * { margin-top: 12px; }

.indicateurs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin-bottom: 18px; }
.indicateur { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); min-width: 0; position: relative; overflow: hidden; }
.indicateur::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--filet-fort); }
.indicateur--rouge::before { background: var(--rouge); }
.indicateur--vert::before { background: var(--vert); }
.indicateur--ambre::before { background: var(--ambre); }
.indicateur__libelle { font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.indicateur__valeur { font-size: 1.6rem; font-weight: 700; color: var(--encre); margin-top: 2px; white-space: nowrap; letter-spacing: -.01em; }
.indicateur__pied { font-size: .82rem; color: var(--doux); }
.indicateur--rouge .indicateur__valeur { color: var(--rouge); }
.indicateur--vert .indicateur__valeur { color: var(--vert); }
.indicateur--ambre .indicateur__valeur { color: var(--ambre); }
@media (max-width: 520px) {
  .indicateurs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .indicateur { padding: 12px 12px 12px 14px; }
  .indicateur__valeur { font-size: 1.3rem; white-space: normal; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px;
  border-radius: var(--rayon-petit); border: 1px solid var(--filet-fort); background: var(--carte); color: var(--encre);
  font: inherit; font-weight: 580; font-size: .92rem; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s, transform .06s;
}
.btn:hover { background: var(--survol); text-decoration: none; border-color: var(--doux); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--principal { background: var(--rouge); border-color: var(--rouge); color: #fff; box-shadow: 0 1px 2px rgba(200, 16, 46, .25); }
.btn--principal:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); }
.btn--danger { color: var(--rouge); }
.btn--discret { border-color: transparent; background: transparent; }
.btn--discret:hover { background: var(--gris-pale); border-color: transparent; }
.btn--icone { width: 36px; min-height: 36px; padding: 0; }
.btn--petit { min-height: 32px; padding: 0 11px; font-size: .85rem; }
.btn--large { width: 100%; min-height: 48px; font-size: 1rem; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .77rem; font-weight: 600;
  background: var(--gris-pale); color: var(--texte); white-space: nowrap; line-height: 1.45;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--nu::before { display: none; }
.badge--vert { background: var(--vert-pale); color: var(--vert); }
.badge--rouge { background: var(--rouge-pale); color: var(--rouge); }
.badge--ambre { background: var(--ambre-pale); color: var(--ambre); }
.badge--bleu { background: var(--bleu-pale); color: var(--bleu); }
.badge--violet { background: var(--violet-pale); color: var(--violet); }
a.badge:hover { text-decoration: none; filter: brightness(.96); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--marine); color: #fff; font-weight: 650; font-size: .8rem; letter-spacing: .03em;
}
a.avatar:hover { text-decoration: none; opacity: .92; }
@media (prefers-color-scheme: dark) { .avatar { color: #111827; } }
.avatar--grand { width: 58px; height: 58px; font-size: 1.12rem; }
.avatar--petit { width: 34px; height: 34px; font-size: .76rem; }

/* ── Tableaux ─────────────────────────────────────────────── */
.tableau-conteneur { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th {
  text-align: left; font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--doux);
  padding: 10px 14px; border-bottom: 1px solid var(--filet); white-space: nowrap; background: var(--carte); position: sticky; top: 0;
}
.tableau td { padding: 11px 14px; border-bottom: 1px solid var(--filet); vertical-align: middle; }
.tableau tbody tr:hover { background: var(--survol); }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tfoot td { font-weight: 650; border-top: 2px solid var(--filet-fort); border-bottom: 0; color: var(--encre); }
.tableau .nb, .nb { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau .actions { text-align: right; white-space: nowrap; width: 1%; }
.tableau th[data-tri] { cursor: pointer; user-select: none; }
.tableau th[data-tri]::after { content: "↕"; opacity: .35; margin-left: 4px; }
.tableau th[aria-sort="ascending"]::after { content: "↑"; opacity: 1; }
.tableau th[aria-sort="descending"]::after { content: "↓"; opacity: 1; }
.tableau .vide { text-align: center; color: var(--doux); padding: 30px; }
[data-href] { cursor: pointer; }
.ligne-attenuee td { color: var(--doux); }
.personne { display: flex; align-items: center; gap: 11px; min-width: 0; }
.personne__nom { font-weight: 600; color: var(--encre); }
.personne__sous { font-size: .8rem; color: var(--doux); }

/* Sur téléphone, chaque ligne devient une carte : la cellule « titre » en tête,
   les autres en paires libellé / valeur (libellés posés par app.js d'après
   l'en-tête), les actions en haut à droite. Colonne th.m-cache : masquée. */
@media (max-width: 720px) {
  .tableau-conteneur:has(> table.tableau:not(.tableau--brut)) { overflow: visible; }
  table.tableau:not(.tableau--brut), table.tableau:not(.tableau--brut) tbody, table.tableau:not(.tableau--brut) tfoot { display: block; }
  table.tableau:not(.tableau--brut) thead { display: none; }
  table.tableau:not(.tableau--brut) tr {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px 14px; position: relative;
    padding: 13px 16px; border-bottom: 1px solid var(--filet);
  }
  table.tableau:not(.tableau--brut) tr.cache, table.tableau:not(.tableau--brut) tr[hidden] { display: none; }
  table.tableau:not(.tableau--brut) tbody tr:last-child { border-bottom: 0; }
  table.tableau:not(.tableau--brut) td { display: flex; flex-direction: column; align-items: flex-start; padding: 0; border: 0; min-width: 0; max-width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: .9rem; }
  table.tableau:not(.tableau--brut) td > * { max-width: 100%; }
  /* Un nowrap posé en ligne dans une page ne doit pas élargir la carte. */
  table.tableau:not(.tableau--brut) td, table.tableau:not(.tableau--brut) td * { white-space: normal !important; }
  table.tableau:not(.tableau--brut) td .badge { height: auto; border-radius: 8px; }
  table.tableau:not(.tableau--brut) td[data-label]::before { content: attr(data-label); font-size: .68rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); margin-bottom: 1px; }
  table.tableau:not(.tableau--brut) td.cellule-titre { grid-column: 1 / -1; order: -1; font-size: 1rem; font-weight: 600; color: var(--encre); padding-right: 84px; }
  table.tableau:not(.tableau--brut) td.cellule-titre::before { display: none; }
  table.tableau:not(.tableau--brut) td.actions { position: absolute; top: 8px; right: 8px; width: auto; flex-direction: row; gap: 2px; }
  table.tableau:not(.tableau--brut) td.actions::before { display: none; }
  table.tableau:not(.tableau--brut) td.vide { grid-column: 1 / -1; padding: 18px 0; align-items: center; }
  table.tableau:not(.tableau--brut) td.vide::before { display: none; }
  table.tableau:not(.tableau--brut) td:empty { display: none; }
  table.tableau:not(.tableau--brut) .m-cache { display: none; }
  table.tableau:not(.tableau--brut) tfoot tr { background: var(--gris-pale); border-radius: 0 0 var(--rayon) var(--rayon); }
  table.tableau:not(.tableau--brut) tfoot td { border: 0; }
  table.tableau:not(.tableau--brut) tbody tr:hover { background: none; }
  table.tableau:not(.tableau--brut) tbody tr[data-href]:active { background: var(--survol); }
}

/* ── Barres d'outils, onglets, bascules ───────────────────── */
.outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--filet); }
.outils .champ-recherche { flex: 1 1 220px; }
.outils select { width: auto; max-width: 100%; }
.champ-recherche input { padding-left: 38px; background: var(--carte) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px 50% / 17px; }
@media (max-width: 600px) {
  .outils { padding: 12px 14px; gap: 8px; }
  .outils .champ-recherche { flex-basis: 100%; }
  .outils select { flex: 1 1 40%; min-width: 0; }
}
.onglets { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--filet); margin-bottom: 18px; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a {
  padding: 10px 14px; color: var(--doux); font-weight: 580; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.onglets a:hover { color: var(--encre); text-decoration: none; }
.onglets a[aria-current="page"] { color: var(--rouge); border-bottom-color: var(--rouge); }
@media (max-width: 960px) { .onglets { margin: 0 -16px 16px; padding: 0 12px; } }
.segments { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--gris-pale); }
.segments a, .segments button {
  padding: 6px 13px; border-radius: 8px; color: var(--doux); font: inherit; font-size: .88rem; font-weight: 580; border: 0; background: none; cursor: pointer; white-space: nowrap;
}
.segments a:hover { text-decoration: none; color: var(--encre); }
.segments [aria-current="page"], .segments [aria-pressed="true"] { background: var(--carte); color: var(--encre); box-shadow: var(--ombre); }
/* Bascule à boutons radio : <div class="choix"><label><input type=radio><span>…</span></label>… */
.choix { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--gris-pale); flex-wrap: wrap; }
.choix label { position: relative; cursor: pointer; }
.choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choix span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 8px; color: var(--doux); font-size: .88rem; font-weight: 580; }
.choix input:checked + span { background: var(--carte); color: var(--encre); box-shadow: var(--ombre); }
.choix input:focus-visible + span { outline: 2px solid var(--rouge); outline-offset: 1px; }
.choix--petit span { padding: 5px 11px; font-size: .84rem; }

/* ── Formulaires ──────────────────────────────────────────── */
.form { display: grid; gap: 14px; }
.form-grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-grille > .large { grid-column: 1 / -1; }
.form-grille--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
fieldset.bloc { margin: 0; padding: 14px; border: 1px solid var(--filet); border-radius: var(--rayon-petit); background: var(--survol); display: grid; gap: 12px; min-width: 0; }
fieldset.bloc > legend { padding: 0 6px; font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.bloc__total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-top: 2px; }
.bloc__total strong { font-size: 1.35rem; font-weight: 700; color: var(--encre); }
.choix--large { display: flex; }
.choix--large label { flex: 1; }
.choix--large span { width: 100%; justify-content: center; padding: 9px 12px; }
.champ { display: grid; gap: 5px; min-width: 0; align-content: start; }
.champ > span, .champ > label, .etiquette { font-size: .84rem; font-weight: 600; color: var(--encre); }
.champ small, .aide { color: var(--doux); font-size: .8rem; }
input[type=datetime-local], input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time],
input[type=number], input[type=search], input[type=month], input[type=file], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: var(--rayon-petit); border: 1px solid var(--filet-fort);
  background: var(--carte); color: var(--encre); font: inherit; font-size: .95rem;
}
input[type=file] { padding: 7px; font-size: .88rem; }
select, .liste__bouton { appearance: none; -webkit-appearance: none; padding-right: 34px; background: var(--carte) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; }
textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--doux); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-pale); }
input[readonly] { background: var(--gris-pale); }
.case { display: inline-flex; gap: 9px; align-items: center; cursor: pointer; font-size: .92rem; min-height: 32px; }
.case input { width: 18px; height: 18px; accent-color: var(--rouge); flex: none; }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.erreur-champ { color: var(--rouge); font-size: .82rem; }
details > summary { cursor: pointer; }
details.depliant > summary { list-style: none; width: fit-content; }
details.depliant > summary::-webkit-details-marker { display: none; }
details.depliant[open] > summary { display: none; }
/* Téléphone : 16 px pour que l'iPhone ne zoome pas au toucher d'un champ ; cibles de 44 px. */
@media (max-width: 960px) {
  input[type=datetime-local], input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time],
  input[type=number], input[type=search], input[type=month], select, textarea { font-size: 16px; min-height: 46px; }
  .btn { min-height: 44px; }
  .btn--petit { min-height: 38px; }
  .btn--icone { width: 40px; min-height: 40px; }
  .boutons > .btn { flex: 1 1 auto; }
}

/* ── Messages ─────────────────────────────────────────────── */
.message { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--rayon-petit); font-size: .92rem; margin-bottom: 16px; line-height: 1.45; }
.message > .ic { margin-top: 1px; }
.message--ok { background: var(--vert-pale); color: var(--vert); }
.message--erreur { background: var(--rouge-pale); color: var(--rouge); }
.message--info { background: var(--bleu-pale); color: var(--bleu); }
.message--alerte { background: var(--ambre-pale); color: var(--ambre); }
.message p:last-child { margin: 0; }
@media (max-width: 960px) {
  .message--flash { position: fixed; z-index: 60; left: 12px; right: 12px; top: calc(var(--barre) + env(safe-area-inset-top, 0px) + 8px); box-shadow: var(--ombre-haute); }
}

/* ── Fenêtres ─────────────────────────────────────────────── */
dialog.fenetre {
  border: 0; padding: 0; border-radius: 16px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--carte); color: var(--texte); box-shadow: var(--ombre-haute);
}
dialog.fenetre--large { width: min(920px, calc(100vw - 24px)); }
dialog.fenetre::backdrop { background: rgba(15, 19, 26, .5); }
.fenetre__tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--filet); position: sticky; top: 0; background: var(--carte); z-index: 2; }
.fenetre__corps { padding: 18px 20px; }
.fenetre__pied { padding: 14px 20px; border-top: 1px solid var(--filet); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--carte); z-index: 2; }
/* Téléphone : la fenêtre prend tout l'écran et monte du bas, boutons toujours visibles. */
@media (max-width: 640px) {
  dialog.fenetre, dialog.fenetre--large {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0;
    animation: monter .22s ease-out;
  }
  dialog.fenetre > form, dialog.fenetre { display: flex; flex-direction: column; }
  dialog.fenetre:not([open]) { display: none; }
  dialog.fenetre > form { min-height: 100%; }
  .fenetre__tete { padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px 16px; }
  .fenetre__corps { padding: 16px; flex: 1; }
  .fenetre__pied { padding: 12px 16px calc(12px + var(--bas)); margin-top: auto; }
  .fenetre__pied > .btn { flex: 1; }
}
@keyframes monter { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ── Divers ───────────────────────────────────────────────── */
.doux { color: var(--doux); }
.petit { font-size: .85rem; }
.gras { font-weight: 600; color: var(--encre); }
.vert { color: var(--vert); } .rouge { color: var(--rouge); } .ambre { color: var(--ambre); }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ligne--entre { justify-content: space-between; }
.liste-def { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: .92rem; }
.liste-def dt { color: var(--doux); }
.liste-def dd { margin: 0; color: var(--encre); }
.jauge { height: 8px; border-radius: 99px; background: var(--gris-pale); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: inherit; background: var(--rouge); }
.jauge--vert > span { background: var(--vert); }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple > li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--filet); }
.liste-simple > li:last-child { border-bottom: 0; }
@media (max-width: 600px) { .liste-simple > li { padding: 11px 14px; } }
.vide-etat { text-align: center; padding: 36px 18px; color: var(--doux); }
.vide-etat .ic { width: 36px; height: 36px; color: var(--filet-fort); margin-bottom: 8px; }
.vide-etat h1 { margin: 4px 0 8px; font-size: 1.3rem; }
.bandeau { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 18px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--filet); margin: 18px 0; }
.graphe { width: 100%; height: auto; display: block; }
.graphe-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.graphe text { fill: var(--doux); font-size: 11px; font-family: inherit; }
.graphe .axe { stroke: var(--filet); }
.cache, [hidden] { display: none !important; }
.codes-secours { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; font-family: ui-monospace, monospace; font-size: 1rem; padding: 14px; background: var(--gris-pale); border-radius: var(--rayon-petit); }

/* ── Accueil : actions rapides ────────────────────────────── */
.raccourcis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-bottom: 18px; }
.raccourci {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--rayon); background: var(--carte);
  border: 1px solid var(--filet); box-shadow: var(--ombre); color: var(--encre); font-weight: 600; line-height: 1.25; min-height: 68px;
  transition: border-color .12s, box-shadow .12s, transform .06s;
}
.raccourci:hover { text-decoration: none; border-color: var(--rouge); box-shadow: var(--ombre-moyenne); }
.raccourci:active { transform: translateY(1px); }
.raccourci__ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--rouge-pale); color: var(--rouge); }
.raccourci__ic .ic { width: 22px; height: 22px; }
.raccourci small { display: block; font-weight: 450; color: var(--doux); font-size: .8rem; margin-top: 2px; }
.raccourci--principal { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.raccourci--principal .raccourci__ic { background: rgba(255, 255, 255, .18); color: #fff; }
.raccourci--principal small { color: rgba(255, 255, 255, .85); }
.raccourci--principal:hover { background: var(--rouge-fonce); }
@media (max-width: 600px) {
  .raccourcis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .raccourci { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 104px; padding: 14px; }
}
.date-pastille { width: 46px; height: 48px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; background: var(--rouge-pale); color: var(--rouge); line-height: 1; }
.date-pastille b { font-size: 1.1rem; font-weight: 700; }
.date-pastille span { font-size: .62rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ── Familles ─────────────────────────────────────────────── */
.proches { display: grid; gap: 12px; }
.proche { position: relative; border: 1px solid var(--filet); border-left: 4px solid var(--bleu); border-radius: var(--rayon-petit); padding: 12px 14px; background: var(--carte); }
.proche[data-type="conjoint"] { border-left-color: var(--violet); }
.proche__tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding-right: 40px; }
.proche__pastille { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bleu-pale); color: var(--bleu); flex: none; }
.proche[data-type="conjoint"] .proche__pastille { background: var(--violet-pale); color: var(--violet); }
.proche__ic-conjoint { display: none; }
.proche[data-type="conjoint"] .proche__ic-conjoint { display: contents; }
.proche[data-type="conjoint"] .proche__ic-enfant { display: none; }
.proche__ic-enfant, .proche__ic-conjoint { line-height: 0; }
.proche__age { font-weight: 650; color: var(--encre); font-size: .92rem; }
.proche__retirer { position: absolute; top: 10px; right: 10px; color: var(--doux); }
.proche__retirer:hover { color: var(--rouge); }
.proche__champs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; }
.proches__vide { border: 1px dashed var(--filet-fort); border-radius: var(--rayon-petit); padding: 22px; }

.familles { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: start; }
.familles > .carte { margin-top: 0; }
.famille { overflow: hidden; }
.famille__tete { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--filet); }
.famille__qui { flex: 1; min-width: 0; }
.famille__nom { font-weight: 650; color: var(--encre); font-size: 1rem; }
.famille__sous { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font-size: .82rem; }
.famille__liste { list-style: none; margin: 0; padding: 6px 0; }
.famille__rien { margin: 0; padding: 14px 16px; color: var(--doux); font-size: .9rem; }
.famille--vide { background: transparent; box-shadow: none; border-style: dashed; }
.famille--vide .avatar { background: var(--filet-fort); }
.membre-famille { display: flex; align-items: flex-start; gap: 12px; padding: 8px 16px; }
.membre-famille + .membre-famille { border-top: 1px solid var(--filet); }
.membre-famille__ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--bleu-pale); color: var(--bleu); margin-top: 1px; }
.membre-famille--conjoint .membre-famille__ic { background: var(--violet-pale); color: var(--violet); }
.membre-famille__corps { flex: 1; min-width: 0; }
.membre-famille__nom { font-weight: 600; color: var(--encre); }
.membre-famille__sous { font-size: .8rem; color: var(--doux); }
.membre-famille__puces { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.membre-famille__age { font-weight: 650; color: var(--encre); white-space: nowrap; font-size: .92rem; padding-top: 2px; }

/* ── Connexion et pages hors coquille ─────────────────────── */
.page-connexion {
  min-height: 100vh; display: grid; place-items: center; padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(28px + var(--bas));
  background:
    radial-gradient(1200px 420px at 50% -120px, var(--rouge-pale), transparent 70%),
    var(--fond);
}
.connexion { width: min(440px, 100%); }
.connexion .carte { border-top: 3px solid var(--rouge); }
.connexion .carte__corps { padding: 28px; }
.connexion h1 { font-size: 1.35rem; margin-bottom: 6px; }
.connexion__pied { text-align: center; margin-top: 18px; font-size: .82rem; color: var(--doux); }
.connexion__illustration { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--rouge-pale); color: var(--rouge); margin-bottom: 16px; }
.connexion__illustration .ic { width: 26px; height: 26px; }
.connexion__conseils { margin: 14px 0 0; padding-left: 18px; color: var(--doux); font-size: .88rem; display: grid; gap: 6px; }
@media (max-width: 480px) { .connexion .carte__corps { padding: 22px 18px; } }

/* ── Impression ───────────────────────────────────────────── */
@media print {
  .menu, .barre-mobile, .onglets-bas, .entete__actions, .outils, .btn, .onglets, .raccourcis, .evitement { display: none !important; }
  .app { display: block; }
  .principal { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .carte, .indicateur { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .familles { display: block; }
  .famille { margin-bottom: 10px; }
}

/* ── Premier accueil (/bienvenue) ─────────────────────────── */
.connexion--assistant { width: min(760px, 100%); }
.assistant h1 { font-size: 1.35rem; margin-bottom: 8px; }
.assistant__sur { font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rouge); margin-bottom: 6px; }
.etapes-accueil { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0; }
.etapes-accueil li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--carte); border: 1px solid var(--filet); color: var(--doux); font-size: .85rem; font-weight: 550; min-width: 0; }
.etapes-accueil__num { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--gris-pale); font-size: .8rem; font-weight: 700; }
.etapes-accueil__lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etapes-accueil li.courante { border-color: var(--rouge); color: var(--encre); }
.etapes-accueil li.courante .etapes-accueil__num { background: var(--rouge); color: #fff; }
.etapes-accueil li.faite .etapes-accueil__num { background: var(--vert-pale); color: var(--vert); }
@media (max-width: 520px) { .etapes-accueil li:not(.courante) .etapes-accueil__lib { display: none; } .etapes-accueil li:not(.courante) { flex: none; } }
.choix-gros { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); margin-top: 18px; }
.choix-gros__bouton { display: flex; align-items: center; gap: 14px; padding: 18px; text-align: left; border-radius: 14px; border: 2px solid var(--filet-fort); background: var(--carte); color: var(--encre); font: inherit; cursor: pointer; }
.choix-gros__bouton .ic { width: 28px; height: 28px; color: var(--rouge); }
.choix-gros__bouton strong { display: block; font-size: 1.02rem; }
.choix-gros__bouton small { color: var(--doux); }
.choix-gros__bouton:hover { border-color: var(--rouge); background: var(--rouge-pale); }
.choix-gros__bouton.choisi { border-color: var(--rouge); }
.questions-famille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.question-famille { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--filet); border-radius: 12px; background: var(--survol); }
.question-famille.en-erreur { border-color: var(--rouge); background: var(--rouge-pale); }
.question-famille .choix { width: 100%; }

/* ── Adresse avec suggestions (champ_adresse) ─────────────── */
fieldset.adresse { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
fieldset.adresse legend { padding: 0; margin-bottom: 4px; }
.adresse__recherche { position: relative; display: grid; gap: 5px; }
.adresse__saisie { position: relative; display: block; }
.adresse__saisie .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--doux); pointer-events: none; }
.adresse__saisie input { padding-left: 34px; }
.adresse__liste { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% - 22px); margin: 0; padding: 4px; list-style: none; background: var(--carte); border: 1px solid var(--filet-fort); border-radius: 10px; box-shadow: var(--ombre-haute); max-height: 300px; overflow-y: auto; }
.adresse__liste li { display: grid; gap: 1px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.adresse__liste li strong { font-weight: 560; color: var(--encre); }
.adresse__liste li small { color: var(--doux); font-size: .78rem; }
.adresse__liste li:hover, .adresse__liste li.actif { background: var(--rouge-pale); }
.adresse__champs { padding: 12px; border: 1px dashed var(--filet-fort); border-radius: 10px; }
.adresse__pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.adresse__ancienne { margin: 0; }

/* ── « Voir comme » (président) ───────────────────────────── */
.voir-comme { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: #1b2a4a; color: #fff; font-size: .9rem; }
.voir-comme .ic { color: #fff; }
.voir-comme strong { color: #fff; }
.voir-comme__ro { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #c8102e; font-weight: 600; font-size: .78rem; }
.voir-comme form { margin: 0; }
.voir-comme .btn { background: #fff; color: #1b2a4a; border-color: #fff; }
.voir-comme ~ .barre-mobile { top: 46px; }

/* Inscription par lien */
.assistant__titre { font-size: 1.02rem; margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--filet); }
.assistant__titre:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.case--accord { align-items: flex-start; margin-top: 14px; line-height: 1.45; }
.case--accord input { margin-top: 2px; }
.case--accord.en-erreur { color: var(--rouge); }
.ligne-interne td { color: var(--doux); } .ligne-interne .vert, .ligne-interne .rouge { color: var(--doux); text-decoration: line-through; }
/* Courbes interactives */
.graphe-guide { stroke: var(--doux); stroke-dasharray: 3 3; }
.graphe-zone { cursor: crosshair; touch-action: pan-y; }
.graphe-bulle { position: absolute; z-index: 5; pointer-events: none; min-width: 190px; padding: 10px 12px; border-radius: var(--rayon-petit); background: var(--carte); border: 1px solid var(--filet-fort); box-shadow: var(--ombre-moyenne); font-size: .85rem; }
.graphe-bulle__titre { font-weight: 700; margin-bottom: 6px; text-transform: capitalize; }
.graphe-bulle__ligne { display: flex; align-items: center; gap: 8px; }
.graphe-bulle__ligne span { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.graphe-bulle__ligne strong { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.legende__bouton { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--filet); background: none; color: inherit; font: inherit; padding: 3px 10px; border-radius: 99px; cursor: pointer; }
.legende__bouton span { width: 10px; height: 10px; border-radius: 3px; }
.legende__bouton[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.periode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.periode input[type=month] { width: auto; }
.choix-comptes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.puce-case { display: inline-flex; cursor: pointer; }
.puce-case input { position: absolute; opacity: 0; pointer-events: none; }
.puce-case span { padding: 5px 12px; border: 1px solid var(--filet-fort); border-radius: 99px; font-size: .85rem; color: var(--doux); }
.puce-case span small { opacity: .8; margin-left: 4px; }
.puce-case input:checked + span { border-color: var(--marine); background: var(--marine-pale); color: var(--encre); font-weight: 600; }
.puce-case input:focus-visible + span { outline: 2px solid var(--rouge); outline-offset: 2px; }
.graphe-barre { transition: opacity .12s; } .graphe-barre.estompee { opacity: .35; }
.graphe text.graphe-mois { font-size: 8.5px; }
.graphe text.graphe-etiquette { font-size: 9px; font-weight: 700; }
.violet { color: var(--violet); }

/* ── Listes déroulantes avec recherche (app.js habille chaque <select>) ──────
   Le <select> reste en place, invisible : il donne sa taille à l'enveloppe, le
   bouton le recouvre. Les règles de largeur des <select> continuent donc de valoir. */
.liste { position: relative; display: block; min-width: 0; }
.entete__actions .liste, .outils .liste, .liste--ajustee { display: inline-block; max-width: 100%; vertical-align: middle; }
.liste__natif { opacity: 0; pointer-events: none; }
.liste__bouton {
  position: absolute; inset: 0; width: 100%; display: flex; align-items: center; padding: 0 34px 0 12px; text-align: left;
  border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit); color: var(--encre); font: inherit; font-size: .95rem; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.liste__bouton:hover { border-color: var(--doux); }
.liste__bouton:focus-visible, .liste--ouverte .liste__bouton { outline: none; border-color: var(--rouge); box-shadow: 0 0 0 3px var(--rouge-pale); }
.liste__bouton:disabled { opacity: .55; cursor: not-allowed; }
.liste--invalide .liste__bouton { border-color: var(--rouge); }
.liste__texte { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste__bouton--vide .liste__texte { color: var(--doux); }

.liste__panneau {
  position: fixed; z-index: 90; display: flex; flex-direction: column; overflow: hidden;
  background: var(--carte); color: var(--texte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre-haute);
  animation: liste-entree .12s ease-out;
}
@keyframes liste-entree { from { opacity: 0; transform: translateY(-4px); } }
.liste__tete { padding: 8px; border-bottom: 1px solid var(--filet); flex: none; }
.liste__titre { display: none; }
.liste__recherche[type=search] {
  min-height: 38px; padding-left: 36px; border-color: var(--filet); background: var(--survol) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") no-repeat 10px center / 18px;
}
.liste__options { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.liste__options li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border-radius: 8px;
  font-size: .93rem; color: var(--encre); cursor: pointer; scroll-margin: 6px;
}
.liste__options li[hidden] { display: none; }
.liste__options li.actif { background: var(--gris-pale); }
.liste__options li[aria-selected=true] { background: var(--rouge-pale); color: var(--rouge); font-weight: 600; }
.liste__options li[aria-selected=true].actif { box-shadow: inset 0 0 0 1px var(--rouge); }
.liste__options li[aria-selected=true]::after { content: ""; flex: none; width: 7px; height: 12px; margin-right: 4px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.liste__options li[aria-disabled=true] { color: var(--doux); cursor: not-allowed; opacity: .7; }
.liste__options li.liste__option--vide:not([aria-selected=true]) { color: var(--doux); }
.liste__rien { padding: 18px; text-align: center; color: var(--doux); font-size: .9rem; }
.liste__rien[hidden] { display: none; }
@media (max-width: 960px) { .liste__bouton { font-size: 16px; } }
@media (max-width: 720px) {
  .outils .liste { flex: 1 1 40%; min-width: 0; }
  .outils .liste > select { width: 100%; }
  /* Sur téléphone : un volet en haut de l'écran, que le clavier ne recouvre pas. */
  .liste__panneau {
    left: 8px; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 8px); max-height: min(72vh, 560px);
    box-shadow: var(--ombre-haute), 0 0 0 100vmax rgba(15, 19, 26, .5);
  }
  .liste__titre { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 8px 6px; font-weight: 650; color: var(--encre); }
  .liste__fermer { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--gris-pale); color: var(--encre); font-size: 1.3rem; line-height: 1; cursor: pointer; }
  .liste__recherche[type=search] { min-height: 46px; }
  .liste__options li { min-height: 46px; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .liste__panneau { animation: none; } }

/* ── Départs en cours (Calendriers › Tournées) ───────────────────────────── */
.departs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.depart {
  display: flex; flex-direction: column; gap: 14px; padding: 16px; min-width: 0;
  border: 1px solid var(--filet); border-left: 4px solid var(--bleu); border-radius: var(--rayon); background: var(--carte);
}
.depart--long { border-left-color: var(--ambre); }
.depart__tete { display: flex; align-items: center; gap: 11px; min-width: 0; }
.depart__qui { flex: 1; min-width: 0; }
.depart__nom { font-weight: 650; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.depart__sous { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--doux); }
.depart__pouls { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bleu); animation: depart-pouls 1.8s ease-out infinite; }
.depart--long .depart__pouls { background: var(--ambre); }
@keyframes depart-pouls { 0% { box-shadow: 0 0 0 0 rgba(29, 78, 216, .45); } 100% { box-shadow: 0 0 0 9px rgba(29, 78, 216, 0); } }
.depart__outils { display: flex; flex: none; }
.depart__chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.depart__chiffre { padding: 10px 6px; border-radius: var(--rayon-petit); background: var(--survol); text-align: center; min-width: 0; }
.depart__chiffre strong { display: block; font-size: 1.35rem; font-weight: 700; line-height: 1.15; color: var(--encre); white-space: nowrap; }
.depart__chiffre span { display: block; margin-top: 2px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); }
.depart__chiffre--fort { background: var(--bleu-pale); }
.depart__chiffre--fort strong { color: var(--bleu); }
.depart--long .depart__chiffre--duree strong { color: var(--ambre); }
.departs-vide { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--doux); }
.departs-vide__ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--gris-pale); color: var(--doux); }
.departs-vide p { flex: 1 1 240px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .depart__pouls { animation: none; } }
.liste__options li.liste__option--vide[aria-selected=true] { background: none; color: var(--doux); font-weight: 400; }
.liste__options li.liste__option--vide[aria-selected=true].actif { background: var(--gris-pale); box-shadow: none; }
.liste__options li.liste__option--vide[aria-selected=true]::after { display: none; }
@media (max-width: 720px) {
  #en-tournee .carte__corps { padding: 12px; }
  .depart { padding: 14px 12px; }
  .depart__nom { white-space: normal; }
}
.liste__bouton { font-weight: 400; letter-spacing: normal; text-transform: none; }

/* ── Retour de tournée : fenêtre plein écran, comptage sur trois colonnes ── */
dialog.fenetre--plein { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
dialog.fenetre--plein[open], dialog.fenetre--plein > form { display: flex; flex-direction: column; }
dialog.fenetre--plein > form { flex: 1; min-height: 0; }
.fenetre--plein .fenetre__corps { flex: 1; min-height: 0; overflow-y: auto; background: var(--fond); padding: 20px clamp(16px, 3vw, 40px); }
.fenetre--plein .fenetre__tete, .fenetre--plein .fenetre__pied { position: static; flex: none; padding-left: clamp(16px, 3vw, 40px); padding-right: clamp(16px, 3vw, 40px); }
.fenetre--plein .fenetre__pied { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; box-shadow: 0 -4px 14px rgba(17, 24, 39, .06); }
.retour-etape { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; font-size: 1.05rem; font-weight: 650; color: var(--encre); }
.retour-etape:not(:first-of-type) { margin-top: 24px; }
.retour-etape small { font-size: .84rem; font-weight: 400; color: var(--doux); }
.retour-etape__no { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--marine); color: #fff; font-size: .85rem; }
.retour-haut { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
.retour-haut + .message { margin: 12px 0 0; }
.retour-vendus { display: flex; flex-direction: column; justify-content: center; min-height: 66px; padding: 8px 14px; border-radius: var(--rayon-petit); background: var(--bleu-pale); }
.retour-vendus span { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bleu); }
.retour-vendus strong { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--bleu); }
.comptage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.comptage__col { display: flex; flex-direction: column; min-width: 0; background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre); }
.comptage__tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 10px 16px; border-bottom: 1px solid var(--filet); font-size: 1.02rem; font-weight: 650; color: var(--encre); }
.comptage__lignes { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.compte-ligne { display: grid; grid-template-columns: 64px 12px minmax(0, 1fr) 96px; align-items: center; gap: 8px; }
.compte-ligne--cheque { grid-template-columns: 44px minmax(0, 1fr) 14px; }
.compte-ligne__val { text-align: right; font-weight: 650; color: var(--encre); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compte-ligne input[type=number] { text-align: center; font-size: 1.05rem; font-weight: 600; min-height: 40px; padding: 4px 8px; }
.compte-ligne__st { text-align: right; color: var(--doux); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compte-ligne--remplie .compte-ligne__st { color: var(--encre); font-weight: 600; }
.compte-ligne--remplie input[type=number] { border-color: var(--vert); background: var(--vert-pale); }
.comptage__pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--filet); background: var(--survol); border-radius: 0 0 var(--rayon) var(--rayon); }
.comptage__pied span { font-weight: 650; color: var(--encre); }
.comptage__pied input[type=number] { width: 150px; text-align: right; font-size: 1.2rem; font-weight: 700; }
.retour-bilan { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; flex: 1 1 420px; min-width: 0; }
.retour-bilan__chiffre span { display: block; font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); }
.retour-bilan__chiffre strong { font-size: 1.5rem; font-weight: 700; line-height: 1.15; color: var(--encre); white-space: nowrap; }
.retour-bilan .message { margin: 0; flex: 0 1 auto; font-weight: 600; }
.retour-actions { display: flex; gap: 8px; }
@media (max-width: 1100px) { .retour-haut { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .comptage { grid-template-columns: minmax(0, 1fr); }
  .comptage__lignes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
}
@media (max-width: 640px) {
  .retour-haut { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comptage__lignes { grid-template-columns: minmax(0, 1fr); }
  .retour-actions { flex: 1 1 100%; }
  .retour-actions > .btn { flex: 1; }
  .retour-bilan { flex-basis: 100%; gap: 8px 18px; }
  .retour-bilan .message { flex-basis: 100%; }
}
/* Total de la colonne en tête, toujours visible ; lignes plus serrées ; chèques sur deux rangs. */
.comptage__tete { padding: 10px 14px 10px 16px; background: var(--survol); border-radius: var(--rayon) var(--rayon) 0 0; cursor: default; }
.comptage__total { display: flex; align-items: center; gap: 6px; flex: none; }
.comptage__total input[type=number] { width: 132px; min-height: 40px; text-align: right; font-size: 1.2rem; font-weight: 700; }
.comptage__total b { font-size: 1.1rem; color: var(--doux); }
.comptage__lignes { gap: 6px; padding: 12px 16px; }
.compte-ligne input[type=number] { min-height: 36px; }
.comptage__lignes--cheques { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(6, auto); gap: 6px 14px; align-content: start; }
.compte-ligne--cheque { grid-template-columns: 38px minmax(0, 1fr) 12px; gap: 6px; }
.retour-etape:not(:first-of-type) { margin-top: 18px; }
@media (max-width: 900px) { .comptage__lignes--cheques { grid-auto-flow: row; grid-template-rows: none; } }
@media (max-width: 640px) { .comptage__lignes--cheques { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.retour-haut + .message[hidden] { display: none; }
/* Quatre colonnes : souche, billets, pièces, chèques ; lignes « tant de tant ». */
.retour-haut--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.comptage { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.comptage__col--souche { border-color: var(--marine); }
.comptage__col--souche .comptage__tete { background: var(--marine-pale); }
.comptage__total input[type=number] { width: 118px; }
.comptage__lignes { padding: 10px 14px 12px; }
.comptage__aide { font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); margin-bottom: 2px; }
.compte-ligne { grid-template-columns: 54px 10px minmax(0, 1fr) 82px; gap: 6px; }
.compte-ligne--lot { grid-template-columns: minmax(0, .75fr) 10px minmax(0, 1fr) 10px 78px; }
.compte-ligne--lot input[type=number] { padding: 4px 6px; }
.compte-ligne--lot input[data-qte], .compte-ligne input[data-somme] { -moz-appearance: textfield; appearance: textfield; }
.compte-ligne--lot input::-webkit-inner-spin-button, .compte-ligne input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.comptage__note { padding: 9px 14px; border-top: 1px solid var(--filet); font-size: .82rem; color: var(--doux); border-radius: 0 0 var(--rayon) var(--rayon); }
.comptage__note--remplie { color: var(--encre); font-weight: 600; background: var(--vert-pale); }
@media (max-width: 1250px) { .comptage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .retour-haut--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .comptage { grid-template-columns: repeat(2, minmax(0, 1fr)); } .comptage__lignes { display: flex; flex-direction: column; } }
@media (max-width: 700px) { .comptage { grid-template-columns: minmax(0, 1fr); } }
.comptage__lignes { gap: 4px; }

/* ── Secteurs, pointage, repasses (Calendriers, 2026-11-27) ──────────────────
   Couleurs d'état : fait = vert, à repasser = ambre, refus = rouge, inhabité = ardoise. */
.pastille { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; flex: none; }
.pastille--vide { background: transparent; border: 2px solid var(--filet-fort); }
a.indicateur { color: inherit; display: block; } a.indicateur:hover { text-decoration: none; border-color: var(--filet-fort); }
.avance { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; }
.avance__barre { display: flex; flex: 1; height: 8px; min-width: 80px; border-radius: 99px; overflow: hidden; background: var(--gris-pale); }
.avance__barre i { display: block; height: 100%; }
.avance--fait { background: #059669; } .avance--autre { background: #64748b; } .avance--repasse { background: #f59e0b; }
.avance__pc { font-size: .8rem; color: var(--doux); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.tableau .coche { width: 34px; } .tableau tr.cache { display: none; }
.rues-action { background: var(--survol); } .rues-action .doux { flex: 1 1 200px; }
.secteurs-sans { border-top: 1px solid var(--filet); font-size: .9rem; color: var(--doux); } .secteurs-sans strong { color: var(--ambre); }
.secteur-nom { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 12px; }
.secteur-nom input[type=color] { padding: 3px; height: 42px; cursor: pointer; }
fieldset.champ { border: 0; padding: 0; margin: 0; min-width: 0; } fieldset.champ > legend { padding: 0; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.cases-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; max-height: 240px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit); }
.cases-agents label { display: flex; align-items: center; gap: 8px; padding: 5px 2px; cursor: pointer; font-size: .92rem; }
.cases-agents input { width: 17px; height: 17px; flex: none; accent-color: var(--rouge); }

.secteurs-carte { overflow: hidden; }
.secteurs-carte .carte__tete { flex-wrap: wrap; }
.secteurs-carte__plan { height: min(68vh, 720px); min-height: 380px; position: relative; z-index: 0; isolation: isolate; background: var(--gris-pale); }
.secteurs-carte__plan--trace { cursor: crosshair; }
.secteurs-carte__plan .leaflet-container, .leaflet-container { font: inherit; }
.secteurs-carte__legende { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 12px 18px; border-top: 1px solid var(--filet); font-size: .86rem; min-height: 46px; }
.legende-carte__item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--filet); background: none; color: inherit; font: inherit; font-size: .86rem; }
button.legende-carte__item { cursor: pointer; } button.legende-carte__item:hover { background: var(--survol); }
.legende-carte__item i { width: 10px; height: 10px; border-radius: 50%; }
.legende-carte__item small { color: var(--doux); }
.trace { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 18px; background: var(--ambre-pale); border-bottom: 1px solid var(--filet); font-size: .9rem; }
.trace[hidden], .trace__form[hidden] { display: none; }
.trace__texte { flex: 1 1 260px; }
.trace__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trace__form select, .trace__form .liste { width: auto; min-width: 200px; }
.bulle { font-size: .88rem; line-height: 1.45; color: #1f2937; }
.bulle__adresse { font-weight: 650; font-size: .95rem; color: #111827; } .bulle__commune { color: #6b7280; margin-bottom: 4px; }
.bulle__etat { font-weight: 600; } .bulle__etat--1 { color: #047857; } .bulle__etat--2 { color: #b45309; } .bulle__etat--3 { color: #b91c1c; }
.bulle a { display: inline-block; margin-top: 6px; font-weight: 600; color: #c8102e; }

.choix-pointage { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; margin-top: 14px; }
.choix-pointage__lien { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 0; padding: 12px 14px; border: 1px solid var(--filet); border-radius: var(--rayon-petit); color: inherit; }
.choix-pointage__lien:hover { text-decoration: none; border-color: var(--filet-fort); background: var(--survol); }
.choix-pointage__lien small { grid-column: 2; color: var(--doux); } .choix-pointage__lien .avance { grid-column: 1 / -1; margin-top: 6px; }

.pinceau { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; margin-bottom: 16px; background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre-moyenne); }
.pinceau__etats { display: flex; flex-wrap: wrap; gap: 6px; }
.pinceau__etat { position: relative; cursor: pointer; }
.pinceau__etat input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pinceau__etat span { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 2px solid var(--filet-fort); font-weight: 600; font-size: .92rem; }
.pinceau__etat span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.pinceau__etat--fait { --c: #059669; } .pinceau__etat--repasse { --c: #f59e0b; } .pinceau__etat--refus { --c: #dc2626; } .pinceau__etat--vide { --c: #64748b; }
.pinceau__etat--efface span::before { background: transparent; border: 2px solid var(--filet-fort); box-sizing: border-box; }
.pinceau__etat input:checked + span { border-color: var(--c, var(--encre)); background: var(--survol); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--encre)) 25%, transparent); }
.pinceau__etat input:focus-visible + span { outline: 2px solid var(--bleu); outline-offset: 2px; }
.pinceau__champ { min-width: 0; } .pinceau__champ select, .pinceau__champ input, .pinceau__champ .liste { width: auto; min-width: 150px; }
.pinceau__note { flex: 1 1 240px; } .pinceau__note input { width: 100%; } .pinceau__note[hidden] { display: none; }
.pinceau__point { margin-left: auto; font-size: .88rem; color: var(--doux); } .pinceau__point strong { color: var(--encre); font-variant-numeric: tabular-nums; }
.pinceau__etat-envoi { margin-left: 8px; color: var(--vert); } .pinceau__etat-envoi--erreur { color: var(--rouge); font-weight: 600; }

.rue { scroll-margin-top: 130px; }
.rue__tete { flex-wrap: wrap; } .rue__nom { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.rue__compte { color: var(--doux); font-variant-numeric: tabular-nums; } .rue__compte strong { color: var(--encre); }
.rue__maisons { display: grid; gap: 10px; }
.rue__cote { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.rue__cote-nom { font-size: .74rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--doux); padding-top: 11px; }
.maisons { display: flex; flex-wrap: wrap; gap: 6px; }
.maison { min-width: 44px; min-height: 40px; padding: 0 9px; border-radius: 9px; border: 1.5px solid var(--filet-fort); background: var(--carte); color: var(--texte); font: inherit; font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color .08s, transform .05s; }
.maison:hover { border-color: var(--doux); } .maison:active { transform: scale(.95); }
.maison--texte { font-weight: 500; font-size: .84rem; }
.maison[data-etat="fait"] { background: #059669; border-color: #059669; color: #fff; }
.maison[data-etat="repasse"] { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
.maison[data-etat="refus"] { background: #dc2626; border-color: #dc2626; color: #fff; }
.maison[data-etat="vide"] { background: #64748b; border-color: #64748b; color: #fff; text-decoration: line-through; }

.repasses__regler { background: var(--survol); } .repasses__regler input[type=date] { width: auto; }
.repasses__tout { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; cursor: pointer; }
.repasse-rue { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 6px 16px; padding: 10px 0; border-bottom: 1px solid var(--filet); }
.repasse-rue:last-child { border-bottom: 0; padding-bottom: 0; } .repasse-rue:first-child { padding-top: 0; }
.repasse-rue__nom { font-weight: 600; } .repasse-rue__nom .doux { font-weight: 400; font-size: .86rem; display: block; }
.repasse-rue__maisons { display: flex; flex-wrap: wrap; gap: 6px; }
.repasse { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 11px; border: 1.5px solid #f59e0b; background: var(--ambre-pale); border-radius: 9px; cursor: pointer; }
.repasse input { width: 17px; height: 17px; accent-color: var(--rouge); } .repasse__no { font-weight: 650; font-variant-numeric: tabular-nums; } .repasse__note { color: var(--doux); font-size: .84rem; }
@media (max-width: 960px) {
  .pinceau { top: var(--barre); margin: 0 -8px 14px; border-radius: var(--rayon-petit); }
  .pinceau__point { margin-left: 0; flex-basis: 100%; }
  .pinceau__champ { flex: 1 1 40%; } .pinceau__champ select, .pinceau__champ input, .pinceau__champ .liste { width: 100%; min-width: 0; }
  .pinceau__etat span { padding: 0 10px; min-height: 42px; }
  .rue__cote { grid-template-columns: 1fr; gap: 4px; } .rue__cote-nom { padding-top: 0; }
  .maison { min-width: 48px; min-height: 44px; }
  .repasse-rue { grid-template-columns: 1fr; }
  .secteurs-carte__plan { height: 62vh; }
  .secteur-nom { grid-template-columns: minmax(0, 1fr) 64px; }
}
@media print {
  .pinceau, .secteurs-carte, .repasses__regler { display: none !important; }
  .repasse { border-color: #999; background: #fff; }
  .repasses { break-inside: auto; } .repasse-rue { break-inside: avoid; }
}
/* La liste des rues (plus de 500 lignes) défile dans son cadre, en-tête figé. */
@media (min-width: 721px) { #rues .tableau-conteneur { max-height: 620px; overflow-y: auto; } #rues thead th { position: sticky; top: 0; background: var(--carte); z-index: 1; } }

/* ── Départ : rues confiées, SMS ; « Ma tournée » de l'amicaliste (2026-11-27) ── */
.depart-rues { border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit); overflow: hidden; }
.depart-rues[hidden] { display: none; }
.depart-rues__tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--survol); border-bottom: 1px solid var(--filet); font-size: .9rem; }
.depart-rues__liste { max-height: 230px; overflow-y: auto; padding: 4px 12px; }
.depart-rues__liste label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; align-items: center; padding: 6px 0; cursor: pointer; border-bottom: 1px solid var(--filet); }
.depart-rues__liste label:last-child { border-bottom: 0; }
.depart-rues__liste input, .case-sms input { width: 18px; height: 18px; accent-color: var(--rouge); flex: none; }
.depart-rues__liste small { grid-column: 2; color: var(--doux); font-size: .8rem; }
.case-sms { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit); cursor: pointer; }
.case-sms input { margin-top: 3px; } .case-sms small { display: block; color: var(--doux); font-size: .84rem; margin-top: 2px; }
.depart__secteur { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .86rem; margin: 2px 0 10px; }
.depart__secteur > span:first-child { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; }
.tournee-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.tournee-chiffre { padding: 12px 14px; border-radius: var(--rayon-petit); background: var(--gris-pale); }
.tournee-chiffre strong { display: block; font-size: 1.7rem; line-height: 1.1; color: var(--encre); font-variant-numeric: tabular-nums; }
.tournee-chiffre span { font-size: .84rem; color: var(--doux); }
.tournee-chiffre--fort { background: var(--rouge-pale); } .tournee-chiffre--fort strong { color: var(--rouge); }
.tournee-titre { font-size: 1.05rem; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--filet); }
.tournee-plan { height: 320px; border-radius: var(--rayon-petit); overflow: hidden; border: 1px solid var(--filet); margin: 10px 0 14px; position: relative; z-index: 0; isolation: isolate; background: var(--gris-pale); }
.tournee-rues { margin-bottom: 12px; } .tournee-rues__commune { font-weight: 650; margin-bottom: 4px; } .tournee-rues__commune .doux { font-weight: 400; font-size: .86rem; }
.tournee-rues ul { list-style: none; margin: 0; padding: 0; }
.tournee-rues li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--filet); }
.tournee-rues__nb { color: var(--doux); font-size: .88rem; white-space: nowrap; }
.engagements { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; } .engagements li::marker { font-weight: 700; color: var(--rouge); }
/* Noter un départ : choix libre des rues (recherche, rues choisies en tête, maisons par rue). */
.depart-secteur__outils { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.depart-secteur__outils .champ-recherche { flex: 2 1 240px; } .depart-secteur__outils select, .depart-secteur__outils .liste { flex: 1 1 170px; width: auto; min-width: 0; }
.depart-secteur .depart-rues__liste { max-height: min(38vh, 330px); min-height: 92px; }
.depart-rues__liste label { grid-template-columns: auto minmax(0, 1fr) auto; }
.depart-rues__liste label b { font-weight: 650; font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.depart-rues__liste label.choisie b { color: var(--vert); }
.depart-rues__liste label:not(.choisie) span { color: var(--doux); }
.depart-rues__liste small { grid-column: 2 / -1; }
.depart-rues__info { padding: 10px 0 6px; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); }
.depart-rues__info:only-child { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .9rem; padding: 14px 0; }
.mes-maisons__aide { margin: 0 0 12px; }
.mes-maisons__carte { overflow: hidden; margin-bottom: 14px; } .mes-maisons__carte .tournee-plan { margin: 0; border: 0; border-radius: 0; height: min(46vh, 420px); }
.mes-maisons__legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 14px; border-top: 1px solid var(--filet); font-size: .86rem; color: var(--doux); }
.mes-maisons__legende i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; } .mes-maisons__legende .btn { margin-left: auto; }
.depart__lien { display: inline-flex; margin: 0; }

/* Pointage en direct : une pastille changée par quelqu'un d'autre se signale un instant. */
.maison--maj { outline: 3px solid var(--rouge, #c8102e); outline-offset: 2px; }

/* Photos de la souche jointes à une tournée. */
.pieces-souche { margin-top: 6px; max-width: 240px; }
.retour-photos { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.retour-photos input[type=file] { max-width: 250px; font-size: .82rem; padding: 2px 6px; min-height: 0; height: 30px; border-radius: 8px; }
.retour-etape:has(.retour-photos) { margin-bottom: 4px; }

/* Noter un départ : carte à côté de la liste des rues (2026-11-28). Toucher une maison coche ou
   décoche sa rue ; « Entourer » ajoute ou retire d'un trait toutes les rues prises dans le contour. */
dialog.fenetre--carte { width: min(1240px, calc(100vw - 24px)); }
.depart-choix { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.depart-carte { border: 1px solid var(--filet-fort); border-radius: var(--rayon-petit); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.depart-carte__outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 8px; background: var(--survol); border-bottom: 1px solid var(--filet); }
.depart-carte__outils .segments button { font-size: .86rem; }
.depart-carte__plan { flex: 1; height: min(44vh, 420px); min-height: 280px; position: relative; z-index: 0; isolation: isolate; background: var(--gris-pale); }
.depart-carte__plan--lasso, .depart-carte__plan--lasso.leaflet-container { cursor: crosshair; touch-action: none !important; }
.depart-carte__aide { margin: 0; padding: 8px 12px; min-height: 37px; font-size: .86rem; color: var(--doux); border-top: 1px solid var(--filet); }
.depart-carte__aide b { color: var(--encre); font-weight: 650; }
@media (min-width: 1000px) {
  .depart-choix { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
  .depart-choix .depart-rues { display: flex; flex-direction: column; }
  .depart-secteur .depart-choix .depart-rues__liste { flex: 1 1 0; height: 0; min-height: 300px; max-height: none; }
  .depart-carte__plan { height: auto; min-height: 400px; }
}
@media (max-width: 640px) {
  .depart-carte__outils .segments { display: flex; width: 100%; }
  .depart-carte__outils .segments button { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; font-size: .78rem; white-space: normal; line-height: 1.15; }
  .depart-carte__plan { height: 46vh; min-height: 300px; }
}
input[type=datetime-local] { min-width: 0; max-width: 100%; }
.depart-carte__legende { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 12px 8px; font-size: .78rem; color: var(--doux); border-top: 1px solid var(--filet); }
.depart-carte__legende span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.depart-carte__legende i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.depart-carte__legende i.cercle { background: transparent; border: 2.5px solid #111827; }
.depart-carte__legende i.cercle--bleu { border-color: #2563eb; }
.depart-rues__liste small.a-repasser { color: #b45309; }
select.carte-fond { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; font-size: .88rem; }
.depart-carte__outils .ligne { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Nom de la personne chargée des rues, posé sur la carte (2026-11-28). */
.leaflet-tooltip.carte-nom { background: #1d4ed8; color: #fff; border: 0; border-radius: 9px; padding: 2px 8px; font-size: .74rem; font-weight: 650; box-shadow: 0 1px 4px rgba(15, 23, 42, .35); white-space: nowrap; pointer-events: none; }
.leaflet-tooltip.carte-nom::before { border-top-color: #1d4ed8; }
.depart-rues__liste small em.confiee { font-style: normal; font-weight: 600; color: #1d4ed8; }
.bulle__confiee { color: #1d4ed8; font-weight: 600; }
/* Bouton « Me situer » des cartes (position.js, 2026-11-28). */
.carte-position { position: relative; }
.carte-position__btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 2px; background: #fff; color: #334155; cursor: pointer; }
.carte-position__btn:hover { background: #f4f4f4; }
.carte-position__btn[aria-pressed="true"] { color: #0284c7; }
.carte-position__btn--suivi { background: #e0f2fe; }
.carte-position__msg { position: absolute; left: 42px; top: 0; width: max-content; max-width: min(250px, 62vw); padding: 7px 10px; border-radius: 8px; background: #111827; color: #fff; font-size: .8rem; line-height: 1.3; box-shadow: 0 2px 8px rgba(15, 23, 42, .3); }
.carte-position__msg[hidden] { display: none; }
/* « En direct » : pastille quand la page n'ose pas se recharger seule (saisie en cours). */
.direct-pastille { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border: 0; border-radius: 999px; background: #111827; color: #fff; font: inherit; font-size: .9rem; font-weight: 600; box-shadow: 0 6px 20px rgba(15, 23, 42, .35); cursor: pointer; max-width: calc(100vw - 24px); }
@media (max-width: 960px) { .direct-pastille { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); font-size: .84rem; } }

/* Tournées, version compacte (2026-11-28) : « En tournée » = une ligne par agent, indicateurs
   sur une ligne fine, graphique replié, tableau resserré. */
.departs { display: block; }
.depart { display: grid; grid-template-columns: minmax(170px, 1.25fr) auto minmax(150px, 1.5fr) auto; align-items: center; gap: 4px 16px; padding: 7px 4px 7px 12px; border: 0; border-left: 3px solid var(--bleu); border-bottom: 1px solid var(--filet); border-radius: 0; box-shadow: none; background: transparent; }
.depart:last-child { border-bottom: 0; }
.depart:hover { background: var(--survol); }
.depart--long { border-left-color: var(--ambre); }
.depart .avatar { width: 30px; height: 30px; font-size: .72rem; }
.depart__tete { gap: 9px; }
.depart__sous { font-size: .78rem; gap: 6px; }
.depart__chiffres { display: flex; gap: 14px; }
.depart__chiffre, .depart__chiffre--fort { padding: 0; background: none; display: flex; align-items: baseline; gap: 4px; text-align: left; }
.depart__chiffre strong { display: inline; font-size: 1rem; }
.depart__chiffre span { display: inline; margin: 0; font-size: .74rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.depart__secteur { margin: 0; font-size: .82rem; gap: 4px 6px; }
.depart__secteur > span:first-child { margin-right: 4px; }
.depart__actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.depart__actions form { display: inline-flex; margin: 0; }
.depart__actions .btn--principal { margin-right: 4px; }
@media (max-width: 1100px) {
  .depart { grid-template-columns: minmax(0, 1fr) auto; padding: 9px 2px 9px 10px; }
  .depart__tete { grid-column: 1; grid-row: 1; }
  .depart__actions { grid-column: 2; grid-row: 1; }
  .depart__chiffres, .depart__secteur { grid-column: 1 / -1; }
}
.indicateurs--compact { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin: 12px 0; }
.indicateurs--compact .indicateur { padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.indicateurs--compact .indicateur::before { top: 8px; bottom: 8px; }
.indicateurs--compact .indicateur__valeur { font-size: 1.15rem; margin: 0; order: -1; }
.indicateurs--compact .indicateur__pied { flex-basis: 100%; font-size: .76rem; }
details.repli > summary { padding: 10px 16px; font-weight: 650; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary::before { content: "▸"; color: var(--doux); }
details.repli[open] > summary::before { content: "▾"; }
details.repli[open] > summary { border-bottom: 1px solid var(--filet); }
.tableau--dense td { padding: 6px 12px; }
.tableau--dense th { padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 640px) {
  .depart { grid-template-columns: minmax(0, 1fr); }
  .depart__tete, .depart__actions { grid-column: 1; grid-row: auto; }
  .depart__actions { justify-content: flex-start; }
  .depart__actions .btn--principal { flex: 1; justify-content: center; }
}
/* Paiements par carte (Stripe, 2026-11-28) : l'écran du QR code. */
.paiement-vue { margin-bottom: 14px; }
.paiement-vue__corps { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px; align-items: center; }
.paiement-vue__qr { width: 100%; max-width: 260px; aspect-ratio: 1; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--filet); }
.paiement-vue__ok { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--vert-pale); color: var(--vert); justify-self: center; }
.paiement-vue__ok .ic { width: 52px; height: 52px; }
@media (max-width: 640px) { .paiement-vue__corps { grid-template-columns: minmax(0, 1fr); } .paiement-vue__qr { justify-self: center; } }
/* Pas de zoom de l'écran, sauf sur les cartes (2026-11-28). Leaflet gère lui-même le pincement
   sur ses cartes ; partout ailleurs on ne garde que le défilement. Et tout champ fait 16 px au
   moins sur un écran tactile : en dessous, l'iPhone zoome dès qu'on y tape. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea, select.carte-fond { font-size: 16px !important; }
}
/* Encaisser par carte depuis sa tournée. */
.encaisser__rapides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.encaisser__rapides .btn { min-height: 56px; font-size: 1.15rem; font-weight: 700; justify-content: center; }
/* Encaisser sans contact dans l'application mobile (encaisser.js, 2026-11-28). */
.encaisser__mode[hidden], .encaisser__voile[hidden] { display: none; }
.encaisser__mode .segments { display: flex; }
.encaisser__mode .segments button { flex: 1; }
.encaisser__voile { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; background: rgba(15, 23, 42, .94); color: #fff; text-align: center; font-size: 1.15rem; font-weight: 600; }
.encaisser__onde { width: 110px; height: 110px; border-radius: 50%; border: 4px solid #fff; opacity: .9; animation: encaisser-onde 1.4s ease-out infinite; }
@keyframes encaisser-onde { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.25); opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .encaisser__onde { animation: none; } }

/* Retour de tournée : paiements par carte comptés dans le rapporté (2026-11-28). */
.retour-carte { margin-top: 8px; }
.retour-bilan__dont { display: block; font-size: .78rem; font-weight: 500; color: var(--doux, #64748b); }

/* Agents en direct sur la carte des secteurs, et bandeau de partage de position (2026-11-28). */
.agent-carte__ancre { background: none; border: 0; }
.agent-carte { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(15, 23, 42, .45); }
.agent-carte--vieux { opacity: .75; }
.carte-nom--agent { font-weight: 600; }
.carte-agents { display: flex; flex-direction: column; gap: 2px; min-width: 170px; max-width: 240px; max-height: 40vh; overflow: auto; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .96); color: #111827; font-size: .8rem; box-shadow: 0 2px 8px rgba(15, 23, 42, .25); }
.carte-agents strong { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: #475569; margin-bottom: 2px; }
.carte-agents__vide { color: #64748b; }
.carte-agents__item { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.carte-agents__item:hover { background: #f1f5f9; }
.carte-agents__item i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.carte-agents__item small { margin-left: auto; color: #64748b; white-space: nowrap; }
.partage-position { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 12px; border-radius: 10px; background: var(--gris-pale); color: var(--texte, #111827); font-size: .88rem; }
.partage-position[hidden] { display: none; }
.partage-position i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.partage-position--actif i { background: #0284c7; box-shadow: 0 0 0 4px rgba(2, 132, 199, .2); }
.partage-position span { flex: 1; }
