/* =====================================================================
   STE LAHLAL SAMU PLUS — feuille de style de l'application

   Parti pris visuel : une salle de regulation. L'interface est dense,
   calme, lisible de loin, et reserve la couleur a ce qui porte une
   information — un statut, une alerte, un ecart de montant. Le rouge
   d'urgence identifie la societe ; le cyan signale le sanitaire ;
   l'ambre, l'attente d'une piece.

   Aucune ressource externe n'est chargee : la politique de securite du
   contenu interdit toute origine tierce.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/*  1. Jetons de couleur                                               */
/* ------------------------------------------------------------------ */

:root {
  color-scheme: light;

  /* Encre plus contrastee : le gris moyen d'avant faisait « brouillon »
     avant de faire « sobre ». */
  --encre: #0b1220;
  --encre-douce: #3d4a60;
  /* O-10/O-11 (recette e2550ad) : #6b7890 se lisait a 4,15:1 sur le fond de
     page, 3,96:1 sur surface-3 — onglets inactifs, declencheur de recherche,
     etiquettes de tuile, champs desactives, indications de champ. */
  --encre-faible: #5d6a80;

  /* Le fond quitte le gris bleute pour un blanc casse tres legerement chaud :
     les cartes blanches s'y detachent sans que l'ecran paraisse sale. */
  --fond: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --surface-active: #e4ebf5;

  /* Traits plus discrets : la separation se fait par l'espace et l'ombre,
     pas par un quadrillage. C'est ce qui distingue une interface d'aujourd'hui
     d'un formulaire de 2010. */
  --trait: #e6eaf1;
  --trait-fort: #ccd4e0;
  /* O-12 : le contour d'un bouton se mesurait a 1,39:1 contre la page —
     invisible au sens de WCAG 1.4.11 (3:1). Ce jeton ne sert qu'aux boutons :
     les traits de separation gardent leur discretion. */
  --bouton-contour: #838994;

  --accent: #c8102e;
  --accent-clair: #e4344c;
  --accent-doux: rgba(200, 16, 46, .08);
  --accent-contraste: #ffffff;
  /* O-5 : le survol du bouton principal eclaircissait le fond (#e4344c,
     4,29:1 sous le texte blanc). Il l'assombrit : 6,97:1. */
  --accent-survol: #b30e29;
  /* Le degrade ne sert qu'aux surfaces qui portent l'identite : marque,
     bouton principal, en-tete public. Ailleurs, il ferait decoratif. */
  /* O-5 : le second arret (#e4344c) passait sous 4,5:1 avec le texte blanc ;
     #d61f3c tient a 5,1:1. */
  --accent-degrade: linear-gradient(135deg, #c8102e 0%, #d61f3c 100%);

  --info: #1668b8;      --info-doux: rgba(22, 104, 184, .10);
  /* O-10 : la pastille « succes » se lisait a 4,44:1 sur la surface, 4,16:1
     sur le fond de page ; #086f4b tient a 4,9:1 et plus. */
  --succes: #086f4b;    --succes-doux: rgba(8, 111, 75, .11);
  /* O-4 : le texte du bouton « succes » etait #fff en dur ; en theme sombre
     le vert clair le rendait a 2,23:1. Le texte suit le theme. */
  --succes-contraste: #ffffff;
  /* O-10 : 4,42:1 puis 4,14:1 sur le fond de page ; #945000 tient a 4,9:1. */
  --attente: #945000;   --attente-doux: rgba(148, 80, 0, .11);
  --danger: #b4162c;    --danger-doux: rgba(180, 22, 44, .10);
  --sanitaire: #0b7285; --sanitaire-doux: rgba(11, 114, 133, .10);
  --neutre: #5b6675;    --neutre-doux: rgba(91, 102, 117, .10);

  /* Les surfaces volontairement sombres — ecran de chargement, volet de
     connexion, banniere et pied de la page publique. Elles empruntaient le
     fond du menu, ce qui allait tant qu'il etait sombre. */
  --sombre: #0d1520;
  --sombre-trait: rgba(255, 255, 255, .12);

  /* Le menu reste sombre : il ancre l'ecran, et la zone de travail claire s'y
     detache. Ce que la refonte lui apporte n'est pas une couleur, c'est du
     mouvement — l'entree courante se marque au lieu de simplement changer de
     teinte. */
  --rail-fond: #0d1520;
  --rail-encre: #c3cddc;
  --rail-encre-vive: #ffffff;
  --rail-actif: rgba(255, 255, 255, .09);
  --rail-trait: rgba(255, 255, 255, .08);

  /* Ombres a deux couches, tres diffuses : c'est ce qui donne la profondeur
     sans le liseré dur des ombres d'un seul niveau. */
  --ombre-1: 0 1px 2px rgba(11, 18, 32, .04), 0 2px 6px rgba(11, 18, 32, .05);
  --ombre-2: 0 2px 6px rgba(11, 18, 32, .05), 0 10px 24px rgba(11, 18, 32, .07);
  --ombre-3: 0 8px 20px rgba(11, 18, 32, .10), 0 28px 64px rgba(11, 18, 32, .16);

  /* Une carte se pose par un trait tres clair double d'une ombre a peine
     perceptible. L'ombre seule fait flotter ; le trait seul fait plat. */
  --carte-trait: #e9edf4;
  --carte-ombre: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);

  /* Rondeur nettement augmentee : le rayon de cinq pixels etait la marque la
     plus datee de l'interface. */
  --rayon-s: 8px;
  --rayon: 14px;
  --rayon-l: 20px;
  --rayon-pilule: 999px;

  --largeur-rail: 244px;
  --hauteur-barre: 58px;

  /* « system-ui » d'abord : sur un poste recent, cela donne Segoe UI Variable
     plutot que Segoe UI, dont le dessin date de 2006. */
  --police: system-ui, "Segoe UI Variable Text", "Segoe UI", -apple-system,
            BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-chiffres: ui-monospace, "SF Mono", "Cascadia Mono", Consolas,
                     "Roboto Mono", monospace;

  --transition: 160ms cubic-bezier(.32, .72, 0, 1);
}

/* Theme sombre : applique explicitement, ou suivant le systeme lorsque
   l'utilisateur n'a pas choisi. */
:root[data-theme="dark"],
:root[data-theme="auto"] {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] { color-scheme: light; }
}

:root[data-theme="dark"],
:root[data-theme="auto"]:not([data-resolu="clair"]) {
  --encre: #eaf0f8;
  --encre-douce: #a6b3c7;
  --encre-faible: #8b98ac; /* O-10/O-11 : 3,98:1 sur surface-3 -> 4,83:1 */

  /* Le sombre gagne une pointe de bleu : un gris pur vire au violet sur les
     dalles OLED, et parait sale sur les autres. */
  --fond: #0b1219;
  --surface: #141d29;
  --surface-2: #1a2432;
  --surface-3: #202c3d;
  --surface-active: #27354a;

  --trait: #22303f;
  --trait-fort: #32415a;
  --bouton-contour: #62708a; /* O-12 : 1,83:1 contre la page -> 3,77:1 */

  /* O-10 : #f05068 sur son fond doux (pastille « accent », bouton marque,
     suggestion survolee) donnait 4,14:1 ; #f3687d tient a 4,7:1. */
  --accent: #f3687d;
  --accent-clair: #ff7186;
  --accent-doux: rgba(243, 104, 125, .15);
  --accent-survol: #b30e29;
  /* O-5 : le degrade sombre finissait a #f05068, 3,47:1 sous le texte blanc,
     et son survol (#ff7186) tombait a 2,64:1. Le bouton principal porte la
     meme marque que le theme clair : le rouge de l'identite, et un texte
     blanc qui se lit (5,1:1 et plus). */
  --accent-degrade: linear-gradient(135deg, #c8102e 0%, #d61f3c 100%);

  --info: #59a5f0;      --info-doux: rgba(89, 165, 240, .13);
  --succes: #34c48a;    --succes-doux: rgba(52, 196, 138, .13);
  --succes-contraste: #0b1219; /* O-4 : encre sombre sur le vert clair, 8,4:1 */
  --attente: #e0a33c;   --attente-doux: rgba(224, 163, 60, .14);
  --danger: #f4677e;    --danger-doux: rgba(244, 103, 126, .13);
  --sanitaire: #3bbcd4; --sanitaire-doux: rgba(59, 188, 212, .13);
  --neutre: #93a0b3;    --neutre-doux: rgba(147, 160, 179, .12);

  --sombre: #070d14;
  --sombre-trait: rgba(255, 255, 255, .10);

  --rail-fond: #070d14;
  --rail-encre: #8e9db3;
  --rail-trait: rgba(255, 255, 255, .06);
  --carte-trait: rgba(255, 255, 255, .07);
  --carte-ombre: 0 1px 2px rgba(0, 0, 0, .30), 0 4px 16px rgba(0, 0, 0, .28);

  --ombre-1: 0 1px 2px rgba(0, 0, 0, .30), 0 2px 6px rgba(0, 0, 0, .24);
  --ombre-2: 0 2px 6px rgba(0, 0, 0, .30), 0 10px 26px rgba(0, 0, 0, .38);
  --ombre-3: 0 8px 22px rgba(0, 0, 0, .42), 0 30px 70px rgba(0, 0, 0, .58);
}

/* ------------------------------------------------------------------ */
/*  2. Base                                                            */
/* ------------------------------------------------------------------ */

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

html, body { height: 100%; }

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

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }
p { margin: 0 0 10px; }

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

button, input, select, textarea { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.lien-evitement {
  position: absolute; top: -60px; left: 10px; z-index: 100;
  background: var(--accent); color: #fff; padding: 9px 15px;
  border-radius: var(--rayon-s); transition: top var(--transition);
}
.lien-evitement:focus { top: 10px; }

.chiffres { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ------------------------------------------------------------------ */
/*  3. Ecran de demarrage                                              */
/* ------------------------------------------------------------------ */

.ecran-demarrage {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--sombre); color: var(--accent-clair);
}
.ecran-demarrage[hidden] { display: none; }
.demarrage-marque { text-align: center; }
.demarrage-pouls svg { overflow: visible; }
.demarrage-pouls polyline {
  stroke-dasharray: 240; stroke-dashoffset: 240;
  animation: trace 1.6s cubic-bezier(.6,.05,.3,1) infinite;
}
@keyframes trace {
  0%   { stroke-dashoffset: 240; opacity: .25; }
  45%  { stroke-dashoffset: 0;   opacity: 1; }
  75%  { stroke-dashoffset: 0;   opacity: 1; }
  100% { stroke-dashoffset: -240; opacity: .25; }
}
.demarrage-texte {
  margin-top: 14px; color: var(--rail-encre);
  font-size: 12.5px; letter-spacing: .4px;
}

/* ------------------------------------------------------------------ */
/*  4. Ossature                                                        */
/* ------------------------------------------------------------------ */

.application { display: flex; min-height: 100vh; }
.application[hidden] { display: none; }

.rail {
  width: var(--largeur-rail);
  flex-shrink: 0;
  background: var(--rail-fond);
  color: var(--rail-encre);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  /* « 100dvh » suit la barre d'adresse des navigateurs mobiles, qui se
     retracte au defilement. Avec « 100vh », le bas du menu — theme, langue,
     compte et deconnexion — passait sous cette barre et devenait invisible :
     les reglages semblaient avoir disparu sur telephone. */
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--rail-trait);
  z-index: 30;
}

