/* ERP CHM Automotive.
   Le noir et le rouge du logo. Le noir porte ce qui est fort (barre du haut, carte des
   encaissements, barres des graphiques) ; le rouge est réservé à la marque et à ce qui
   s'actionne ; le vert dit « encaissé, soldé », l'ambre « en attente ».
   Sur ordinateur : menu sur le côté et tableaux. Sur téléphone : onglets en bas et cartes. */

:root {
  --fond: var(--teinte-f1f2f4);
  --surface: var(--palette-surface);
  --surface-2: var(--teinte-f6f7f9);
  --bord: var(--teinte-e2e5e9);
  --bord-fort: var(--teinte-cdd2d9);
  --texte: var(--teinte-14171a);
  --texte-2: var(--teinte-5c6570);
  --texte-3: var(--teinte-6f7883);
  --nuit: var(--teinte-101216);
  --nuit-2: var(--teinte-1e2228);
  --nuit-texte: var(--teinte-c9ced6);
  --nuit-discret: var(--teinte-8b94a0);
  --rouge: var(--teinte-d4202a);
  --rouge-charte: var(--teinte-ff0000); /* le rouge exact de la charte (R 255, V 0, B 0) : bandes et aplats, jamais du texte */
  --rouge-fonce: var(--teinte-b61922);
  --rouge-pale: var(--teinte-fdecec);
  --rouge-bord: var(--teinte-f0bfc2);
  --entree: var(--teinte-127040);
  --entree-pale: var(--teinte-e3f1ea);
  --sortie: var(--teinte-b61922);
  --sortie-pale: var(--teinte-fdecec);
  --alerte: var(--teinte-9a5800);
  --alerte-pale: var(--teinte-f8efe0);
  --alerte-bord: var(--teinte-e6cfa6);
  --piste: var(--teinte-e6e9ed);
  --barre: var(--teinte-2a2f36);
  --barre-claire: var(--teinte-b4bcc6);
  --anneau: var(--teinte-rgb-20-23-26-0_14);
  --rayon: 14px;
  --rayon-petit: 10px;
  --ombre-menu: 0 14px 34px var(--teinte-rgb-16-18-22-0_16), 0 2px 6px var(--teinte-rgb-16-18-22-0_08);
  --titres: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif);
  --onglets: calc(62px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
html { font-size:var(--t-15, 15px); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font-weight: inherit; }
body { font-weight: 400;
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif);
  line-height: 1.45;
}
html:not(.interface-erp) body { font-weight: 600; }
a { color: var(--texte); text-decoration: underline; text-decoration-color: var(--bord-fort); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--texte); outline-offset: 2px; border-radius: 4px; }
h1 { margin: 0; font-family: var(--titres); font-size:var(--t-34, 34px); font-weight: 700; line-height: 1.1; letter-spacing: 0.01em; }
h2 { margin: 0 0 0.75rem; font-size:var(--t-17, 17px); font-weight: 600; line-height: 1.3; }
p { margin: 0 0 0.8rem; }
strong { font-weight: 700; }
summary { cursor: pointer; }
.discret { color: var(--texte-2); font-size:var(--t-13, 13px); }
.entree { color: var(--entree); }
.sortie { color: var(--sortie); }
.icone { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; }
.icones { position: absolute; }
.code {
  display: inline-block; padding: 0 0.4em; border: 1px solid var(--bord); border-radius: 5px;
  background: var(--surface-2); color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; line-height: 1.45;
}

/* --- Cadre général : menu, barre du haut, contenu ---------------------------------- */
.cadre { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.1rem 0.75rem 1rem; background: var(--nuit); color: var(--nuit-texte);
}
.marque { display: block; padding: 0.2rem 0.6rem 1rem; border-bottom: 1px solid var(--nuit-2); }
.marque img { display: block; width: 132px; height: auto; }
.menu { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
/* Le nom d'un service ; à sa droite, la mention d'un service dont les écrans ne sont pas encore ouverts. */
.menu-titre {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.35rem; padding: 0 0.65rem;
  color: var(--nuit-discret); font-size:var(--t-12, 12px); font-weight: 600; text-decoration: none;
}
.menu-titre:last-child { margin-bottom: 0; }
.menu-titre small { color: var(--teinte-8a939d); font-size:var(--t-12, 12px); font-weight: 600; white-space: nowrap; }
a.menu-titre:hover, a.menu-titre[aria-current="page"] { color: var(--palette-surface); }
.menu a {
  position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.65rem;
  border-radius: var(--rayon-petit); color: var(--nuit-texte); font-weight: 600; text-decoration: none;
}
.menu a:hover { background: var(--nuit-2); color: var(--palette-surface); }
.menu a[aria-current="page"] { background: var(--nuit-2); color: var(--palette-surface); }
.menu a[aria-current="page"]::before {
  content: ""; position: absolute; left: -0.75rem; top: 0.45rem; bottom: 0.45rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--rouge);
}
.menu .icone { color: var(--nuit-discret); }
.menu a:hover .icone, .menu a[aria-current="page"] .icone { color: var(--palette-surface); }
.rail-pied { margin-top: auto; padding: 0.9rem 0.65rem 0; border-top: 1px solid var(--nuit-2); color: var(--nuit-discret); font-size:var(--t-13, 13px); }
.rail-pied p { margin: 0; }

.corps { display: flex; flex-direction: column; min-width: 0; }
.barre {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  min-height: 60px; padding: 0.5rem 1.75rem; border-bottom: 1px solid var(--bord); background: var(--surface);
}
.marque-barre, .chercher { display: none; }
.fil { display: flex; align-items: center; gap: 0.45rem; min-width: 0; margin: 0; color: var(--texte-2); white-space: nowrap; }
.fil strong { overflow: hidden; color: var(--texte); text-overflow: ellipsis; }
.fil .icone { width: 1em; height: 1em; color: var(--texte-3); }
.recherche { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.recherche .icone { position: absolute; left: 0.75rem; top: 50%; margin-top: -0.6em; color: var(--texte-3); pointer-events: none; }
.recherche input {
  width: 100%; padding: 0.55rem 0.75rem 0.55rem 2.4rem; border: 1px solid var(--bord); border-radius: var(--rayon-petit);
  background: var(--surface-2); color: var(--texte); font: inherit;
}
.recherche input::placeholder, .chercher input::placeholder { color: var(--texte-3); }
.recherche input:focus { border-color: var(--texte); background: var(--surface); outline: 3px solid var(--anneau); }
.profil { position: relative; }
.profil > summary {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.5rem 0.3rem 0.3rem;
  border-radius: var(--rayon-petit); list-style: none;
}
.profil > summary::-webkit-details-marker, .chercher > summary::-webkit-details-marker, .plus > summary::-webkit-details-marker { display: none; }
.profil > summary:hover, .profil[open] > summary { background: var(--surface-2); }
.pastille {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--rouge); color: var(--palette-surface); font-size:var(--t-14, 14px); font-weight: 600;
}
.profil-nom { display: grid; line-height: 1.25; text-align: left; }
.profil-nom span { color: var(--texte-2); font-size:var(--t-13, 13px); }
.profil-menu {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); display: grid; min-width: 240px; padding: 0.4rem;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); color: var(--texte); box-shadow: var(--ombre-menu);
}
.profil-qui { display: none; }
.profil-menu a, .profil-menu button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.6rem 0.65rem; border: 0; border-radius: var(--rayon-petit);
  background: none; color: var(--texte); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.profil-menu a:hover, .profil-menu button:hover { background: var(--surface-2); }
