/*
 * Espace de gestion : styles.
 *
 * Les couleurs de marque viennent de /theme.css (--marque, --marque-2,
 * --sur-marque), servi depuis les parametres. Ce fichier ne les redefinit
 * pas : il les lit avec une valeur de repli, pour rester lisible si /theme.css
 * est absent. Aucun style en ligne n'est employe (CSP) ; les positions
 * calculees passent par le CSSOM.
 *
 * Sommaire : 1 jetons  2 base  3 coquille  4 acces  5 page  6 boutons
 * 7 champs  8 cartes et badges  9 tableaux  10 modale, menu, notifications
 * 11 composants metier  12 ecrans  13 mouvement et impression
 */

/* ================================================================== */
/*  1. Jetons                                                          */
/* ================================================================== */

:root {
  --g-marque: var(--marque, #e8793a);
  --g-marque-2: var(--marque-2, #0f3d3e);
  --g-sur-marque: var(--sur-marque, #0b1f24);
  --g-nuit: #0b1f24;
  --g-sable: #f7f2ea;

  --police: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --police-titre: 'Bricolage Grotesque', 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --police-code: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --fond: var(--d-fond, #fbf8f3);
  --surface: var(--d-surface, #ffffff);
  --surface-2: var(--d-surface-2, #f6f1e9);
  --surface-3: var(--d-surface-3, #ece4d6);
  --bordure: var(--d-bordure, #e9e0d2);
  --bordure-forte: var(--d-bordure-forte, #d3c6b2);
  --texte: var(--d-texte, #0b1f24);
  --texte-2: var(--d-texte-2, #45555a);
  --texte-3: var(--d-texte-3, #5f6f73);
  --lien: var(--d-lien, #0f3d3e);
  --accent-texte: var(--d-accent-texte, #a84b17);
  --focus: #b8561c;

  --menthe-fond: #daf0eb; --menthe-texte: #16605a; --menthe-plein: #2f9e8f; --menthe-sur: #06201d;
  /* Teintes de la marque (elles suivent le design) ; les autres restent des couleurs de sens. */
  --atlas-fond: color-mix(in srgb, var(--g-marque-2) 15%, var(--surface)); --atlas-texte: var(--d-lien-fort, #0f3d3e); --atlas-plein: var(--g-marque-2); --atlas-sur: var(--sur-marque-2, #ffffff);
  --safran-fond: color-mix(in srgb, var(--g-marque) 18%, var(--surface)); --safran-texte: var(--d-accent-fort, #8a3a10); --safran-plein: var(--g-marque); --safran-sur: var(--g-sur-marque);
  --ocre-fond: #f8ecd0; --ocre-texte: #6e4c0c; --ocre-plein: #d9a441; --ocre-sur: #0b1f24;
  --argile-fond: #f7dfd8; --argile-texte: #8f321c; --argile-plein: #b8492f; --argile-sur: #ffffff;
  --brume-fond: #e8ecec; --brume-texte: #42524f; --brume-plein: #637376; --brume-sur: #ffffff;
  --raye-ocre: rgba(217, 164, 65, 0.3);
  --hache-argile: rgba(184, 73, 47, 0.22);

  /* Menu lateral : couleur choisie par le design (marque.design_menu, /theme.css). */
  --lateral-fond: var(--d-lateral, #0b1f24);
  --lateral-bord: rgba(var(--d-lateral-bord-rgb, 255, 255, 255), 0.08);
  --lateral-texte: var(--d-lateral-texte, #c7d3d5);
  --lateral-texte-2: var(--d-lateral-texte-2, #8ea3a7);
  --lateral-fort: var(--d-lateral-fort, #ffffff);
  --lateral-survol: rgba(var(--d-lateral-bord-rgb, 255, 255, 255), 0.07);
  --lateral-actif: var(--d-lateral-actif, rgba(232, 121, 58, 0.16));

  --gantt-weekend: rgba(217, 164, 65, 0.08);

  --ombre-1: 0 1px 2px rgba(11, 31, 36, 0.05), 0 1px 1px rgba(11, 31, 36, 0.03);
  --ombre-2: 0 10px 28px -10px rgba(11, 31, 36, 0.22), 0 2px 6px rgba(11, 31, 36, 0.06);
  --ombre-3: 0 28px 70px -14px rgba(6, 16, 19, 0.42);

  --rayon: 12px;
  --lateral-largeur: 256px;
  --lateral-replie: 72px;
  --entete-hauteur: 60px;
  color-scheme: light;
}

:root[data-theme='sombre'] {
  --fond: #0b181c;
  --surface: #11232a;
  --surface-2: #162c33;
  --surface-3: #1e3840;
  --bordure: #213a41;
  --bordure-forte: #33525a;
  --texte: #e8eff0;
  --texte-2: #b4c3c5;
  --texte-3: #95a8ab;
  --lien: #86d3c8;
  --accent-texte: #f3a877;
  --focus: #f3a877;

  --menthe-fond: rgba(47, 158, 143, 0.2); --menthe-texte: #86dccd; --menthe-plein: #2f9e8f; --menthe-sur: #04201c;
  --atlas-fond: rgba(134, 211, 200, 0.13); --atlas-texte: #a6d9d2; --atlas-plein: #2b6f70; --atlas-sur: #ffffff;
  --safran-fond: rgba(232, 121, 58, 0.2); --safran-texte: #f5ae80; --safran-plein: #e8793a; --safran-sur: #0b1f24;
  --ocre-fond: rgba(217, 164, 65, 0.2); --ocre-texte: #ebc77f; --ocre-plein: #d9a441; --ocre-sur: #0b1f24;
  --argile-fond: rgba(214, 102, 76, 0.22); --argile-texte: #f3a18c; --argile-plein: #b8492f; --argile-sur: #ffffff;
  --brume-fond: rgba(149, 168, 171, 0.16); --brume-texte: #bccacc; --brume-plein: #5d6e71; --brume-sur: #ffffff;
  --raye-ocre: rgba(217, 164, 65, 0.22);
  --hache-argile: rgba(214, 102, 76, 0.22);

  --lateral-fond: #07131a;
  --lateral-texte: #c7d3d5; --lateral-texte-2: #8ea3a7; --lateral-fort: #ffffff;
  --lateral-bord: rgba(255, 255, 255, 0.06); --lateral-survol: rgba(255, 255, 255, 0.06); --lateral-actif: rgba(232, 121, 58, 0.16);
  --gantt-weekend: rgba(217, 164, 65, 0.06);
  --ombre-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --ombre-2: 0 12px 30px -10px rgba(0, 0, 0, 0.55);
  --ombre-3: 0 30px 80px -10px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='clair']) {
    --fond: #0b181c;
    --surface: #11232a;
    --surface-2: #162c33;
    --surface-3: #1e3840;
    --bordure: #213a41;
    --bordure-forte: #33525a;
    --texte: #e8eff0;
    --texte-2: #b4c3c5;
    --texte-3: #95a8ab;
    --lien: #86d3c8;
    --accent-texte: #f3a877;
    --focus: #f3a877;
    --menthe-fond: rgba(47, 158, 143, 0.2); --menthe-texte: #86dccd; --menthe-plein: #2f9e8f; --menthe-sur: #04201c;
    --atlas-fond: rgba(134, 211, 200, 0.13); --atlas-texte: #a6d9d2; --atlas-plein: #2b6f70; --atlas-sur: #ffffff;
    --safran-fond: rgba(232, 121, 58, 0.2); --safran-texte: #f5ae80; --safran-plein: #e8793a; --safran-sur: #0b1f24;
    --ocre-fond: rgba(217, 164, 65, 0.2); --ocre-texte: #ebc77f; --ocre-plein: #d9a441; --ocre-sur: #0b1f24;
    --argile-fond: rgba(214, 102, 76, 0.22); --argile-texte: #f3a18c; --argile-plein: #b8492f; --argile-sur: #ffffff;
    --brume-fond: rgba(149, 168, 171, 0.16); --brume-texte: #bccacc; --brume-plein: #5d6e71; --brume-sur: #ffffff;
    --raye-ocre: rgba(217, 164, 65, 0.22);
    --hache-argile: rgba(214, 102, 76, 0.22);
    --lateral-fond: #07131a;
    --lateral-texte: #c7d3d5; --lateral-texte-2: #8ea3a7; --lateral-fort: #ffffff;
    --lateral-bord: rgba(255, 255, 255, 0.06); --lateral-survol: rgba(255, 255, 255, 0.06); --lateral-actif: rgba(232, 121, 58, 0.16);
    --gantt-weekend: rgba(217, 164, 65, 0.06);
    --ombre-1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --ombre-2: 0 12px 30px -10px rgba(0, 0, 0, 0.55);
    --ombre-3: 0 30px 80px -10px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* Tons : chaque classe pose ses variables, les composants les lisent. */
.ton-menthe { --t-fond: var(--menthe-fond); --t-texte: var(--menthe-texte); --t-plein: var(--menthe-plein); --t-sur: var(--menthe-sur); }
.ton-atlas { --t-fond: var(--atlas-fond); --t-texte: var(--atlas-texte); --t-plein: var(--atlas-plein); --t-sur: var(--atlas-sur); }
.ton-safran { --t-fond: var(--safran-fond); --t-texte: var(--safran-texte); --t-plein: var(--safran-plein); --t-sur: var(--safran-sur); }
.ton-ocre, .ton-ocre-raye { --t-fond: var(--ocre-fond); --t-texte: var(--ocre-texte); --t-plein: var(--ocre-plein); --t-sur: var(--ocre-sur); }
.ton-argile, .ton-argile-barre, .ton-argile-hache { --t-fond: var(--argile-fond); --t-texte: var(--argile-texte); --t-plein: var(--argile-plein); --t-sur: var(--argile-sur); }
.ton-brume { --t-fond: var(--brume-fond); --t-texte: var(--brume-texte); --t-plein: var(--brume-plein); --t-sur: var(--brume-sur); }

/* ================================================================== */
/*  2. Base                                                            */
/* ================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--entete-hauteur) + 16px); }
body.gestion {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
html.modale-ouverte body, html.tiroir-actif body { overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--police-titre); line-height: 1.2; }
p { margin: 0; }
a { color: var(--lien); }
/* Un code lu au comptoir (permission, reference) ne descend pas sous 12,5 px. */
code, kbd, pre { font-family: var(--police-code); font-size: max(12.5px, 0.88em); }
code { padding: 0.1em 0.35em; border-radius: 5px; background: var(--surface-2); color: var(--texte-2); overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--g-marque) 32%, transparent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icone { flex: none; display: inline-block; vertical-align: middle; }

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lien-evitement {
  position: fixed; inset-inline-start: 12px; top: -60px; z-index: 300; padding: 10px 16px; border-radius: 10px;
  background: var(--g-marque); color: var(--g-sur-marque); font-weight: 700; text-decoration: none; transition: top 0.15s;
}
.lien-evitement:focus { top: 12px; }

.texte-discret { color: var(--texte-3); }
.texte-fort { font-weight: 700; }
.texte-centre { text-align: center; }
.texte-tabulaire { font-variant-numeric: tabular-nums; white-space: nowrap; }
.texte-ajout { color: var(--menthe-texte); font-weight: 700; }
.texte-retrait { color: var(--argile-texte); font-weight: 700; }
.lien-discret { display: inline-flex; align-items: center; gap: 6px; color: var(--texte-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.lien-discret:hover { color: var(--texte); text-decoration: underline; }
.lien-fort { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--lien); text-decoration: none; }
.lien-fort:hover { text-decoration: underline; }

.pile { display: grid; gap: 16px; align-content: start; min-width: 0; }
.rangee { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rangee-centree { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-around; align-items: flex-start; }
.grille-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grille-deux { grid-template-columns: minmax(0, 1fr); } }

/* Demarrage et sans script */
.demarrage { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--texte-2); font-weight: 600; }
.demarrage-route { width: 120px; height: 48px; display: block; }
.demarrage-route-ligne { fill: none; stroke: var(--surface-3); stroke-width: 9; stroke-linecap: round; }
.demarrage-route-tirets { fill: none; stroke: var(--g-marque); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 10; animation: rouler 0.9s linear infinite; }
.sans-script { max-width: 520px; margin: 15vh auto; padding: 24px; border-radius: 12px; background: var(--surface); border: 1px solid var(--bordure); display: grid; gap: 8px; }

/* ================================================================== */
/*  3. Coquille : barre laterale, en-tete, contenu                     */
/* ================================================================== */

.coque { display: grid; grid-template-columns: var(--lateral-largeur) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.coque.est-replie { grid-template-columns: var(--lateral-replie) minmax(0, 1fr); }

.lateral {
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 40;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--lateral-fond); color: var(--lateral-texte);
  box-shadow: inset -1px 0 0 var(--lateral-bord);
}
.lateral-haut { height: var(--entete-hauteur); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--lateral-bord); }
.lateral-marque { flex: 1; min-width: 0; color: var(--lateral-fort); text-decoration: none; border-radius: 10px; }
.lateral-fermer { display: none; }
.lateral-defilement { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 10px 18px; scrollbar-width: thin; scrollbar-color: rgba(var(--d-lateral-bord-rgb, 255, 255, 255), 0.16) transparent; }
.lateral-pied { flex: none; display: grid; gap: 2px; padding: 8px 10px 12px; border-top: 1px solid var(--lateral-bord); }

.nav-groupe + .nav-groupe { margin-top: 16px; }
.nav-groupe-titre { margin: 0 0 4px; padding: 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--lateral-texte-2); }
.nav-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav-liste > li { min-width: 0; }
.nav-lien {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 8px 10px;
  border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: start;
  color: var(--lateral-texte); text-decoration: none; font: 600 14px/1.25 var(--police);
  transition: background 0.12s, color 0.12s;
}
.nav-lien .icone { color: var(--lateral-texte-2); transition: color 0.12s; }
.nav-lien:hover { background: var(--lateral-survol); color: var(--lateral-fort); }
.nav-lien:hover .icone { color: var(--lateral-fort); }
.nav-lien[aria-current='page'] { background: var(--lateral-actif); color: var(--lateral-fort); }
.nav-lien[aria-current='page']::before { content: ''; position: absolute; inset-inline-start: -10px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--g-marque); }
.nav-lien[aria-current='page'] .icone { color: var(--g-marque); }

/* Bulle de messages a traiter (entree « Avis, demandes et temoignages »).
   La variante alerte (demandes de reservation en attente) porte le ton argile :
   une demande non traitee fait perdre le client — elle se voit de loin. */
.nav-badge {
  flex: none; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--ocre-plein); color: var(--ocre-sur);
  font: 800 12px/1 var(--police); font-variant-numeric: tabular-nums;
}
.nav-badge--alerte { background: var(--argile-plein); color: var(--argile-sur); }
@media (min-width: 961px) {
  .coque.est-replie .nav-badge {
    position: absolute; inset-inline-end: -3px; top: -2px;
    min-width: 16px; height: 16px; padding: 0 4px; font-size: 10.5px; margin: 0;
  }
}
.nav-lien:focus-visible { outline: 2px solid var(--g-marque); outline-offset: -2px; }
/*
 * Un libelle de menu coupe (« Categories, saisons et opt… ») oblige a deviner
 * ou a survoler : il passe a la ligne, la hauteur du lien s'adapte.
 */
.nav-texte { flex: 1; min-width: 0; overflow-wrap: break-word; }
.coque.est-replie .nav-texte { white-space: nowrap; }
.nav-externe { opacity: 0.7; }
.nav-vide { padding: 10px; font-size: 13px; color: var(--lateral-texte-2); }
.icone-deplier { display: none; }

@media (min-width: 961px) {
  .coque.est-replie .nav-texte, .coque.est-replie .nav-externe, .coque.est-replie .marque-nom { display: none; }
  .coque.est-replie .nav-groupe-titre { height: 1px; margin: 10px 8px; padding: 0; overflow: hidden; color: transparent; background: var(--lateral-bord); }
  .coque.est-replie .nav-groupe + .nav-groupe { margin-top: 0; }
  .coque.est-replie .nav-lien { justify-content: center; padding: 8px 0; }
  .coque.est-replie .lateral-haut { padding: 0; justify-content: center; }
  .coque.est-replie .lateral-marque { flex: none; }
  .coque.est-replie .icone-replier { display: none; }
  .coque.est-replie .icone-deplier { display: inline-block; }
}

.principal { min-width: 0; display: flex; flex-direction: column; }
.entete {
  position: sticky; top: 0; z-index: 30; height: var(--entete-hauteur);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--fond) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--bordure);
}
.entete-burger { display: none; }
.entete-marque-mobile { display: none; color: var(--texte); text-decoration: none; border-radius: 10px; }
.entete-recherche { position: relative; flex: 1 1 auto; max-width: 540px; min-width: 0; }
.entete-recherche-saisie {
  width: 100%; height: 40px; padding: 0 44px 0 40px; border-radius: 11px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); font: 500 14px var(--police);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entete-recherche-saisie::placeholder { color: var(--texte-3); }
.entete-recherche-saisie:focus { outline: none; border-color: var(--g-marque); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-marque) 25%, transparent); }
.entete-recherche-icone { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--texte-3); pointer-events: none; }
.entete-raccourci {
  position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%);
  min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px;
  border: 1px solid var(--bordure); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface-2); color: var(--texte-3); font: 700 12px var(--police); pointer-events: none;
}
.entete-droite { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

/* Panneau de la recherche globale (reservation, client, contrat, facture, vehicule) */
.recherche-panneau {
  position: absolute; z-index: 40; top: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: 0;
  max-height: min(70vh, 560px); overflow-y: auto; padding: 6px;
  border: 1px solid var(--bordure); border-radius: 14px; background: var(--surface); box-shadow: var(--ombre-3);
}
.recherche-panneau[hidden] { display: none; }
.recherche-groupe + .recherche-groupe { margin-top: 4px; border-top: 1px solid var(--bordure); padding-top: 4px; }
.recherche-groupe-titre {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 10px 4px;
  font: 700 12.5px var(--police); text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-2);
}
.recherche-groupe-compte {
  min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2);
  color: var(--texte-2); font-size: 12px; font-weight: 700; text-align: center; text-transform: none; letter-spacing: 0;
}
.recherche-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; min-height: 44px;
  border-radius: 10px; color: var(--texte); text-decoration: none;
}
.recherche-item-icone { flex: none; margin-top: 2px; color: var(--texte-2); }
.recherche-item-corps { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.recherche-item-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 14px; }
.recherche-item-sous { color: var(--texte-2); }
.recherche-item-detail { font-size: 12.5px; color: var(--texte-2); overflow-wrap: anywhere; }
.recherche-item-statut {
  flex: none; align-self: center; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--texte-2); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.recherche-item:hover, .recherche-item.est-surligne, .recherche-tout:hover, .recherche-tout.est-surligne {
  background: color-mix(in srgb, var(--g-marque) 12%, transparent);
}
.recherche-item.est-surligne, .recherche-tout.est-surligne { outline: 2px solid var(--g-marque); outline-offset: -2px; }
.recherche-tout {
  display: block; padding: 8px 10px; min-height: 44px; border-radius: 10px;
  color: var(--g-marque); font: 600 13px var(--police); text-decoration: none;
}
.recherche-vide, .recherche-note {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 10px;
  color: var(--texte-2); font-size: 13.5px;
}
.recherche-note { padding-bottom: 4px; }

.compte-bouton {
  display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 4px 10px 4px 4px;
  border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; color: var(--texte);
  transition: background 0.12s, border-color 0.12s;
}
.compte-bouton:hover, .compte-bouton[aria-expanded='true'] { background: var(--surface); border-color: var(--bordure); }
.compte-textes { display: grid; text-align: start; line-height: 1.2; min-width: 0; }
.compte-nom { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compte-role { font-size: 12px; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compte-chevron { color: var(--texte-3); }

.contenu { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px 28px 56px; outline: none; }
.contenu[aria-busy='true'] > * { opacity: 0.55; transition: opacity 0.2s 0.1s; pointer-events: none; }

.tiroir-voile { display: none; }

@media (max-width: 960px) {
  .coque, .coque.est-replie { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; inset: 0 auto 0 0; width: min(304px, 86vw); height: 100%;
    transform: translateX(-104%); visibility: hidden;
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.24s;
    box-shadow: var(--ombre-3);
  }
  .coque.tiroir-ouvert .lateral { transform: none; visibility: visible; transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .coque.tiroir-ouvert .tiroir-voile { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(4, 12, 15, 0.55); animation: apparaitre 0.2s ease; }
  .lateral-fermer {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px;
    background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer;
  }
  .nav-replier { display: none; }
  .entete { padding: 0 16px; gap: 10px; }
  .entete-burger {
    display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; margin-inline-start: -6px;
    border: 0; border-radius: 10px; background: none; color: var(--texte); cursor: pointer;
  }
  .entete-burger:hover { background: var(--surface-2); }
  .contenu { padding: 20px 20px 48px; }
}

@media (max-width: 640px) {
  body.gestion { font-size: 15.5px; }
  .entete { padding: 0 12px; gap: 6px; }
  .entete-marque-mobile { display: flex; flex: none; }
  .entete-marque-mobile .marque-nom { display: none; }
  .entete-recherche-saisie { padding-inline-end: 10px; font-size: 16px; height: 38px; }
  .entete-raccourci { display: none; }
  /* Sur telephone, le champ est etroit : le panneau prend toute la largeur. */
  .recherche-panneau { position: fixed; top: calc(var(--entete-hauteur) + 4px); inset-inline-start: 8px; inset-inline-end: 8px; }
  .compte-textes, .compte-chevron { display: none; }
  .compte-bouton { padding: 3px; }
  .contenu { padding: 16px 14px 40px; }
}

/* Marque */
.marque { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.marque-monogramme { flex: none; display: block; line-height: 0; }
.marque-monogramme svg { width: 32px; height: 32px; }
.marque-fond { fill: var(--g-marque); }
.marque-route { fill: none; stroke: var(--g-sur-marque); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 4 3; }
.marque-soleil { fill: var(--g-sable); }
.marque-logo { display: block; height: 32px; width: auto; max-width: 150px; object-fit: contain; }
.marque-nom { font: 800 17px/1.1 var(--police-titre); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marque-grande { gap: 14px; }
.marque-grande .marque-monogramme svg { width: 46px; height: 46px; }
.marque-grande .marque-logo { height: 46px; }
.marque-grande .marque-nom { font-size: 25px; }

/* Barre laterale : un vrai logo televerse remplace le monogramme ET le nom
   ecrit a cote (deja present dans l'image). Il occupe toute la largeur de la
   barre, sur une plaque claire : la barre est sombre, et un logo transparent a
   lettres foncees s'y fondrait. Le bandeau du haut s'agrandit avec lui. Le
   monogramme generique garde le nom et la hauteur habituelle. */
.coque:not(.est-replie):has(.lateral-marque .marque-logo) { --lateral-largeur: 296px; }
.lateral-haut:has(.marque-logo) { height: auto; min-height: var(--entete-hauteur); padding: 10px; }
.lateral-marque:has(.marque-logo) { display: block; padding: 6px 8px; background: #fffdf8; border-radius: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.lateral-marque .marque:has(.marque-logo) { display: block; gap: 0; width: 100%; }
.lateral-marque .marque:has(.marque-logo) .marque-nom { display: none; }
.lateral-marque .marque:has(.marque-logo) .marque-logo { width: 100%; height: auto; max-width: none; }
/* Menu replie (rail de 72 px) : le logo se reduit a la largeur du rail. */
@media (min-width: 961px) {
  .coque.est-replie .lateral-haut:has(.marque-logo) { padding: 8px 6px; }
  .coque.est-replie .lateral-marque:has(.marque-logo) { flex: 1; padding: 3px; }
}
/* Barre du haut sur telephone : meme plaque, le theme sombre la rend sombre. */
.entete-marque-mobile .marque-logo { height: 36px; max-width: 160px; padding: 2px 6px; background: #fffdf8; border-radius: 8px; }

/* ================================================================== */
/*  4. Ecrans d'acces (connexion, mot de passe impose)                 */
/* ================================================================== */

.ecran-acces { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--fond); }
.acces-visuel { position: relative; overflow: hidden; display: flex; align-items: flex-start; padding: 56px; background: #0b1f24; color: #fff; }
.acces-paysage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ciel-haut { stop-color: #0a1d22; }
.ciel-milieu { stop-color: #1e4b4b; }
.ciel-bas { stop-color: #d87a45; }
.pays-soleil { fill: #f4ad62; }
.pays-halo { fill: #f4ad62; opacity: 0.14; }
.pays-atlas-loin { fill: #2c5553; }
.pays-atlas { fill: #173b3c; }
.pays-dune { fill: #0e272b; }
.pays-route { fill: none; stroke: #071419; stroke-width: 44; }
.pays-route-tirets { fill: none; stroke: #f7f2ea; stroke-width: 3; stroke-dasharray: 20 18; animation: rouler 1.4s linear infinite; }
.pays-etoiles circle { fill: #f7f2ea; opacity: 0.55; }
.acces-visuel-texte { position: relative; max-width: 440px; display: grid; gap: 22px; }
.acces-visuel .marque-nom { color: #fff; }
.acces-accroche { font: 700 clamp(24px, 1.2vw + 16px, 34px)/1.18 var(--police-titre); letter-spacing: -0.02em; color: #f7f2ea; text-wrap: balance; }

.acces-principal { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 28px; padding: 48px 28px; outline: none; }
.acces-carte { width: 100%; max-width: 410px; display: grid; gap: 16px; }
.acces-carte-large { max-width: 520px; }
.acces-surtitre { font: 800 12px var(--police); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-texte); }
.acces-titre { margin: -8px 0 0; font: 800 clamp(28px, 2vw + 16px, 36px)/1.08 var(--police-titre); letter-spacing: -0.03em; outline: none; }
.acces-intro { margin-top: -4px; color: var(--texte-2); }
.acces-pied { font-size: 14px; }
.acces-carte .btn-bloc { margin-top: 6px; }

@media (max-width: 960px) {
  .ecran-acces { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .acces-visuel { min-height: 168px; padding: 22px 20px; align-items: flex-start; }
  .acces-accroche { display: none; }
  .acces-principal { justify-content: flex-start; padding: 28px 18px 40px; }
}

.regles-mdp { list-style: none; margin: -6px 0 0; padding: 12px 14px; display: grid; gap: 6px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.regle { display: flex; align-items: center; gap: 8px; color: var(--texte-2); }
.regle.est-ok { color: var(--menthe-texte); font-weight: 600; }
.regle.est-attente .icone { color: var(--texte-3); }
.bloc-mdp { gap: 14px; }
.bloc-mdp .form-actions { justify-content: space-between; margin-top: 6px; }
.bloc-mdp .regles-mdp { margin-top: -8px; }
.compte-a-rebours { font-variant-numeric: tabular-nums; font-size: 1.1em; }

/* ================================================================== */
/*  5. Page                                                            */
/* ================================================================== */

.page { display: grid; gap: 20px; min-width: 0; animation: monter-doux 0.22s ease; }
.page-entete { display: grid; gap: 8px; min-width: 0; }
.page-entete-ligne { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 18px; }
.page-entete-ligne > .avatar { align-self: center; }
.page-entete-textes { flex: 1 1 340px; min-width: 0; }
.page-titre-ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.page-titre { margin: 0; font-family: var(--police-titre); font-weight: 750; font-size: clamp(25px, 1.2vw + 18px, 33px); letter-spacing: -0.025em; line-height: 1.12; outline: none; overflow-wrap: anywhere; }
.page-sous-titre { margin-top: 5px; max-width: 78ch; color: var(--texte-2); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-compteur { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--texte-2); font: 700 12.5px var(--police); font-variant-numeric: tabular-nums; }
.page-compteur:empty { display: none; }
.fiche-sous-titre code { background: none; padding: 0; font-weight: 600; color: var(--texte-2); }

.fil-ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 13px; color: var(--texte-3); }
.fil-ariane li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.fil-ariane a { color: var(--texte-2); text-decoration: none; font-weight: 600; }
.fil-ariane a:hover { color: var(--texte); text-decoration: underline; }
.fil-sep { color: var(--texte-3); }

.page-vide { display: grid; justify-items: center; gap: 6px; padding: 44px 20px; text-align: center; }
.page-vide-compacte { padding: 28px 16px; }
.page-vide-titre { font: 700 18px/1.3 var(--police-titre); letter-spacing: -0.01em; }
.page-vide-message { max-width: 56ch; color: var(--texte-2); }
.page-vide-action { margin-top: 12px; }
.illustration { width: 210px; height: auto; margin-bottom: 6px; overflow: visible; }
.page-vide-compacte .illustration { width: 150px; }
.ill-ombre { fill: var(--surface-3); }
.ill-soleil { fill: var(--g-marque); opacity: 0.85; }
.ill-montagne { fill: var(--atlas-fond); }
.ill-route { fill: none; stroke: var(--texte-2); stroke-width: 11; stroke-linecap: round; opacity: 0.85; }
.ill-route-tirets { fill: none; stroke: var(--fond); stroke-width: 1.8; stroke-dasharray: 6 6; }
.ill-cone { fill: var(--g-marque); }
.ill-cone-bande { stroke: #fff; stroke-width: 3.5; stroke-linecap: round; }
.ill-barriere { fill: var(--surface); stroke: var(--argile-plein); stroke-width: 2; }
.ill-barriere-rayures { stroke: var(--argile-plein); stroke-width: 5; }
.ill-poteau { stroke: var(--texte-3); stroke-width: 3; stroke-linecap: round; }
.ill-loupe { fill: var(--surface); stroke: var(--g-marque-2); stroke-width: 6; }
:root[data-theme='sombre'] .ill-loupe, :root[data-theme='sombre'] .ill-loupe-manche { stroke: var(--atlas-texte); }
.ill-loupe-manche { stroke: var(--g-marque-2); stroke-width: 9; stroke-linecap: round; }
.ill-cadenas { fill: var(--g-marque); }
.ill-anse { fill: none; stroke: var(--texte-2); stroke-width: 8; }
.ill-serrure { fill: var(--g-nuit); }
.ill-serrure-trait { stroke: var(--g-nuit); stroke-width: 4; stroke-linecap: round; }
.ill-panneau { fill: var(--g-marque); }
.ill-panneau-2 { fill: var(--menthe-plein); }
.ill-voiture, .ill-voiture-toit { fill: var(--g-marque); }
.ill-roue { fill: var(--texte); }

.encart { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--rayon); border: 1px solid transparent; min-width: 0; }
.encart-icone { margin-top: 1px; }
.encart-corps { display: grid; gap: 3px; min-width: 0; }
.encart-titre { font-weight: 750; }
.encart-message { overflow-wrap: anywhere; }
.encart-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.encart-info { background: var(--atlas-fond); color: var(--atlas-texte); }
.encart-succes { background: var(--menthe-fond); color: var(--menthe-texte); }
.encart-alerte { background: var(--ocre-fond); color: var(--ocre-texte); }
.encart-erreur { background: var(--argile-fond); color: var(--argile-texte); }
.liste-alertes { margin: 4px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }

.chargeur { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 36px; color: var(--texte-2); font-weight: 600; }
.chargeur-en-ligne { justify-content: flex-start; padding: 4px 0; }
.chargeur-roue { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--surface-3); border-top-color: var(--g-marque); animation: tourner 0.75s linear infinite; }

.squelette { display: grid; gap: 10px; }
.squelette-ligne {
  display: block; height: 12px; border-radius: 6px; min-width: 40px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: miroiter 1.3s ease-in-out infinite;
}
.squelette-l1 { width: 90%; } .squelette-l2 { width: 70%; } .squelette-l3 { width: 45%; }

/* ================================================================== */
/*  6. Boutons                                                         */
/* ================================================================== */

.btn {
  --btn-fond: var(--surface); --btn-texte: var(--texte); --btn-bord: var(--bordure-forte);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border: 1px solid var(--btn-bord); border-radius: var(--rayon-bouton, 10px);
  background: var(--btn-fond); color: var(--btn-texte); cursor: pointer; user-select: none;
  font: 650 14px/1 var(--police); text-decoration: none; white-space: nowrap;
  transition: background-color 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.06s, color 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --btn-fond: var(--surface-2); --btn-bord: color-mix(in srgb, var(--bordure-forte) 70%, var(--texte-3)); }
.btn:active { transform: translateY(1px); }
.btn-primaire {
  --btn-fond: var(--g-marque); --btn-texte: var(--g-sur-marque); --btn-bord: transparent;
  box-shadow: 0 1px 2px rgba(11, 31, 36, 0.14), inset 0 -2px 0 rgba(11, 31, 36, 0.14);
}
.btn-primaire:hover { --btn-fond: color-mix(in srgb, var(--g-marque) 88%, #000); --btn-bord: transparent; }
.btn-danger { --btn-fond: var(--argile-plein); --btn-texte: #fff; --btn-bord: transparent; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.btn-danger:hover { --btn-fond: color-mix(in srgb, var(--argile-plein) 86%, #000); --btn-bord: transparent; }
.btn-fantome { --btn-fond: transparent; --btn-bord: transparent; --btn-texte: var(--texte-2); }
.btn-fantome:hover { --btn-fond: var(--surface-2); --btn-bord: transparent; --btn-texte: var(--texte); }
.btn-lien { --btn-fond: transparent; --btn-bord: transparent; --btn-texte: var(--lien); min-height: auto; padding: 0; text-decoration: underline; }
.btn-petit { min-height: 32px; padding: 0 10px; gap: 6px; border-radius: 8px; font-size: 13px; }
.btn-grand { min-height: 48px; padding: 0 22px; border-radius: 12px; font-size: 15.5px; }
.btn-icone { width: 38px; padding: 0; }
.btn-petit.btn-icone { width: 32px; }
.btn-bloc { width: 100%; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-roue { display: none; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: tourner 0.7s linear infinite; }
.btn.est-occupe { opacity: 0.92; cursor: progress; }
.btn.est-occupe .btn-roue { display: inline-block; }
.btn.est-occupe > .icone:not(:last-child) { display: none; }

/* ================================================================== */
/*  7. Champs                                                          */
/* ================================================================== */

.formulaire { display: grid; min-width: 0; }
.form-grille { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 18px; }
.form-grille > * { grid-column: 1 / -1; }
.form-grille > .champ-demi { grid-column: span 3; }
.form-grille > .champ-tiers { grid-column: span 2; }
.form-grille > .champ-deux-tiers { grid-column: span 4; }
@media (max-width: 720px) {
  .form-grille > .champ-demi, .form-grille > .champ-tiers, .form-grille > .champ-deux-tiers { grid-column: 1 / -1; }
}
.form-intertitre { margin: 8px 0 -4px; padding-top: 14px; border-top: 1px dashed var(--bordure); font: 700 13px var(--police); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-texte); }
.form-grille > .form-intertitre:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bordure); }
.form-bandeau { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; background: var(--argile-fond); color: var(--argile-texte); }
.form-bandeau ul { margin: 6px 0 0; padding-inline-start: 18px; }
.form-bandeau-titre { font-weight: 700; }

.champ { display: grid; gap: 6px; align-content: start; min-width: 0; }
.champ-libelle { font-weight: 650; font-size: 13.5px; color: var(--texte); }
.champ-requis { color: var(--argile-texte); }
.champ-aide { font-size: 12.5px; color: var(--texte-3); }
.champ-erreur { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; font-weight: 650; color: var(--argile-texte); }
.champ-erreur .icone { margin-top: 2px; }
.champ-bascule { align-content: center; }
.champ-bloc { margin: 0; padding: 0; border: 0; }

.saisie {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--bordure-forte); border-radius: 10px; background: var(--surface); color: var(--texte);
  font: 500 14.5px/1.4 var(--police); transition: border-color 0.14s, box-shadow 0.14s;
}
.saisie:hover { border-color: color-mix(in srgb, var(--bordure-forte) 55%, var(--texte-3)); }
.saisie:focus { outline: none; border-color: var(--g-marque); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-marque) 26%, transparent); }
.saisie::placeholder { color: var(--texte-3); opacity: 0.8; }
.saisie:disabled { background: var(--surface-2); color: var(--texte-3); cursor: not-allowed; }
.a-erreur .saisie, .saisie[aria-invalid='true'] { border-color: var(--argile-plein); }
.a-erreur .saisie:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--argile-plein) 25%, transparent); }
@media (max-width: 640px) { .saisie { font-size: 16px; } }

.selecteur {
  appearance: none; -webkit-appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23788a8e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.selecteur option, .selecteur optgroup { background: var(--surface); color: var(--texte); }
.zone-texte { min-height: 84px; resize: vertical; line-height: 1.5; }
.zone-code { font: 500 13px/1.5 var(--police-code); }
.saisie-nombre { font-variant-numeric: tabular-nums; }
.saisie-recherche { padding-inline-start: 36px; }
.saisie-recherche::-webkit-search-cancel-button { cursor: pointer; }

.saisie-unite { position: relative; }
.saisie-unite .saisie { padding-inline-end: 46px; text-align: end; font-variant-numeric: tabular-nums; }
.saisie-suffixe { position: absolute; inset-inline-end: 13px; top: 50%; transform: translateY(-50%); font: 750 12.5px var(--police); color: var(--texte-3); pointer-events: none; }
.saisie-mdp { position: relative; }
.saisie-mdp .saisie { padding-inline-end: 46px; }
.saisie-bascule { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--texte-3); cursor: pointer; }
.saisie-bascule:hover { color: var(--texte); background: var(--surface-2); }
.saisie-date-heure { display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, 128px); gap: 8px; }
.saisie-couleur { display: flex; align-items: center; gap: 8px; }
.saisie-nuancier { flex: none; width: 44px; height: 40px; padding: 3px; border: 1px solid var(--bordure-forte); border-radius: 10px; background: var(--surface); cursor: pointer; }
.saisie-nuancier::-webkit-color-swatch-wrapper { padding: 0; }
.saisie-nuancier::-webkit-color-swatch { border: 0; border-radius: 7px; }
.saisie-hex { max-width: 130px; font-family: var(--police-code); text-transform: lowercase; }
.apercu-couleur { display: inline-grid; place-items: center; width: 52px; height: 40px; border-radius: 10px; font: 800 16px var(--police-titre); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }

.case { position: relative; display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.case-input { position: absolute; inset-inline-start: 0; top: 0; width: 20px; height: 20px; margin: 0; opacity: 0; cursor: pointer; }
.case-boite { flex: none; width: 20px; height: 20px; margin-top: 1px; display: grid; place-items: center; border: 1.5px solid var(--bordure-forte); border-radius: 6px; background: var(--surface); color: transparent; transition: background 0.12s, border-color 0.12s; }
.case-input:checked + .case-boite { background: var(--atlas-plein); border-color: var(--atlas-plein); color: #fff; }
.case-input:focus-visible + .case-boite { outline: 2px solid var(--focus); outline-offset: 2px; }
.case-input:disabled + .case-boite { opacity: 0.55; cursor: not-allowed; }
.case-texte { display: grid; gap: 2px; }
.case-aide { font-weight: 500; font-size: 12.5px; color: var(--texte-3); }

.interrupteur { display: inline-flex; align-items: center; gap: 10px; }
.interrupteur-bouton { flex: none; padding: 2px; border: 0; border-radius: 999px; background: none; cursor: pointer; }
.interrupteur-bouton:disabled { opacity: 0.5; cursor: not-allowed; }
.interrupteur-piste { position: relative; display: block; width: 40px; height: 24px; border-radius: 999px; background: var(--bordure-forte); transition: background 0.16s; }
.interrupteur-pastille { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
[aria-checked='true'] > .interrupteur-piste, [aria-checked='true'] .interrupteur-piste { background: var(--menthe-plein); }
[aria-checked='true'] > .interrupteur-piste .interrupteur-pastille, [aria-checked='true'] .interrupteur-pastille { transform: translateX(16px); }
.interrupteur-texte { font-weight: 600; font-size: 14px; cursor: pointer; }

.segments { margin: 0; padding: 0; border: 0; min-width: 0; }
/* Recette : motifs prepares a l'avance, cliquables, sous un champ de motif. */
.chips-motifs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips-motifs .btn-petit { padding: 4px 10px; border-radius: 999px; }
.chips-motifs .btn-texte { font-size: 13px; }
.segments-liste { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.segment { position: relative; display: inline-flex; }
.segment-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segment-input:disabled { cursor: not-allowed; }
.segment-texte { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid var(--bordure-forte); border-radius: 999px; background: var(--surface); font-weight: 650; font-size: 14px; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.segment-input:hover:not(:disabled) + .segment-texte { border-color: var(--texte-3); }
.segment-input:checked + .segment-texte { background: var(--atlas-plein); border-color: var(--atlas-plein); color: #fff; }
.segment-input:focus-visible + .segment-texte { outline: 2px solid var(--focus); outline-offset: 2px; }
.segment-input:disabled + .segment-texte { opacity: 0.45; }
.compteur-caracteres { justify-self: end; font-size: 12px; color: var(--texte-3); font-variant-numeric: tabular-nums; }

/* Barre de filtres : collante sous l en-tete, pour rester a portee au milieu d une longue liste */
.barre-filtres {
  position: sticky; top: var(--entete-hauteur); z-index: 12;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 12px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1);
}
.filtre { position: relative; display: grid; gap: 4px; flex: 0 1 170px; min-width: 130px; }
.filtre-recherche { flex: 1 1 220px; }
.filtre-date { flex: 0 1 150px; }
.filtre .saisie[type="date"] { height: 38px; min-height: 38px; padding-top: 0; padding-bottom: 0; }
.filtre-libelle { font-size: 12px; font-weight: 700; color: var(--texte-2); }
.filtre-loupe { position: absolute; inset-inline-start: 12px; bottom: 12px; color: var(--texte-3); pointer-events: none; }
.filtre .saisie { min-height: 38px; }
.filtre-effacer { margin-inline-start: auto; align-self: end; }
@media (max-width: 640px) {
  .filtre { flex: 1 1 calc(50% - 6px); min-width: 0; grid-template-columns: minmax(0, 1fr); }
  /* Le champ date a une largeur propre qui depassait la moitie d'ecran. */
  .filtre .saisie { min-width: 0; width: 100%; }
  .filtre-recherche { flex-basis: 100%; }
  .filtre-effacer { margin-inline-start: 0; }
}

/* ================================================================== */
/*  8. Cartes, badges, definitions, onglets                            */
/* ================================================================== */

.carte { min-width: 0; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1); }
.carte-entete { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 16px 20px; border-bottom: 1px solid var(--bordure); }
.carte-icone { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--safran-fond); color: var(--safran-texte); }
.carte-titres { flex: 1 1 200px; min-width: 0; }
.carte-titre { margin: 0; font: 700 16.5px/1.3 var(--police-titre); letter-spacing: -0.01em; }
.carte-sous-titre { margin-top: 2px; font-size: 13px; color: var(--texte-3); }
.carte-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.carte-corps { padding: 20px; min-width: 0; }
.carte-pied { padding: 12px 20px; border-top: 1px solid var(--bordure); background: var(--surface-2); border-radius: 0 0 var(--rayon) var(--rayon); }
@media (max-width: 640px) {
  .carte-entete { padding: 14px 16px; }
  .carte-corps { padding: 16px; }
  .carte-pied { padding: 12px 16px; }
}

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--t-fond, var(--brume-fond)); color: var(--t-texte, var(--brume-texte));
  font: 700 12px/1 var(--police); white-space: nowrap; vertical-align: middle;
}
.badge-point { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ton-ocre-raye { background-image: repeating-linear-gradient(-45deg, transparent 0 5px, var(--raye-ocre) 5px 9px); }
.badge.ton-argile-barre > span:last-child { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.badge.ton-argile-hache { background-image: repeating-linear-gradient(45deg, transparent 0 4px, var(--hache-argile) 4px 7px); }
.pile-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.avatar { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 750 12.5px/1 var(--police); letter-spacing: 0.02em; }
.avatar-petit { width: 28px; height: 28px; font-size: 12.5px; }
.avatar-grand { width: 60px; height: 60px; font: 750 21px/1 var(--police-titre); }
.avatar-teinte-0 { background: #0f3d3e; }
.avatar-teinte-1 { background: #a44a17; }
.avatar-teinte-2 { background: #2a756b; }
.avatar-teinte-3 { background: #7d5410; }
.avatar-teinte-4 { background: #5f4a8b; }
.avatar-teinte-5 { background: #9a3a28; }

.definitions { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 22px; margin: 0; }
.definition { min-width: 0; }
.definition dt { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-3); }
.definition dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.onglets { min-width: 0; }
.onglets-liste { display: flex; gap: 2px; margin-bottom: 18px; overflow-x: auto; border-bottom: 1px solid var(--bordure); scrollbar-width: none; }
.onglets-liste::-webkit-scrollbar { display: none; }
.onglet { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border: 0; border-radius: 9px 9px 0 0; background: none; color: var(--texte-2); font: 650 14.5px var(--police); white-space: nowrap; cursor: pointer; }
.onglet:hover { color: var(--texte); background: var(--surface-2); }
.onglet[aria-selected='true'] { color: var(--texte); }
.onglet[aria-selected='true']::after { content: ''; position: absolute; inset-inline-start: 10px; inset-inline-end: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--g-marque); }
.onglet:focus-visible { outline-offset: -2px; }
.onglet-compteur { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--texte-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.onglet-panneau { outline: none; }
.onglet-panneau:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: 6px; }

/* Cartes KPI */
.grille-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
@media (max-width: 640px) {
  .grille-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .carte-kpi { padding: 12px 14px; }
  .kpi-valeur { font-size: 22px; }
}
.carte-kpi { position: relative; display: grid; gap: 6px; align-content: start; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1); color: inherit; text-decoration: none; }
.kpi-lien { transition: box-shadow 0.16s, transform 0.16s, border-color 0.16s; }
.kpi-lien:hover { border-color: var(--bordure-forte); box-shadow: var(--ombre-2); transform: translateY(-1px); }
.kpi-haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-libelle { font-size: 13px; font-weight: 650; color: var(--texte-2); }
.kpi-icone { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--t-fond); color: var(--t-texte); }
.kpi-valeur { font: 800 clamp(24px, 1vw + 18px, 30px)/1.1 var(--police-titre); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-bas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; }
.kpi-tendance { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--texte-2); font-weight: 700; }
.kpi-tendance.est-favorable { background: var(--menthe-fond); color: var(--menthe-texte); }
.kpi-tendance.est-defavorable { background: var(--argile-fond); color: var(--argile-texte); }
.kpi-detail { color: var(--texte-3); }
.kpi-fleche { position: absolute; inset-inline-end: 14px; bottom: 16px; color: var(--texte-3); }

/* ================================================================== */
/*  9. Tableaux                                                        */
/* ================================================================== */

.tableau-bloc { display: grid; min-width: 0; }
.tableau-defilement {
  /* position RELATIVE obligatoire : les libellees "visuellement-cache" des
     cellules sont en position absolute et epongent autrement le document,
     la page s'allongeant en blanc bien au-dela du tableau. */
  position: relative;
  overflow: auto; max-height: min(72vh, 920px); min-width: 0;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1);
  overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--bordure-forte) transparent;
}
.tableau-defilement:focus-visible { outline-offset: 1px; }
.carte-corps > .tableau-bloc .tableau-defilement, .carte-corps > .tableau-defilement { box-shadow: none; }
.tableau-defilement-libre { max-height: none; }
.tableau { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tableau th {
  position: sticky; top: 0; z-index: 2; padding: 10px 14px; text-align: start; white-space: nowrap; vertical-align: bottom;
  background: var(--surface-2); color: var(--texte-2); border-bottom: 1px solid var(--bordure);
  font: 750 12.5px/1.2 var(--police); letter-spacing: 0.06em; text-transform: uppercase;
}
.tableau tbody th { position: static; text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 650; background: none; color: var(--texte); vertical-align: top; }
.tableau td code { white-space: nowrap; }
.tableau td { padding: 11px 14px; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau tbody tr:last-child > * { border-bottom: 0; }
.tableau .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau th.num { text-align: end; }
.tableau th.est-trie { color: var(--texte); }
.tableau-dense td { padding: 8px 12px; }
.tableau-dense th { padding: 9px 12px; }
.tri-bouton { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.tri-bouton:hover { color: var(--texte); background: var(--surface-3); }
.tri-icone { opacity: 0.55; }
.est-trie .tri-icone { opacity: 1; color: var(--accent-texte); }
.ligne-cliquable { cursor: pointer; }
.ligne-cliquable:hover > td { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.ligne-cliquable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ligne-attenuee > td { color: var(--texte-3); }
.ligne-attenuee .avatar { filter: grayscale(0.8); opacity: 0.7; }
.lien-ligne { color: inherit; text-decoration: none; border-radius: 6px; }
.lien-ligne:hover .texte-fort { text-decoration: underline; }
.tableau-squelette td { padding: 15px 14px; }
.tableau-vide { background: var(--surface); border: 1px dashed var(--bordure-forte); border-radius: var(--rayon); }
.carte-corps .tableau-vide { border: 0; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 4px 0; font-size: 13px; color: var(--texte-2); }
.pagination-info { font-variant-numeric: tabular-nums; }
.pagination-boutons { display: flex; align-items: center; gap: 6px; }
.pagination-page { min-width: 88px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.masquer-mobile { }
@media (max-width: 640px) {
  .tableau .masquer-mobile { display: none; }
  .tableau th, .tableau td { padding-inline-start: 12px; padding-inline-end: 12px; }
}

@media (max-width: 640px) {
  .tableau-empile .tableau-defilement { max-height: none; overflow: visible; background: none; border: 0; box-shadow: none; }
  .tableau-empile .tableau, .tableau-empile .tableau tbody { display: block; width: 100%; }
  .tableau-empile .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau-empile .tableau tbody tr { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1); }
  .tableau-empile .tableau td { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); align-items: center; gap: 10px; padding: 5px 0; border: 0; text-align: start; white-space: normal; }
  .tableau-empile .tableau td::before { content: attr(data-libelle); font: 700 11px/1.3 var(--police); letter-spacing: 0.05em; text-transform: uppercase; color: var(--texte-3); }
  .tableau-empile .tableau td.col-principale { order: -1; display: block; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--bordure); }
  .tableau-empile .tableau td.col-principale::before { content: none; }
  /* Un badge long (alerte « Non rendu depuis … ») passe a la ligne : sans cela
     il elargit la fiche, puis toute la page au-dela de l'ecran du telephone. */
  .tableau-empile .tableau td > * { min-width: 0; max-width: 100%; }
  .tableau-empile .tableau td .badge { white-space: normal; height: auto; min-height: 24px; padding: 4px 9px; line-height: 1.35; }
  .tableau-empile .tableau tbody tr:last-child > * { border-bottom: 0; }
  .tableau-empile .tableau tbody tr:last-child > td.col-principale { border-bottom: 1px solid var(--bordure); }
  .tableau-empile .ligne-cliquable:hover > td { background: none; }
  .tableau-empile .cellule-personne, .tableau-empile .cellule-evenement { min-width: 0; }
  .tableau-empile .tableau-squelette td::before { content: none; }
}

.cellule-personne { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cellule-personne-textes { display: grid; min-width: 0; line-height: 1.3; }
.cellule-personne-textes .texte-discret { font-size: 12.5px; overflow-wrap: anywhere; }
.cellule-icone { display: flex; align-items: center; gap: 10px; }
.cellule-icone > .icone { color: var(--texte-3); }
.cellule-evenement { display: grid; gap: 2px; min-width: 260px; }
.cellule-evenement .texte-discret { font-size: 12px; }
.cellule-evenement code { background: none; padding: 0; }
.col-date { white-space: nowrap; }
.ligne-outils { display: flex; justify-content: flex-end; font-size: 13px; }

/* ================================================================== */
/*  10. Modale, menu, notifications                                    */
/* ================================================================== */

#couche-modale { position: relative; z-index: 100; }
.modale-fond { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: rgba(5, 14, 17, 0.58); animation: apparaitre 0.16s ease; }
.modale-fond.sort { animation: disparaitre 0.16s ease forwards; }
.modale {
  width: 100%; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--surface); color: var(--texte); border: 1px solid var(--bordure); border-radius: 18px; box-shadow: var(--ombre-3);
  outline: none; animation: monter 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modale-petite { max-width: 480px; }
.modale-moyenne { max-width: 640px; }
.modale-grande { max-width: 940px; }
.modale-entete { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.modale-icone { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--atlas-fond); color: var(--atlas-texte); }
.modale-ton-danger .modale-icone { background: var(--argile-fond); color: var(--argile-texte); }
.modale-titres { flex: 1; min-width: 0; padding-top: 2px; }
.modale-titre { margin: 0; font: 750 19px/1.25 var(--police-titre); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.modale-sous-titre { margin-top: 3px; font-size: 13.5px; color: var(--texte-3); }
.modale-fermer { flex: none; width: 36px; height: 36px; margin: -4px -6px 0 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--texte-3); cursor: pointer; }
.modale-fermer:hover { background: var(--surface-2); color: var(--texte); }
.modale-corps { flex: 1 1 auto; min-height: 0; padding: 4px 20px 20px; overflow-y: auto; }
.modale-corps > .formulaire .form-actions { margin-inline-start: -20px; margin-inline-end: -20px; margin-bottom: -20px; padding: 14px 20px; background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modale-pied { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--bordure); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.confirmation { display: grid; gap: 14px; }
.confirmation-message { color: var(--texte-2); }
@media (max-width: 640px) {
  .modale-fond { place-items: end center; padding: 0; }
  .modale { max-height: 94vh; max-height: 94dvh; border-radius: 20px 20px 0 0; border-bottom: 0; animation: monter-bas 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .modale-pied { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .modale-pied .btn { flex: 1 1 auto; }
  .modale-corps > .formulaire .form-actions { border-radius: 0; }
  .modale-corps > .formulaire .form-actions .btn { flex: 1 1 auto; }
}

.menu-conteneur { position: relative; }
.menu { position: absolute; top: calc(100% + 8px); z-index: 60; min-width: 256px; padding: 6px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 14px; box-shadow: var(--ombre-2); animation: monter 0.14s ease; }
.menu-droite { inset-inline-end: 0; }
.menu-gauche { inset-inline-start: 0; }
.menu-entete { padding: 8px 10px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--bordure); }
.menu-compte-nom { font-weight: 750; }
.menu-compte-detail { font-size: 12.5px; color: var(--texte-3); }
.menu-element { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--texte); text-align: start; text-decoration: none; font: 600 14px var(--police); cursor: pointer; }
.menu-element > span:not([class]) { flex: 1; }
.menu-element .icone { color: var(--texte-3); }
.menu-element:hover, .menu-element:focus { outline: none; background: var(--surface-2); }
.menu-element:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.menu-danger, .menu-danger .icone { color: var(--argile-texte); }
.menu-separateur { height: 1px; margin: 6px 4px; background: var(--bordure); }
.menu-bascule .interrupteur-piste { flex: none; transform: scale(0.85); }

.notifications { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 200; width: min(390px, calc(100vw - 32px)); display: grid; gap: 10px; pointer-events: none; }
/*
 * Une fenetre modale porte ses actions en bas : une notification posee au meme
 * endroit cache « Copier le message » ou le bouton WhatsApp, surtout sur
 * telephone ou la fenetre occupe toute la largeur. Tant qu'une fenetre est
 * ouverte, la pile passe donc en haut de l ecran.
 */
:root.modale-ouverte .notifications { bottom: auto; top: calc(12px + env(safe-area-inset-top, 0px)); }
.notif {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 12px 10px 12px 14px;
  border-radius: 13px; background: #102a30; color: #eef4f4; box-shadow: var(--ombre-3);
  border-inline-start: 4px solid var(--menthe-plein); animation: glisser 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
:root[data-theme='sombre'] .notif { background: #1d3a42; }
.notif.sort { animation: disparaitre 0.2s ease forwards; }
.notif-icone { margin-top: 1px; color: #7ed6c8; }
.notif-erreur { border-inline-start-color: #e0735a; }
.notif-erreur .notif-icone { color: #f3a18c; }
.notif-alerte { border-inline-start-color: var(--ocre-plein); }
.notif-alerte .notif-icone { color: #ebc77f; }
.notif-info { border-inline-start-color: #86d3c8; }
.notif-info .notif-icone { color: #a6d9d2; }
.notif-corps { flex: 1; min-width: 0; display: grid; gap: 2px; }
.notif-titre { font-weight: 750; }
.notif-message { font-size: 14px; overflow-wrap: anywhere; }
.notif-action { justify-self: start; margin-top: 6px; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px; background: none; color: #fff; font-weight: 700; cursor: pointer; }
/*
 * Notification qui porte ses propres suites (U-08 : « Bon PDF », « WhatsApp »
 * apres une confirmation). Elle remplace une fenetre a fermer : les actions
 * sont la, cote a cote, et disparaissent avec la notification si l'agent
 * enchaine sur la demande suivante.
 */
.notif-avec-actions { display: grid; gap: 2px; }
.notif-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-actions .notif-action { display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 32px; font-size: 13.5px; text-decoration: none; }
.notif-actions .notif-action:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.notif-fermer { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: rgba(238, 244, 244, 0.7); cursor: pointer; }
.notif-fermer:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
@media (max-width: 640px) {
  .notifications { inset-inline-start: 12px; inset-inline-end: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; }
}

/* ================================================================== */
/*  11. Composants metier                                              */
/* ================================================================== */

/* Jauge de carburant */
.jauge { display: grid; justify-items: center; gap: 8px; width: 100%; max-width: 260px; }
.jauge-libelle { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--texte-2); }
.jauge-cadran { width: 100%; border-radius: 12px; }
.jauge-modifiable .jauge-cadran { cursor: pointer; }
.jauge-dessin { display: block; width: 100%; height: auto; overflow: visible; }
.jauge-segment { fill: var(--surface-3); transition: fill 0.16s; }
.jauge-modifiable .jauge-segment:hover { fill: var(--bordure-forte); }
.jauge-segment.niveau-bas { fill: var(--argile-plein); }
.jauge-segment.niveau-moyen { fill: var(--ocre-plein); }
.jauge-segment.niveau-haut { fill: var(--menthe-plein); }
.jauge-aiguille { stroke: var(--texte); stroke-width: 3.5; stroke-linecap: round; }
.jauge-pivot { fill: var(--texte); }
.jauge-valeur { margin-top: -6px; color: var(--texte); font: 800 22px/1 var(--police-titre); font-variant-numeric: tabular-nums; }
.jauge-borne { fill: var(--texte-3); font: 800 12px var(--police); }
.jauge-commandes { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--texte-3); }

/* Etat des lieux */
.edl { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.edl-schema-bloc { display: grid; gap: 8px; }
.edl-schema { display: block; width: 100%; height: auto; touch-action: manipulation; }
.edl-ombre { fill: var(--surface-2); }
.edl-zone { fill: var(--surface); stroke: var(--bordure-forte); stroke-width: 1.5; stroke-linejoin: round; transition: fill 0.12s, stroke 0.12s; }
.edl-vitre { fill: color-mix(in srgb, var(--atlas-plein) 20%, var(--surface)); }
.edl-jante { fill: #22363b; stroke: #22363b; }
:root[data-theme='sombre'] .edl-jante { fill: #3b545a; stroke: #4a666d; }
.edl-retro { fill: var(--surface-3); }
.edl-zone.a-dommage { fill: color-mix(in srgb, var(--argile-plein) 18%, var(--surface)); }
.edl-modifiable .edl-zone { cursor: pointer; }
.edl-modifiable .edl-zone:hover, .edl-modifiable .edl-zone:focus-visible { outline: none; fill: color-mix(in srgb, var(--g-marque) 32%, var(--surface)); stroke: var(--g-marque); stroke-width: 2.5; }
.edl-phare { fill: #f3d68b; pointer-events: none; }
.edl-feu { fill: #c2553a; pointer-events: none; }
.edl-repere { fill: var(--texte-3); font: 800 9px var(--police); letter-spacing: 0.14em; pointer-events: none; }
.edl-marque { pointer-events: none; }
.edl-marque circle { stroke: #fff; stroke-width: 2; }
.edl-marque text { fill: #fff; font: 800 11px var(--police); }
.gravite-legere circle, .edl-pastille.gravite-legere, .edl-numero.gravite-legere { fill: #8a6410; background: #8a6410; }
.gravite-moyenne circle, .edl-pastille.gravite-moyenne, .edl-numero.gravite-moyenne { fill: #bb5418; background: #bb5418; }
.gravite-importante circle, .edl-pastille.gravite-importante, .edl-numero.gravite-importante { fill: #a3321d; background: #a3321d; }
.edl-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--texte-2); }
.edl-legende li { display: inline-flex; align-items: center; gap: 6px; }
.edl-pastille { width: 10px; height: 10px; border-radius: 50%; }
.edl-panneau { min-width: 0; }
.edl-titre { font: 750 16px var(--police-titre); }
.edl-compteur { color: var(--texte-3); }
.edl-aide { margin-top: 4px; font-size: 13.5px; color: var(--texte-2); }
.edl-liste { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.edl-ligne { display: flex; align-items: flex-start; gap: 12px; padding: 10px 10px 10px 12px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 11px; }
.edl-numero { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; font: 800 13px var(--police); }
.edl-ligne-texte { flex: 1; min-width: 0; display: grid; gap: 1px; }
.edl-ligne-zone { font-weight: 700; }
.edl-ligne-detail { font-size: 13px; color: var(--texte-2); }
.edl-ligne-note { font-size: 13px; color: var(--texte-3); font-style: italic; overflow-wrap: anywhere; }
.edl-vide { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: var(--menthe-fond); color: var(--menthe-texte); font-weight: 650; }
.edl-saisie { display: grid; gap: 14px; }
/* Prise de la photo du dommage sans quitter la fenetre du constat */
.edl-photo { display: grid; gap: 6px; justify-items: start; padding-top: 12px; border-top: 1px solid var(--bordure); }
.edl-photo p { margin: 0; }
@media (max-width: 760px) {
  .edl { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .edl-schema-bloc { width: 100%; max-width: 270px; margin: 0 auto; }
}

/* Planning (Gantt) */
.gantt { --hauteur-piste: 30px; display: grid; gap: 8px; min-width: 0; }
.gantt-defilement { position: relative; overflow: auto; max-height: 72vh; min-width: 0; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--bordure-forte) transparent; }
.gantt-grille { --colonne-libelle: 200px; position: relative; width: calc(var(--colonne-libelle) + var(--nb-jours) * var(--largeur-jour)); }
.gantt-entete { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface-2); border-bottom: 1px solid var(--bordure); }
.gantt-coin { position: sticky; inset-inline-start: 0; z-index: 7; flex: none; width: var(--colonne-libelle); display: flex; align-items: flex-end; padding: 10px 12px; background: var(--surface-2); border-inline-end: 1px solid var(--bordure); font: 750 11.5px var(--police); letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-2); }
.gantt-jours { display: flex; }
.gantt-jour { position: relative; flex: none; width: var(--largeur-jour); height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; padding-bottom: 6px; border-inline-end: 1px solid var(--bordure); font-variant-numeric: tabular-nums; }
.gantt-jour.est-weekend { background: var(--gantt-weekend); }
.gantt-jour.debut-mois { box-shadow: inset 2px 0 0 var(--bordure-forte); }
.gantt-mois { position: absolute; top: 4px; inset-inline-start: 5px; font: 800 10px var(--police); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-texte); white-space: nowrap; }
.gantt-jour-lettre { font: 700 10.5px var(--police); color: var(--texte-3); }
.gantt-jour-numero { min-width: 26px; height: 22px; display: grid; place-items: center; border-radius: 999px; font: 700 14px var(--police-titre); color: var(--texte); }
.gantt-jour.est-aujourdhui .gantt-jour-numero { background: var(--g-marque); color: var(--g-sur-marque); }
.gantt-ligne { display: flex; border-bottom: 1px solid var(--bordure); }
.gantt-ligne:last-child { border-bottom: 0; }
.gantt-libelle { position: sticky; inset-inline-start: 0; z-index: 5; flex: none; width: var(--colonne-libelle); display: grid; align-content: center; gap: 1px; padding: 6px 12px; background: var(--surface); border-inline-end: 1px solid var(--bordure); min-width: 0; }
.gantt-libelle-titre { font-weight: 750; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-libelle-sous { font-size: 12px; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-piste {
  position: relative; flex: none; width: calc(var(--nb-jours) * var(--largeur-jour)); min-height: calc(var(--pistes, 1) * var(--hauteur-piste) + 12px);
  background-image: linear-gradient(to right, transparent calc(var(--largeur-jour) - 1px), var(--bordure) calc(var(--largeur-jour) - 1px));
  background-size: var(--largeur-jour) 100%; cursor: crosshair; user-select: none; -webkit-user-select: none;
}
.gantt-fond { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.gantt-fond.est-weekend { background: var(--gantt-weekend); }
.gantt-fond.est-aujourdhui { background: color-mix(in srgb, var(--g-marque) 9%, transparent); }
.gantt-maintenant { position: absolute; top: 0; bottom: 0; z-index: 3; width: 2px; margin-inline-start: -1px; background: var(--g-marque); pointer-events: none; }
.gantt-maintenant::before { content: ''; position: absolute; top: -1px; inset-inline-start: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--g-marque); }
.gantt-barre, .gantt-indispo { position: absolute; display: flex; align-items: center; min-width: 0; padding: 0 8px; overflow: hidden; white-space: nowrap; font: 700 12px/1 var(--police); }
.gantt-barre {
  z-index: 2; height: calc(var(--hauteur-piste) - 6px); margin-inline-start: 1px; border: 0; border-radius: 7px; cursor: pointer; text-align: start;
  background: var(--t-plein); color: var(--t-sur); box-shadow: 0 1px 2px rgba(11, 31, 36, 0.22);
  transition: filter 0.12s, box-shadow 0.12s;
}
.gantt-barre:hover { filter: brightness(1.08) saturate(1.05); box-shadow: 0 4px 10px -2px rgba(11, 31, 36, 0.35); z-index: 4; }
.gantt-barre:focus-visible { outline: 2px solid var(--texte); outline-offset: 1px; z-index: 4; }
.gantt-barre.ton-ocre-raye { background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255, 255, 255, 0.28) 6px 12px); }
.gantt-barre.ton-argile-barre .gantt-barre-texte { text-decoration: line-through; }
.gantt-barre.ton-argile-barre { opacity: 0.85; }
.gantt-barre.coupee-avant { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-inline-start: 0; }
.gantt-barre.coupee-apres { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gantt-barre-texte { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gantt-indispo { top: 4px; bottom: 4px; z-index: 1; border-radius: 7px; color: var(--t-texte); border: 1px dashed var(--t-plein); background: repeating-linear-gradient(45deg, var(--hache-argile) 0 5px, transparent 5px 10px); pointer-events: auto; }
.gantt-selection { position: absolute; top: 3px; bottom: 3px; z-index: 3; border: 2px dashed var(--atlas-texte); border-radius: 8px; background: color-mix(in srgb, var(--atlas-plein) 14%, transparent); pointer-events: none; }
.gantt-aide { min-height: 1.2em; font-size: 13px; color: var(--texte-2); }
@media (max-width: 640px) { .gantt-grille { --colonne-libelle: 118px; } .gantt-libelle-sous { display: none; } }

/* ================================================================== */
/*  12. Ecrans                                                         */
/* ================================================================== */

/* Chantier */
.carte-chantier .carte-corps { padding: 12px 20px 28px; }
.chantier-liens { display: grid; justify-items: center; gap: 10px; }
.chantier-liens-titre { font-size: 13px; font-weight: 700; color: var(--texte-3); }
.chantier-liens ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.page-etat .page-vide { padding-top: 24px; }

/* Mon compte */
.grille-compte { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grille-compte { grid-template-columns: minmax(0, 1fr); } }
.compte-identite { display: flex; align-items: flex-start; gap: 18px; }
.compte-identite-textes { flex: 1; min-width: 0; display: grid; gap: 12px; }
.compte-identite-nom { font: 750 21px/1.2 var(--police-titre); letter-spacing: -0.015em; }
.compte-identite-role { margin-top: -6px; }
.compte-droits summary { cursor: pointer; font-weight: 650; font-size: 13.5px; color: var(--texte-2); }
.liste-codes { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.liste-codes code { background: var(--surface); border: 1px solid var(--bordure); }
@media (max-width: 480px) { .compte-identite { flex-direction: column; } }
@media (max-width: 640px) { .page-entete-ligne > .avatar { display: none; } }

/* Mot de passe provisoire */
.mdp-provisoire { display: grid; gap: 14px; }
.mdp-provisoire-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mdp-provisoire-code {
  flex: 1 1 220px; display: block; padding: 14px 16px; border-radius: 12px; border: 2px dashed var(--g-marque);
  background: var(--safran-fond); color: var(--texte); text-align: center; user-select: all;
  font: 800 clamp(20px, 3vw, 26px)/1.1 var(--police-code); letter-spacing: 0.08em; font-variant-numeric: tabular-nums;
}

/* Fiche utilisateur */
.grille-fiche { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grille-fiche { grid-template-columns: minmax(0, 1fr); } }
.droits-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.droits-outils .saisie-recherche { width: 220px; padding-inline-start: 12px; }
.droits-grille { display: grid; min-width: 0; font-size: 14px; }
.droits-entete, .droits-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 100px 250px 80px; align-items: center; gap: 12px; }
.droits-entete { padding: 0 8px 8px; border-bottom: 1px solid var(--bordure); font: 750 11.5px var(--police); letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-2); }
.droits-categorie { padding: 16px 8px 6px; font: 750 12.5px var(--police); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-texte); }
.droits-ligne { padding: 8px; border-bottom: 1px solid var(--bordure); border-radius: 8px; }
.droits-ligne.est-exception { background: color-mix(in srgb, var(--ocre-fond) 55%, transparent); }
.droits-ligne.est-modifiee { box-shadow: inset 3px 0 0 var(--g-marque); }
.droits-libelle { display: grid; gap: 3px; min-width: 0; }
.droits-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.droits-meta code { font-size: 12px; }
.droits-meta .badge { height: 22px; font-size: 12.5px; padding: 0 7px; }
.droits-col-role, .droits-col-effectif { text-align: center; justify-self: center; }
.droit-oui, .droit-non { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 13px; }
.droit-oui { color: var(--menthe-texte); }
.droit-non { color: var(--texte-3); }
.droit-tiret { color: var(--texte-3); }
.segments-compacts { margin: 0; flex-wrap: nowrap; gap: 0; }
.segments-compacts .segment-texte { min-height: 30px; padding: 0 11px; border-radius: 0; margin-inline-start: -1px; font-size: 13px; }
.segments-compacts .segment:first-child .segment-texte { border-radius: 999px 0 0 999px; margin-inline-start: 0; }
.segments-compacts .segment:last-child .segment-texte { border-radius: 0 999px 999px 0; }
.segment-grant .segment-input:checked + .segment-texte { background: var(--menthe-plein); border-color: var(--menthe-plein); color: var(--menthe-sur); }
.segment-deny .segment-input:checked + .segment-texte { background: var(--argile-plein); border-color: var(--argile-plein); color: #fff; }
.segment-herite .segment-input:checked + .segment-texte { background: var(--surface-3); border-color: var(--bordure-forte); color: var(--texte); }
@media (max-width: 860px) {
  .droits-entete { display: none; }
  .droits-ligne { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'libelle effectif' 'exception exception'; gap: 8px; }
  .droits-ligne .droits-libelle { grid-area: libelle; }
  .droits-ligne .droits-col-role { display: none; }
  .droits-ligne .droits-col-exception { grid-area: exception; }
  .droits-ligne .droits-col-effectif { grid-area: effectif; }
}

.barre-enregistrer {
  position: sticky; bottom: 16px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--g-nuit); color: #eef4f4; box-shadow: var(--ombre-3); animation: monter 0.2s ease;
}
:root[data-theme='sombre'] .barre-enregistrer { background: #1d3a42; }
.barre-enregistrer-texte { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.barre-enregistrer-texte .texte-ajout { color: #86dccd; }
.barre-enregistrer-texte .texte-retrait { color: #f3a18c; }
.barre-enregistrer-actions { display: flex; gap: 8px; }
.barre-enregistrer .btn-fantome { --btn-texte: #d7e2e3; }
.barre-enregistrer .btn-fantome:hover { --btn-fond: rgba(255, 255, 255, 0.1); --btn-texte: #fff; }

.resume-modifs { display: grid; gap: 12px; }
.resume-bloc ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; font-size: 13.5px; }
.resume-bloc li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.resume-signe { width: 12px; font-weight: 800; }

/* Roles et droits */
.legende-matrice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 13px; color: var(--texte-2); }
.legende-matrice > span { display: inline-flex; align-items: center; gap: 6px; }
.legende-recherche { margin-inline-start: auto; }
.legende-recherche .saisie { width: 240px; padding-inline-start: 12px; }
.carte-matrice { overflow: hidden; }
.carte-matrice .carte-corps { padding: 0; }
.matrice-conteneur { position: relative; overflow: auto; max-height: calc(100vh - 250px); min-height: 320px; scrollbar-width: thin; }
.matrice { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.matrice th, .matrice td { border-bottom: 1px solid var(--bordure); }
.matrice thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); vertical-align: bottom; }
.matrice-coin { inset-inline-start: 0; z-index: 4 !important; min-width: 280px; padding: 12px 16px; text-align: start; font: 750 12.5px var(--police); letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-2); }
.matrice-role { min-width: 128px; padding: 12px 10px; text-align: center; font-weight: 400; }
.matrice-role > span:not(.badge) { display: block; margin: 0 auto; }
.matrice-role .badge, .matrice-role .btn { margin-top: 6px; }
.matrice-role .badge { display: inline-flex; }
.matrice-role.est-edite { background: color-mix(in srgb, var(--g-marque) 16%, var(--surface-2)); box-shadow: inset 0 3px 0 var(--g-marque); }
.matrice-role-nom { font: 750 13.5px/1.25 var(--police-titre); color: var(--texte); }
.matrice-role-meta { margin-top: 2px; font-size: 12.5px; color: var(--texte-3); }
.matrice-role-compte { margin-top: 2px; font: 700 12.5px var(--police); color: var(--texte-2); font-variant-numeric: tabular-nums; }
.matrice-role-verrou { display: inline-flex !important; align-items: center; gap: 4px; margin-top: 8px !important; font-size: 12.5px; color: var(--texte-3); }
.matrice-categorie th { position: sticky; top: 72px; z-index: 1; padding: 14px 16px 6px; text-align: start; background: var(--surface); font: 750 12px var(--police); letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent-texte); }
.matrice-droit { position: sticky; inset-inline-start: 0; z-index: 2; padding: 9px 16px; text-align: start; font-weight: 400; background: var(--surface); box-shadow: inset -1px 0 0 var(--bordure); }
.matrice-droit-libelle { display: block; font-weight: 650; }
.matrice-droit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.matrice-droit-meta code { font-size: 12.5px; }
.matrice-droit-meta .badge { height: 22px; font-size: 12.5px; padding: 0 7px; }
.matrice-cellule { text-align: center; padding: 6px; }
.matrice tbody tr:hover > * { background: color-mix(in srgb, var(--surface-2) 75%, var(--surface)); }
.matrice-oui { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--menthe-fond); color: var(--menthe-texte); }
.matrice-non { color: var(--texte-3); font-weight: 800; font-size: 18px; }
.matrice-cellule.est-edite { background: color-mix(in srgb, var(--g-marque) 7%, var(--surface)); }
.matrice-cellule.est-modifiee { background: color-mix(in srgb, var(--g-marque) 22%, var(--surface)) !important; }
.case-seule { justify-content: center; padding: 4px; }
.case-seule .case-input { inset-inline-start: 4px; top: 4px; }
@media (max-width: 640px) {
  .matrice-coin { min-width: 180px; }
  .matrice-droit { max-width: 190px; }
  .matrice-droit-meta code { display: none; }
  .legende-recherche { margin-inline-start: 0; width: 100%; }
  .legende-recherche .saisie { width: 100%; }
}

/* Journal d'audit */
.zone-verification:empty { display: none; }
.detail-resume { font-size: 15.5px; font-weight: 600; }
.intertitre { margin: 6px 0 -6px; font: 750 14px var(--police-titre); }
.tableau-changements th[scope='row'] { white-space: nowrap; }
.tableau-changements td { vertical-align: top; overflow-wrap: anywhere; }
.valeur-avant { color: var(--argile-texte); background: color-mix(in srgb, var(--argile-fond) 45%, transparent); }
.valeur-apres { color: var(--menthe-texte); background: color-mix(in srgb, var(--menthe-fond) 45%, transparent); }
.json { margin: 0; padding: 8px 10px; max-height: 260px; overflow: auto; border-radius: 8px; background: var(--surface-2); color: var(--texte); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Parametres */
.grille-parametres { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.sommaire { position: sticky; top: calc(var(--entete-hauteur) + 20px); display: grid; gap: 6px; }
.sommaire-titre { padding: 0 10px; font: 750 11.5px var(--police); letter-spacing: 0.08em; text-transform: uppercase; color: var(--texte-3); }
.sommaire ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.sommaire-lien { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--texte-2); font-weight: 650; font-size: 14px; text-decoration: none; }
.sommaire-lien:hover { background: var(--surface-2); color: var(--texte); }
.sommaire-pastille { width: 8px; height: 8px; margin-inline-start: auto; border-radius: 50%; background: var(--g-marque); }
@media (max-width: 1100px) { .grille-parametres { grid-template-columns: minmax(0, 1fr); } .sommaire { display: none; } }
.carte-parametres { scroll-margin-top: calc(var(--entete-hauteur) + 16px); }
.form-actions-parametres.est-modifiee { position: sticky; box-shadow: 0 -8px 20px -14px rgba(11, 31, 36, 0.35); }
.form-actions-parametres { position: relative; bottom: 0; z-index: 5; margin: 20px -20px -20px; padding: 12px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 0 0 var(--rayon) var(--rayon); }
@media (max-width: 640px) { .form-actions-parametres { margin: 16px -16px -16px; padding: 12px 16px; } }
.carte-etat { margin-inline-end: auto; font-size: 13px; font-weight: 700; color: var(--accent-texte); }
.faq-liste { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.faq-element { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 12px; }
.faq-numero { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--bordure); font: 800 13px var(--police); color: var(--texte-2); }
.faq-champs { display: grid; gap: 8px; min-width: 0; }
.faq-libelle { display: grid; gap: 4px; }
.faq-libelle .champ-libelle { font-size: 12px; color: var(--texte-2); }
.faq-outils { display: flex; flex-direction: column; gap: 2px; }
.faq-vide { padding: 14px; border: 1px dashed var(--bordure-forte); border-radius: 12px; color: var(--texte-3); text-align: center; }
.faq-pied { margin-top: 10px; }
@media (max-width: 640px) {
  .faq-element { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .faq-numero { display: none; }
  .faq-outils { flex-direction: row; justify-content: flex-end; }
}
.reseaux { display: grid; gap: 8px; margin-top: 6px; }
.reseau-ligne { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 12px; }
.reseau-nom { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; }
@media (max-width: 640px) { .reseau-ligne { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.logo-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.logo-apercu { flex: none; width: 190px; height: 96px; display: grid; place-items: center; padding: 10px; border-radius: 12px; border: 1px dashed var(--bordure-forte); background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px; }
.logo-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-absent { display: grid; justify-items: center; gap: 4px; font-size: 12.5px; color: var(--texte-3); text-align: center; }
.logo-actions { flex: 1 1 240px; display: grid; gap: 8px; }
.logo-boutons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Securite */
.posture { margin: 0; padding: 0; list-style: none; display: grid; }
.posture-ligne { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bordure); }
.posture-ligne:first-child { padding-top: 0; }
.posture-ligne:last-child { border-bottom: 0; padding-bottom: 0; }
.posture-icone { color: var(--menthe-texte); }
.est-alerte .posture-icone { color: var(--ocre-texte); }
.posture-textes { display: grid; gap: 2px; min-width: 0; }
.posture-libelle { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.posture-libelle .icone { color: var(--texte-3); }
.posture-note { font-size: 12.5px; color: var(--texte-3); }
.posture-valeur { font: 750 15px var(--police-titre); font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.est-alerte .posture-valeur { color: var(--ocre-texte); }

/* Numerotation */
.choix-annee { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 14px; color: var(--texte-2); }
.selecteur-annee { width: 110px; }
.grille-series { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grille-series[aria-busy='true'] { opacity: 0.55; }
.carte-serie { display: flex; flex-direction: column; }
.carte-serie .carte-corps { flex: 1; }
.serie { display: grid; gap: 4px; }
.serie-libelle { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-3); }
.serie-numero {
  justify-self: start; padding: 8px 14px; border-radius: 10px; border: 1.5px dashed var(--bordure-forte); background: var(--surface-2);
  font: 800 clamp(22px, 1vw + 17px, 28px)/1.1 var(--police-titre); letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
}
.serie-detail { margin-top: 4px; font-size: 13px; color: var(--texte-3); }
.apercu-numero { color: var(--texte-2); }
.recap-reglage { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); text-align: center; }
.recap-libelle { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-3); }
.recap-numero { font: 800 21px var(--police-titre); font-variant-numeric: tabular-nums; }
.recap-numero.est-nouveau { color: var(--accent-texte); }
.recap-fleche { color: var(--texte-3); }

/* Bibliotheque */
.rangee-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rangee-titre { min-width: 104px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

/* ================================================================== */
/*  13. Mouvement, impression                                          */
/* ================================================================== */

@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes miroiter { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes apparaitre { from { opacity: 0; } to { opacity: 1; } }
@keyframes disparaitre { to { opacity: 0; } }
@keyframes monter { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes monter-doux { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes monter-bas { from { transform: translateY(100%); } to { transform: none; } }
@keyframes glisser { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes rouler { to { stroke-dashoffset: -38; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .pays-route-tirets, .demarrage-route-tirets { animation: none !important; }
  .chargeur-roue, .btn-roue { animation: tourner 1.6s linear infinite !important; }
}

@media (forced-colors: active) {
  .nav-lien[aria-current='page']::before { background: Highlight; }
  .badge, .btn { border: 1px solid ButtonText; }
}

@media print {
  .lateral, .entete, .notifications, .barre-enregistrer, .page-actions, .sommaire { display: none !important; }
  .coque { display: block; }
  .contenu { padding: 0; max-width: none; }
  body.gestion { background: #fff; color: #000; }
  .carte { box-shadow: none; break-inside: avoid; }
  .tableau-defilement { max-height: none; overflow: visible; }
}

/*
 * Cibles tactiles : au comptoir, l ecran se touche avec un pouce, souvent d une
 * seule main en tenant les cles. Tout ce qui se touche fait donc au moins
 * 44 px de haut sur telephone (recommandation WCAG 2.5.5), pose une fois sur
 * les composants partages plutot qu ecran par ecran.
 */
@media (max-width: 640px) {
  .btn, .saisie, .selecteur, .zone-texte, .entete-recherche-saisie, .nav-lien, .puce-statut,
  .cloche-bouton, .entete-burger, .lateral-fermer, .compte-bouton, .menu-element,
  .onglet, .tri-bouton, .recherche-item, .recherche-tout, .puce, .puce-statut, .btn-petit, .pagination-boutons .btn,
  .filtre .saisie, .filtre .saisie[type="date"], .barre-filtres .saisie, .barre-filtres .selecteur {
    min-height: 44px;
  }
  .btn-icone { min-width: 44px; }
  .entete-marque-mobile { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .case, .interrupteur-bouton { min-height: 44px; }
}

/* ------------------------------------------------------------------ */
/*  Messagerie de l'espace client (cote gestion)                       */
/* ------------------------------------------------------------------ */
.messagerie { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 860px) { .messagerie { grid-template-columns: 20rem 1fr; align-items: start; } }
.messagerie-liste { display: flex; flex-direction: column; gap: .35rem; max-height: 70vh; overflow-y: auto; }
.messagerie-item { display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; text-align: start; padding: .7rem .8rem; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); cursor: pointer; }
.messagerie-item:hover { border-color: var(--bordure-forte); }
.messagerie-item.est-actif { border-color: var(--g-marque); box-shadow: inset 0 0 0 1px var(--g-marque); }
.messagerie-item.a-des-non-lus { font-weight: 650; }
.messagerie-item__nom { font-weight: 650; }
.messagerie-item__apercu { grid-column: 1 / -1; font-size: 13px; color: var(--texte-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messagerie-detail { min-height: 20rem; }
.messagerie-fil { display: flex; flex-direction: column; gap: .8rem; border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1rem; background: var(--surface); }
.messagerie-fil__entete { display: flex; flex-direction: column; gap: .15rem; padding-bottom: .6rem; border-bottom: 1px solid var(--bordure); }
.messagerie-fil__messages { display: flex; flex-direction: column; gap: .5rem; max-height: 52vh; overflow-y: auto; padding: .2rem; }
.messagerie-fil__saisie { display: flex; gap: .5rem; align-items: flex-end; }
.messagerie-fil__saisie textarea { flex: 1; resize: vertical; min-height: 2.6rem; }
.msg { max-width: 82%; padding: .55rem .8rem; border-radius: 13px; }
.msg__corps { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__heure { display: block; margin-top: .25rem; font-size: 11.5px; color: var(--texte-3); }
.msg--client { align-self: flex-start; background: var(--surface-2); }
.msg--agence { align-self: flex-end; background: var(--g-marque); color: #fff; }
.msg--agence .msg__heure { color: rgba(255, 255, 255, .82); }

/* ================================================================== */
/*  Langue : etiquette du menu, et bascule droite-a-gauche (arabe)     */
/* ================================================================== */

/* Petite etiquette de section dans le menu du compte (« Langue »). */
.menu-section {
  margin: 4px 12px 2px; padding: 0;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--texte-3);
}

/*
 * La conversion des proprietes physiques en proprietes LOGIQUES (margin-inline,
 * inset-inline, text-align: start/end) fait seule l'essentiel du miroir quand
 * le document passe en dir="rtl" (arabe). Restent les translations explicites,
 * qui ne suivent pas le sens d'ecriture : on les inverse ici.
 */
[dir="rtl"] [aria-checked='true'] > .interrupteur-piste .interrupteur-pastille,
[dir="rtl"] [aria-checked='true'] .interrupteur-pastille { transform: translateX(-16px); }

@media (max-width: 960px) {
  /* En arabe, le tiroir lateral est ancre a DROITE et sort par la droite. */
  [dir="rtl"] .lateral { inset: 0 0 0 auto; transform: translateX(104%); }
  [dir="rtl"] .coque.tiroir-ouvert .lateral { transform: none; }
}

/* ================================================================== */
/*  Tout le parametrage (/reglages)                                    */
/* ================================================================== */
.reglages-barre {
  display: flex; align-items: center; gap: 10px; max-width: 640px; margin-bottom: 20px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--bordure-forte); border-radius: var(--rayon); box-shadow: var(--ombre-1); color: var(--texte-2);
}
.reglages-barre .reglages-recherche { flex: 1; min-width: 0; border: 0; box-shadow: none; background: transparent; min-height: 48px; font-size: 16px; }
.reglages-barre .reglages-recherche:focus { outline: none; }
.reglages-barre:focus-within { border-color: var(--g-marque); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-marque) 25%, transparent); }
.reglages-groupes { display: grid; gap: 26px; }
.reglages-groupe-titre { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font: 700 15px/1.3 var(--police-titre); color: var(--texte-2); text-transform: uppercase; letter-spacing: 0.04em; }
.reglages-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.reglage-tuile {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; min-height: 84px; color: inherit; text-decoration: none;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1);
}
.reglage-tuile:hover, .reglage-tuile:focus-visible { border-color: var(--g-marque); }
.reglage-tuile-icone { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--safran-fond); color: var(--safran-texte); }
.reglage-tuile-corps { flex: 1; min-width: 0; display: grid; gap: 3px; }
.reglage-tuile-titre { font-weight: 700; }
.reglage-tuile-texte { font-size: 13.5px; color: var(--texte-2); line-height: 1.4; }
.reglage-tuile-fleche { flex: none; align-self: center; color: var(--texte-3, var(--texte-2)); }
@media (max-width: 640px) { .reglages-grille { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================== */
/*  Designs : organisation choisie par la marque                       */
/*  (server/site/designs.js ; attributs data-* poses sur <html> par    */
/*  app.js). Les couleurs viennent de /theme.css (--d-*).              */
/* ================================================================== */

:root[data-titres='serif'] { --police-titre: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif; }
:root[data-titres='systeme'] {
  --police-titre: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --police: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
:root[data-angles='doux'] { --rayon: 8px; }
:root[data-angles='nets'] { --rayon: 3px; }
/* Boutons : « pilule » (origine) garde ici l'arrondi d'origine de la gestion, plus dense que le site. */
:root[data-boutons='arrondi'] { --rayon-bouton: 8px; }
:root[data-boutons='carre'] { --rayon-bouton: 3px; }
:root[data-cartes='bordure'] { --ombre-1: none; }
:root[data-cartes='plat'] { --ombre-1: none; }
:root[data-cartes='plat'] .carte, :root[data-cartes='plat'] .carte-kpi { border-color: transparent; }
:root[data-densite='compacte'] .contenu { padding: 16px 20px 40px; }
:root[data-densite='compacte'] .page { gap: 14px; }
:root[data-densite='compacte'] .carte-entete { padding: 12px 16px; }
/* Menu clair : le monogramme et les separateurs restent visibles. */
:root[data-menu='clair']:not([data-theme='sombre']) .lateral { box-shadow: inset -1px 0 0 var(--bordure); }
@media (prefers-color-scheme: dark) {
  :root[data-menu='clair']:not([data-theme='clair']) .lateral { box-shadow: inset -1px 0 0 var(--lateral-bord); }
}

/* ================================================================== */
/*  Refonte de l'espace de gestion : un outil de travail sobre.        */
/*  Meme systeme pour tous les designs (ils n'apportent que couleurs   */
/*  et axes) : filets fins a la place des ombres, pictos nus a la      */
/*  place des pastilles teintees, titres en police d'interface,        */
/*  chiffres tabulaires. Cette section ferme les regles de base.       */
/* ================================================================== */

:root { --rayon: 10px; --ombre-1: none; --entete-hauteur: 58px; }
:root[data-angles='doux'] { --rayon: 7px; }
:root[data-angles='nets'] { --rayon: 3px; }
:root:not([data-boutons='arrondi']):not([data-boutons='carre']) { --rayon-bouton: 9px; }
body { font-feature-settings: 'cv11', 'ss01'; }

/* Menu lateral : libelles calmes, page active en aplat discret, sans barre. */
.nav-groupe + .nav-groupe { margin-top: 20px; }
.nav-groupe-titre { margin-bottom: 6px; font-size: 12px; font-weight: 650; letter-spacing: 0.06em; }
.nav-lien { min-height: 36px; padding: 7px 10px; gap: 11px; border-radius: 8px; font-weight: 550; font-size: 13.5px; }
.nav-lien .icone { width: 18px; height: 18px; }
.nav-lien[aria-current='page'] { font-weight: 650; }
.nav-lien[aria-current='page']::before { display: none; }
.nav-lien[aria-current='page'] .icone { color: var(--lateral-fort); }
.lateral-haut { border-bottom-color: transparent; }

/* Barre du haut : pleine, la recherche en champ doux. */
.entete { background: var(--fond); -webkit-backdrop-filter: none; backdrop-filter: none; }
.entete-recherche-saisie { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.entete-recherche-saisie:focus { background: var(--surface); border-color: var(--bordure-forte); }

/* Titres de page et de carte : police d'interface, graisse moderee. */
.page { gap: 22px; }
.page-titre { font-family: var(--police); font-weight: 700; font-size: clamp(22px, 0.8vw + 17px, 27px); letter-spacing: -0.022em; }
.page-sous-titre { margin-top: 4px; font-size: 14px; color: var(--texte-3); }
.carte-entete { padding: 14px 18px; gap: 8px 10px; }
.carte-titre { font: 650 15px/1.3 var(--police); letter-spacing: -0.005em; }
.carte-icone { width: auto; height: auto; background: none; border-radius: 0; color: var(--texte-3); }
.carte-icone .icone { width: 18px; height: 18px; }
.carte-corps { padding: 18px; }
.carte-pied { background: none; }
.page-vide-titre { font: 650 16px/1.3 var(--police); }

/* Indicateurs : un seul panneau a filets, plus de pastilles. */
.grille-kpi { gap: 0; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; }
.carte-kpi { padding: 16px 18px 15px; background: none; border: 0; border-radius: 0; box-shadow: 0 0 0 0.5px var(--bordure); }
.kpi-lien:hover { transform: none; box-shadow: 0 0 0 0.5px var(--bordure); background: var(--surface-2); }
.kpi-libelle { font-size: 12.5px; font-weight: 550; color: var(--texte-3); }
.kpi-icone { width: auto; height: auto; background: none; border-radius: 0; color: var(--texte-3); opacity: .75; }
.kpi-icone .icone { width: 16px; height: 16px; }
.kpi-valeur { font: 700 clamp(22px, 0.6vw + 18px, 26px)/1.15 var(--police); letter-spacing: -0.025em; }
.kpi-detail { font-size: 12.5px; }
.kpi-fleche { display: none; }
@media (max-width: 640px) { .grille-kpi { gap: 0; } }

/* Boutons : a plat. */
.btn { font-weight: 600; font-size: 13.5px; }
.btn-primaire, .btn-danger { box-shadow: none; }
.btn-grand { font-size: 15px; }

/* Tableaux : en-tetes discrets, lignes fines. */
.tableau th { padding: 9px 14px; background: var(--surface); color: var(--texte-3); font: 600 12px/1.2 var(--police); letter-spacing: 0.02em; text-transform: none; }
.tableau td { padding: 10px 14px; }
.tableau-vide { border-style: solid; border-color: var(--bordure); }

/* Etats vides et encarts : plus legers. */
.encart { padding: 11px 14px; font-size: 14px; }
.encart-titre { font-weight: 650; }
.vide-compact { background: none; }

/* Onglets et compteurs. */
.onglet { font-weight: 600; }
.page-compteur { background: var(--surface-2); font-weight: 600; }

/* Ecran de connexion : le panneau de marque sans motif. */
.acces-visuel::before, .acces-visuel::after { display: none; }

/* Purger les donnees : choix des comptes (boutons radio au dessin des cases). */
.purge-comptes { border: 0; margin: 0; padding: 0; min-width: 0; }
.case-radio .case-boite { border-radius: 50%; }
.purge-duree { display: flex; gap: 10px; align-items: center; max-width: 320px; }
.purge-duree .saisie { flex: 1 1 100px; min-width: 0; }
.purge-mode .segment-texte { display: inline-flex; align-items: center; gap: 6px; }

/* Agent automatique */
.agent-essai { white-space: pre-wrap; font: inherit; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--bordure); }
.agent-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* Horaires et conges */
.horaires-etat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.horaires-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
@media (max-width: 760px) { .horaires-grille { grid-template-columns: 1fr; } }
.horaires-mode { gap: 10px; }
.horaires-mode-choix .segment-texte { display: grid; gap: 2px; text-align: start; padding: 8px 12px; }
.horaires-mode-choix small { font-weight: 500; color: var(--texte-3); }
.horaires-semaine { display: grid; gap: 6px; }
.horaires-jour { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface-1, transparent); }
@media (max-width: 760px) { .horaires-jour { grid-template-columns: 1fr; } }
.horaires-plages { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.horaires-plage { display: inline-flex; align-items: center; gap: 6px; }
.horaires-plage .saisie-heure { width: 9.5em; }
.horaires-copier { justify-content: flex-start; }
.horaires-dateheure { display: flex; gap: 8px; }
.horaires-dateheure .saisie-heure { width: 9.5em; flex: none; }
.horaires-dateheure input[type="date"] { min-width: 0; flex: 1 1 10em; }
.horaires-raccourcis { gap: 6px; }
.horaires-nouvelle { padding: 12px; border: 1px dashed var(--bordure); border-radius: 12px; }
.horaires-fermetures { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.horaires-fermeture { padding: 10px 12px; border: 1px solid var(--bordure); border-radius: 10px; display: grid; gap: 8px; }
.horaires-fermeture.est-en-cours { border-color: var(--argile, #c0623b); }
.horaires-fermeture.est-passee { opacity: .7; }
.horaires-fermeture-haut { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.horaires-fermeture-badges { display: inline-flex; gap: 6px; align-items: center; }
.horaires-apercu { display: grid; gap: 4px; margin: 0; }
.horaires-apercu div { display: flex; justify-content: space-between; gap: 12px; }
.horaires-apercu dt { font-weight: 650; }
.horaires-apercu dd { margin: 0; font-variant-numeric: tabular-nums; }
.horaires-bandeau-apercu { padding: 8px 12px; border-radius: 8px; background: var(--ocre-fond, #f3e3c3); color: var(--texte-1, inherit); font-weight: 650; font-size: 13px; }

/* Suivi de l'agent automatique */
.agent-suivi-compteurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .agent-suivi-compteurs { grid-template-columns: 1fr; } }
.agent-suivi-compteurs .carte-entete h2 { font-size: 28px; }
.agent-suivi-ligne { position: relative; }
.agent-suivi-action { display: flex; justify-content: flex-end; margin-top: 4px; }
.agent-suivi-filtre { justify-content: flex-start; }

/* Contravention : recherche de contrat et copie de l'avis */
.amende-contrat-recherche { grid-column: 1 / -1; position: relative; }
.amende-contrats-resultats { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface, #fff); max-height: 240px; overflow: auto; display: grid; gap: 2px; }
.amende-contrats-resultats li.texte-discret { padding: 6px 8px; }
.amende-contrat-trouve { width: 100%; text-align: start; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; font: inherit; cursor: pointer; color: inherit; }
.amende-contrat-trouve:hover, .amende-contrat-trouve:focus-visible { background: var(--surface-2); }
.amende-avis { grid-column: 1 / -1; }
.amende-avis-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.amende-avis-liste { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.amende-avis-liste li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border: 1px solid var(--bordure); border-radius: 8px; }
.amende-avis-nom { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }

/* ==================================================================
   Plateforme SaaS : bandeau de l'espace et ecran Abonnement
   ================================================================== */
.bandeau-espace {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.55rem 1.25rem; font-size: 0.9rem; font-weight: 600;
  border-block-end: 1px solid transparent;
}
.bandeau-espace--essai { background: var(--atlas-fond); color: var(--atlas-texte); }
.bandeau-espace--urgent { background: var(--safran-fond); color: var(--safran-texte); }
.bandeau-espace--alerte { background: var(--argile-fond); color: var(--argile-texte); }
.bandeau-espace-texte { flex: 1 1 18rem; }
.bandeau-espace-lien {
  color: inherit; text-decoration: none; padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1.5px solid currentColor; white-space: nowrap;
}
.bandeau-espace-lien:hover, .bandeau-espace-lien:focus-visible { background: color-mix(in srgb, currentColor 12%, transparent); }

.abo-grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.abo-jauges { display: grid; gap: 1rem; }
.abo-jauge-ligne { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.92rem; margin-block-end: 0.35rem; }
.abo-jauge-libelle { font-weight: 600; }
.abo-jauge-valeur { font-variant-numeric: tabular-nums; }
.abo-jauge-piste { height: 0.7rem; border-radius: 999px; background: var(--brume-fond, rgba(127, 127, 127, 0.15)); overflow: hidden; }
.abo-jauge-barre { display: block; height: 100%; border-radius: inherit; inline-size: 0; transition: inline-size 0.4s ease; }
.abo-ton-menthe { background: var(--menthe-plein); }
.abo-ton-safran { background: var(--safran-plein); }
.abo-ton-argile { background: var(--argile-plein); }
.abo-p1 { inline-size: 5%; } .abo-p2 { inline-size: 10%; } .abo-p3 { inline-size: 15%; } .abo-p4 { inline-size: 20%; }
.abo-p5 { inline-size: 25%; } .abo-p6 { inline-size: 30%; } .abo-p7 { inline-size: 35%; } .abo-p8 { inline-size: 40%; }
.abo-p9 { inline-size: 45%; } .abo-p10 { inline-size: 50%; } .abo-p11 { inline-size: 55%; } .abo-p12 { inline-size: 60%; }
.abo-p13 { inline-size: 65%; } .abo-p14 { inline-size: 70%; } .abo-p15 { inline-size: 75%; } .abo-p16 { inline-size: 80%; }
.abo-p17 { inline-size: 85%; } .abo-p18 { inline-size: 90%; } .abo-p19 { inline-size: 95%; } .abo-p20 { inline-size: 100%; }
.abo-fonctions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.abo-fonctions li { display: flex; align-items: center; gap: 0.6rem; }
.abo-non span:last-child { opacity: 0.65; }
.abo-domaine { padding: 0.8rem; border-radius: var(--rayon); background: var(--brume-fond, rgba(127, 127, 127, 0.08)); display: grid; gap: 0.6rem; }
.abo-domaine code { font-size: 0.85em; padding: 0.1em 0.35em; border-radius: 6px; background: var(--surface); word-break: break-all; }
.abo-ajout-domaine { align-items: flex-end; margin-block-start: 0.8rem; }
.abo-formules { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.abo-formule {
  border: 1.5px solid var(--brume-fond, rgba(127, 127, 127, 0.25)); border-radius: var(--rayon); padding: 1rem;
  display: grid; gap: 0.5rem; align-content: start;
}
.abo-formule h3 { margin: 0; font-family: var(--police-titre, inherit); }
.abo-formule-prix { margin: 0; font-size: 1.35rem; font-weight: 800; }
.abo-formule--vedette { border-color: var(--safran-plein); }
.abo-formule--actuelle { border-color: var(--atlas-plein); background: var(--atlas-fond); }
.abo-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.abo-table th, .abo-table td { text-align: start; padding: 0.55rem 0.4rem; border-block-end: 1px solid var(--brume-fond, rgba(127, 127, 127, 0.2)); }

/* Installer l'application sur ce telephone */
.installer { display: grid; gap: 1.2rem; }
.installer-tete { display: grid; gap: 1.2rem; grid-template-columns: 1fr auto; align-items: start; }
@media (max-width: 640px) { .installer-tete { grid-template-columns: 1fr; } .installer-qr { display: none; } }
.installer-tete-texte p { margin: 0 0 0.8rem; }
.installer-ok { display: flex; align-items: center; gap: 0.4rem; color: var(--menthe-texte); font-weight: 700; }
.installer-qr { margin: 0; display: grid; gap: 0.4rem; justify-items: center; max-width: 12rem; text-align: center; font-size: 0.8rem; color: var(--texte-discret, inherit); }
.installer-qr img { border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--brume-fond, rgba(127, 127, 127, 0.25)); }
.installer-guides { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.installer-guide { border: 1.5px solid var(--brume-fond, rgba(127, 127, 127, 0.25)); border-radius: var(--rayon); padding: 1rem; }
.installer-guide--ici { border-color: var(--safran-plein); background: var(--safran-fond); order: -1; }
.installer-guide-titre { margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; font-size: 1rem; }
.installer-ici { margin-inline-start: auto; font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 0.1rem 0.55rem; background: var(--safran-plein); color: var(--safran-sur); }
.installer-etapes { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: 0.4rem; }

/* Lecture automatique de la piece (fonction lecture_pieces) */
.carte-lecture-piece { margin-bottom: 1rem; }
.lecture-piece { display: grid; gap: .75rem; }
.lecture-piece-texte { margin: 0; color: var(--texte-discret, inherit); }
.lecture-piece-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.champ-lu input, .champ-lu select { outline: 2px solid var(--menthe-texte); outline-offset: 1px; background: var(--menthe-fond); }

/* Abonnement : virement et parrainage */
.abo-rib { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; overflow-wrap: anywhere; }
.abo-motif { display: block; color: var(--argile-texte, inherit); margin-top: .25rem; }
.abo-code { font-size: 1.25rem; letter-spacing: .08em; }
.abo-lien { overflow-wrap: anywhere; }

/* Bouton « Aide » vers l'equipe de la plateforme */
.aide-flottante {
  position: fixed; inset-inline-end: 1rem; inset-block-end: 1rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 999px;
  background: var(--menthe-plein); color: var(--menthe-sur); font-weight: 700; text-decoration: none;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .45);
}
.aide-flottante:hover, .aide-flottante:focus-visible { filter: brightness(1.06); }
@media (max-width: 640px) { .aide-flottante { inset-block-end: 4.5rem; padding: .6rem; } .aide-flottante-texte { display: none; } }
@media print { .aide-flottante { display: none; } }
.bandeau-espace--demo { background: var(--menthe-fond); color: var(--menthe-texte); flex-wrap: wrap; }

/* Bien demarrer */
.demarrage-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.demarrage-etape { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem .8rem; border-radius: 10px; background: var(--safran-fond, transparent); }
.demarrage-etape--faite { background: var(--menthe-fond); }
.demarrage-libelle { flex: 1 1 14rem; }
.demarrage-etape--faite .demarrage-libelle { color: var(--menthe-texte); }
.demarrage-lien { font-weight: 700; }
.form-actions--gauche { justify-content: flex-start; flex-wrap: wrap; }
.import-refus summary { cursor: pointer; font-weight: 600; }

/* ================================================================== */
/*  Centre « Paramètres » (/reglages) : themes colores, reglages sur   */
/*  place, sous-parties repliables                                     */
/* ================================================================== */
[data-teinte='agence'] { --teinte: #d9622b; }
[data-teinte='location'] { --teinte: #0f8b8d; }
[data-teinte='flotte'] { --teinte: #2563eb; }
[data-teinte='documents'] { --teinte: #7c3aed; }
[data-teinte='site'] { --teinte: #16a34a; }
[data-teinte='communication'] { --teinte: #db2777; }
[data-teinte='equipe'] { --teinte: #b7791f; }
[data-teinte='marque'] { --teinte: #e11d48; }
[data-teinte='systeme'] { --teinte: #64748b; }
[data-teinte='compte'] { --teinte: #0891b2; }

.page-reglages .reglages-barre { max-width: none; }
.reglages-centre { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.reglages-nav {
  position: sticky; top: calc(var(--entete-hauteur) + 16px); display: grid; gap: 4px; padding: 8px;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-1);
}
.reglages-nav-lien {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--texte-2); text-align: start; cursor: pointer; font: inherit;
}
.reglages-nav-lien:hover { background: color-mix(in srgb, var(--teinte) 9%, var(--surface)); color: var(--texte); }
.reglages-nav-lien:focus-visible { outline: 2px solid var(--teinte); outline-offset: 1px; }
.reglages-nav-lien.est-actif { background: color-mix(in srgb, var(--teinte) 15%, var(--surface)); color: var(--texte); box-shadow: inset 3px 0 0 var(--teinte); }
.reglages-nav-icone {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  background: color-mix(in srgb, var(--teinte) 16%, var(--surface)); color: var(--teinte);
}
.reglages-nav-lien.est-actif .reglages-nav-icone { background: var(--teinte); color: #fff; }
.reglages-nav-texte { display: grid; gap: 1px; min-width: 0; }
.reglages-nav-titre { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.reglages-nav-detail { font-size: 12px; color: var(--texte-3, var(--texte-2)); }

.reglages-panneau { display: grid; gap: 20px; min-width: 0; }
.reglages-panneau-entete {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--rayon);
  background: linear-gradient(120deg, color-mix(in srgb, var(--teinte) 18%, var(--surface)), color-mix(in srgb, var(--teinte) 4%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--teinte) 30%, var(--bordure));
}
.reglages-panneau-icone { flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--teinte); color: #fff; box-shadow: 0 8px 18px -10px var(--teinte); }
.reglages-panneau-titre { margin: 0; font: 750 21px/1.2 var(--police-titre); }
.reglages-panneau-texte { margin: 4px 0 0; color: var(--texte-2); }
.reglages-cartes .carte-parametres { border-top: 3px solid var(--teinte, var(--g-marque)); }
.reglage-tuile[data-teinte] .reglage-tuile-icone { background: color-mix(in srgb, var(--teinte) 16%, var(--surface)); color: var(--teinte); }
.reglage-tuile[data-teinte]:hover, .reglage-tuile[data-teinte]:focus-visible { border-color: var(--teinte); }

/* Resultats de recherche : un reglage precis, et ou il se trouve. */
.reglages-resultats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.reglage-resultat {
  display: grid; gap: 3px; padding: 11px 14px; text-align: start; color: inherit; text-decoration: none; cursor: pointer; font: inherit;
  background: var(--surface); border: 1px solid var(--bordure); border-inline-start: 4px solid var(--teinte); border-radius: 10px;
}
.reglage-resultat:hover, .reglage-resultat:focus-visible { background: color-mix(in srgb, var(--teinte) 8%, var(--surface)); }
.reglage-resultat-libelle { font-weight: 650; line-height: 1.35; }
.reglage-resultat-ou { font-size: 12.5px; color: var(--teinte); font-weight: 650; }

/* Sous-parties repliables des grandes cartes. */
.form-grille-parties { gap: 10px; }
.sous-partie { grid-column: 1 / -1; border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); }
.sous-partie[open] { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.sous-partie-titre {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none;
  font: 700 15px/1.3 var(--police); color: var(--texte);
}
.sous-partie-titre::-webkit-details-marker { display: none; }
.sous-partie-chevron { transition: transform 0.15s ease; color: var(--texte-2); }
.sous-partie[open] > .sous-partie-titre .sous-partie-chevron { transform: rotate(90deg); }
.sous-partie-compte { margin-inline-start: auto; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--texte-2); }
.sous-partie-pastille { width: 9px; height: 9px; border-radius: 50%; background: var(--g-marque); }
.sous-partie > .form-grille { padding: 4px 14px 16px; }

/* Reglage vise par la recherche : mis en evidence un instant. */
.champ-vise { border-radius: 10px; animation: champ-vise 2.6s ease-out; }
@keyframes champ-vise {
  0%, 35% { box-shadow: 0 0 0 3px var(--g-marque); background: color-mix(in srgb, var(--g-marque) 10%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}
@media (prefers-reduced-motion: reduce) { .champ-vise { animation: none; box-shadow: 0 0 0 3px var(--g-marque); } .sous-partie-chevron { transition: none; } }

/* Tablette et telephone : les themes deviennent une bande qui defile. */
@media (max-width: 900px) {
  .reglages-centre { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .reglages-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding: 6px; scroll-snap-type: x proximity; }
  .reglages-nav-lien { flex: none; width: auto; scroll-snap-align: start; padding: 7px 12px 7px 7px; }
  .reglages-nav-lien.est-actif { box-shadow: inset 0 -3px 0 var(--teinte); }
  .reglages-nav-detail { display: none; }
  .reglages-panneau-entete { padding: 14px; }
  .reglages-panneau-icone { width: 42px; height: 42px; }
  .reglages-resultats { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================== */
/*  Refonte (suite) : une seule police dans la gestion, connexion nue  */
/* ================================================================== */
/* L'outil de travail garde la police d'interface, quel que soit l'axe « titres » du site. */
:root, :root[data-titres='serif'], :root[data-titres='systeme'] { --police-titre: var(--police); }
/* Connexion : un panneau a la couleur du menu, l'accroche en bas, sans paysage. */
.acces-paysage { display: none; }
.acces-visuel { align-items: stretch; background: var(--lateral-fond); color: var(--lateral-fort); }
.acces-visuel-texte { max-width: 520px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; width: 100%; }
.acces-visuel .marque-nom { color: var(--lateral-fort); }
.acces-accroche { font: 600 clamp(26px, 1.6vw + 16px, 40px)/1.12 var(--police); letter-spacing: -0.03em; color: var(--lateral-fort); padding-top: 22px; border-top: 1px solid var(--lateral-bord); }
.reglages-panneau-titre { font: 700 20px/1.2 var(--police); letter-spacing: -0.02em; }
.reglages-groupe-titre { font: 650 13px/1.3 var(--police); text-transform: none; letter-spacing: 0; color: var(--texte-3); }
.reglages-barre { box-shadow: none; border-color: var(--bordure); }

/* ================================================================== */
/*  De la vie dans la gestion : indicateurs en couleur, boutons qui    */
/*  repondent au survol, menu et onglets a la couleur de la marque.    */
/* ================================================================== */
/* Chaque indicateur porte la couleur de son picto : filet, pastille, survol. */
.carte-kpi:has(.ton-menthe) { --t-fond: var(--menthe-fond); --t-texte: var(--menthe-texte); --t-plein: var(--menthe-plein); }
.carte-kpi:has(.ton-atlas) { --t-fond: var(--atlas-fond); --t-texte: var(--atlas-texte); --t-plein: var(--atlas-plein); }
.carte-kpi:has(.ton-safran) { --t-fond: var(--safran-fond); --t-texte: var(--safran-texte); --t-plein: var(--safran-plein); }
.carte-kpi:has(.ton-ocre) { --t-fond: var(--ocre-fond); --t-texte: var(--ocre-texte); --t-plein: var(--ocre-plein); }
.carte-kpi:has(.ton-argile) { --t-fond: var(--argile-fond); --t-texte: var(--argile-texte); --t-plein: var(--argile-plein); }
.carte-kpi:has(.ton-brume) { --t-fond: var(--brume-fond); --t-texte: var(--brume-texte); --t-plein: var(--brume-plein); }
.grille-kpi { gap: 12px; background: none; border: 0; border-radius: 0; overflow: visible; }
.carte-kpi {
  overflow: hidden; padding: 16px 18px 15px; border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t-fond, var(--surface-2)) 55%, var(--surface)) 0%, var(--surface) 62%);
  transition: transform 0.2s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}
.carte-kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--t-plein, var(--g-marque)); }
.kpi-lien:hover { transform: translateY(-3px); background: linear-gradient(135deg, var(--t-fond, var(--surface-2)) 0%, var(--surface) 70%); border-color: color-mix(in srgb, var(--t-plein, var(--g-marque)) 55%, var(--bordure)); box-shadow: 0 16px 28px -20px color-mix(in srgb, var(--t-plein, var(--g-marque)) 80%, transparent); }
.kpi-icone { width: 34px; height: 34px; border-radius: 10px; background: var(--t-fond); color: var(--t-texte); opacity: 1; transition: transform 0.3s cubic-bezier(.2, .8, .2, 1.5), background-color 0.2s ease, color 0.2s ease; }
.kpi-icone .icone { width: 18px; height: 18px; }
.kpi-lien:hover .kpi-icone { transform: scale(1.1) rotate(-6deg); background: var(--t-plein); color: var(--t-sur, #fff); }
.kpi-libelle { color: var(--texte-2); font-weight: 600; }
.kpi-valeur { color: var(--texte); }

/* Boutons : le survol prend la couleur de la marque, le principal s'eclaire. */
.btn { transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.22s ease, transform 0.12s ease, color 0.18s ease; }
.btn:hover { --btn-fond: color-mix(in srgb, var(--g-marque) 13%, var(--surface)); --btn-bord: color-mix(in srgb, var(--g-marque) 55%, var(--bordure)); transform: translateY(-1px); box-shadow: 0 8px 16px -12px color-mix(in srgb, var(--g-marque) 90%, transparent); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primaire { background-image: linear-gradient(135deg, color-mix(in srgb, var(--g-marque) 84%, #fff) 0%, var(--g-marque) 60%); overflow: hidden; }
.btn-primaire::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%); transform: translateX(-120%); transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.btn-primaire:hover::after { transform: translateX(120%); }
.btn-primaire:hover { --btn-fond: var(--g-marque); --btn-bord: transparent; box-shadow: 0 12px 22px -12px var(--g-marque); }
.btn-danger:hover { --btn-fond: color-mix(in srgb, var(--argile-plein) 88%, #000); --btn-bord: transparent; box-shadow: 0 10px 20px -12px var(--argile-plein); }
.btn-fantome:hover { --btn-fond: color-mix(in srgb, var(--g-marque) 12%, transparent); --btn-bord: transparent; --btn-texte: var(--texte); box-shadow: none; }
.btn-lien:hover { transform: none; box-shadow: none; --btn-fond: transparent; --btn-bord: transparent; }
.btn[disabled]:hover, .btn.est-occupe:hover { transform: none; box-shadow: none; }

/* Menu : la page active reprend la couleur de la marque, le survol glisse. */
.nav-lien { transition: background 0.15s ease, color 0.15s ease, padding 0.2s ease; }
.nav-lien:hover { padding-inline-start: 14px; }
.nav-lien[aria-current='page']::before { display: block; inset-inline-start: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--g-marque); }
.nav-lien[aria-current='page'] .icone { color: var(--g-marque); }
.coque.est-replie .nav-lien:hover { padding-inline-start: 0; }

/* Cartes, onglets, tableaux, compteurs : une touche de couleur. */
.carte-icone { width: 30px; height: 30px; border-radius: 9px; background: var(--safran-fond); color: var(--safran-texte); }
.carte-icone .icone { width: 16px; height: 16px; }
.carte { transition: border-color 0.2s ease, box-shadow 0.25s ease; }
.onglet { border-radius: 8px 8px 0 0; transition: background-color 0.15s ease, color 0.15s ease; }
.onglet:hover { background: color-mix(in srgb, var(--g-marque) 10%, transparent); color: var(--texte); }
.onglet[aria-selected='true']::after { background: var(--g-marque); }
.ligne-cliquable:hover > td { background: color-mix(in srgb, var(--g-marque) 7%, var(--surface)); }
.ligne-cliquable:hover > td:first-child { box-shadow: inset 3px 0 0 var(--g-marque); }
.page-compteur { background: var(--safran-fond); color: var(--safran-texte); }
.page-titre { position: relative; }
.entete-recherche-saisie:focus { border-color: var(--g-marque); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-marque) 22%, transparent); }
.menu-element:hover, .menu-element:focus { background: color-mix(in srgb, var(--g-marque) 12%, var(--surface)); }
.reglage-tuile { transition: transform 0.2s cubic-bezier(.2, .8, .2, 1), border-color 0.2s ease, box-shadow 0.25s ease; }
.reglage-tuile:hover { transform: translateY(-2px); box-shadow: 0 14px 24px -18px color-mix(in srgb, var(--teinte, var(--g-marque)) 80%, transparent); }
.acces-visuel { background: radial-gradient(40rem 30rem at 0% 100%, color-mix(in srgb, var(--g-marque) 34%, transparent), transparent 65%), var(--lateral-fond); }
@media (prefers-reduced-motion: reduce) {
  .btn, .carte-kpi, .kpi-icone, .nav-lien, .reglage-tuile, .btn-primaire::after { transition: none; }
  .btn:hover, .kpi-lien:hover, .reglage-tuile:hover { transform: none; }
}

/* Audit G5 : textes propres a chaque ville (Parametres > Site). */
.villes-textes { display: grid; gap: 10px; margin-top: 8px; }
.villes-textes__ville { border: 1px solid var(--bordure); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.villes-textes__ville > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 36px; }
.villes-textes__ville[open] > summary { margin-bottom: 10px; }
.villes-textes__ville .champ { display: grid; gap: 6px; margin-bottom: 12px; }
.villes-textes__faq { margin-bottom: 12px; }

/* Audit V7 : etats des lieux seuls. */
.edl-dommages-editeur { display: grid; gap: 8px; }
.edl-dommage-ligne { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; }
@media (max-width: 860px) { .edl-dommage-ligne { grid-template-columns: minmax(0, 1fr) auto; } }