.rail-marque {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 18px 14px 15px; border-bottom: 1px solid var(--rail-trait);
}

/* La variante compacte est dessinee pour un fond sombre : aucun filtre ne
   vient ecraser le rouge de l'ecusson. */
.marque-logo { width: 100%; max-width: 184px; height: auto; display: block; }

/* Le slogan est du vrai texte : il reste net a toute taille, et se traduit. */
.marque-slogan {
  font-size: 10px; font-style: italic; letter-spacing: .2px;
  color: var(--rail-encre); opacity: .85; text-align: center; line-height: 1.35;
}
.marque-sigle {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 8px; font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.marque-texte { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.marque-texte strong { color: var(--rail-encre-vive); font-size: 13.5px; letter-spacing: .4px; }
.marque-texte span { font-size: 10.5px; color: var(--rail-encre); opacity: .75; letter-spacing: .8px; text-transform: uppercase; }

/* Le menu defile lorsque les entrees depassent, jamais autrement.
   « min-height: 0 » est indispensable : sans lui, un enfant flexible refuse de
   retrecir sous la taille de son contenu, et la barre de defilement apparait
   alors qu'il resterait de la place. La glissiere elle-meme reste invisible
   tant que la souris n'entre pas dans le menu : une barre permanente dans une
   colonne sombre attire l'oeil pour rien. */
.rail-nav {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px;
}
.rail-nav:hover { scrollbar-color: var(--rail-trait) transparent; }
.rail-nav::-webkit-scrollbar { width: 8px; }
.rail-nav::-webkit-scrollbar-track { background: transparent; }
.rail-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.rail-nav:hover::-webkit-scrollbar-thumb { background: var(--rail-trait); }
.nav-groupe { margin-bottom: 18px; }
.nav-titre {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--rail-encre); opacity: .62; padding: 0 12px 7px; font-weight: 700;
}
/* Une pilule remplace le filet colle au bord. Elle marque l'entree courante
   sans decouper la colonne, et l'icone prend la couleur d'accent au lieu de
   rester grise a cote d'un libelle qui, lui, change. */
.nav-lien {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0; border-radius: 10px;
  color: var(--rail-encre); font-size: 13.5px; position: relative;
  transition: background var(--transition), color var(--transition);
}
.nav-lien svg {
  flex-shrink: 0; opacity: .7;
  transition: opacity var(--transition), transform var(--transition);
}
.nav-lien:hover {
  background: var(--rail-actif); color: var(--rail-encre-vive); text-decoration: none;
}
.nav-lien:hover svg { opacity: 1; transform: translateX(1px); }

/* L'entree courante ne se contente plus de changer de teinte : elle se pose.
   Le fond apparait en glissant, le repere rouge se deplie, et l'icone avance
   d'un cheveu. Trois cents millisecondes suffisent — au-dela, le mouvement
   se remarque au lieu d'accompagner. */
.nav-lien.actif {
  background: var(--rail-actif); color: var(--rail-encre-vive); font-weight: 650;
  animation: nav-pose .34s cubic-bezier(.22, .8, .24, 1);
}
.nav-lien.actif svg { opacity: 1; color: var(--accent-clair); }
.nav-lien.actif::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; background: var(--accent-clair); border-radius: 0 3px 3px 0;
  animation: nav-repere .34s cubic-bezier(.22, .8, .24, 1);
}

@keyframes nav-pose {
  from { background: transparent; transform: translateX(-4px); }
  to   { background: var(--rail-actif); transform: none; }
}
@keyframes nav-repere {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* Un mouvement qu'on n'a pas demande peut gener : le systeme le dit, on
   l'ecoute. */
@media (prefers-reduced-motion: reduce) {
  .nav-lien.actif, .nav-lien.actif::before { animation: none; }
  .nav-lien:hover svg { transform: none; }
}
.nav-pastille {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
}
.nav-pastille.calme { background: rgba(255, 255, 255, .14); color: var(--rail-encre-vive); }
/* Une pastille qui porte un signe dit de quoi elle compte : une enveloppe
   pour des demandes venues du dehors, que le seul chiffre ne distinguait pas
   d'un brouillon en retard. */
.nav-pastille.signee { gap: 3px; padding: 0 6px 0 4px; grid-auto-flow: column; }
.nav-pastille.signee svg { width: 11px; height: 11px; }

/* Le pied ne se comprime jamais : c'est la navigation qui defile au-dessus. */
.rail-pied {
  flex-shrink: 0; border-top: 1px solid var(--rail-trait);
  padding: 9px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
}
.bouton-rail {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; background: transparent; color: var(--rail-encre);
  border-radius: var(--rayon-s); cursor: pointer; font-size: 13px; text-align: left;
  transition: background var(--transition);
}
.bouton-rail:hover { background: var(--rail-actif); color: var(--rail-encre-vive); }

.carte-utilisateur {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-top: 4px;
  border-radius: 10px; background: rgba(255, 255, 255, .05); cursor: pointer;
  transition: background var(--transition);
}
.carte-utilisateur:hover { background: var(--rail-actif); }
.avatar {
  width: 31px; height: 31px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  /* Le monogramme portait l'accent et sa nuance claire sous un texte blanc :
     2,96:1 en theme sombre, 4,29:1 en clair. Il prend le degrade de la
     marque, qui tient 5,1:1 dans les deux themes (classe 15). */
  background: var(--accent-degrade); color: #fff;
}
.carte-utilisateur .infos { min-width: 0; flex: 1; line-height: 1.25; }

/* Deconnexion : accessible d'un seul clic depuis n'importe quel ecran. */
.bouton-sortie {
  flex-shrink: 0; display: grid; place-items: center;
  width: 27px; height: 27px; padding: 0;
  border: 1px solid transparent; border-radius: var(--rayon-s);
  background: transparent; color: var(--rail-encre); cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.bouton-sortie:hover, .bouton-sortie:focus-visible {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18);
  color: var(--rail-encre-vive);
}
.carte-utilisateur .nom {
  color: var(--rail-encre-vive); font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.carte-utilisateur .role { font-size: 10.5px; opacity: .7; }

/* --- Zone principale --- */
.zone { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.barre {
  height: var(--hauteur-barre); flex-shrink: 0;
  display: flex; align-items: center; gap: 13px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--trait);
  position: sticky; top: 0; z-index: 20;
}
.bouton-menu {
  display: none; border: 0; background: transparent; padding: 7px;
  border-radius: var(--rayon-s); cursor: pointer;
}
.fil { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.fil .separateur { color: var(--encre-faible); }
.fil .courant { font-weight: 600; }
.fil a { color: var(--encre-douce); }

.recherche-declencheur {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--trait); background: var(--surface-2);
  border-radius: var(--rayon-s); color: var(--encre-faible); cursor: pointer;
  font-size: 12.5px; transition: border-color var(--transition), background var(--transition);
}
.recherche-declencheur:hover { border-color: var(--trait-fort); background: var(--surface-3); }
kbd {
  font-family: var(--police); font-size: 10px; padding: 1px 5px;
  border: 1px solid var(--trait-fort); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface); color: var(--encre-faible);
}

.barre-actions { display: flex; align-items: center; gap: 8px; }

/* Classe 28 : le filtre d'exercices de l'en-tete, a cote de la recherche. */
.choix-exercices { position: relative; }
.exercices-declencheur {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border: 1px solid var(--trait); background: var(--surface-2);
  border-radius: var(--rayon-s); color: var(--encre-douce); cursor: pointer;
  font-size: 12.5px; white-space: nowrap;
  transition: border-color var(--transition), background var(--transition);
}
.exercices-declencheur:hover { border-color: var(--trait-fort); background: var(--surface-3); }
.exercices-panneau {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  min-width: 210px; padding: 8px 10px; display: grid; gap: 4px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre-2);
}
@media (max-width: 720px) { .exercices-declencheur .libelle { display: none; } }

/* Classe 30 : les notifications du tableau de bord. */
.notifications { list-style: none; margin: 0; padding: 0; }
.notification {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-top: 1px solid var(--carte-trait);
}
.notification .signe {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex: none;
}
.notification.info .signe { color: var(--info); background: var(--info-doux); }
.notification.attente .signe { color: var(--attente); background: var(--attente-doux); }
.notification.danger .signe { color: var(--danger); background: var(--danger-doux); }
.notification .texte { flex: 1; min-width: 0; }
.notification .titre { font-weight: 600; }

.contenu { flex: 1; padding: 22px; max-width: 1680px; width: 100%; }
.contenu:focus { outline: none; }

/* ------------------------------------------------------------------ */
/*  5. En-tete de page et cartes                                       */
/* ------------------------------------------------------------------ */

.page-entete {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-entete .accroche { color: var(--encre-douce); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.carte {
  background: var(--surface); border: 1px solid var(--carte-trait);
  border-radius: var(--rayon-l); box-shadow: var(--carte-ombre);
  transition: box-shadow var(--transition);
}
.carte + .carte { margin-top: 18px; }
/* L'en-tete ne porte plus de trait : l'espace suffit a le detacher, et un
   quadrillage de moins allege chaque ecran. */
.carte-entete {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px 4px; flex-wrap: wrap;
}
.carte-entete h2 { font-size: 15.5px; letter-spacing: -.015em; }
.carte-entete .sous { color: var(--encre-faible); font-size: 12.5px; margin-top: 3px; line-height: 1.5; }
.carte-corps { padding: 18px 22px 22px; }
.carte-corps.serre { padding: 0; }
/* Un tableau colle a l'en-tete a besoin, lui, de son trait. */
.carte-corps.serre > .table-enveloppe { border-top: 1px solid var(--carte-trait); }

.grille { display: grid; gap: 16px; }
.grille.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grille.c3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grille.c4 { grid-template-columns: repeat(auto-fit, minmax(198px, 1fr)); }

/* --- Tuiles d'indicateurs --- */
/* La tuile portait un filet vertical colle a son bord gauche. Il disait la
   couleur, mais mordait sur le texte et donnait a la rangee un air de tableau
   de bord d'imprimante. La teinte passe dans une pastille posee en tete, ou
   elle se lit mieux et laisse la carte respirer. */
/* La tuile n'est pas une carte blanche de plus : sa teinte se lit d'abord au
   fond et au trait, avant meme le chiffre. Un encours a jour se voit vert sans
   qu'on ait rien a lire ; le meme encours en retard se voit rouge. La nuance
   est tres faible — six pour cent — parce qu'un aplat franc rendrait la rangee
   criarde et le chiffre moins lisible. */
.tuile {
  background: color-mix(in srgb, var(--teinte, var(--neutre)) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teinte, var(--neutre)) 28%, var(--carte-trait));
  border-radius: var(--rayon-l); padding: 18px 20px; position: relative;
  box-shadow: var(--carte-ombre);
  transition: transform var(--transition), box-shadow var(--transition);
}
.tuile:hover { transform: translateY(-2px); box-shadow: var(--ombre-2); }
@media (prefers-reduced-motion: reduce) { .tuile:hover { transform: none; } }
.tuile .marqueur {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); color: var(--teinte, var(--neutre));
  border: 1px solid color-mix(in srgb, var(--teinte, var(--neutre)) 22%, transparent);
  margin-bottom: 12px;
}
/* Tuile servant de bouton d'onglet : celle qui est active se detache. */
.tuile.active {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.tuile[style*="cursor: pointer"]:hover { filter: brightness(1.03); }

.tuile .etiquette {
  font-size: 11px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--encre-faible); font-weight: 650;
}
.tuile .valeur {
  font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--encre);
}
/* La variation par rapport a la periode precedente : un chiffre seul ne dit
   pas s'il est bon. */