.profil-menu .icone { color: var(--texte-3); }
.profil-menu form { margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px solid var(--bord); }
/* Le choix de la langue : trois boutons, dans le menu du compte et sur la page de connexion. */
.langues { display: flex; gap: 0.3rem; }
.langues button {
  flex: 1; justify-content: center; width: auto; min-height: 2.4rem; padding: 0.35rem 0.5rem; border: 1px solid var(--bord); border-radius: var(--rayon-petit);
  background: var(--surface); color: var(--texte); font: inherit; font-size:var(--t-13, 13px); text-align: center; cursor: pointer;
}
.langues button:hover { border-color: var(--texte-3); background: var(--surface); }
.langues button[aria-pressed="true"], .langues button[aria-pressed="true"]:hover { border-color: var(--texte); background: var(--texte); color: var(--palette-surface); }
.connexion .langues { margin-top: 1.5rem; }
.onglets { display: none; }

.contenu { width: 100%; padding: 1.6rem 1.75rem 4rem; }
.entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.8rem 1.5rem; margin-bottom: 1.25rem; }
.entete > *, .section > * { min-inline-size: 0; max-inline-size: 100%; }
.entete h1, .section h2, .sous-titre { overflow-wrap: anywhere; }
.sur-titre { margin: 0 0 0.15rem; color: var(--texte-2); font-size:var(--t-14, 14px); }
h1 .compte { margin-left: 0.35rem; color: var(--texte-2); font-size:var(--t-12, 12px); font-weight: 600; font-variant-numeric: tabular-nums; }
.sous-titre { max-width: 85ch; margin: 0.4rem 0 0; color: var(--texte-2); }
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.section { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; margin: 1.75rem 0 0.65rem; }
.section h2 { margin: 0; }
h2 .compte { margin-left: 0.3rem; color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; font-variant-numeric: tabular-nums; }
/* La phrase qui dit ce que montre l'onglet ouvert, et la page où il n'y a rien à lister. */
.explication { max-width: 85ch; margin: 0 0 1rem; color: var(--texte-2); }
.vide-page { padding: 2rem 1.25rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); color: var(--texte-2); text-align: center; }
/* Les rubriques du service ouvert, en bande sous la barre du haut : téléphone seulement. */
.sous-menu { display: none; }

/* La page d'un service : ses rubriques ouvertes, puis ce qui est en préparation. */
.rubriques { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.7rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.rubriques a {
  display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.1rem; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--surface); font-weight: 600; text-decoration: none;
}
.rubriques a:hover { border-color: var(--texte); }
.rubriques .icone { width: 1.4rem; height: 1.4rem; color: var(--rouge); }
.a-venir { max-width: 780px; margin: 0; padding: 0.9rem 1.25rem 0.9rem 2.6rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); color: var(--texte-2); }
.a-venir li { padding: 0.3rem 0; }

/* --- Boutons et champs ------------------------------------------------------------ */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.75rem; padding: 0.45rem 1rem;
  border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte);
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.bouton:hover { border-color: var(--texte-3); background: var(--surface-2); }
.bouton.principal { border-color: var(--rouge); background: var(--rouge); color: var(--palette-surface); }
.bouton.principal:hover { border-color: var(--rouge-fonce); background: var(--rouge-fonce); }
.bouton.danger { border-color: var(--rouge-bord); color: var(--sortie); }
.bouton.danger:hover { border-color: var(--sortie); background: var(--sortie-pale); }
.bouton.discret { border-color: var(--bord); color: var(--texte-2); font-weight: 600; }
.bouton.discret:hover { color: var(--texte); }
.bouton.petit { min-height: 2.2rem; padding: 0.25rem 0.7rem; font-size:var(--t-14, 14px); }
.bascule-filtres { display: none; }

.champ, .filtres input, .filtres select {
  min-width: 0; min-height: 2.75rem; padding: 0.45rem 0.75rem; border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit);
  background: var(--surface); color: var(--texte); font: inherit;
}
.champ:focus, .filtres input:focus, .filtres select:focus, .chercher input:focus { border-color: var(--texte); outline: 3px solid var(--anneau); }
.champ { width: 100%; }
input.champ, select.champ, .filtres input, .filtres select { height: 2.75rem; }
textarea.champ { resize: vertical; }
/* Les listes déroulantes ont la même hauteur que les autres champs, avec le même chevron partout. */
select.champ, .filtres select {
  -webkit-appearance: none; appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.65rem center; background-size: 1.1rem;
}