.tuile .variation {
  display: inline-flex; align-items: center; gap: 3px; margin-top: 9px;
  padding: 3px 8px; border-radius: var(--rayon-pilule);
  font-size: 11.5px; font-weight: 650;
  background: var(--succes-doux); color: var(--succes);
}
.tuile .variation.baisse { background: var(--danger-doux); color: var(--danger); }
.tuile .variation.neutre { background: var(--surface-3); color: var(--encre-faible); }
.tuile .valeur .unite { font-size: 14px; font-weight: 600; color: var(--encre-douce); margin-left: 3px; }
.tuile .detail { font-size: 12px; color: var(--encre-douce); margin-top: 5px; }
.tuile.accent { --teinte: var(--accent); --teinte-doux: var(--accent-doux); }
.tuile.succes { --teinte: var(--succes); --teinte-doux: var(--succes-doux); }
.tuile.info   { --teinte: var(--info);   --teinte-doux: var(--info-doux); }
.tuile.attente{ --teinte: var(--attente);--teinte-doux: var(--attente-doux); }
.tuile.danger { --teinte: var(--danger); --teinte-doux: var(--danger-doux); }

/* ------------------------------------------------------------------ */
/*  6. Tableaux                                                        */
/* ------------------------------------------------------------------ */

.table-enveloppe { overflow-x: auto; }

table.donnees { width: 100%; border-collapse: collapse; font-size: 13px; }
table.donnees thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); text-align: left; font-weight: 650; font-size: 11px;
  text-transform: uppercase; letter-spacing: .6px; color: var(--encre-faible);
  padding: 12px 18px; border-bottom: 1px solid var(--carte-trait); white-space: nowrap;
}
table.donnees thead th.num { text-align: right; }
table.donnees thead th.triable { cursor: pointer; user-select: none; }
table.donnees thead th.triable:hover { color: var(--encre); }
table.donnees thead th .fleche { opacity: .45; margin-left: 3px; }

table.donnees tbody td {
  padding: 14px 18px; border-bottom: 1px solid var(--carte-trait); vertical-align: middle;
  overflow-wrap: anywhere; /* O-8 : un mot sans espace ne pousse pas la colonne */
}
/* La derniere ligne n'a pas besoin d'un trait : la carte s'arrete la. */
table.donnees tbody tr:last-child td { border-bottom: 0; }
table.donnees tbody td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.donnees tbody tr { transition: background var(--transition); }
table.donnees tbody tr:hover { background: var(--surface-2); }
table.donnees tbody tr.cliquable { cursor: pointer; }
table.donnees tbody tr.selectionnee { background: var(--accent-doux); }
table.donnees .principal { font-weight: 600; }
table.donnees .secondaire { color: var(--encre-faible); font-size: 12px; }
/* O-8 : un nom de client de 10 003 caracteres faisait une ligne de 5 624 px,
   et une seule fiche chassait les dix-neuf autres hors de l'ecran. Le texte
   libre d'une cellule se coupe a trois lignes ; la fiche le donne en entier. */
table.donnees tbody td div.principal,
table.donnees tbody td div.secondaire {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
}
table.donnees tfoot td {
  padding: 10px 12px; font-weight: 650; background: var(--surface-2);
  border-top: 2px solid var(--trait-fort);
}

.vide {
  padding: 46px 22px; text-align: center; color: var(--encre-faible);
}
.vide .titre { font-weight: 650; color: var(--encre-douce); margin-bottom: 5px; font-size: 14px; }

/* ------------------------------------------------------------------ */
/*  7. Pastilles et marqueurs                                          */
/* ------------------------------------------------------------------ */

.pastille {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--rayon-pilule);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
  background: var(--neutre-doux); color: var(--neutre);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
}
.pastille::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.pastille.sans-point::before { display: none; }
.pastille.succes   { background: var(--succes-doux);    color: var(--succes); }
.pastille.info     { background: var(--info-doux);      color: var(--info); }
.pastille.attente  { background: var(--attente-doux);   color: var(--attente); }
.pastille.danger   { background: var(--danger-doux);    color: var(--danger); }
.pastille.sanitaire{ background: var(--sanitaire-doux); color: var(--sanitaire); }
.pastille.accent   { background: var(--accent-doux);    color: var(--accent); }

/* Marqueur discret d'une ligne ajustee (RG-17.4) */
.marqueur-ajuste {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--attente); font-size: 11px; font-weight: 700;
  cursor: help; border-bottom: 1px dotted currentColor;
}
.marqueur-ajuste .glyphe { font-size: 12px; }

tr.ligne-ajustee td:first-child { box-shadow: inset 3px 0 0 var(--attente); }

/* Ce qui va disparaitre se repere sans avoir a lire la colonne « Sort ». */
tr.ligne-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ------------------------------------------------------------------ */
/*  8. Boutons                                                         */
/* ------------------------------------------------------------------ */

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--rayon-s); border: 1px solid var(--bouton-contour);
  background: var(--surface); color: var(--encre);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  box-shadow: var(--ombre-1);
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
}
.bouton:hover:not(:disabled) {
  background: var(--surface-2); border-color: var(--bouton-contour);
  box-shadow: var(--ombre-2); transform: translateY(-1px);
}
.bouton:active:not(:disabled) { transform: translateY(0); box-shadow: var(--ombre-1); }
/* O-17 : a .45, « Analyse poussée avec l'IA » eteint se lisait a 3,1:1 — et
   c'est le libelle qui explique pourquoi le bouton est eteint. A .6, le bouton
   ordinaire tient a 5:1 dans les deux themes et reste visiblement inactif. */
.bouton:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

.bouton.principal {
  background: var(--accent-degrade); border-color: transparent;
  color: var(--accent-contraste); box-shadow: 0 2px 8px var(--accent-doux), var(--ombre-1);
}
.bouton.principal:hover:not(:disabled) { background: var(--accent-survol); border-color: var(--accent-survol); }

.bouton.sourdine { border-color: transparent; background: transparent; color: var(--encre-douce); }
.bouton.sourdine:hover:not(:disabled) { background: var(--surface-3); color: var(--encre); }

.bouton.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.bouton.danger:hover:not(:disabled) { background: var(--danger-doux); }

/* Une action qui acheve sans rien detruire : marquer une demande traitee.
   Elle ne peut porter ni la couleur du danger, ni celle de l'accent, qui
   annonce la creation. */
.bouton.succes {
  background: var(--succes); border-color: var(--succes); color: var(--succes-contraste);
}
/* K-D1 : cette regle ne posait QUE filter. Le fond etait donc repris par
   .bouton:hover:not(:disabled) — plus specifique (0,3,0) que .bouton.succes
   (0,2,0) —, qui le remet a --surface-2, presque blanc, pendant que la
   couleur du texte reste #fff. Contraste mesure : 1,05:1, la ou le seuil AA
   est de 4,5:1. Le bouton devenait illisible des qu on le survolait, soit
   exactement au moment ou on va cliquer dessus.
   Le fond et la couleur sont donc reposes ici : une variante qui pose un
   fond doit le reposer au survol, sinon la regle generique le lui reprend. */
.bouton.succes:hover:not(:disabled) {
  background: var(--succes); border-color: var(--succes); color: var(--succes-contraste);
  filter: brightness(1.08);
}

.bouton.petit { padding: 4px 9px; font-size: 12px; }
.bouton.large { padding: 10px 20px; font-size: 14px; }
.bouton.pleine-largeur { width: 100%; }
/* Bouton marque : volet ouvert, axe retenu, filtre en vigueur. */
.bouton.actif { background: var(--accent-doux); color: var(--accent); border-color: var(--accent); }
/* Meme classe que K-D1, second site : sans cette regle, survoler un bouton
   marque lui faisait perdre son fond — l etat « en vigueur » disparaissait
   sous le curseur, au moment precis ou on cherche a le lire. */
.bouton.actif:hover:not(:disabled) {
  background: var(--accent-doux); color: var(--accent); border-color: var(--accent);
}

.groupe-boutons { display: inline-flex; }

/* Choix cumulables : chaque bouton vit pour lui-meme, et la rangee se replie
   sur plusieurs lignes plutot que de deborder de sa carte. */
.choix-multiples { display: flex; flex-wrap: wrap; gap: 6px; }
.groupe-boutons .bouton { border-radius: 0; margin-left: -1px; }
.groupe-boutons .bouton:first-child { border-radius: var(--rayon-s) 0 0 var(--rayon-s); margin-left: 0; }
.groupe-boutons .bouton:last-child { border-radius: 0 var(--rayon-s) var(--rayon-s) 0; }
.groupe-boutons .bouton.actif { background: var(--accent-doux); color: var(--accent); border-color: var(--accent); z-index: 1; }

/* ------------------------------------------------------------------ */
/*  9. Formulaires                                                     */
/* ------------------------------------------------------------------ */

.champ { margin-bottom: 14px; }
.champ > label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--encre-douce); margin-bottom: 5px;
}
.champ > label .obligatoire { color: var(--accent); margin-left: 2px; }
.champ .aide { font-size: 11.5px; color: var(--encre-faible); margin-top: 4px; }
.champ .erreur { font-size: 12px; color: var(--danger); margin-top: 4px; font-weight: 600; }

.saisie, select.saisie, textarea.saisie {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--trait-fort); border-radius: var(--rayon-s);
  background: var(--surface); color: var(--encre);
  font-family: inherit; font-size: 13.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.saisie:hover:not(:disabled) { border-color: var(--encre-faible); }
.saisie:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-doux);
}
.saisie:disabled, .saisie[readonly] {
  background: var(--surface-3); color: var(--encre-faible); cursor: not-allowed;
}
.saisie.en-erreur { border-color: var(--danger); }
/* O-11 : aucune regle ne colorait l'indication d'un champ ; le navigateur
   posait son gris (#757575), calibre pour un fond blanc — 3,68:1 en theme
   sombre. L'encre faible suit le theme ; l'opacite est reposee parce que
   Firefox en applique une par defaut. */
.saisie::placeholder { color: var(--encre-faible); opacity: 1; }
.saisie.num { text-align: right; font-variant-numeric: tabular-nums; }
textarea.saisie { resize: vertical; min-height: 70px; line-height: 1.5; }
select.saisie { cursor: pointer; }

/* L'attribut « hidden » du navigateur pose « display: none », mais il vient
   de la feuille par defaut : la moindre regle d'auteur qui pose un display le
   supplante. Une rangee de champs en grille restait donc visible apres avoir
   ete masquee — le defaut ne se voyait que sur les elements qui portent un
   display, c'est-a-dire les plus structurants. La regle est retablie ici, une
   fois pour toutes. */
[hidden] { display: none !important; }

.ligne-champs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ligne-champs.deux { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Champ libre assorti d'un <datalist> : il occupe la place d'un champ ordinaire. */
.saisie-suggeree { display: block; }

/* Champ de mot de passe avec bascule d'affichage oeil. */
.conteneur-saisie-oeil {
  position: relative; display: flex; align-items: center; width: 100%;
}
.conteneur-saisie-oeil .saisie {
  width: 100%; padding-inline-end: 38px;
}
.bouton-oeil {
  position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; background: transparent; color: var(--encre-faible);
  border-radius: var(--rayon-s); cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.bouton-oeil:hover, .bouton-oeil:focus-visible {
  color: var(--encre); background: var(--surface-3); outline: none;
}


/* Formules proposees sous une mention imprimee. */
.propositions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.proposition {
  max-width: 100%; padding: 3px 9px; font: inherit; font-size: 11.5px;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px dashed var(--trait-fort); border-radius: 999px;
  background: var(--surface-2); color: var(--encre-douce); cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.proposition:hover, .proposition:focus-visible {
  background: var(--accent-doux); color: var(--accent);
  border-color: var(--accent); border-style: solid;
}

/* Une piece jointe dans la fenetre qui les rassemble. */
.piece-jointe {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0; border-bottom: 1px solid var(--trait);
}
.piece-jointe:last-child { border-bottom: 0; }

/* Barre d'enregistrement : elle reste sous les yeux au bas d'un long
   formulaire, ou le bouton se perdait apres cinquante champs. */
.barre-enregistrement {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 16px; padding: 12px 16px;
  border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface); box-shadow: 0 -6px 18px rgba(20, 30, 45, .08);
}

/* Parametre portant une image : apercu a cote des gestes. */
.champ-image { display: flex; align-items: flex-start; gap: 12px; }
.apercu-image {
  max-width: 190px; max-height: 82px; object-fit: contain;
  border: 1px solid var(--trait); border-radius: var(--rayon-s);
  padding: 6px; background: #fff;
}
.apercu-image.vide {
  display: grid; place-items: center; width: 190px; height: 82px;
  border-style: dashed; background: var(--surface-2);
  color: var(--encre-faible); font-size: 12px;
}

.case { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; padding: 5px 0; }
.case input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.case .texte { font-size: 13px; }
/* Le code technique passe a la ligne : sans display:block, il se collait au
   libelle et l'ecran affichait « Consulter les facturesinvoice.view ». */
.case .texte .sous { display: block; margin-top: 1px; color: var(--encre-faible); font-size: 11.5px; }

fieldset { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--encre-douce); padding: 0 6px; }

/* Barre de filtres */
/* La barre de filtres etait un bandeau gris colle sous l'en-tete, separe par
   un trait : deux lignes horizontales a lire avant d'arriver au contenu. Elle
   devient une rangee posee dans la carte, sans fond ni trait — ce sont les
   champs eux-memes qui la dessinent. */
.filtres {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 22px 18px;
}
/* Ce qui suit la barre de filtres respire : sans cette marge, la premiere
   rangee de tuiles venait se coller aux champs, et l'on ne savait plus ou
   finissait le reglage et ou commencait le resultat. */
.filtres + * { margin-top: 4px; }

/* Meme regle un cran plus haut. Sur l'ecran des rapports, les filtres sont
   seuls dans leur carte, et le resultat est pose apres elle : la marge
   ci-dessus ne pouvait pas l'atteindre, faute de voisin a l'interieur. Une
   carte qui ne porte que des reglages n'est pas un contenu — ce qu'elle
   commande doit s'en detacher. */
.carte:has(> .filtres:only-child) + * { margin-top: 18px; }
.filtres .champ { margin: 0; min-width: 152px; }
.filtres .champ.large { min-width: 244px; flex: 1; }
.filtres .champ > label {
  font-size: 10.5px; margin-bottom: 4px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--encre-faible); font-weight: 650;
}
/* Un champ de filtre est plus discret qu'un champ de saisie : on le parcourt,
   on ne le remplit pas. Discret ne veut pas dire invisible : sans trait, il se
   confondait avec le fond de la barre et l'on ne voyait plus qu'il y avait
   quelque chose a ouvrir. */
.filtres .saisie {
  background: var(--surface); border-color: var(--trait-fort);
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition);
}
.filtres .saisie:hover {
  border-color: var(--encre-faible); background: var(--surface);
}
.filtres .saisie:focus {
  background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-doux);
}

/* ------------------------------------------------------------------ */
/*  10. Editeur de lignes de prestation                                */
/* ------------------------------------------------------------------ */

/*
 * I-1 : au zoom, le texte grandit et la colonne non.
 *
 * Les largeurs sont en pourcentage : a 150 %, la colonne « A/R » retombait a
 * 73 px pour un texte qui en demande 76, et « simple » se lisait « sir ». Or
 * A/R est precisement le facteur qui double le prix ET la distance : mal lu,
 * il fait partir une facture au double ou a la moitie, et le resultat reste
 * arithmetiquement juste — aucun controle ne le rattrape.
 *
 * Le tableau garde donc une largeur minimale, et c'est son conteneur qui
 * defile. Mieux vaut une barre de defilement qu'une valeur tronquee.
 */
.editeur-lignes {
  border: 1px solid var(--trait); border-radius: var(--rayon);
  overflow-x: auto; overflow-y: hidden;
}
.editeur-lignes table { min-width: 880px; }
/*
 * « table-layout: fixed » et « min-width: 0 » vont ensemble, et sans eux les
 * largeurs en pourcentage declarees sur les colonnes ne sont que des voeux.
 *
 * Un <input> porte une largeur intrinseque — vingt caracteres par defaut, que
 * le placeholder allonge encore. En disposition automatique, c'est ELLE qui
 * l'emporte : les colonnes larges (tarif, quantite, montant) reclamaient leur
 * place et ecrasaient les etroites voisines, A/R et TVA, jusqu'a les rendre
 * illisibles. Le defaut se voyait surtout au zoom du navigateur, ou la largeur
 * du texte grandit sans que celle du tableau suive.
 *
 * Raccourcir les placeholders ne faisait que reculer le seuil ; c'est la
 * largeur intrinseque qu'il faut neutraliser.
 */
.editeur-lignes table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.editeur-lignes tbody td .saisie,
.editeur-lignes tbody td select { width: 100%; min-width: 0; }
/* Les colonnes de chiffres n'ont pas besoin de la meme respiration que le
   texte : leur padding lateral les faisait deborder de colonnes deja
   etroites. */
.editeur-lignes tbody td .saisie.num { padding-inline: 7px; }
.editeur-lignes thead th {
  background: var(--surface-2); font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--encre-douce); font-weight: 650;
  padding: 8px 9px; text-align: left; border-bottom: 1px solid var(--trait); white-space: nowrap;
}
.editeur-lignes thead th.num { text-align: right; }
.editeur-lignes tbody td { padding: 5px 6px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.editeur-lignes tbody td .saisie { padding: 5px 8px; font-size: 13px; }
.editeur-lignes tbody tr.alerte { background: var(--attente-doux); }
.editeur-lignes tbody tr.bloquee { background: var(--danger-doux); }
.editeur-lignes tfoot td { padding: 9px; background: var(--surface-2); }

.ligne-note {
  font-size: 11.5px; padding: 3px 9px 7px; display: flex; align-items: center; gap: 6px;
}
.ligne-note.avertissement { color: var(--attente); }
.ligne-note.blocage { color: var(--danger); font-weight: 600; }

.recap-totaux { display: flex; justify-content: flex-end; padding: 14px 16px; }
.recap-totaux table { min-width: 290px; font-size: 13.5px; }
.recap-totaux td { padding: 4px 9px; }
.recap-totaux td.libelle { color: var(--encre-douce); }
.recap-totaux td.valeur { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.recap-totaux tr.ventilation td { font-size: 12px; color: var(--encre-faible); }
.recap-totaux tr.grand td {
  border-top: 2px solid var(--trait-fort); padding-top: 8px;
  font-size: 17px; font-weight: 700; color: var(--accent);
}

/* ------------------------------------------------------------------ */
/*  11. Modales                                                        */
/* ------------------------------------------------------------------ */

.conteneur-modales:empty { display: none; }
.modale-fond {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 13, 20, .58);
  backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px;
  animation: apparition 130ms ease-out;
}
@keyframes apparition { from { opacity: 0; } to { opacity: 1; } }

.modale {
  background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon-l); box-shadow: var(--ombre-3);
  width: 100%; max-width: 560px; max-height: 88vh;
  display: flex; flex-direction: column;
  animation: montee 160ms cubic-bezier(.2,.8,.3,1);
}
@keyframes montee { from { transform: translateY(14px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modale.large { max-width: 880px; }
.modale.tres-large { max-width: 1180px; }

.modale-entete {
  padding: 15px 19px; border-bottom: 1px solid var(--trait);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modale-entete .sous { color: var(--encre-faible); font-size: 12.5px; margin-top: 3px; }
.modale-corps { padding: 19px; overflow-y: auto; flex: 1; }
.modale-pied {
  padding: 13px 19px; border-top: 1px solid var(--trait);
  display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap;
  background: var(--surface-2); border-radius: 0 0 var(--rayon-l) var(--rayon-l);
}
.bouton-fermer {
  border: 0; background: transparent; cursor: pointer; padding: 5px;
  border-radius: var(--rayon-s); color: var(--encre-faible); line-height: 1;
}
.bouton-fermer:hover { background: var(--surface-3); color: var(--encre); }

/* ------------------------------------------------------------------ */
/*  12. Notifications                                                  */
/* ------------------------------------------------------------------ */

.conteneur-notifications {
  position: fixed; bottom: 18px; right: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 9px; max-width: 430px;
}
.notification {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--rayon);
  background: var(--surface); border: 1px solid var(--trait);
  border-left: 3px solid var(--teinte, var(--info));
  box-shadow: var(--ombre-2);
  animation: glisse 190ms cubic-bezier(.2,.8,.3,1);
}
@keyframes glisse { from { transform: translateX(22px); opacity: 0; } to { transform: none; opacity: 1; } }
.notification.succes { --teinte: var(--succes); }
.notification.erreur { --teinte: var(--danger); }
.notification.attention { --teinte: var(--attente); }
.notification .corps { flex: 1; min-width: 0; }
.notification .titre { font-weight: 650; font-size: 13.5px; }
.notification .message { font-size: 12.5px; color: var(--encre-douce); margin-top: 2px; word-wrap: break-word; }
.notification.sortante { animation: retrait 160ms ease-in forwards; }
@keyframes retrait { to { transform: translateX(22px); opacity: 0; } }

/* Encadres d'information contextuelle */
.encadre {
  padding: 11px 14px; border-radius: var(--rayon-s); font-size: 13px;
  border-left: 3px solid var(--teinte, var(--info));
  background: var(--fond-doux, var(--info-doux)); margin-bottom: 14px;
}
.encadre .titre { font-weight: 650; margin-bottom: 3px; }
.encadre ul { margin: 6px 0 0; padding-left: 19px; }
.encadre li { margin-bottom: 3px; }
.encadre.attention { --teinte: var(--attente); --fond-doux: var(--attente-doux); }
.encadre.danger    { --teinte: var(--danger);  --fond-doux: var(--danger-doux); }
.encadre.succes    { --teinte: var(--succes);  --fond-doux: var(--succes-doux); }

/* ------------------------------------------------------------------ */
/*  13. Palette de recherche                                           */
/* ------------------------------------------------------------------ */

.palette { position: fixed; inset: 0; z-index: 70; }
.palette[hidden] { display: none; }
.palette-fond { position: absolute; inset: 0; background: rgba(8,13,20,.55); backdrop-filter: blur(2px); }
.palette-boite {
  position: relative; max-width: 600px; margin: 11vh auto 0;
  background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon-l); box-shadow: var(--ombre-3); overflow: hidden;
  animation: montee 150ms cubic-bezier(.2,.8,.3,1);
}
.palette-champ {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--trait);
}
.palette-champ input {
  flex: 1; border: 0; background: transparent; font-size: 15px; outline: none;
}
.palette-champ .bouton-fermer { flex-shrink: 0; display: flex; align-items: center; }
.palette-resultats { max-height: 54vh; overflow-y: auto; padding: 6px; }
.palette-resultat {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: var(--rayon-s); cursor: pointer;
}
.palette-resultat:hover, .palette-resultat.survol { background: var(--surface-3); }
.palette-resultat .type {
  font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  padding: 2px 7px; border-radius: 4px; background: var(--accent-doux);
  color: var(--accent); font-weight: 700; flex-shrink: 0;
}
.palette-resultat .libelle { flex: 1; min-width: 0; }
.palette-resultat .libelle .principal { font-weight: 600; font-size: 13.5px; }
.palette-resultat .libelle .secondaire { font-size: 12px; color: var(--encre-faible); }
.palette-vide { padding: 30px; text-align: center; color: var(--encre-faible); font-size: 13px; }

/* ------------------------------------------------------------------ */
/*  13 bis. Graphiques                                                 */
/* ------------------------------------------------------------------ */
/*
 *  Barres en HTML et CSS : la politique de securite du contenu interdit
 *  toute bibliotheque externe, et un histogramme n'en demande pas.
 */

.graphe { display: flex; flex-direction: column; gap: 8px; }

/* Axe gradue a gauche, zone des barres a droite. Les deux partagent la meme
   hauteur, ce qui permet de poser graduations et lignes de fond au meme
   pourcentage et de les faire coincider exactement. */
.graphe-cadre { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }

.graphe-axe { position: relative; height: 236px; }
.graphe-graduation {
  position: absolute; right: 0; transform: translateY(50%);
  font-size: 10.5px; color: var(--encre-faible);
  font-family: var(--police-chiffres); white-space: nowrap;
}

.graphe-zone {
  position: relative; height: 236px;
  border-bottom: 1px solid var(--trait);
}
/* Les lignes de fond etaient en pointille : a l'ecran, le pointille scintille
   et attire l'oeil plus que les barres qu'il sert a mesurer. Un trait plein
   tres clair fait le meme travail sans se faire voir. */
.graphe-ligne {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px solid var(--trait);
}
.graphe-ligne:first-child { border-top-color: var(--trait-fort); }

.graphe-colonnes {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; gap: 6px; padding: 0 4px;
}
.graphe-colonne { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }

/* Etiquette de colonne, pour les graphiques a plusieurs series.
   Deux barres de treize pixels ne portent aucun chiffre ; l'etiquette les
   donne tous, en entier, au survol de la colonne. Elle reste dans le document
   en permanence : invisible a l'oeil, elle est lue par un lecteur d'ecran. */
.graphe-bulle {
  /* Posee en haut de la zone tracee, jamais au-dessus : le graphique n'a pas
     de marge exterieure ou deborder sans recouvrir sa legende. */
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 5; min-width: 140px; padding: 9px 11px;
  border: 1px solid var(--carte-trait); border-radius: var(--rayon-s);
  background: var(--surface); box-shadow: var(--ombre-2);
  font-size: 11.5px; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s;
}
.graphe-colonne:hover .graphe-bulle { opacity: 1; visibility: visible; }
/* La colonne survolee recoit un fond tres pale : on sait laquelle on lit,
   meme quand la souris est loin des barres. */
.graphe-colonne::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--surface-3); border-radius: var(--rayon-s);
  opacity: 0; transition: opacity var(--transition); pointer-events: none;
}
.graphe-colonne:hover::after { opacity: .7; }
.graphe-barres { position: relative; z-index: 1; }
/* Aux extremites, l'etiquette se range du cote ou il reste de la place. */
.graphe-colonne:first-child .graphe-bulle { left: 0; transform: none; }
.graphe-colonne:last-child .graphe-bulle { left: auto; right: 0; transform: none; }