.filtres {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.75rem; margin-bottom: 1rem; padding: 0.9rem 1rem;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface);
}
.filtres label { display: grid; min-inline-size: 0; max-inline-size: 100%; gap: 0.2rem; color: var(--texte-2); font-size:var(--t-14, 14px); font-weight: 700; overflow-wrap: anywhere; }
.filtres input[type="search"] { min-width: 230px; }
/* Filtres rapides : une rangée de pastilles au-dessus d'une liste. */
.puces { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.puces a, .sous-menu a {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.3rem; padding: 0.3rem 0.85rem; border: 1px solid var(--bord);
  border-radius: 99px; background: var(--surface); color: var(--texte-2); font-size:var(--t-14, 14px); font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.puces a:hover, .sous-menu a:hover { border-color: var(--texte-3); color: var(--texte); }
.puces b { color: var(--rouge); font-weight: 600; font-variant-numeric: tabular-nums; }
.puces a[aria-current="true"], .sous-menu a.actif { border-color: var(--texte); background: var(--texte); color: var(--palette-surface); }
.puces a[aria-current="true"] b { color: var(--palette-surface); }

.formulaire { max-width: 880px; padding: 1.5rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.grille-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.4rem; }
.ligne-champ { min-inline-size: 0; }
.ligne-champ.large { grid-column: 1 / -1; }
.ligne-champ label { display: block; margin-bottom: 0.3rem; font-weight: 700; overflow-wrap: anywhere; }
.facultatif { color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; }
.aide { margin: 0.3rem 0 0; color: var(--texte-2); font-size:var(--t-13, 13px); }
.errorlist { margin: 0.3rem 0 0.6rem; padding: 0; list-style: none; color: var(--sortie); font-size:var(--t-14, 14px); font-weight: 600; }
.en-erreur .champ { border-color: var(--sortie); }
.actions-formulaire { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--bord); }

/* --- Messages --------------------------------------------------------------------- */
.messages { display: grid; gap: 0.5rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.messages li { padding: 0.75rem 1rem; border: 1px solid var(--bord); border-left: 4px solid var(--texte-3); border-radius: var(--rayon-petit); background: var(--surface); }
.messages .success { border-color: var(--teinte-b9dcc8); border-left-color: var(--entree); background: var(--entree-pale); }
.messages .error { border-color: var(--rouge-bord); border-left-color: var(--sortie); background: var(--sortie-pale); }
.messages .info { border-color: var(--bord-fort); border-left-color: var(--texte); background: var(--surface); }
/* Serveur d'essai ou de recette : une pastille discrète sur chaque page ; l'explication s'ouvre au clic. */
.bandeau-essai { margin: 0 0 1rem; color: var(--teinte-5c3d00); font-size:var(--t-13, 13px); }
.bandeau-essai > summary, p.bandeau-essai {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.85rem; border: 1px solid var(--alerte-bord);
  border-radius: 99px; background: var(--alerte-pale); color: var(--alerte); font-weight: 600; list-style: none;
}
.bandeau-essai > summary::-webkit-details-marker { display: none; }
.bandeau-essai > p { max-width: 70ch; margin: 0.5rem 0 0; padding: 0.6rem 0.85rem; border: 1px solid var(--alerte-bord); border-radius: var(--rayon-petit); background: var(--alerte-pale); }
p.bandeau-essai { display: flex; border-radius: var(--rayon-petit); padding: 0.6rem 0.85rem; }
p.bandeau-essai .icone { margin-top: 0.1em; }
.note { max-width: 95ch; padding: 0.75rem 1rem; border: 1px solid var(--bord); border-left: 4px solid var(--bord-fort); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte-2); }
div.note { margin: 0 0 1rem; }
.note > strong { display: block; color: var(--texte); }
.note ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.note li + li { margin-top: 0.35rem; }

/* --- Tableaux ----------------------------------------------------------------------- */
.defilant { overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.registre { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.registre th {
  padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--bord); background: var(--surface-2);
  color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; text-align: left; white-space: nowrap;
}
/* Un titre de colonne de montants peut se plier sur deux lignes : la colonne garde la largeur de ses chiffres. */
.registre th.nombre { white-space: normal; }
.registre td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
@media (min-width: 901px) {
  .registre th:first-child, .registre td:first-child { padding-left: 1rem; }
  .registre th:last-child, .registre td:last-child { padding-right: 1rem; }
}
.registre tbody tr:last-child td { border-bottom: 0; }
.registre tbody tr:hover td { background: var(--teinte-fafbfc); }
.registre .nombre { text-align: right; white-space: nowrap; }
.registre .fixe { white-space: nowrap; }
/* Le détail d'un montant, sous le montant : il peut passer à la ligne pour laisser la place aux autres colonnes. */
.registre .nombre .detail { display: block; white-space: normal; }
.registre .nombre .detail.ligne { margin-right: 0; white-space: nowrap; }
.registre td.large { min-width: 15rem; }
.registre tfoot td { border-top: 1px solid var(--bord-fort); border-bottom: 0; background: var(--surface-2); font-weight: 600; }
/* Un relevé arrêté, sous le relevé en cours du même showroom. */
.registre tr.ancien td { background: var(--teinte-fafbfc); color: var(--texte-2); }
.registre tr.ancien td:first-child { padding-left: 2rem; }
.registre tr.contrepasse td { color: var(--texte-3); }
.registre tr.contrepasse .libelle, .registre tr.contrepasse .nombre { text-decoration: line-through; }
.registre td.vide { padding: 2.5rem 1rem; color: var(--texte-2); text-align: center; }
.registre form { display: inline; }
.registre td > a > strong { font-family: var(--titres); font-size:var(--t-17, 17px); font-weight: 700; letter-spacing: 0.02em; }
.registre td > a:has(> strong) { text-decoration: none; }
.registre td > a:hover > strong { text-decoration: underline; text-underline-offset: 3px; }
.detail { display: inline-block; margin-right: 0.8rem; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1rem; color: var(--texte-2); }
/* Tableaux de contrôle : la colonne « Système » se lit juste à droite de la colonne « Fichier ». */
.comparaison th.groupe { border-left: 1px solid var(--bord); text-align: center; }
.comparaison thead tr + tr th { font-weight: 600; }
.comparaison td.fichier, .comparaison th.fichier { border-left: 1px solid var(--bord); color: var(--texte-2); }
/* Une somme versée et, dessous, la part du total qu'elle représente. */
.jauge { display: block; width: 100%; min-width: 72px; height: 6px; margin-top: 0.35rem; overflow: hidden; border-radius: 3px; }
.jauge .piste { fill: var(--piste); }
.jauge .plein { fill: var(--barre); }
.jauge.solde .plein { fill: var(--entree); }

/* --- Le VIN, écrit comme une plaque ------------------------------------------------ */
.plaque {
  display: inline-block; padding: 0.05rem 0.5rem; border: 1px solid var(--bord-fort); border-radius: 6px;
  background: var(--surface-2); color: var(--texte); font-family: var(--titres); font-size:var(--t-15, 15px); font-weight: 600;
  letter-spacing: 0.035em; text-decoration: none; white-space: nowrap;
}
a.plaque:hover { border-color: var(--texte); }
.plaque.grande { padding: 0.2rem 0.8rem; background: var(--surface); font-size:var(--t-28, 28px); letter-spacing: 0.06em; }
.plaque.sans-vin { border-style: dashed; background: transparent; color: var(--texte-2); font-family: inherit; font-size:var(--t-13, 13px); font-weight: 600; letter-spacing: 0; }

/* --- États ------------------------------------------------------------------------ */
.etat {
  display: inline-flex; align-items: center; padding: 0.15rem 0.7rem; border-radius: 99px;
  background: var(--piste); color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; white-space: nowrap;
}
.etat.brouillon, .etat.demande, .etat.en_attente { background: var(--alerte-pale); color: var(--alerte); }
.etat.validee, .etat.encaisse, .etat.confirme { background: var(--entree-pale); color: var(--entree); }
.etat.valide { background: transparent; color: var(--entree); box-shadow: inset 0 0 0 1px currentColor; }
.etat.cloturee { background: var(--piste); color: var(--texte); }
.etat.annulee, .etat.annule, .etat.rejete, .etat.refuse { background: var(--sortie-pale); color: var(--sortie); }
.etat.alerte { background: var(--sortie); color: var(--palette-surface); }

/* --- Fiches ------------------------------------------------------------------------- */
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.bloc { padding: 1.1rem 1.25rem 1.2rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.bloc h2 { margin-bottom: 0.85rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--bord); }
.bloc .ligne-champ { margin-bottom: 0.7rem; }
/* Une action à faire maintenant : le formulaire est posé dans la page, pas caché derrière un bouton. */
.encart { max-width: 540px; margin-bottom: 1.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--bord-fort); border-left: 4px solid var(--rouge); border-radius: var(--rayon); background: var(--surface); }
.encart h2 { margin-bottom: 0.7rem; }
.encart .ligne-champ { margin-bottom: 0.7rem; }
.encart .aide { margin-bottom: 0.8rem; }
.donnees { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: 0.45rem 0; margin: 0; }
.donnees dt { min-inline-size: 0; padding-inline-end: 1.25rem; color: var(--texte-2); overflow-wrap: anywhere; }
.donnees dd { min-inline-size: 0; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.donnees dd.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.donnees .total { padding-top: 0.45rem; border-top: 1px solid var(--bord); color: var(--texte); font-weight: 600; }
.donnees .fort { border-top-color: var(--bord-fort); font-size:var(--t-17, 17px); }
.donnees .sous { color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; }
/* Une précision sous un montant : elle se plie sur deux lignes au lieu d'élargir la colonne des libellés. */
.donnees dt.sous { width: 0; min-width: 100%; padding-left: 1rem; }
.donnees.origine { grid-template-columns: repeat(auto-fit, minmax(150px, max-content) minmax(140px, 1fr)); padding: 1rem 1.25rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }

.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; margin-bottom: 1.25rem; }
.action { position: relative; }
.action > summary { list-style: none; }
.action > summary::-webkit-details-marker { display: none; }
.action[open] > summary { border-color: var(--texte-3); background: var(--surface-2); }
.panneau {
  position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; width: min(88vw, 360px);
  display: grid; gap: 0.6rem; padding: 1rem; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--surface); box-shadow: var(--ombre-menu);
}
.panneau p { margin: 0; }
.panneau label { font-weight: 600; }
.panneau.a-droite { left: auto; right: 0; }
/* Dans une ligne de tableau, le panneau s'ouvre dans la cellule (un panneau flottant serait coupé). */
.panneau.dans-ligne { position: static; width: 260px; margin-top: 0.4rem; box-shadow: none; }