.graphe-bulle-titre {
  margin-bottom: 4px; padding-bottom: 4px;
  border-bottom: 1px solid var(--trait);
  font-weight: 650; color: var(--encre);
}
.graphe-bulle-ligne { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.graphe-bulle-ligne .puce {
  width: 8px; height: 8px; flex-shrink: 0; border-radius: 2px; display: inline-block;
}
.graphe-bulle-ligne .nom { flex: 1; color: var(--encre-douce); }
.graphe-bulle-ligne .chiffres {
  font-family: var(--police-chiffres); font-weight: 700; color: var(--encre);
}
.graphe-barres {
  flex: 1; height: 100%;
  display: flex; align-items: flex-end; justify-content: center; gap: 2px;
}
.graphe-barre {
  position: relative;
  flex: 1; min-width: 4px; max-width: 30px;
  border-radius: 6px 6px 2px 2px;
  transition: opacity .12s, filter .12s;
  /* Les barres montent depuis la ligne de base a l'ouverture de l'ecran. Le
     mouvement dure moins d'une demi-seconde et part du bas : il donne a lire
     le sens de la mesure — ce qui croit monte — au lieu de decorer. */
  transform-origin: bottom;
  animation: graphe-monte .52s cubic-bezier(.22, .9, .28, 1) backwards;
}
.graphe-barre:hover { filter: brightness(1.12); }
@keyframes graphe-monte { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Chaque colonne demarre un cheveu apres la precedente : la lecture suit le
   temps, de janvier a decembre. */
.graphe-colonne:nth-child(1) .graphe-barre  { animation-delay: 0ms; }
.graphe-colonne:nth-child(2) .graphe-barre  { animation-delay: 32ms; }
.graphe-colonne:nth-child(3) .graphe-barre  { animation-delay: 64ms; }
.graphe-colonne:nth-child(4) .graphe-barre  { animation-delay: 96ms; }
.graphe-colonne:nth-child(5) .graphe-barre  { animation-delay: 128ms; }
.graphe-colonne:nth-child(6) .graphe-barre  { animation-delay: 160ms; }
.graphe-colonne:nth-child(7) .graphe-barre  { animation-delay: 192ms; }
.graphe-colonne:nth-child(8) .graphe-barre  { animation-delay: 224ms; }
.graphe-colonne:nth-child(9) .graphe-barre  { animation-delay: 256ms; }
.graphe-colonne:nth-child(10) .graphe-barre { animation-delay: 288ms; }
.graphe-colonne:nth-child(11) .graphe-barre { animation-delay: 320ms; }
.graphe-colonne:nth-child(12) .graphe-barre { animation-delay: 352ms; }

@media (prefers-reduced-motion: reduce) {
  .graphe-barre { animation: none; }
}

/* La part se lit au-dessus de la barre, sans la recouvrir. */
.graphe-valeur {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 3px;
  font-size: 9.5px; font-weight: 650; color: var(--encre-douce);
  font-family: var(--police-chiffres); white-space: nowrap;
}

/* Le montant s'ecrit dans la barre, en haut : la part au-dessus dit le poids,
   le montant dedans dit la somme. */
.graphe-montant {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  max-width: 100%; overflow: hidden;
  font-size: 9px; font-weight: 700; color: #fff;
  font-family: var(--police-chiffres); white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.graphe-libelles { display: flex; gap: 6px; padding: 0 4px; margin-left: 60px; }
.graphe-etiquette {
  flex: 1; min-width: 0;
  text-align: center; font-size: 11px; color: var(--encre-faible);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.graphe-pied {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-left: 60px; padding-top: 6px;
  border-top: 1px solid var(--trait);
  font-size: 12px; color: var(--encre-douce);
}
.graphe-pied .chiffres { font-weight: 700; color: var(--encre); }

.graphe-legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; }
.graphe-legende-item { display: inline-flex; align-items: center; gap: 6px; }
.graphe-legende-item .puce { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.graphe-vide { padding: 40px; text-align: center; color: var(--encre-faible); font-size: 13px; }

/* ------------------------------------------------------------------ */
/*  Assistant flottant                                                 */
/* ------------------------------------------------------------------ */

/* Les questions naissent devant une facture, pas sur une page dediee : le
   volet s'ouvre par-dessus l'ecran et garde la conversation d'une page a
   l'autre. */
/* ------------------------------------------------------------------ */
/*  Assistant : un dialogue, non une liste de fiches                   */
/* ------------------------------------------------------------------ */

/* Les echanges se presentaient en encadres identiques, empiles, chacun
   precede de son etiquette. On lisait une liste de fiches, pas une
   conversation : rien ne disait d'un coup d'oeil qui parlait. */

/* Le fil occupe ce qui reste sous l'en-tete, jamais plus : c'est lui qui
   defile, et la barre de saisie ne bouge pas. Une hauteur fixee, et non une
   hauteur minimale : avec « min-height », le fil grandissait avec les
   echanges, poussait la barre hors de l'ecran, et c'etait la page entiere
   qu'il fallait faire defiler pour retrouver ou taper. */
.assistant-page {
  display: flex; flex-direction: column; gap: 14px;
  height: calc(100dvh - var(--hauteur-barre) - 152px);
  min-height: 420px;
}

.fil-echanges {
  flex: 1; min-height: 260px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  padding: 26px 22px;
  background: var(--surface); border: 1px solid var(--carte-trait);
  border-radius: var(--rayon-l); box-shadow: var(--carte-ombre);
  scroll-behavior: smooth;
}

.echange { display: flex; gap: 11px; align-items: flex-start; max-width: 86%; }
.echange.question { align-self: flex-end; flex-direction: row-reverse; }
.echange.reponse { align-self: flex-start; }

/* Le signe de l'assistant tient lieu de nom : on sait qui parle avant de
   lire. */
.echange-signe {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; margin-top: 2px;
  background: var(--accent-degrade); color: #fff;
  box-shadow: 0 2px 8px var(--accent-doux);
}

.echange-corps { min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.echange-bulle {
  padding: 13px 16px; font-size: 14px; line-height: 1.62;
  white-space: pre-wrap; overflow-wrap: anywhere;
  animation: echange-entre .3s cubic-bezier(.22, .85, .25, 1);
}
.echange.reponse .echange-bulle {
  background: var(--surface-2); color: var(--encre);
  border: 1px solid var(--carte-trait);
  border-radius: 4px var(--rayon) var(--rayon) var(--rayon);
}
/* La question porte la couleur de l'identite : c'est vous qui parlez. Le coin
   coupe du cote de l'epaule donne a la bulle son sens de lecture. */
.echange.question .echange-bulle {
  background: var(--accent-degrade); color: #fff;
  border-radius: var(--rayon) 4px var(--rayon) var(--rayon);
  box-shadow: 0 2px 10px var(--accent-doux);
}
.echange-bulle.patiente {
  background: var(--surface-2); border: 1px solid var(--carte-trait);
  border-radius: 4px var(--rayon) var(--rayon) var(--rayon);
  padding: 11px 14px;
}

@keyframes echange-entre {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .echange-bulle { animation: none; }
  .fil-echanges { scroll-behavior: auto; }
}

/* La provenance de la reponse passe sous la bulle : elle informe sans
   interrompre la lecture. */
.echange-marques {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-inline: 3px;
}
.echange.question .echange-marques { justify-content: flex-end; }
.echange-modele {
  font-size: 10.5px; color: var(--encre-faible);
  font-family: var(--police-chiffres);
}

/* --- La barre de saisie --- */
.assistant-barre {
  display: grid; gap: 11px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--carte-trait);
  border-radius: var(--rayon-l); box-shadow: var(--carte-ombre);
}
.assistant-portee {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12px; color: var(--encre-faible); font-weight: 600;
}
.assistant-portee .saisie { max-width: 300px; font-size: 13px; }

.assistant-saisie { display: flex; gap: 9px; }
/* Le champ portait un fond a peine plus gris que la carte et aucun trait :
   on ne voyait pas qu'il y avait quelque chose ou ecrire. Il prend un cadre
   franc, qui s'epaissit au survol et rougit au moment de la frappe. */
.assistant-saisie .saisie {
  flex: 1; min-width: 0; padding: 13px 18px; font-size: 14.5px;
  border-radius: var(--rayon-pilule); background: var(--surface);
  border: 1.5px solid var(--trait-fort);
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition);
}
.assistant-saisie .saisie::placeholder { color: var(--encre-faible); }
.assistant-saisie .saisie:hover { border-color: var(--encre-faible); }
.assistant-saisie .saisie:focus {
  background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-doux);
}
.assistant-saisie .bouton { border-radius: var(--rayon-pilule); padding-inline: 22px; }

.assistant-suggestions { display: grid; gap: 7px; }
.suggestions-assistant { display: flex; gap: 7px; flex-wrap: wrap; }

/* Une suggestion n'est pas un bouton d'action : elle propose, elle n'engage
   pas. D'ou la forme de pilule et le trait plutot que l'aplat. */
.suggestion-assistant {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--rayon-pilule);
  border: 1px solid var(--trait-fort); background: var(--surface);
  color: var(--encre-douce); font-family: inherit; font-size: 12.5px;
  cursor: pointer; text-align: start; line-height: 1.35;
  transition: border-color var(--transition), color var(--transition),
              background var(--transition);
}
.suggestion-assistant svg { color: var(--encre-faible); flex-shrink: 0; }
.suggestion-assistant:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-doux);
}
.suggestion-assistant:hover svg { color: var(--accent); }

@media (max-width: 720px) {
  .echange { max-width: 96%; }
  .fil-echanges { padding: 18px 14px; }
}

/* --- Le volet flottant reprend les memes bulles --- */
.assistant-volet .echange { max-width: 100%; }
.assistant-volet .fil-echanges {
  border: 0; border-radius: 0; box-shadow: none; padding: 14px;
  gap: 14px; min-height: 0;
}

.assistant-declencheur {
  position: fixed; inset-inline-end: 22px; inset-block-end: 22px; z-index: 60;
  width: 52px; height: 52px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent-degrade); color: #fff;
  box-shadow: 0 8px 24px rgba(20, 30, 45, .28);
  transition: transform var(--transition), box-shadow var(--transition);
}
.assistant-declencheur:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20, 30, 45, .34); }
.assistant-declencheur:active { transform: translateY(0); }

.assistant-volet {
  position: fixed; inset-inline-end: 22px; inset-block-end: 86px; z-index: 60;
  width: min(400px, calc(100vw - 32px));
  max-height: min(600px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface); box-shadow: 0 18px 48px rgba(20, 30, 45, .26);
  overflow: hidden;
}
.assistant-volet[hidden] { display: none; }

.assistant-entete {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border-bottom: 1px solid var(--trait); background: var(--surface-2);
}

.assistant-echanges {
  flex: 1; min-height: 140px; overflow-y: auto; padding: 12px 13px;
  display: flex; flex-direction: column; gap: 9px;
}

.assistant-bulle {
  padding: 9px 11px; border-radius: var(--rayon-s); font-size: 13px; line-height: 1.5;
  border: 1px solid var(--trait); background: var(--surface);
  max-width: 92%;
}
.assistant-bulle.question {
  align-self: flex-end; background: var(--accent-doux);
  border-color: var(--accent); color: var(--encre);
}
.assistant-bulle.reponse { align-self: flex-start; }
.assistant-marque { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }

.assistant-pied {
  display: grid; gap: 7px; padding: 11px 13px;
  border-top: 1px solid var(--trait); background: var(--surface-2);
}

/* Attente : l'etape et les secondes. Vingt secondes de « Recherche… » fige ne
   se distinguent pas d'une panne. */
.attente-ia {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--encre-douce);
}
.attente-point {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: battement 1.1s ease-in-out infinite;
}
@keyframes battement {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50%      { opacity: 1;   transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .attente-point { animation: none; opacity: .8; }
}

/* ------------------------------------------------------------------ */
/*  Ecriture de droite a gauche                                        */
/* ------------------------------------------------------------------ */

/* L'essentiel de la mise en page est deja logique (flex, grid) et se retourne
   seul. Ne restent que les endroits ou une direction physique etait ecrite en
   dur — et les chiffres, qui se lisent de gauche a droite meme en arabe. */
[dir="rtl"] .chiffres,
[dir="rtl"] .graphe-graduation,
[dir="rtl"] td.num,
[dir="rtl"] .num { direction: ltr; }

[dir="rtl"] table.donnees th,
[dir="rtl"] table.donnees td { text-align: right; }
[dir="rtl"] table.donnees th.num,
[dir="rtl"] table.donnees td.num { text-align: left; }

[dir="rtl"] .graphe-cadre { direction: ltr; }
[dir="rtl"] .graphe-libelles,
[dir="rtl"] .graphe-pied { direction: ltr; }

[dir="rtl"] .priorite-constat,
[dir="rtl"] .etat-note { border-left: 0; border-right: 2px solid var(--trait); padding-inline-start: 9px; }

[dir="rtl"] .carte-utilisateur .nom,
[dir="rtl"] .carte-utilisateur .role { text-align: right; }

/* ------------------------------------------------------------------ */
/*  Recommandations hierarchisees de l'assistant                       */
/* ------------------------------------------------------------------ */

/* Le rang vient de la numerotation native de la liste : c'est elle qui porte
   la hierarchie, et un lecteur d'ecran l'annonce sans qu'on ait rien a dire. */
.priorites { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 10px; }
.priorite { padding-left: 4px; }
.priorite::marker { color: var(--accent); font-weight: 700; font-size: 13px; }

.priorite-lien {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  font: inherit; text-align: left;
}
.priorite-titre {
  font-weight: 600; color: var(--encre);
  text-decoration: underline; text-decoration-color: var(--trait-fort);
  text-underline-offset: 3px;
}
.priorite-lien:hover .priorite-titre, .priorite-lien:focus-visible .priorite-titre {
  color: var(--accent); text-decoration-color: var(--accent);
}
.priorite-enjeu {
  font-family: var(--police-chiffres); font-size: 12px; font-weight: 700;
  color: var(--encre-douce); white-space: nowrap;
}
.priorite-constat {
  margin-top: 3px; padding-left: 9px;
  border-left: 2px solid var(--trait); font-style: italic;
  font-size: 12.5px; color: var(--encre-douce);
}

.classement { display: flex; flex-direction: column; gap: 9px; }
.classement-ligne { display: grid; grid-template-columns: minmax(90px, 1.4fr) 3fr minmax(96px, auto); gap: 11px; align-items: center; }
.classement-libelle {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.classement-piste { background: var(--surface-3); border-radius: 4px; height: 15px; overflow: hidden; }
/* La barre ne porte plus de texte : la part se lit a cote du montant, ou
   elle tient quelle que soit sa largeur. */
.classement-remplissage {
  height: 100%; background: var(--accent-degrade); border-radius: 4px;
  transition: width var(--transition);
}

.classement-valeur { text-align: right; font-size: 12.5px; }
.classement-valeur .secondaire { font-size: 11px; }

@media (max-width: 720px) {
  /* Sur un ecran etroit, le libelle et la valeur tiennent ; la piste se
     reduit, mais la part se lit desormais a cote du montant. */
  .classement-valeur .secondaire { white-space: normal; }
  .graphe-cadre { grid-template-columns: 42px 1fr; }
  .graphe-axe, .graphe-zone { height: 160px; }
  .graphe-libelles, .graphe-pied { margin-left: 50px; }
  .graphe-valeur, .graphe-montant { display: none; }
  .graphe-bulle { min-width: 118px; font-size: 11px; }
  .classement-ligne { grid-template-columns: 1fr 2fr auto; }
}

/* ------------------------------------------------------------------ */
/*  14. Connexion                                                      */
/* ------------------------------------------------------------------ */

.page-connexion {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--fond);
}
.connexion-recit {
  background: var(--sombre); color: #c3cddc;
  padding: 52px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.connexion-recit::before {
  content: ""; position: absolute; right: -140px; top: -140px;
  width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,16,46,.24), transparent 68%);
}
.connexion-recit .marque {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  position: relative;
}
.connexion-recit .marque .marque-logo { max-width: 236px; }
.connexion-recit .marque .marque-slogan { text-align: left; color: rgba(255,255,255,.72); }
.connexion-recit .marque .marque-sigle { width: 42px; height: 42px; font-size: 15px; }
.connexion-recit .marque-logo { max-width: 210px; }
.connexion-recit .marque strong { color: #fff; font-size: 16px; letter-spacing: .5px; }
.connexion-recit .marque span { display: block; font-size: 11px; opacity: .7; letter-spacing: .9px; text-transform: uppercase; }
.connexion-recit .propos { position: relative; max-width: 430px; }
.connexion-recit .propos h2 { color: #fff; font-size: 27px; line-height: 1.28; margin-bottom: 14px; letter-spacing: -.02em; }
.connexion-recit .propos p { font-size: 14px; line-height: 1.65; opacity: .82; }
.connexion-recit .metiers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.connexion-recit .metiers span {
  font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--sombre-trait); background: rgba(255,255,255,.04);
}
.connexion-recit .pied { position: relative; font-size: 11.5px; opacity: .55; line-height: 1.7; }

.connexion-formulaire { display: grid; place-items: center; padding: 40px 24px; }
.connexion-boite { width: 100%; max-width: 372px; }
.connexion-boite h1 { margin-bottom: 6px; }
.connexion-boite .accroche { color: var(--encre-douce); font-size: 13.5px; margin-bottom: 26px; }
.connexion-boite .mention-securite {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--trait);
  font-size: 11.5px; color: var(--encre-faible); line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/*  15. Onglets, chronologie, divers                                   */
/* ------------------------------------------------------------------ */

.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--trait); margin-bottom: 16px; overflow-x: auto; }
.onglet {
  padding: 9px 15px; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--encre-faible);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.onglet:hover { color: var(--encre); }
.onglet.actif { color: var(--accent); border-bottom-color: var(--accent); }