/* --- Chiffres clés ------------------------------------------------------------------ */
.situation { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 0.8rem; margin: 0 0 1.5rem; }
.situation > div { min-inline-size: 0; padding: 1rem 1.25rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); overflow-wrap: anywhere; }
.situation dt { display: flex; align-items: center; gap: 0.5rem; color: var(--texte-2); font-size:var(--t-14, 14px); font-weight: 600; }
.situation dt .icone { color: var(--texte-3); }
.situation dd { margin: 0.25rem 0 0; font-family: var(--titres); font-size:var(--t-34, 34px); font-weight: 700; line-height: 1.15; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.situation dd.ajuste { white-space: normal; }
.situation dd a { color: inherit; text-decoration: none; }
.situation dd a:hover { text-decoration: underline; text-underline-offset: 4px; }
.situation dd small { color: var(--texte-2); font-family: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif); font-size:var(--t-12, 12px); font-weight: 600; letter-spacing: 0; }
.situation p { margin: 0.3rem 0 0; color: var(--texte-2); font-size:var(--t-13, 13px); }
.situation .conforme { border-left: 4px solid var(--entree); }
.situation .attention { border-left: 4px solid var(--teinte-d9a528); }
.entete .situation { display: block; margin: 0; }
.entete .situation > div { padding: 0.55rem 1.1rem; text-align: right; }
.entete .situation dt { justify-content: flex-end; }
.entete .situation dd { font-size:var(--t-28, 28px); }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 0 1.25rem; }