.chronologie { position: relative; padding-left: 22px; }
.chronologie::before {
  content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px;
  width: 2px; background: var(--trait);
}
.chrono-entree { position: relative; padding-bottom: 17px; }
.chrono-entree::before {
  content: ""; position: absolute; left: -21px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--teinte, var(--neutre));
}
.chrono-entree.critical { --teinte: var(--danger); }
.chrono-entree.warning  { --teinte: var(--attente); }
.chrono-entree.notice   { --teinte: var(--info); }
.chrono-entree .quand { font-size: 11.5px; color: var(--encre-faible); }
.chrono-entree .quoi { font-size: 13px; margin-top: 2px; }
.chrono-entree .qui { font-size: 11.5px; color: var(--encre-douce); font-weight: 600; }
.chrono-diff {
  margin-top: 6px; font-size: 12px; background: var(--surface-2);
  border: 1px solid var(--trait); border-radius: var(--rayon-s); padding: 7px 10px;
}
.chrono-diff .champ-diff { display: flex; gap: 7px; padding: 1px 0; }
.chrono-diff .champ-diff .cle { font-weight: 600; min-width: 130px; }
.chrono-diff .avant { color: var(--danger); text-decoration: line-through; }
.chrono-diff .apres { color: var(--succes); font-weight: 600; }

.definitions { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13px; }
.definitions dt { color: var(--encre-faible); font-size: 12.5px; }
.definitions dd { margin: 0; font-weight: 550; }

.chargement { display: grid; place-items: center; padding: 60px; color: var(--encre-faible); }
.rotateur {
  width: 26px; height: 26px; border: 2.5px solid var(--trait-fort);
  border-top-color: var(--accent); border-radius: 50%;
  animation: rotation .7s linear infinite;
}
@keyframes rotation { to { transform: rotate(360deg); } }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 16px; border-top: 1px solid var(--trait); flex-wrap: wrap;
}
.pagination .info { font-size: 12.5px; color: var(--encre-faible); }

.icone { display: inline-flex; width: 17px; height: 17px; flex-shrink: 0; }
.icone svg { width: 100%; height: 100%; }

/* ------------------------------------------------------------------ */
/*  16. Adaptation aux petits ecrans                                   */
/* ------------------------------------------------------------------ */

@media (max-width: 1080px) {
  .page-connexion { grid-template-columns: 1fr; }
  .connexion-recit { display: none; }
}

@media (max-width: 860px) {
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform var(--transition);
    box-shadow: var(--ombre-3);
  }
  .rail.ouvert { transform: none; }
  .bouton-menu { display: inline-flex; }
  .recherche-declencheur span:not(.icone) { display: none; }
  .recherche-declencheur kbd { display: none; }
  .contenu { padding: 15px; }
  .conteneur-notifications { left: 12px; right: 12px; max-width: none; }

  /* Le volet de l'assistant occupait presque tout l'ecran sans jamais le
     remplir : sur telephone, il le prend entierement. */
  .assistant-volet {
    inset: 0; width: auto; max-height: none; border-radius: 0; border: 0;
  }
  .assistant-declencheur {
    inset-inline-end: 16px;
    inset-block-end: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .rail, .barre, .page-actions, .filtres, .pagination { display: none !important; }
  .contenu { padding: 0; }
  .carte { border: 0; box-shadow: none; }
}

/* ------------------------------------------------------------------ */
/*  17. Sélecteur de client (recherche + création à la volée)          */
/* ------------------------------------------------------------------ */

.selecteur-client { position: relative; }

/*
 * Liste deroulante cherchable. Elle reprend l'apparence du selecteur de
 * client, dont elle generalise le principe : au-dela de huit options, taper
 * trois lettres va plus vite que faire defiler.
 */
.liste-cherchable { position: relative; }
.liste-cherchable .saisie { width: 100%; }
.liste-cherchable .saisie.vide { color: var(--encre-faible); }
.liste-cherchable .suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 30;
  background: var(--surface); border: 1px solid var(--trait-fort);
  border-radius: var(--rayon); box-shadow: var(--ombre-2);
  max-height: 280px; overflow-y: auto; padding: 4px;
}
.liste-cherchable .suggestions[hidden] { display: none; }
.liste-cherchable .suggestion {
  padding: 7px 10px; border-radius: var(--rayon-s); cursor: pointer; font-size: 13px;
}
.liste-cherchable .suggestion:hover { background: var(--surface-3); }
.liste-cherchable .suggestion.retenue { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
/* K-D5 : la ligne que les fleches designent. Elle se distingue de « retenue »,
   qui dit ce qui est deja choisi : sans cette difference, on ne saurait pas
   sur quoi « Entree » va tomber. Le trait a gauche la marque meme quand les
   deux se superposent. */
.liste-cherchable .suggestion.actif {
  background: var(--surface-3); box-shadow: inset 3px 0 0 var(--accent);
}
.liste-cherchable .suggestion-vide {
  padding: 9px 10px; font-size: 12px; color: var(--encre-faible);
}

.selecteur-client .suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 25;
  background: var(--surface); border: 1px solid var(--trait-fort);
  border-radius: var(--rayon); box-shadow: var(--ombre-2);
  max-height: 300px; overflow-y: auto; padding: 4px;
}
.selecteur-client .suggestions[hidden] { display: none; }

.suggestion {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: var(--rayon-s); cursor: pointer;
}
.suggestion:hover { background: var(--surface-3); }
.suggestion .principal { font-weight: 600; font-size: 13.5px; }
.suggestion .secondaire { font-size: 11.5px; color: var(--encre-faible); }

/* La création se distingue nettement des résultats existants. */
.suggestion.creation {
  justify-content: flex-start;
  border-top: 1px solid var(--trait); margin-top: 4px; padding-top: 10px;
  color: var(--accent);
}
.suggestion.creation .principal { color: var(--accent); }
.suggestion.creation:hover { background: var(--accent-doux); }

.suggestion-vide {
  padding: 14px; text-align: center; color: var(--encre-faible); font-size: 13px;
}

.client-retenu, .facture-retenue {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 7px; padding: 9px 12px;
  border: 1px solid var(--trait); border-left: 3px solid var(--accent);
  border-radius: var(--rayon-s); background: var(--surface-2);
}
.client-retenu .nom, .facture-retenue .nom { font-weight: 650; font-size: 13.5px; }
.client-retenu .detail, .facture-retenue .detail { font-size: 11.5px; color: var(--encre-faible); margin-top: 2px; }

/* ------------------------------------------------------------------ */
/*  18. Bloc de signature des documents imprimés                       */
/* ------------------------------------------------------------------ */

.signatures {
  display: flex; gap: 10mm; margin-top: 8mm;
}
.signature-case {
  flex: 1; border: 1px solid var(--trait); border-radius: 3px;
  padding: 3mm 4mm; min-height: 24mm;
}
.signature-case .intitule {
  font-size: 7.5pt; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gris); font-weight: 700;
}
.signature-case .consigne {
  font-size: 8pt; color: var(--gris); margin-top: 1mm;
}

/* ------------------------------------------------------------------ */
/*  Vitrine publique                                                   */
/* ------------------------------------------------------------------ */

/* L'application s'ouvrait sur un formulaire de connexion : une porte close
   sans enseigne pour tous ceux qui ne travaillent pas ici. Cette page dit qui
   est la societe, et offre le seul geste qui interesse un visiteur. */

.vitrine { background: var(--fond); color: var(--encre); min-height: 100vh; }
.vitrine-largeur { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.vitrine-entete {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--trait);
}
.vitrine-entete-corps {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; height: 72px;
}
.vitrine-marque { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vitrine-marque strong { display: block; font-size: 14.5px; letter-spacing: -.01em; }
.vitrine-marque span { display: block; font-size: 11.5px; color: var(--encre-faible); }

.vitrine-nav { display: flex; align-items: center; gap: 8px; }
.vitrine-nav a {
  padding: 8px 12px; border-radius: var(--rayon-s);
  color: var(--encre-douce); font-size: 13.5px; font-weight: 550;
}
.vitrine-nav a:hover { background: var(--surface-3); color: var(--encre); text-decoration: none; }
/* Le bouton d'acces a la gestion se distingue de la navigation publique : il
   ne mene pas a une section de la page, mais hors d'elle. Il porte donc la
   couleur de l'identite, en trait plutot qu'en aplat — l'aplat rouge est
   reserve au geste qu'on attend d'un visiteur, demander un devis. */
.vitrine-connexion {
  margin-inline-start: 6px;
  border-color: var(--accent); color: var(--accent); background: transparent;
  font-weight: 600;
}
/* .bouton:hover:not(:disabled) l'emporterait sinon sur le fond (specificite
   plus haute) sans toucher au texte : un bouton blanc sur fond reste clair,
   invisible. Le second selecteur egalise la specificite pour que ce bloc
   gagne bien sur les deux proprietes ensemble. */
.vitrine-connexion:hover, .bouton.vitrine-connexion:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.vitrine-connexion:hover svg { color: #fff; }

/* --- Banniere --- */
.vitrine-banniere {
  background: var(--sombre); color: #fff;
  padding: 96px 0 104px; position: relative; overflow: hidden;
}
.vitrine-banniere::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(880px 520px at 8% -25%, rgba(200, 16, 46, .42), transparent 66%),
    radial-gradient(760px 460px at 96% 115%, rgba(11, 114, 133, .30), transparent 64%);
  pointer-events: none;
}
/* Une trame tres fine par-dessus le degrade : elle donne au fond une matiere,
   la ou un degrade seul reste lisse et un peu vide. */
.vitrine-banniere::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 70% at 30% 40%, #000 30%, transparent 100%);
}
.vitrine-banniere-corps {
  position: relative; display: grid; gap: 52px;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); align-items: center;
}
/* Le contenu entre en montant, une piece apres l'autre. Une page qui se pose
   sous les yeux se lit dans l'ordre ou elle s'ecrit ; une page deja complete
   se parcourt au hasard. */
.vitrine-banniere-corps > * > * { animation: vitrine-entre .62s cubic-bezier(.2,.85,.25,1) backwards; }
.vitrine-banniere-corps > *:first-child > *:nth-child(1) { animation-delay: .04s; }
.vitrine-banniere-corps > *:first-child > *:nth-child(2) { animation-delay: .12s; }
.vitrine-banniere-corps > *:first-child > *:nth-child(3) { animation-delay: .20s; }
.vitrine-banniere-corps > *:first-child > *:nth-child(4) { animation-delay: .28s; }
.vitrine-banniere-corps > *:last-child  > *              { animation-delay: .34s; }

@keyframes vitrine-entre {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vitrine-banniere-corps > * > * { animation: none; }
}
/* Le lieu devient une etiquette posee, plutot qu'une ligne de texte perdue
   au-dessus du titre. */
.vitrine-surtitre {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.3px;
  color: rgba(255, 255, 255, .82); margin-bottom: 20px; font-weight: 650;
  padding: 5px 13px 5px 10px; border-radius: var(--rayon-pilule);
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14);
}
.vitrine-surtitre::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, .22);
}
.vitrine-banniere h1 {
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.1;
  letter-spacing: -.032em; color: #fff; margin-bottom: 18px; max-width: 19ch;
}
.vitrine-accroche {
  font-size: 17px; font-style: italic; max-width: 46ch; line-height: 1.6;
  color: rgba(255, 255, 255, .8); margin-bottom: 34px;
}
.vitrine-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.vitrine-actions .bouton { padding: 12px 22px; font-size: 14.5px; }
.vitrine-actions .bouton:not(.principal) {
  background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff;
  backdrop-filter: blur(6px);
}
.vitrine-actions .bouton:not(.principal):hover {
  background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34);
}
.vitrine-actions .bouton.principal { box-shadow: 0 8px 24px rgba(200, 16, 46, .38); }