/* --- Tableau de bord ------------------------------------------------------------------ */
.accueil-haut { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1rem; margin-bottom: 1rem; }
.accueil-haut.seul { grid-template-columns: minmax(0, 1fr); }
/* La carte noire des encaissements : le seul élément fort de la page, avec la bande rouge du logo. */
.phare { position: relative; overflow: hidden; padding: 1.3rem 4.2rem 1.25rem 1.35rem; border-radius: 16px; background: var(--nuit); color: var(--palette-surface); }
.phare::after { content: ""; position: absolute; right: -34px; top: -20px; width: 74px; height: 190%; background: var(--rouge-charte); transform: rotate(22deg); }
.phare > * { position: relative; z-index: 1; }
.phare .etiquette { margin: 0; color: var(--teinte-b9c0c8); font-size:var(--t-14, 14px); }
.phare .grand { margin: 0.2rem 0 0; font-family: var(--titres); font-size:var(--t-34, 34px); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.phare .grand small { color: var(--teinte-b9c0c8); font-family: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif); font-size:var(--t-17, 17px); font-weight: 600; }
.phare .precision { margin: 0.15rem 0 0; color: var(--teinte-b9c0c8); font-size:var(--t-13, 13px); }
.phare dl { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; margin: 1rem 0 0; }
.phare dt { color: var(--teinte-b9c0c8); font-size:var(--t-13, 13px); }
.phare dd { margin: 0; font-size:var(--t-17, 17px); font-weight: 600; font-variant-numeric: tabular-nums; }
.phare dl > div { flex: 1 1 14rem; }
.phare dd.precision { max-width: 34ch; margin-top: 0.1rem; color: var(--teinte-b9c0c8); font-size:var(--t-13, 13px); font-weight: 600; }
.a-traiter h2 { margin: 0.2rem 0 0.6rem; color: var(--texte-2); font-size:var(--t-15, 15px); }
.a-traiter ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.a-traiter a {
  display: block; height: 100%; padding: 0.8rem 0.95rem; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--surface); color: var(--texte-2); font-size:var(--t-14, 14px); line-height: 1.3; text-decoration: none;
}
.a-traiter a:hover { border-color: var(--texte); color: var(--texte); }
.a-traiter strong { display: block; margin-bottom: 0.25rem; color: var(--rouge); font-family: var(--titres); font-size:var(--t-34, 34px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.carte { grid-column: span 12; min-width: 0; padding: 1.1rem 1.25rem 1.25rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.carte.c8 { grid-column: span 8; }
.carte.c7 { grid-column: span 7; }
.carte.c5 { grid-column: span 5; }
.carte.c4 { grid-column: span 4; }
.carte > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 1rem; }
.carte > header h2 { margin: 0; }
.carte > header p { margin: 0; color: var(--texte-2); font-size:var(--t-13, 13px); }
.carte > header a, .lien { color: var(--rouge); font-size:var(--t-14, 14px); font-weight: 600; text-decoration: none; }
.carte > header a:hover, .lien:hover { text-decoration: underline; text-underline-offset: 3px; }
.carte.sans-marge { padding: 0; overflow: hidden; }
/* Une carte qui se replie : son titre reste, son contenu s'ouvre au clic. */
.repli > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; list-style: none; }
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary h2 { margin: 0; }
.repli > summary span { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--texte-2); font-size:var(--t-13, 13px); }
.repli[open] > summary { margin-bottom: 0.9rem; }
.repli[open] > summary .icone { transform: rotate(180deg); }
.chiffre { font-family: var(--titres); font-size:var(--t-28, 28px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.taches { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.taches li { display: flex; gap: 0.6rem; }
.taches .icone { margin-top: 0.15em; color: var(--entree); }
.postes td { vertical-align: top; }
.postes .taches { gap: 0.25rem; font-size:var(--t-14, 14px); }
.postes .comptes { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.carte.sans-marge > header { margin: 0; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bord); }
.carte.sans-marge .defilant { border: 0; border-radius: 0; }
@media (min-width: 901px) {
  .carte.sans-marge .registre th, .carte.sans-marge .registre td { padding-left: 0.75rem; padding-right: 0.75rem; }
  .carte.sans-marge .registre th:first-child, .carte.sans-marge .registre td:first-child { padding-left: 1.25rem; }
  .carte.sans-marge .registre th:last-child, .carte.sans-marge .registre td:last-child { padding-right: 1.25rem; }
}

/* Graphiques : tracés par le serveur, en SVG. Les barres sont à l'encre, les valeurs dans la couleur du texte. */
.legende { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin: 0; padding: 0; list-style: none; color: var(--texte-2); font-size:var(--t-13, 13px); }
.legende li { display: flex; align-items: center; gap: 0.4rem; }
.legende i { width: 0.7rem; height: 0.7rem; border-radius: 3px; background: var(--barre); }
.legende .claire i { background: var(--barre-claire); }
.barres { display: grid; gap: 0.85rem; }
.barres .ligne { display: grid; grid-template-columns: 9.5rem minmax(60px, 1fr) 7.5rem 3.4rem; align-items: center; gap: 0 0.9rem; }
.barres .nom { font-weight: 600; letter-spacing: 0.01em; }
.barres .valeur { font-family: var(--titres); font-size:var(--t-17, 17px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; text-align: right; white-space: nowrap; }
.barres .part { color: var(--texte-2); font-size:var(--t-13, 13px); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.barres .titres span { color: var(--texte-3); font-family: inherit; font-size:var(--t-13, 13px); font-weight: 600; letter-spacing: 0; }
.seulement-carte, .sur-telephone { display: none; }
.barres svg { display: block; width: 100%; height: 10px; overflow: visible; }
.trace { fill: var(--barre); }
.trace.claire { fill: var(--barre-claire); }
.joint { fill: var(--surface); }
[data-bulle] { cursor: default; }
[data-bulle]:hover, [data-bulle]:focus-visible { filter: brightness(0.92); outline: none; }
.colonnes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 0.75rem; }
.colonnes { margin-top: 1.6rem; }
.colonnes .axe { display: flex; flex-direction: column-reverse; justify-content: space-between; height: 260px; color: var(--texte-3); font-size:var(--t-13, 13px); font-variant-numeric: tabular-nums; text-align: right; }
.colonnes .axe span { line-height: 1; transform: translateY(50%); }
.colonnes .axe span:last-child { transform: translateY(-10%); }
.colonnes svg { display: block; width: 100%; height: 260px; overflow: visible; }
.colonnes .grille-fine { stroke: var(--bord); stroke-width: 1; }
.colonnes .base { stroke: var(--bord-fort); stroke-width: 1; }
.colonnes text { fill: var(--texte); font-family: var(--titres); font-size:var(--t-15, 15px); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Le mois en cours, encore incomplet, se détache des mois terminés. */
.colonnes svg svg:last-of-type .trace { fill: var(--rouge); }
.colonnes .mois { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0.45rem 0 0; padding: 0; list-style: none; color: var(--texte-2); font-size:var(--t-12, 12px); text-align: center; }
.parcours .tete { display: flex; align-items: baseline; gap: 0.5rem; margin: 0 0 0.7rem; color: var(--texte-2); }
.parcours .tete strong { color: var(--texte); }
.parcours svg { display: block; width: 100%; height: 26px; }
.parcours text { fill: var(--palette-surface); font-family: var(--titres); font-size:var(--t-15, 15px); font-weight: 600; }
.parcours text.sombre { fill: var(--texte); }
.parcours .legende { margin-top: 0.85rem; }
/* De la Chine à la livraison : une seule teinte, du plus clair au plus foncé. */
.e1 { fill: var(--teinte-d3d8de); } .e2 { fill: var(--teinte-a9b1bb); } .e3 { fill: var(--teinte-5f6873); } .e4 { fill: var(--teinte-353b43); } .e5 { fill: var(--teinte-14171a); }
.legende .e1 { background: var(--teinte-d3d8de); } .legende .e2 { background: var(--teinte-a9b1bb); } .legende .e3 { background: var(--teinte-5f6873); } .legende .e4 { background: var(--teinte-353b43); } .legende .e5 { background: var(--teinte-14171a); }
.legende b { color: var(--texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.bulle {
  position: fixed; z-index: 50; max-width: 280px; padding: 0.5rem 0.7rem; border-radius: var(--rayon-petit);
  background: var(--nuit); color: var(--palette-surface); font-size:var(--t-13, 13px); line-height: 1.4; white-space: pre-line; pointer-events: none;
  box-shadow: var(--ombre-menu);
}
.bulle[hidden] { display: none; }

/* --- Le trajet d'un véhicule, de la Chine au client ----------------------------------- */
.trajet { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 0 0 1.25rem; padding: 1.4rem 1rem 1.1rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); list-style: none; }
.trajet li { position: relative; padding: 1.6rem 0.25rem 0; color: var(--texte-3); font-size:var(--t-13, 13px); line-height: 1.25; text-align: center; }
.trajet li::before { content: ""; position: absolute; top: 0.45rem; left: 0; right: 0; height: 2px; background: var(--bord); }
.trajet li:first-child::before { left: 50%; }
.trajet li:last-child::before { right: 50%; }
.trajet li::after {
  content: ""; position: absolute; top: 0; left: 50%; width: 0.95rem; height: 0.95rem; margin-left: -0.475rem;
  border: 2px solid var(--bord-fort); border-radius: 50%; background: var(--surface);
}
.trajet li.faite { color: var(--texte-2); }
.trajet li.faite::before { background: var(--barre); }
.trajet li.faite::after { border-color: var(--barre); background: var(--barre); }
.trajet li.courante { color: var(--texte); font-weight: 600; }
.trajet li.courante::before { background: linear-gradient(to right, var(--barre) 50%, var(--bord) 50%); }
.trajet li.courante::after { top: -0.2rem; width: 1.35rem; height: 1.35rem; margin-left: -0.675rem; border: 4px solid var(--rouge-pale); background: var(--rouge); box-shadow: 0 0 0 1.5px var(--rouge); }

/* --- Connexion ------------------------------------------------------------------------ */
.accueil { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; background: var(--surface); }
.vitrine { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 3rem; background: var(--nuit); color: var(--nuit-texte); }
.vitrine::after { content: ""; position: absolute; right: -70px; top: -10%; width: 150px; height: 130%; background: var(--rouge); transform: rotate(14deg); }
.vitrine > * { position: relative; z-index: 1; }
.vitrine img { display: block; width: 180px; height: auto; }
.vitrine h2 { max-width: 16ch; margin: 0 0 1rem; color: var(--palette-surface); font-family: var(--titres); font-size:var(--t-34, 34px); font-weight: 700; line-height: 1.05; letter-spacing: 0.01em; }
.vitrine p { max-width: 40ch; margin: 0; color: var(--nuit-texte); font-size:var(--t-15, 15px); }
.vitrine ul { display: grid; gap: 0.6rem; max-width: 44ch; margin: 0; padding: 0; list-style: none; }
.vitrine li { display: flex; align-items: center; gap: 0.7rem; }
.vitrine li .icone { color: var(--palette-surface); }
.connexion { display: grid; align-content: center; justify-self: center; width: min(100%, 430px); padding: 2rem 1.5rem; }
.connexion h1 { margin-bottom: 0.4rem; }
.connexion > p { color: var(--texte-2); }
.connexion form { margin-top: 1.2rem; }
.connexion .ligne-champ { margin-bottom: 1rem; }
.connexion .bouton { width: 100%; margin-top: 0.4rem; min-height: 3rem; }
.connexion .marque-mobile { display: none; }
/* Page hors du cadre (adresse introuvable) : une carte au milieu de l'écran. */
.page-seule { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.page-seule > div { width: min(100%, 460px); padding: 2rem 2rem 1.5rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.page-seule img { display: block; width: 150px; height: auto; margin-bottom: 1.5rem; }
.page-seule h1 { margin-bottom: 0.5rem; }
.page-seule .bouton { margin-top: 0.75rem; }

/* --- Documents à imprimer -------------------------------------------------------------- */
.document { max-width: 780px; margin: 1.5rem auto; padding: 2.6rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--palette-surface); }
.document-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; padding-bottom: 1rem; border-bottom: 2px solid var(--texte); }
.document h1 { font-size:var(--t-28, 28px); }
.document-entete img { width: 140px; height: auto; }
.document .donnees { margin-bottom: 1.4rem; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
.signatures div { padding-top: 3.5rem; border-bottom: 1px solid var(--texte); font-size:var(--t-13, 13px); }
.barre-impression { display: flex; justify-content: center; gap: 0.6rem; margin: 1.2rem; }

@media (max-width: 1100px) {
  .carte.c8, .carte.c7, .carte.c5, .carte.c4 { grid-column: span 12; }
  .accueil-haut { grid-template-columns: minmax(0, 1fr); }
}

/* --- Téléphone et tablette : barre noire en haut, onglets en bas ------------------------ */
@media (max-width: 900px) {
  .cadre { grid-template-columns: minmax(0, 1fr); }
  .rail, .fil, .recherche, .profil-nom, .profil > summary > .icone { display: none; }
  .barre { min-height: 60px; padding: 0.55rem 0.9rem 0.55rem 1.05rem; gap: 0.6rem; border-bottom: 0; background: var(--nuit); color: var(--palette-surface); }
  .marque-barre { display: block; margin-right: auto; }
  .marque-barre img { display: block; width: auto; height: 40px; }
  .chercher { display: block; }
  .chercher > summary {
    display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--nuit-2); color: var(--palette-surface); list-style: none;
  }
  .chercher > summary .icone { width: 1.3rem; height: 1.3rem; }
  .chercher > form { position: absolute; left: 0; right: 0; top: 100%; display: flex; gap: 0.5rem; padding: 0.2rem 1.05rem 0.85rem; background: var(--nuit); }
  .chercher input { flex: 1; min-width: 0; min-height: 2.75rem; padding: 0.45rem 0.75rem; border: 1px solid transparent; border-radius: var(--rayon-petit); background: var(--palette-surface); color: var(--texte); font: inherit; }
  .profil > summary { padding: 0; }
  .profil > summary:hover, .profil[open] > summary { background: none; }
  .profil-menu { right: 0; }
  .profil-qui { display: grid; margin: 0 0 0.3rem; padding: 0.5rem 0.65rem 0.7rem; border-bottom: 1px solid var(--bord); line-height: 1.3; }
  .profil-qui span { color: var(--texte-2); font-size:var(--t-13, 13px); }
  .contenu { padding: 1rem 1.05rem calc(var(--onglets) + 5.5rem); }
  .entete { align-items: flex-start; margin-bottom: 1rem; }
  h1 { font-size:var(--t-28, 28px); }

  .sous-menu { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.9rem; }

  .onglets {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--onglets);
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: start;
    padding: 0.45rem 0.25rem env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--bord); background: var(--surface);
  }
  .onglets > a, .plus > summary {
    display: grid; justify-items: center; gap: 0.2rem; padding: 0.15rem 0.1rem; color: var(--texte-2);
    font-size:var(--t-12, 12px); font-weight: 600; line-height: 1.2; text-decoration: none; list-style: none;
  }
  .onglets > a .icone, .plus > summary .icone { width: 1.5rem; height: 1.5rem; }
  .onglets > a[aria-current="page"], .plus > summary.actif, .plus[open] > summary { color: var(--rouge); }
  /* « Menu » : tous les services montent du bas de l'écran ; toucher le voile referme la feuille. */
  .plus[open] > summary::before { content: ""; position: fixed; left: 0; right: 0; top: 0; bottom: var(--onglets); background: var(--teinte-rgb-16-18-22-0_45); }
  .feuille {
    position: fixed; left: 0; right: 0; bottom: var(--onglets); max-height: 72vh; overflow-y: auto;
    padding: 0.9rem 0.75rem 0.75rem; border-radius: 18px 18px 0 0; background: var(--surface); box-shadow: 0 -12px 32px var(--teinte-rgb-16-18-22-0_18);
  }
  /* Dans la feuille, chaque service porte son nom en clair ; la direction ouvre sa page d'un geste. */
  .feuille .menu-titre {
    display: flex; align-items: center; gap: 0.6rem; min-height: 2.6rem; margin: 0.5rem 0 0; padding: 0.3rem 0.65rem;
    border-radius: var(--rayon-petit); color: var(--texte); font-size:var(--t-15, 15px); font-weight: 600;
  }
  .feuille .menu-titre:first-child { margin-top: 0; }
  .feuille .menu-titre span { flex: 1; min-width: 0; }
  .feuille .menu-titre small { color: var(--texte-3); font-size:var(--t-13, 13px); font-weight: 600; }
  .feuille .menu-titre .icone { width: 1.05rem; height: 1.05rem; color: var(--texte-3); }
  .feuille a.menu-titre:hover, .feuille a.menu-titre[aria-current="page"] { background: var(--surface-2); color: var(--texte); }
  .feuille .menu a { padding: 0.8rem 0.65rem; color: var(--texte); font-size:var(--t-15, 15px); }
  .feuille .menu a:hover, .feuille .menu a[aria-current="page"] { background: var(--surface-2); color: var(--texte); }
  .feuille .menu a[aria-current="page"]::before { left: 0; }
  .feuille .menu .icone, .feuille .menu a:hover .icone, .feuille .menu a[aria-current="page"] .icone { color: var(--texte-2); }

  /* L'action principale d'une liste : un bouton rouge rond, au-dessus des onglets. */
  .bouton.flottant {
    position: fixed; z-index: 25; right: 1.05rem; bottom: calc(var(--onglets) + 1rem); width: 3.75rem; height: 3.75rem; min-height: 0; padding: 0;
    border-radius: 18px; box-shadow: 0 8px 18px var(--teinte-rgb-16-18-22-0_28);
  }
  .bouton.flottant .icone { width: 1.75rem; height: 1.75rem; }
  .bouton.flottant span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  .phare { padding: 1.2rem 3.4rem 1.1rem 1.2rem; }
  .phare .grand { font-size:var(--t-34, 34px); }
  .trajet { grid-template-columns: minmax(0, 1fr); padding: 1rem 1.25rem; }
  .trajet li { padding: 0.35rem 0 0.35rem 2rem; text-align: left; }
  .trajet li::before, .trajet li:first-child::before, .trajet li:last-child::before { top: 0; bottom: 0; left: 0.45rem; right: auto; width: 2px; height: auto; }
  .trajet li::after { top: 0.4rem; left: 0; margin-left: 0; }
  .trajet li.courante::before { background: linear-gradient(to bottom, var(--barre) 50%, var(--bord) 50%); }
  .trajet li.courante::after { top: 0.25rem; left: -0.2rem; margin-left: 0; }
  .accueil { grid-template-columns: minmax(0, 1fr); }
  .vitrine { display: none; }
  .connexion .marque-mobile { display: block; width: 150px; height: auto; margin-bottom: 1.5rem; }
}

/* --- Téléphone : une colonne, chiffres et filtres resserrés ---------------------------------- */
@media (max-width: 640px) {
  .grille-champs { grid-template-columns: minmax(0, 1fr); }
  .situation { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .situation > div { padding: 0.8rem 0.9rem; }
  /* Deux tuiles par rangée : un montant à treize chiffres doit encore tenir sur une ligne. */
  .situation dd { font-size: var(--t-22, 22px); }
  .entete .situation dd { font-size:var(--t-22, 22px); }
  .entete .situation > div { text-align: left; }
  .entete .situation dt { justify-content: flex-start; }
  .phare .secondaire { display: none; }
  .phare dl > div { flex: 0 1 auto; }
  .barres .ligne { grid-template-columns: minmax(0, 1fr) max-content max-content; grid-template-areas: "nom valeur part" "trait trait trait"; gap: 0.3rem 0.6rem; }
  .barres .nom { grid-area: nom; }
  .barres .trait { grid-area: trait; }
  .barres .valeur { grid-area: valeur; }
  .barres .part { grid-area: part; }
  .barres .titres { display: none; }
  .sur-telephone { display: inline; }
  .barres svg { height: 6px; }
  .colonnes .axe { display: none; }
  .colonnes { grid-template-columns: minmax(0, 1fr); }
  .colonnes svg { height: 200px; }
  .colonnes .mois { grid-column: 1; font-size:var(--t-12, 12px); }
  .filtres { padding: 0.75rem; }
  .filtres label { flex: 1 1 9rem; }
  .filtres input[type="search"] { min-width: 0; width: 100%; }
  .filtres label:first-of-type { flex-basis: 100%; }
  /* Les filtres secondaires se replient derrière le bouton « Filtres » (posé par le script). */
  .bascule-filtres { display: inline-flex; }
  .filtres.repliable:not(.ouvert) label:not(:first-of-type) { display: none; }
  .filtres.repliable .bascule-filtres { order: 1; }
  .filtres.repliable label:not(:first-of-type) { order: 2; }
  .filtres.repliable > .bouton:not(.bascule-filtres) { order: 3; }
  .filtres.repliable.ouvert .bascule-filtres { flex: 1 1 100%; border-color: var(--texte); color: var(--texte); }
  .puces { margin-bottom: 0.9rem; }
  .puces li { max-width: 100%; }
  .puces a { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .outils { width: 100%; }
  .formulaire { padding: 1.1rem; }
  .donnees.origine { grid-template-columns: fit-content(45%) minmax(0, 1fr); padding: 1rem 1.05rem; }
  .donnees dd.nombre { white-space: normal; }
  .contenu .bouton { max-inline-size: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }
  .bloc, .carte { padding: 1rem 1.05rem 1.1rem; }
  .document { margin: 0; padding: 1.25rem; }

}

/* --- Téléphone et tablette : une carte par ligne à la place des tableaux ---------------------- */
@media (max-width: 900px) {
  .defilant { overflow: visible; border: 0; border-radius: 0; background: none; }
  .registre, .registre tbody, .registre tfoot, .registre tr, .registre td { display: block; }
  .registre thead { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .registre tr { margin-bottom: 0.65rem; padding: 0.8rem 1rem 0.85rem; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
  .registre tbody tr:hover td { background: none; }
  .registre td { padding: 0.18rem 0; border: 0; text-align: end; overflow-wrap: anywhere; }
  .registre td::after { content: ""; display: block; clear: both; }
  .registre td[data-titre]::before { content: attr(data-titre); float: inline-start; max-inline-size: 46%; margin-inline-end: 0.75rem; color: var(--texte-2); font-size:var(--t-14, 14px); font-weight: 700; text-align: start; }
  .registre td:first-child { padding-bottom: 0.35rem; font-size:var(--t-15, 15px); font-weight: 700; text-align: start; }
  .registre td:first-child::before { content: none; }
  .registre td.creux { display: none; }
  /* Une valeur faite d'une liste ou d'un formulaire se lit sous son libellé, alignée à gauche. */
  .registre td:has(> ul, > ol, > p, > details, > form) { text-align: start; }
  .registre td:has(> ul, > ol, > p, > details, > form)::before { float: none; display: block; max-width: none; margin: 0 0 0.25rem; }
  .registre .nombre, .registre .fixe, .registre .nombre .detail.ligne { white-space: normal; }
  .registre .etat { max-inline-size: 100%; white-space: normal; }
  .registre td.large { min-width: 0; }
  .registre td.vide { padding: 1.5rem 0.5rem; font-size:var(--t-15, 15px); font-weight: 600; text-align: center; }
  .registre tfoot tr { border-color: var(--texte); }
  .registre tfoot td { border: 0; background: none; }
  .seulement-carte { display: revert; }
  .seulement-table { display: none; }
  .panneau.dans-ligne { width: 100%; text-align: left; }
  /* Le panneau d'une action s'ouvre sous la rangée de boutons, sur toute la largeur de l'écran. */
  .actions { position: relative; }
  .actions > .action { position: static; }
  .actions .panneau, .actions .panneau.a-droite { left: 0; right: 0; width: auto; }
  .comparaison td.fichier, .comparaison th.fichier { border-left: 0; }
  /* Dans une carte du tableau de bord, les lignes se suivent sans cadre, séparées d'un filet. */
  .carte.sans-marge .registre tr { margin: 0; padding: 0.8rem 1.05rem; border: 0; border-bottom: 1px solid var(--bord); border-radius: 0; }
  .carte.sans-marge .registre tbody tr:last-child, .carte.sans-marge .registre tfoot tr { border-bottom: 0; }
  .carte.sans-marge .registre tfoot tr { border-top: 1px solid var(--bord-fort); }

  /* La carte d'une commande : numéro et état, véhicule, VIN, showroom et date, puis versé, reste et prix. */
  .registre.commandes tr {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 0.9rem; align-items: baseline;
    grid-template-areas: "titre titre etat" "objet objet objet" "vin vin vin" "client client client" "lieu lieu date" "jauge jauge jauge" "verse reste prix";
  }
  .registre.commandes td { padding: 0; text-align: left; }
  .registre.commandes td::after { content: none; }
  .registre.commandes td[data-titre]::before { float: none; max-width: none; margin-right: 0.3rem; font-family: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif); font-size:var(--t-13, 13px); font-weight: 600; letter-spacing: 0; }
  .registre.commandes .z-titre, .registre.commandes .z-verse { display: contents; }
  .registre.commandes .z-titre > a { grid-area: titre; }
  .registre.commandes td.vide { grid-column: 1 / -1; }
  .registre.commandes .z-titre > .client { grid-area: client; margin-top: 0.3rem; color: var(--texte); font-size:var(--t-14, 14px); font-weight: 600; }
  .registre.commandes .z-titre > .lieu { grid-area: lieu; color: var(--texte-2); font-size:var(--t-13, 13px); font-weight: 600; letter-spacing: 0.02em; }
  .registre.commandes .z-etat { grid-area: etat; justify-self: end; }
  .registre.commandes .z-objet { grid-area: objet; margin-top: 0.15rem; font-size:var(--t-15, 15px); font-weight: 600; }
  .registre.commandes .z-objet .discret { font-weight: 600; }
  .registre.commandes .z-vin { grid-area: vin; margin-top: 0.3rem; }
  .registre.commandes .z-client { grid-area: client; margin-top: 0.3rem; font-size:var(--t-14, 14px); font-weight: 600; }
  .registre.commandes .z-date { grid-area: date; justify-self: end; color: var(--texte-2); font-size:var(--t-13, 13px); }
  .registre.commandes .z-titre > .lieu, .registre.commandes .z-date { margin-top: 0.35rem; }
  .registre.commandes .z-verse > .jauge { grid-area: jauge; margin: 0.6rem 0 0.5rem; }
  .registre.commandes .z-verse > .montant { grid-area: verse; }
  .registre.commandes .z-verse > .montant::before { content: "Versé "; color: var(--texte-2); font-family: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif); font-size:var(--t-13, 13px); font-weight: 600; letter-spacing: 0; }
  :where(html[lang="en"]) .registre.commandes .z-verse > .montant::before { content: "Paid "; }
  .registre.commandes .z-reste { grid-area: reste; }
  .registre.commandes .z-prix { grid-area: prix; justify-self: end; font-size:var(--t-17, 17px); font-weight: 700; }
  .registre.commandes .z-prix::after { content: " DA"; display: inline; }
  .registre.commandes .montant, .registre.commandes .z-reste, .registre.commandes .z-prix { font-family: var(--titres); font-size:var(--t-17, 17px); font-weight: 600; letter-spacing: 0.01em; }
  .registre.commandes .z-reste .entree, .registre.commandes .z-reste .sortie, .registre.commandes .z-reste .discret { font-family: var(--police, "IBM Plex Sans Arabic", system-ui, sans-serif); font-size:var(--t-13, 13px); letter-spacing: 0; }
  .registre.commandes .z-prix { font-size:var(--t-17, 17px); font-weight: 700; }
  .registre.commandes br, .registre.commandes .seulement-table { display: none; }
  /* Sur tablette, les cartes se rangent sur deux colonnes. */
  .registre tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0.65rem; }
  .registre tbody tr { margin-bottom: 0; }
  .registre tfoot tr { margin-top: 0.65rem; }
  .registre td.vide { grid-column: 1 / -1; }
  .registre tbody tr:has(> td.vide) { grid-column: 1 / -1; }
  .carte.sans-marge .registre tbody { display: block; }
  .carte.sans-marge .registre tfoot tr { margin-top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .bouton, .menu a, .champ, .recherche input, .puces a, .a-traiter a { transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
}
@media print {
  body { background: var(--palette-surface); }
  .rail, .barre, .onglets, .sous-menu, .bandeau-essai, .filtres, .puces, .outils, .actions { display: none; }
  .cadre { display: block; }
  .contenu { max-width: none; padding: 0; }
  .document { margin: 0; padding: 0; border: 0; }
  .barre-impression { display: none; }
}

/* La charte graphique : le logo sur ses deux fonds, les deux couleurs. */
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.logos figure { margin: 0; padding: 1.5rem; border: 1px solid var(--bord-fort); border-radius: var(--rayon); background: var(--palette-surface); text-align: center; }
.logos figure.sombre { border-color: var(--teinte-000000); background: var(--teinte-000000); color: var(--palette-surface); }
.logos img { width: min(100%, 300px); height: auto; }
.logos figcaption { margin-top: 0.75rem; font-size:var(--t-13, 13px); }
.nuancier { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.nuancier li { overflow: hidden; border: 1px solid var(--bord-fort); border-radius: var(--rayon); background: var(--surface); }
.nuancier li::before { content: ""; display: block; height: 84px; }
.nuancier .noir::before { background: var(--teinte-000000); }
.nuancier .rouge::before { background: var(--teinte-ff0000); }
.nuancier div { padding: 0.75rem 1rem; }
.nuancier strong { display: block; font-family: var(--titres); font-size:var(--t-17, 17px); }
.nuancier span { display: block; font-size:var(--t-13, 13px); font-variant-numeric: tabular-nums; }
.devise { margin: 0 0 1.25rem; font-family: var(--titres); font-size:var(--t-22, 22px); font-weight: 700; }

/* --- Parc : la liste de contrôle, un bloc par point, et les relevés ligne à ligne --- */
.points { margin: 0 0 1rem; }
.point {
  display: grid; grid-template-columns: minmax(11rem, 1.1fr) auto minmax(12rem, 2fr); gap: 0.5rem 1.25rem; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid var(--bord);
}
.point .choix { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.point .choix label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; cursor: pointer; }
.point .choix input { width: 1.15rem; height: 1.15rem; accent-color: var(--texte); }
.releve { margin: 0.25rem 0 1rem; padding: 0; list-style: none; color: var(--texte-2); }
.releve li { padding: 0.3rem 0; border-bottom: 1px solid var(--bord); }
.releve li:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .point { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* --- Avant la remise au client : lavage et contrôle, quatre photos chacun (décision du 20/11/2026) ---------- */
.etapes-remise { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.8rem; margin: 0 0 1.25rem; }
.etape-remise h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; }
.repli-photos { margin-top: 0.6rem; }
.repli-photos > summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; font-weight: 600; }
.photos-etape { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.photos-etape li { display: flex; flex-direction: column; gap: 0.25rem; }
.photos-etape img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--fond); }
.photos-etape .vue { font-size:var(--t-13, 13px); color: var(--texte-2); }
.formulaire-photos input[type="file"] { min-height: 2.75rem; margin-bottom: 0.6rem; }

@media (min-width: 801px) {
  .accueil { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
  .vitrine { justify-content:center; align-items:flex-start; gap:clamp(1.4rem, 4vh, 3.5rem); padding:clamp(2rem, 7vw, 8rem); }
  .vitrine::after { top:0; right:0; width:6px; height:100%; transform:none; }
  .vitrine h2 { font-size: var(--t-34, 34px); }
  .vitrine ul { border-top:1px solid var(--teinte-51545b); padding-top:1.25rem; }
  .connexion { width:min(100%, 480px); }
}

.aide-appareil { border-inline-start: 3px solid var(--rouge); background: var(--surface-2); padding:.75rem 1rem; margin-block:.4rem 1rem; }
.aide-appareil h2 { font-size:var(--t-17, 17px); margin:0 0 .4rem; }
.aide-appareil p { margin:.4rem 0; }
@media (max-width: 800px) {
  .accueil .connexion { align-content:start; padding-block-start:clamp(1.25rem, 8svh, 4rem); padding-block-end:2rem; }
  .connexion .marque-mobile { width:clamp(7.2rem, 30vw, 9.4rem); margin-bottom:1.4rem; }
}