/* Les engagements formaient une simple liste a puces sur le fond. Ils passent
   dans un panneau de verre : ils cessent d'etre une note en marge du titre
   pour devenir la seconde moitie de la banniere. */
.vitrine-engagements {
  list-style: none; display: grid; gap: 2px;
  padding: 22px; border-radius: var(--rayon-l);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .13);
  backdrop-filter: blur(10px);
}
.vitrine-engagements li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 14px; color: rgba(255, 255, 255, .92); line-height: 1.5;
  padding: 11px 4px;
}
.vitrine-engagements li + li { border-top: 1px solid rgba(255, 255, 255, .09); }
.vitrine-engagements .icone {
  color: #35d07f; flex-shrink: 0; margin-top: 1px;
}

/* --- Sections --- */
.vitrine-section { padding: 84px 0; }
.vitrine-section.alt { background: var(--surface); border-block: 1px solid var(--trait); }

/* Un surtitre en petites capitales rouges annonce la section avant son titre.
   Deux mots suffisent a dire ou l'on est, et le titre n'a plus a le faire. */
.vitrine-surtitre-section {
  display: block; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); margin-bottom: 12px;
}
.vitrine-titre {
  font-size: clamp(23px, 3vw, 32px); letter-spacing: -.028em; margin-bottom: 14px;
  max-width: 22ch;
}
.vitrine-chapo {
  font-size: 15.5px; color: var(--encre-douce); line-height: 1.65;
  max-width: 58ch; margin-bottom: 34px;
}

.vitrine-cartes { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.vitrine-carte {
  background: var(--surface); border: 1px solid var(--carte-trait);
  border-radius: var(--rayon-l); padding: 30px 26px; box-shadow: var(--carte-ombre);
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
  position: relative; overflow: hidden;
}
/* Un filet de couleur se deploie en haut de la carte au survol : le metier se
   designe lui-meme, sans qu'on ait besoin d'un cadre permanent. */
.vitrine-carte::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--accent-degrade);
  transform: scaleX(0); transform-origin: left;
  transition: transform .34s cubic-bezier(.22, .8, .24, 1);
}
.vitrine-carte:hover {
  transform: translateY(-4px); box-shadow: var(--ombre-2);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--carte-trait));
}
.vitrine-carte:hover::before { transform: scaleX(1); }
.vitrine-carte-icone {
  width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 18px;
  border-radius: var(--rayon); background: var(--accent-doux); color: var(--accent);
  transition: background var(--transition), color var(--transition);
}
.vitrine-carte:hover .vitrine-carte-icone {
  background: var(--accent-degrade); color: #fff;
}
@media (prefers-reduced-motion: reduce) {
  .vitrine-carte:hover { transform: none; }
  .vitrine-carte::before { transition: none; }
}
.vitrine-carte h3 { font-size: 17px; margin-bottom: 9px; letter-spacing: -.015em; }
.vitrine-carte p { color: var(--encre-douce); font-size: 14px; line-height: 1.65; }

/* --- Contact --- */
.vitrine-contact {
  display: grid; gap: 44px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start;
}
.vitrine-coordonnees { display: grid; gap: 16px; }
.vitrine-coordonnee { display: grid; gap: 2px; }
.vitrine-coordonnee span:last-child, .vitrine-coordonnee a { font-size: 15px; font-weight: 600; }
.vitrine-formulaire { box-shadow: var(--ombre-2); border-color: var(--carte-trait); }
.vitrine-coordonnee span:first-child {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--encre-faible); font-weight: 650;
}
.vitrine-merci { text-align: center; padding: 52px 26px; }
.vitrine-merci .icone { color: var(--succes); }
.vitrine-merci h2 { margin: 14px 0 8px; font-size: 20px; }
.vitrine-merci p { color: var(--encre-douce); max-width: 40ch; margin: 0 auto; line-height: 1.6; }

/* --- Pied de page --- */
/* Le pied de page occupait presque une hauteur d'ecran pour trois colonnes et
   deux lignes de mentions : il se resserre, sans rien perdre. */
.vitrine-pied { background: var(--sombre); color: rgba(255, 255, 255, .74); padding: 30px 0 18px; }
.vitrine-pied-colonnes {
  display: grid; gap: 16px 30px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.vitrine-pied strong { color: #fff; display: block; margin-bottom: 4px; font-size: 12.5px; }
.vitrine-pied p { font-size: 12.5px; line-height: 1.5; margin: 0 0 2px; }
.vitrine-pied a { color: rgba(255, 255, 255, .82); }
.vitrine-legal {
  display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 12px 0;
  font-size: 11px; font-family: var(--police-chiffres);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.vitrine-legal strong { display: inline; color: rgba(255, 255, 255, .55); font-weight: 600; }
.vitrine-mentions {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding-top: 12px; font-size: 11.5px; color: rgba(255, 255, 255, .52);
}

@media (max-width: 900px) {
  .vitrine-banniere-corps, .vitrine-contact { grid-template-columns: 1fr; }
  .vitrine-banniere { padding: 52px 0 56px; }
  .vitrine-section { padding: 46px 0; }
  .vitrine-nav a { display: none; }
}

/* ------------------------------------------------------------------ */
/*  Reprise d'une facture papier                                       */
/* ------------------------------------------------------------------ */

.reprise-depot {
  display: flex; align-items: center; gap: 16px; margin-top: 14px;
  padding: 24px; border: 2px dashed var(--trait-fort); border-radius: var(--rayon);
  background: var(--surface-2);
}
.reprise-depot .icone { color: var(--encre-faible); flex-shrink: 0; }
.reprise-depot > div { flex: 1; min-width: 0; }

.reprise-attente {
  display: flex; align-items: center; gap: 14px;
  padding: 34px 24px; border: 1px solid var(--trait); border-radius: var(--rayon);
  background: var(--surface-2);
}

.reprise-grille {
  display: grid; gap: 12px 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.reprise-champ { display: grid; gap: 1px; }
.reprise-champ > span:last-child { font-weight: 600; font-size: 13.5px; }
/* Ce qui n'a pas ete lu se voit : une case vide qui ressemble a une valeur
   passe inapercue, et c'est elle qu'il faut corriger. */
.reprise-vide { color: var(--encre-faible); font-style: italic; font-weight: 400; }

/* Une ligne decochee, dans le lot d'un avis de paiement : elle reste lisible
   (on peut la recocher) mais ne se confond plus avec les lignes retenues. */
.reprise-exclue { opacity: .45; }

/* ------------------------------------------------------------------ */
/*  Vitrine : valeurs, apparitions, coordonnees masquees               */
/* ------------------------------------------------------------------ */

.vitrine-chapo {
  color: var(--encre-douce); font-size: 15px; line-height: 1.65;
  max-width: 56ch; margin: -18px 0 28px;
}

.vitrine-valeurs {
  display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.vitrine-valeur { display: flex; gap: 16px; align-items: flex-start; }
.vitrine-valeur-icone {
  width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: var(--rayon); background: var(--accent-degrade); color: #fff;
  box-shadow: 0 4px 12px var(--accent-doux);
}
.vitrine-valeur h3 { font-size: 15.5px; margin-bottom: 6px; letter-spacing: -.01em; }
.vitrine-valeur p { color: var(--encre-douce); font-size: 13.5px; line-height: 1.65; }

/* Apparition au defilement.
   L'etat de repos est deja lisible : si le script n'agit pas, rien ne reste
   invisible — c'est l'inverse qui laisserait une page blanche. */
.apparait {
  opacity: 0; transform: translateY(14px);
  transition: opacity .55s cubic-bezier(.22, .61, .36, 1),
              transform .55s cubic-bezier(.22, .61, .36, 1);
  transition-delay: var(--delai, 0ms);
}
.apparait.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .apparait { opacity: 1; transform: none; transition: none; }
}

/* Coordonnee revelee au clic : un numero en clair sur une page publique est
   aspire par les robots et finit en appels automatises sur une astreinte. */
.coordonnee-valeur { min-height: 34px; display: flex; align-items: center; }
.coordonnee-revelation { padding: 5px 12px; font-size: 12.5px; }
.coordonnee-lien {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--accent);
}
.coordonnee-lien:hover { text-decoration: underline; }
.coordonnee-texte { font-size: 15px; font-weight: 600; }

/* ------------------------------------------------------------------ */
/*  Administration : onglets ranges par famille                        */
/* ------------------------------------------------------------------ */

/* Neuf onglets sur une seule barre se ressemblaient tous : rien ne
   distinguait ce qui decrit l'entreprise de ce qui regle le logiciel. */
.onglets-familles {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  padding: 14px 0 4px; margin-bottom: 18px;
  border-bottom: 1px solid var(--trait);
}
.onglets-famille { display: flex; flex-direction: column; gap: 6px; }
.onglets-titre {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--encre-faible);
}
.onglets-famille .onglets { border-bottom: 0; padding: 0; margin: 0; gap: 4px; }

/* Theme et langue partagent une ligne : les deux reglent l'affichage, et se
   cherchent au meme endroit. */
.rail-affichage { display: flex; align-items: center; gap: 6px; }
.rail-affichage .bouton-rail { flex: 1; min-width: 0; }
.rail-langue {
  flex-shrink: 0; max-width: 108px;
  padding: 7px 8px; border-radius: var(--rayon-s);
  border: 1px solid var(--rail-trait); background: rgba(255, 255, 255, .06);
  color: var(--rail-encre); font-family: inherit; font-size: 12.5px; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.rail-langue:hover { background: var(--rail-actif); color: var(--rail-encre-vive); }
.rail-langue option { color: var(--encre); background: var(--surface); }

/* Coordonnee masquee au pied de page : plus discrete que dans la section
   contact, mais protegee de la meme facon — proteger a un endroit et laisser
   en clair a l'autre ne protege rien. */
.pied-coordonnee { margin: 0 0 6px; }
.pied-coordonnee .coordonnee-valeur { min-height: 0; }
.pied-coordonnee .coordonnee-revelation {
  background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .82); box-shadow: none;
}
.pied-coordonnee .coordonnee-revelation:hover {
  background: rgba(255, 255, 255, .16); color: #fff;
}
.pied-coordonnee .coordonnee-lien { font-size: 13.5px; color: #fff; }

/* Le logo de la vitrine : dessine pour un fond clair, il y reste tel quel. */
.vitrine-logo { max-width: 220px; width: 100%; height: auto; display: block; }
@media (max-width: 560px) { .vitrine-logo { max-width: 168px; } }

/* Nature d'une ligne de prestation : un petit titre qui coiffe la
   designation. Il dit de quoi la ligne est faite — prestation du catalogue,
   forfait libre, remise — et cela se lit avant son contenu, pas apres. */
.editeur-lignes .nature-ligne {
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--texte-doux); font-weight: 600; margin-bottom: 3px;
}

/*
 * Position de repli de l'assistant flottant.
 *
 * En bas a droite, il tombe sur le coin ou finissent les tableaux : derniere
 * ligne, total, pagination. Des qu'un tableau passe dessous, il remonte en
 * haut a droite, sous la barre d'en-tete. Voir surveillerLesTableaux().
 */
.assistant-declencheur.decale { inset-block-end: auto; inset-block-start: 86px; }
.assistant-volet.decale { inset-block-end: auto; inset-block-start: 150px; }
