/*
  Feuille unique, sans framework. La palette est celle de la marque
  (tailwind.config.js) ; les contrastes retenus tiennent le AA sur fond clair —
  d'où `teal-700` pour le texte et le `teal` plein réservé aux aplats.
*/

:root {
  --navy: #00163d;
  --navy-deep: #0a192c;
  --navy-100: #e6ebf2;
  --navy-50: #f4f7fa;
  --teal: #009ea7;
  --teal-700: #00727a;
  --teal-100: #e0f3f4;
  --orange: #ef8200;
  --danger: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--navy-50);
  color: var(--navy);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--teal-700); }

/* ------------------------------------------------------------ structure -- */

.page { max-width: 68rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 1.25rem; }
h2 { font-size: 1.05rem; margin: 1.75rem 0 0.6rem; }

.card {
  background: #fff;
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 2px rgba(0, 22, 61, 0.06);
}

.card--narrow { max-width: 24rem; margin: 3rem auto; }
.card-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.card-head h1 { margin: 0 0.4rem 0 0; }

/* --------------------------------------------------------- formulaires -- */

.stack { display: grid; gap: 1rem; }
.stack label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }

input, select, textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c8d2e0;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font-weight: 400;
}

input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--teal-700);
  outline-offset: 2px;
}

textarea { resize: vertical; }

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--navy);
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn--ghost { background: #fff; color: var(--navy); }

.link {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.link--danger { color: var(--danger); font-size: 0.9rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.filters input[name="q"] { min-width: 15rem; flex: 1; }
.check { display: flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }

/* --------------------------------------------------------------- listes -- */

.counters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.counters a {
  display: block;
  padding: 0.5rem 0.85rem;
  background: #fff;
  border: 1px solid var(--navy-100);
  border-radius: 999px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
}

.counters b { color: var(--teal-700); }

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  overflow: hidden;
}

.table th, .table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--navy-100); }
.table th { background: var(--navy-50); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--teal-100); }

/* Une demande jamais traitée se repère sans lire la colonne « Statut ». */
.is-new td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

.nowrap { white-space: nowrap; }
.muted { color: #4a5a72; }
.small { font-size: 0.8rem; word-break: break-word; }
.empty { padding: 2.5rem; text-align: center; color: #4a5a72; background: #fff; border-radius: 12px; }

.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--navy-100);
}

.tag--nouveau { background: #ffe8cc; color: #8a4b00; }
.tag--en-cours { background: var(--teal-100); color: var(--teal-700); }
.tag--traite { background: #dcf3e3; color: #1a6b39; }
.tag--archive { background: var(--navy-100); color: #4a5a72; }
.tag--spam { background: #fde2e0; color: var(--danger); }

.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.back { margin: 0 0 1rem; }

.facts { display: grid; grid-template-columns: 10rem 1fr; gap: 0.4rem 1rem; margin: 1.25rem 0 0; }
.facts dt { font-weight: 700; font-size: 0.85rem; }
.facts dd { margin: 0; }

/* `pre-wrap` : les retours à la ligne du visiteur sont porteurs de sens. */
.message { white-space: pre-wrap; background: var(--navy-50); padding: 1rem; border-radius: 8px; }

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: #fde2e0;
  color: var(--danger);
  font-size: 0.9rem;
}

/* Une information, pas une erreur : même gabarit, couleurs de la marque. */
.alert--info {
  background: var(--navy-50);
  color: var(--navy);
}

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 0.5rem; }
  /* Masque « Formulaire », déductible du reste de la ligne. Restreint au
     tableau des demandes : la même colonne porte le nom du produit dans le
     catalogue, et l'y masquer rendrait la liste illisible. */
  .table--demandes th:nth-child(2), .table--demandes td:nth-child(2) { display: none; }
  /* Le courriel aussi : sur un téléphone, il poussait « Statut » — l'information la plus utile —
     hors de l'écran. Le courriel reste sur la fiche de la demande. */
  .table--demandes th:nth-child(4), .table--demandes td:nth-child(4) { display: none; }
}

/* ============================================================== contenu == */

.page--large { max-width: 84rem; }

.bandeau {
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.bandeau--ok { background: #dcf3e3; color: #14532d; }
.bandeau--bloque { background: #fde2e0; color: var(--danger); }

.aide { color: #4a5a72; font-size: 0.85rem; margin: 0 0 0.9rem; }
.liste-simple { margin: 0; padding-left: 1.1rem; }
.liste-simple li { margin-bottom: 0.35rem; }

/* -------------------------------------------------------------- pastilles -- */

.tag--ok { background: #dcf3e3; color: #1a6b39; }
.tag--ul { background: var(--teal-100); color: var(--teal-700); }
.tag--masque { background: var(--navy-100); color: #4a5a72; }

/* Orange et non rouge : un champ vide n'est pas une faute, c'est un travail
   en cours. Le rouge est réservé à ce qui empêche de publier. */
.tag--manque { background: #ffe8cc; color: #8a4b00; }

.est-masque td:first-child { box-shadow: inset 3px 0 0 #94a3b8; }
.est-masque td:nth-child(2) { opacity: 0.6; }
.est-bloquant td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.est-avertissement td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

/* ------------------------------------------------------------ formulaires -- */

.grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grille label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.grille .large { grid-column: 1 / -1; }

/*
  Les deux langues côte à côte, ligne à ligne. Le point important est l'en-tête
  collant : sur une fiche de quarante champs, sans lui, on perd de vue laquelle
  des deux colonnes on est en train de remplir.
*/
.bilingue { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.25rem; }

.bilingue > .entete {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding: 0.45rem 0;
  border-bottom: 2px solid var(--navy-100);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bilingue label { display: grid; gap: 0.3rem; }
.bilingue .libelle { font-weight: 600; font-size: 0.82rem; color: #4a5a72; }

/* Un champ vide se repère sans lire, dans l'une ou l'autre colonne. */
.manque { border-color: var(--orange); background: #fffaf3; }

/* ---------------------------------------------------------------- lignes -- */

/* Cinq colonnes de saisie ne tiennent pas sous 60 rem : on fait défiler le
   tableau seul, plutôt que la page entière en travers. */
.defilable { overflow-x: auto; margin-bottom: 0.5rem; }

.table--lignes { table-layout: auto; }
.table--lignes td { padding: 0.3rem 0.4rem; vertical-align: middle; }
.table--lignes th { padding: 0.5rem 0.4rem; }
.table--lignes input { width: 100%; min-width: 9rem; padding: 0.4rem 0.5rem; }
.table--lignes tbody tr:hover { background: transparent; }

.col-rang { width: 4.5rem; }
.col-ops { width: 7rem; }
.rang-champ { min-width: 0 !important; width: 3.2rem !important; text-align: center; }
.ligne-neuve td { background: var(--navy-50); }
.ligne-neuve input::placeholder { color: #8a97ab; }

.rang {
  border: 1px solid #c8d2e0;
  background: #fff;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.rang:disabled { opacity: 0.35; cursor: default; }
.rang--danger { color: var(--danger); border-color: #eab8b4; }
.reprendre { font-size: 0.85rem; color: #4a5a72; margin: 0 0 0.5rem; }
.reprendre select { padding: 0.3rem 0.45rem; }

/* La barre d'enregistrement suit le défilement : sur une fiche longue, avoir à
   remonter pour valider est le meilleur moyen de perdre une saisie. */
.barre-enregistrer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: #fff;
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  box-shadow: 0 -2px 10px rgba(0, 22, 61, 0.08);
}

code {
  background: var(--navy-50);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* --------------------------------------------------------- publication -- */

.tag--en-cours { background: #ffe8cc; color: #8a4b00; }
.tag--reussie { background: #dcf3e3; color: #1a6b39; }
.tag--echouee { background: #fde2e0; color: var(--danger); }

.journal,
.diff {
  background: var(--navy-deep);
  color: #d7e0ec;
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  font: 12.5px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace;
  margin: 0;
  /* `pre-wrap` sur le journal seulement : un diff doit garder ses colonnes,
     un message d'erreur de GitHub doit pouvoir se replier. */
  white-space: pre;
}

.journal { white-space: pre-wrap; word-break: break-word; }

.diff span { display: block; }
.diff .d-plus { color: #7ee0a1; }
.diff .d-moins { color: #ff9d94; }
.diff .d-repere { color: #8fb3d9; }

/* ------------------------------------------------- arbre de copie -- */

/* Un groupe ou une liste occupe les deux colonnes : c'est un bloc de sens,
   pas un champ, et le couper en deux le rendrait illisible. */
.pleine-largeur { grid-column: 1 / -1; }

.groupe {
  border: 1px solid var(--navy-100);
  border-radius: 10px;
  padding: 0.4rem 1rem 1rem;
  margin: 0.5rem 0 1rem;
  min-width: 0; /* sans quoi un fieldset refuse de rétrécir dans une grille */
}

.groupe > legend {
  padding: 0 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-700);
}

/* Sans légende, le cadre n'entoure plus rien de nommé : il devient du bruit. */
.groupe--nu { border: 0; padding: 0; margin: 0; }

.bilingue--simple { grid-template-columns: 1fr; max-width: 42rem; }

.item-liste {
  border-left: 3px solid var(--navy-100);
  padding: 0.3rem 0 0.3rem 0.9rem;
  margin-bottom: 1rem;
}

.item-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.rang-etiquette {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--navy-100);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.bilingue .aide { margin: -0.4rem 0 0.4rem; }
.bilingue label .aide { margin: 0; }

/* Un formulaire par bouton dans une cellule de tableau : il ne doit pas
   pousser la ligne à la ligne suivante. */
.en-ligne { display: inline; }

.cases { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin: 1rem 0 0; }
.cases .link--danger { margin-left: auto; }

/* --- Vignettes des visuels ------------------------------------------------
 *
 * Servies par le site en ligne, jamais par le backend : voir cms/apercus.py.
 * D'où la boîte fixe et le `contain` — les rendus produit, les photos
 * d'installation et la plaque de certification n'ont pas le même format, et
 * une vignette qui change de taille d'une ligne à l'autre rendrait la liste
 * illisible.
 *
 * Fond clair plutôt que blanc : les rendus produit sont détourés sur fond
 * transparent, et plusieurs batteries sont blanches. */
.visuel { display: flex; align-items: flex-start; gap: 1rem; }
.visuel__corps { flex: 1; min-width: 0; }

.vignette {
  flex: none;
  box-sizing: border-box;
  width: 7rem;
  height: 7rem;
  padding: 0.3rem;
  border: 1px solid var(--navy-100);
  border-radius: 8px;
  background: var(--navy-50);
  object-fit: contain;
}

/* Visuel pas encore publié : ses dérivés ne sont pas en ligne, donc absents du
   manifeste. On le dit, plutôt que de laisser un cadre d'image cassée. */
.vignette--absente {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.3;
  text-align: center;
}

.table .vignette { width: 4.5rem; height: 4.5rem; }

@media (max-width: 40rem) {
  .visuel { flex-direction: column; }
}

@media (max-width: 60rem) {
  .bilingue { grid-template-columns: 1fr; }
  /* Une seule colonne : les en-têtes « Français » / « English » n'ont plus de
     sens, le libellé de chaque champ suffit à se repérer. */
  .bilingue > .entete { display: none; }
  .grille { grid-template-columns: 1fr; }
}

/* ============================================================ visiteurs == */
/*
  La section de fréquentation. Trois familles seulement — les tuiles chiffrées,
  les barres, et quelques pastilles — parce que tout le reste (`.table`,
  `.filters`, `.pager`, `.card`, `.facts`) sert déjà ailleurs et n'avait aucune
  raison d'être redéfini.

  Une teinte unique pour tous les graphiques : le teal de la marque. Ces
  graphiques répondent tous à « lequel est le plus gros », c'est-à-dire à une
  magnitude, qui se code par la longueur. Une couleur par série coderait une
  identité que personne ne cherche — et la palette de marque ne tient de toute
  façon pas comme jeu catégoriel : navy-700 et teal-700 ne se distinguent pas
  l'un de l'autre en vision déficiente, et l'orange tombe à 2,6:1 sur fond clair.
*/

.entete-ecran {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.entete-ecran h1 { margin-bottom: 0; }

/* Navigation interne à la section. Distincte de `.onglets`, qui vit dans la
   barre sombre du haut : ici le fond est clair, et le contraste s'inverse. */
.onglets-secondaires, .periodes {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.onglets-secondaires a, .periodes a {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  color: #4a5a72;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.onglets-secondaires a:hover, .periodes a:hover { background: var(--navy-100); }

.onglets-secondaires a[aria-current], .periodes a[aria-current] {
  background: var(--navy);
  color: #fff;
}

.periodes { margin: 1.25rem 0 0; }

/* ------------------------------------------------------------- icônes -- */

/* `currentColor` : la même icône suit le teal d'une tuile et le gris d'une
   ligne de tableau, sans être redéclinée. */
.ico {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  vertical-align: -0.2em;
}

.ico--petit { width: 0.95rem; height: 0.95rem; }

/* --------------------------------------------------------- tuiles -- */

.tuiles {
  display: grid;
  /* 12 rem et non 11 : « 17 min 50 s » passait à la ligne entre le nombre et
     son unité, ce qui se lisait « 17 min 50 » puis « s ». */
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.tuile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  background: #fff;
}

.tuile-ico { color: var(--teal-700); }

.tuile-valeur {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tuile-libelle { color: #4a5a72; font-size: 0.85rem; font-weight: 600; }
.tuile-note { color: #64748b; font-size: 0.75rem; }

.tuile--direct { border-color: var(--teal); }

/* Réservée à ce qui change vraiment sous les yeux. L'étendre à autre chose lui
   ferait perdre sa seule fonction : signaler que la page est vivante. */
.pastille {
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55);
  animation: battement 2s ease-out infinite;
}

@keyframes battement {
  70%  { box-shadow: 0 0 0 0.5rem rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Éteinte : plus de battement reçu depuis plus d'un intervalle. Le visiteur est
   peut-être déjà parti, et la pastille verte de ses voisins ne doit pas laisser
   croire le contraire. */
.pastille--muette { background: #94a3b8; animation: none; box-shadow: none; }

/* Une animation en boucle sur une page qui se recharge toute seule est
   exactement ce que ce réglage système demande de calmer. */
@media (prefers-reduced-motion: reduce) {
  .pastille { animation: none; }
}

/* ------------------------------------------------------------ blocs -- */

.bloc {
  margin: 1.5rem 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  background: #fff;
}

.bloc-titre {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--navy);
  font-size: 1rem;
}

.bloc-titre .ico { color: var(--teal-700); }

.colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 0 1rem;
}

/* --------------------------------------------------- barres horizontales -- */

/* Un vrai tableau, et non un SVG : le chiffre reste sélectionnable, la lecture
   d'écran fonctionne sans description alternative, et la « vue tableau » qu'on
   doit à toute visualisation accessible est alors le graphique lui-même. */
.table--barres { table-layout: auto; border: 0; }
.table--barres td, .table--barres th { border: 0; padding: 0.3rem 0.5rem 0.3rem 0; }
.table--barres tbody tr:hover { background: transparent; }

/* Les libellés de classement sont des `th`, mais ce ne sont pas des en-têtes de
   colonne : ce sont des données. La casse forcée et le fond gris de `.table th`
   sont donc à défaire — « /PRODUITS/S48200/ » n'est pas l'adresse réelle de la
   page, et le crier n'aide personne. */
/* Sélecteur à deux classes, et c'est nécessaire : `.table th` porte une classe
   et un élément, ce qui l'emporterait sur un `.barre-cle` seul — les libellés
   restaient en majuscules sur fond gris malgré la règle. */
.table--barres .barre-cle {
  max-width: 14rem;
  overflow: hidden;
  background: transparent;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.barre-piste { width: 100%; min-width: 4rem; }

.barre {
  display: block;
  height: 0.6rem;
  min-width: 2px;
  border-radius: 4px;
  background: var(--teal);
}

/* La valeur est écrite à côté de chaque barre : lire le graphique ne doit pas
   exiger de survoler quoi que ce soit. */
.barre-valeur {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* ----------------------------------------------------- barres verticales -- */

/* Le seul graphique en SVG : une suite temporelle se lit horizontalement, ce
   qu'un tableau ne rend pas. */
.graphe { width: 100%; height: var(--hauteur, 120px); }
.graphe svg { width: 100%; height: 100%; overflow: visible; }

.barre-v { fill: var(--teal); }

/* Un jour sans visite garde sa place, en trait fantôme : le retirer ferait
   mentir la forme de la période. */
.barre-v--vide { fill: var(--navy-100); }

.axe {
  display: flex;
  justify-content: space-between;
  margin: 0.4rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
}

/* ---------------------------------------------------------- pastilles -- */

.tag--ordinateur { background: var(--navy-100); color: #33415c; }
.tag--mobile { background: var(--teal-100); color: var(--teal-700); }
.tag--tablette { background: #ede9fe; color: #5b21b6; }
.tag--neutre { background: var(--navy-100); color: #4a5a72; }
.tag--robot { background: #ffe8cc; color: #8a4b00; }
.tag--en-ligne { background: #dcf3e3; color: #14532d; }

.tag .ico { vertical-align: -0.15em; }

@media (max-width: 60rem) {
  /* L'adresse IP et le fournisseur sont ce qu'on regarde en dernier : sur un
     téléphone, ils poussent la page vue hors de l'écran. Le parcours du
     visiteur, lié depuis la ligne, les porte toujours. */
  .table--direct .colonne-large,
  .table--historique .colonne-large { display: none; }
}

/* L'accueil de l'espace distributeur : trois cartes cliquables. */
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--navy); }
.cartes .card h2 { margin-top: 0; }

/* ======================================================== navigation == */

/*
  Une structure, deux affichages. Sur ordinateur : une barre latérale sombre. Sous 56 rem
  (environ 900 px) : une barre étroite en haut, quatre onglets en bas, une feuille « Plus ».
  Aucun JavaScript : la feuille s'ouvre par `:target`.
*/

.shell { display: flex; min-height: 100vh; }

.sidebar {
  flex: none;
  width: 264px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 22px 14px 16px;
  background: var(--navy);
  color: #fff;
}

.sidebar__logo { display: block; padding: 2px 10px 6px; }
.sidebar__logo svg { display: block; }

.sidebar__nav { display: flex; flex-direction: column; gap: 1.25rem; flex-grow: 1; }

.nav-groupe { display: flex; flex-direction: column; gap: 2px; }

.nav-groupe__titre {
  padding: 0 12px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #9db0cb;
}

.nav-lien {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: #d6deea;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-lien svg { flex: none; color: #aebbd0; }
.nav-lien:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-lien[aria-current="page"] { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 700; }
.nav-lien[aria-current="page"] svg { color: #4fd1d8; }

/* Le repère turquoise de l'entrée active, collé au bord de la barre. */
.nav-lien[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  width: 4px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: var(--teal);
}

.nav-lien__texte { flex-grow: 1; }
.nav-lien--discret { height: 36px; font-size: 0.84rem; color: #c3cfe0; }

.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 11px;
  background: var(--teal);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar__bas {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.usager-carte {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.usager-carte__lien {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
  min-width: 0;
  text-decoration: none;
  color: #fff;
}

.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy);
  font-weight: 800;
  font-size: 0.8125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.usager-carte__texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.usager-carte__nom { font-weight: 600; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usager-carte__role { font-size: 0.78rem; color: #aebbd0; }

.usager-carte__sortie {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #aebbd0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.usager-carte__sortie:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.nav-lien:focus-visible,
.tab:focus-visible,
.feuille__lien:focus-visible,
.usager-carte__lien:focus-visible,
.usager-carte__sortie:focus-visible,
.sidebar__logo:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.shell__main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.shell__main .page { width: 100%; box-sizing: border-box; }

.appbar {
  flex: none;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  background: #fff;
  border-bottom: 1px solid var(--navy-100);
}

.fil { display: flex; align-items: center; gap: 8px; color: #4a5a72; font-size: 0.875rem; }
.fil strong { color: var(--navy); font-weight: 600; }

/* Réservés au téléphone. */
.appbar__marque, .appbar__titre, .appbar__avatar { display: none; }
.tabbar, .feuille { display: none; }

/* Sans session (connexion, liens d'invitation) : une simple bande avec le logo. */
.entete-simple { padding: 1rem 1.5rem; background: var(--navy); }
.entete-simple svg { display: block; }

@media (max-width: 56.25rem) {
  .sidebar { display: none; }

  .appbar { height: 60px; padding: 0 16px; }
  .fil { display: none; }
  .appbar__marque { display: flex; }
  .appbar__titre { display: block; flex-grow: 1; font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; }
  .appbar__avatar { display: inline-flex; width: 34px; height: 34px; font-size: 0.78rem; }

  /* La place des onglets du bas : sans elle, le dernier élément de chaque page passerait dessous. */
  .shell__main .page { padding: 1.25rem 1rem 7rem; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: 72px;
    padding: 0 6px env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid var(--navy-100);
  }

  .tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #4a5a72;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
  }

  .tab[aria-current="page"] { color: var(--teal-700); font-weight: 700; }

  .tab[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--teal);
  }

  .tab__icone { position: relative; display: inline-flex; }
  .badge--tab { position: absolute; top: -6px; right: -10px; min-width: 17px; height: 17px; font-size: 0.66rem; background: var(--navy); color: #fff; }

  .feuille { position: fixed; inset: 0; z-index: 30; }
  .feuille:target { display: block; }
  .feuille__voile { position: absolute; inset: 0; background: rgba(0, 22, 61, 0.5); }

  .feuille__panneau {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 22px 22px 0 0;
  }

  .feuille__poignee { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: #cfd9e6; margin-bottom: 8px; }
  .feuille__titre { padding: 4px 10px 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #4a5a72; }

  .feuille__lien {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 54px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
  }

  .feuille__lien[aria-current="page"] { background: var(--teal-100); color: var(--teal-700); }
  .feuille__tuile { width: 36px; height: 36px; border-radius: 10px; background: #eef2f7; display: inline-flex; align-items: center; justify-content: center; }
  .feuille__lien--danger { color: var(--danger); }
  .feuille__lien--danger .feuille__tuile { background: #fde2e0; }

  /* Les sous-onglets d'une rubrique (Inventaire : Articles, Entrées, Retraits, Statistiques)
     passent sur leur propre ligne, en contrôle segmenté : un geste, sans chercher dans le titre. */
  .entete-ecran { flex-direction: column; align-items: stretch; gap: 0.75rem; }

  .onglets-secondaires {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: var(--navy-100);
  }

  .onglets-secondaires a { flex: 1 0 auto; text-align: center; white-space: nowrap; border-radius: 9px; }
  .onglets-secondaires a:hover { background: rgba(255, 255, 255, 0.6); }
  .onglets-secondaires a[aria-current] { background: #fff; color: var(--navy); }
}

/* ================================================== tableaux, recherche, fenêtres == */

/* Tous les tableaux de l'admin : une carte arrondie, un en-tête discret, des rangées aérées. */
.table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--navy-100);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 22, 61, 0.05), 0 6px 18px -12px rgba(0, 22, 61, 0.18);
}

.table th {
  padding: 0.8rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--navy-100);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #4a5a72;
  white-space: nowrap;
}

.table td { padding: 0.85rem 1rem; vertical-align: middle; }
.table tbody tr { transition: background-color 0.12s; }
.table tbody tr:hover { background: var(--navy-50); }
.table thead th:first-child { border-top-left-radius: 13px; }
.table thead th:last-child { border-top-right-radius: 13px; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }

/* Pastilles d'état : la couleur ne porte jamais seule le sens, le mot reste écrit. */
.etat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.etat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.etat--ok { background: #e3f6ec; color: #0b6b3a; }
.etat--attente { background: #fff1de; color: #9a5200; }
.etat--off { background: #eceff4; color: #4a5a72; }

/* Compteurs en tête de liste. */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin: 1.25rem 0; }
.stat {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.1rem;
  background: #fff;
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 22, 61, 0.05);
}
.stat__n { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat__l { font-size: 0.8rem; color: #4a5a72; }

/* Recherche et filtres. */
.recherche { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.recherche__champ {
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.8rem;
  background: #fff;
  border: 1px solid #c8d2e0;
  border-radius: 10px;
  color: #4a5a72;
}
.recherche__champ:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-100); }
.recherche__champ input { flex: 1; min-width: 0; border: 0; padding: 0.6rem 0; background: transparent; outline: 0; }
.recherche select { padding: 0.6rem 0.8rem; border-radius: 10px; }
.recherche__effacer { font-size: 0.9rem; }

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.carte-table { margin-bottom: 1.25rem; }
.carte-table__pied { margin: 0.6rem 0.2rem 0; font-size: 0.82rem; color: #4a5a72; }

.table--usagers .col-actions { text-align: right; white-space: nowrap; }
.table--usagers .vide { padding: 2.5rem 1rem; text-align: center; color: #4a5a72; }

/* La photo de la fiche du site à côté d'un article d'inventaire (entrées, retraits, statistiques). */
.article-cellule { display: flex; align-items: center; gap: 0.75rem; }
.article-cellule__photo {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden;
  border-radius: 8px; background: var(--navy-50); color: #9fb0c8;
}
.article-cellule__photo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.article-cellule__photo svg { width: 24px; height: 24px; }
/* Le résumé de la consignation et son bouton, sur une même ligne. */
.barre-consignation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.barre-consignation p { margin: 0; color: #4a5a72; }
/* Les paiements et retours d'une consignation, sous le nom du consignataire. */
.consignation-historique { list-style: none; margin: 0.35rem 0 0; padding: 0; font-size: 0.8rem; color: #4a5a72; }
.consignation-historique li + li { margin-top: 0.15rem; }
.usager-cellule { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--navy); }
.usager-cellule__texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.usager-cellule__nom { font-weight: 600; }
.usager-cellule:hover .usager-cellule__nom { color: var(--teal-700); }
.usager-cellule__courriel { font-size: 0.82rem; color: #4a5a72; overflow: hidden; text-overflow: ellipsis; }
.avatar--clair { background: var(--teal-100); color: var(--teal-700); }

/* Actions de rangée : des boutons-liens, pas des liens perdus dans le texte. */
.btn-lien {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  margin-left: 0.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--teal-700);
}
.btn-lien:hover { background: var(--teal-100); }
.btn-lien--danger { color: var(--danger); }
.btn-lien--danger:hover { background: #fde8e6; }

.btn--danger { background: var(--danger); border-color: var(--danger); }
.btn:hover { filter: brightness(1.1); }
.btn--ghost:hover { filter: none; background: var(--navy-50); }

/* Fenêtres modales, par `:target` : aucune ligne de JavaScript. */
.modale { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; padding: 1rem; }
.modale:target { display: flex; }
.modale__voile { position: absolute; inset: 0; background: rgba(0, 22, 61, 0.55); }
.modale__boite {
  position: relative;
  width: 100%;
  max-width: 30rem;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.6rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(0, 22, 61, 0.45);
}
.modale__boite--etroite { max-width: 26rem; }
.modale__boite h2 { margin-top: 0; font-size: 1.2rem; }
.modale__actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.5rem; }

@media (max-width: 56.25rem) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .table--usagers .col-entreprise, .table--usagers .col-connexion { display: none; }
  .table--usagers .col-actions { white-space: normal; }
  .btn-lien { margin: 0; }
  .modale { align-items: flex-end; padding: 0; }
  .modale__boite { max-width: none; border-radius: 20px 20px 0 0; }
}

/* ============================================ grilles : compléments (documents, stock) == */

/* Une fenêtre qui se rouvre d'elle-même après un refus (la saisie et la raison reviennent). */
.modale--ouverte { display: flex; }

.etat--info { background: var(--teal-100); color: var(--teal-700); }

/* Barre d'outils d'une grille : recherche à gauche, action principale à droite. */
.barre-outils { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.barre-outils .recherche { flex: 1 1 24rem; margin-bottom: 0; }
.barre-outils > .btn { white-space: nowrap; }

.table--grille .col-nombre { text-align: right; white-space: nowrap; }
.table--grille .col-actions { text-align: right; white-space: nowrap; }
.table--grille .vide { padding: 2.5rem 1rem; text-align: center; color: #4a5a72; }
.table--grille tr.est-masque td { opacity: 0.6; }

/* Pastille d'extension d'un fichier. */
.tuile-type {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: #4a5a72;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modale .check { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; }
.modale .check input { width: auto; }

@media (max-width: 640px) {
  .table--grille .col-taille, .table--grille .col-ajout, .table--grille .col-client { display: none; }
  .table--grille .col-actions { white-space: normal; }
  .table--grille th, .table--grille td { padding-left: 0.7rem; padding-right: 0.7rem; }
  .barre-outils > .btn { width: 100%; text-align: center; }
}

/* Compteurs cliquables (filtres rapides) et outils d exploitation, sous la grille des demandes. */
.stats--liens { grid-template-columns: repeat(5, 1fr); }
.stats--liens .stat { text-decoration: none; color: var(--navy); transition: border-color 0.12s, box-shadow 0.12s; }
.stats--liens .stat:hover { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-100); }
.stat--accent .stat__n { color: var(--orange); }
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.5rem 0; padding-top: 1.25rem; border-top: 1px solid var(--navy-100); }
.outils form { margin: 0; }
.outils .aide { flex-basis: 100%; }
@media (max-width: 56.25rem) { .stats--liens { grid-template-columns: repeat(2, 1fr); } }

.carte-table { overflow-x: auto; }
@media (max-width: 640px) { .table--grille .col-motif { display: none; } }

/* En-tete d ecran : le titre prend la place, l action principale reste a droite meme avec une longue description. */
.entete-ecran > div:first-child { flex: 1 1 20rem; min-width: 0; }
.entete-ecran__sous { max-width: 52rem; margin-top: 0.25rem; }
.entete-ecran > .btn { align-self: flex-start; white-space: nowrap; }
/* Empilé (voir plus haut, 56.25rem) : la base de 20rem s'appliquerait à la HAUTEUR et creuserait un grand
   vide sous le titre. */
@media (max-width: 56.25rem) { .entete-ecran > div:first-child { flex: none; } }
@media (max-width: 640px) {
  .table--grille th, .table--grille td { padding-left: 0.5rem; padding-right: 0.5rem; }
  .table--grille .col-actions .btn-lien { display: block; text-align: right; }
  .entete-ecran > .btn { width: 100%; text-align: center; }
}

/* ============================================================ passkeys == */

/* Séparateur « ou » entre le mot de passe et la passkey : une ligne, le mot au centre. */
.separateur-ou { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0 1rem; color: #4a5a72; font-size: 0.85rem; }
.separateur-ou::before, .separateur-ou::after { content: ""; flex: 1; height: 1px; background: var(--navy-100); }
.separateur-ou[hidden] { display: none; }

.btn--plein { display: block; width: 100%; text-align: center; }
.btn[hidden], .btn-lien[hidden] { display: none; }

/* Message d'état (annonce par role="status") : discret, et sans hauteur quand il est vide. */
.statut-passkey { min-height: 0; margin: 0.6rem 0 0; font-size: 0.9rem; }
.statut-passkey:empty { display: none; }

/* La liste des passkeys du profil : une ligne par clé, le nom et la méta à gauche, l'action à droite. */
.liste-passkeys { list-style: none; margin: 1rem 0; padding: 0; border: 1px solid var(--navy-100); border-radius: 12px; }
.liste-passkeys li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--navy-100); }
.liste-passkeys li:last-child { border-bottom: 0; }
.liste-passkeys__texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.liste-passkeys__texte .muted { font-size: 0.82rem; }

@media (max-width: 640px) {
  .liste-passkeys li { align-items: flex-start; flex-direction: column; gap: 0.4rem; }
}

/* ================================ vue « au nom du distributeur » (administration) == */

/* Le bandeau reste en haut tant qu'on agit dans l'espace d'un distributeur : impossible d'oublier
   que les actions touchent son compte. Orange doux, texte sombre : contraste AA sur le fond. */
.bandeau-vue {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  background: #fff1de;
  border-bottom: 1px solid #f3cf9a;
  color: #5c3300;
  font-size: 0.9rem;
}

.bandeau-vue__texte { margin: 0; line-height: 1.4; }

.bandeau-vue__sortie {
  flex: none;
  padding: 0.35rem 0.9rem;
  border: 1px solid #9a5200;
  border-radius: 8px;
  background: #fff;
  color: #5c3300;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.bandeau-vue__sortie:hover { background: #ffe3bd; }

/* Le bouton de sortie de la carte du compte est ici un lien, pas un bouton de formulaire. */
a.usager-carte__sortie { text-decoration: none; }

.btn-lien--principal { background: var(--teal-100); }
.btn-lien--principal:hover { background: #c7e9eb; }

/* Carte réservée à l'administrateur, dans le profil d'un distributeur. */
.carte-admin { border-color: #f3cf9a; background: #fffaf3; }
.carte-admin__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn--danger-contour { color: var(--danger); border-color: var(--danger); }

@media (max-width: 640px) {
  .bandeau-vue { padding: 0.5rem 1rem; font-size: 0.84rem; align-items: flex-start; }
}

/* ============================================================== profil == */

/* L'en-tête : le logo de l'entreprise (ou ses initiales), qui l'on est, et la jauge de complétion. */
.profil-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.profil-entete__logo {
  flex: none; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--navy-100); border-radius: 18px; background: var(--teal-100); color: var(--teal-700);
  font-size: 1.4rem; font-weight: 800;
}
.profil-entete__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.profil-entete__texte { flex: 1 1 16rem; min-width: 0; }
.profil-entete__texte h1 { margin: 0; }
.profil-entete__texte p { margin: 0.25rem 0 0; }
.jauge-profil { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem; border: 1px solid var(--navy-100); border-radius: 14px; background: #fff; }
.jauge-profil__texte { display: flex; flex-direction: column; font-size: 0.9rem; line-height: 1.35; }

/* Les onglets sont des liens : le soulignement suit `aria-current`, sans classe « active » à tenir. */
.onglets-profil { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--navy-100); }
.onglets-profil a { margin-bottom: -1px; padding: 0.75rem 0.15rem; border-bottom: 3px solid transparent; color: #4a5a72; font-weight: 600; text-decoration: none; }
.onglets-profil a:hover { color: var(--navy); }
.onglets-profil a[aria-current="page"] { border-bottom-color: var(--teal); color: var(--navy); font-weight: 800; }
.onglet-profil[hidden] { display: none; }

/* La fiche : le formulaire à gauche, l'aperçu à droite (dessous sur un téléphone). */
.profil-fiche { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2.5rem; }
/* Une carte, comme les autres onglets : le champ verrouillé et la zone de dépôt, teintés, s'y détachent. */
.profil-fiche__formulaire {
  flex: 3 1 30rem; min-width: 0; display: grid; gap: 2rem; padding: 1.75rem;
  border: 1px solid var(--navy-100); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 22, 61, 0.06);
}
/* Un bloc de formulaire : titre, phrase d'aide, champs. `.bloc-formulaire` est le même bloc ailleurs
   que dans le profil (le formulaire de retour). */
.profil-bloc, .bloc-formulaire { display: grid; gap: 1rem; }
.profil-bloc h2, .bloc-formulaire h2 { margin: 0; font-size: 1.1rem; }
.profil-bloc > p, .bloc-formulaire > p { margin: -0.6rem 0 0; }
.profil-bloc label, .bloc-formulaire label { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 600; }
.etiquette-compteur { display: flex; justify-content: space-between; gap: 1rem; }
.etiquette-compteur .muted { font-weight: 500; }
.grille-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grille-champs__large { grid-column: 1 / -1; }

/* Le dépôt du logo : tout le cadre est le champ de fichier (transparent par-dessus), donc on peut y
   glisser une image comme cliquer pour parcourir — sans une ligne de JavaScript. */
.depot-logo { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.profil-bloc .depot-logo__zone {
  position: relative; flex: 1 1 18rem; min-height: 11rem; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 0.4rem; padding: 1.5rem; border: 2px dashed #9fb0c8; border-radius: 16px;
  background: var(--navy-50); color: var(--teal-700); text-align: center; font-weight: 400; cursor: pointer;
}
.depot-logo__zone:hover { border-color: var(--teal-700); background: var(--teal-100); }
.depot-logo__zone:focus-within { outline: 2px solid var(--teal-700); outline-offset: 2px; }
.depot-logo__zone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.depot-logo__titre { color: var(--navy); font-size: 1rem; font-weight: 800; }
.depot-logo__lien { color: var(--teal-700); font-weight: 700; text-decoration: underline; }
.depot-logo__fichier { color: var(--navy); font-size: 0.85rem; font-weight: 600; }
.depot-logo__fichier:empty { display: none; }
.depot-logo__apercus { flex: 0 1 12rem; display: grid; align-content: start; gap: 0.6rem; }
.depot-logo__legende { color: #33435c; font-size: 0.82rem; font-weight: 700; }
.depot-logo__fond {
  height: 4.75rem; display: flex; align-items: center; justify-content: center; padding: 0.6rem;
  border: 1px solid var(--navy-100); border-radius: 12px; font-size: 0.82rem;
}
.depot-logo__fond--fonce { border-color: var(--navy); background: var(--navy); color: #9fb0c8; }
.depot-logo__fond img { max-width: 100%; max-height: 100%; object-fit: contain; }
[data-apercu-logo][hidden], [data-apercu-sans-logo][hidden] { display: none; }

.champ-verrouille { display: grid; gap: 0.35rem; }
.champ-verrouille__etiquette { font-size: 0.9rem; font-weight: 600; }
.champ-verrouille__valeur {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.55rem 0.7rem; border-radius: 8px; background: var(--navy-50); font-weight: 600;
}
.champ-verrouille__note { display: inline-flex; align-items: center; gap: 0.35rem; color: #4a5a72; font-size: 0.78rem; white-space: nowrap; }

.puces-choix { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
.puces-choix legend { padding: 0 0 0.6rem; font-size: 0.9rem; font-weight: 600; }
.profil-bloc .puce-choix, .bloc-formulaire .puce-choix {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem;
  border: 1px solid #c8d2e0; border-radius: 999px; cursor: pointer;
}
.puce-choix input { width: auto; margin: 0; accent-color: var(--teal-700); }
.puce-choix:has(input:checked) { border-color: var(--teal-700); background: var(--teal-100); }

/* L'aperçu de la fiche : reste en vue pendant qu'on remplit le formulaire. */
.apercu-fiche { flex: 2 1 18rem; min-width: 0; position: sticky; top: 1.5rem; display: grid; gap: 0.75rem; }
.apercu-fiche__titre { color: #4a5a72; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.apercu-fiche__note { margin: 0; font-size: 0.85rem; }
.fiche { overflow: hidden; border: 1px solid var(--navy-100); border-radius: 20px; background: #fff; box-shadow: 0 16px 40px rgba(0, 22, 61, 0.08); }
.fiche__bandeau { height: 5.5rem; background: var(--navy-deep); }
.fiche__corps { display: grid; gap: 0.75rem; padding: 0 1.5rem 1.5rem; }
.fiche__logo {
  width: 4.5rem; height: 4.5rem; margin-top: -2.25rem; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--navy-100); border-radius: 18px; background: #fff; box-shadow: 0 6px 16px rgba(0, 22, 61, 0.1);
  color: var(--teal-700); font-size: 1.3rem; font-weight: 800;
}
.fiche__logo img { width: 100%; height: 100%; padding: 0.35rem; object-fit: contain; }
.fiche__nom { font-size: 1.25rem; font-weight: 800; }
.fiche__slogan { color: #4a5a72; font-size: 0.9rem; }
.fiche__description { margin: 0; color: #33435c; font-size: 0.9rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.fiche__etiquettes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fiche__etiquettes:empty { display: none; }
.fiche__etiquette { padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--teal-100); color: var(--teal-700); font-size: 0.78rem; font-weight: 700; }
.fiche__lieu { color: #33435c; font-size: 0.85rem; font-weight: 600; }
.fiche__actions { display: flex; gap: 0.5rem; padding-top: 0.25rem; }
.fiche__action { flex: 1; padding: 0.6rem; border: 1px solid var(--navy); border-radius: 10px; text-align: center; font-size: 0.88rem; font-weight: 700; }
.fiche__action--plein { background: var(--navy); color: #fff; }
/* Ce qui n'est pas encore rempli : en retrait, pour qu'on voie d'un coup d'œil ce qui manque. */
.fiche .est-vide { color: #5c6b82; font-style: italic; }
.fiche .fiche__action.est-vide { opacity: 0.4; color: var(--navy); font-style: normal; }
.fiche .fiche__action--plein.est-vide { color: #fff; }

@media (max-width: 640px) {
  .grille-champs { grid-template-columns: 1fr; }
  .apercu-fiche { position: static; }
}

/* ============================================ listes en lignes (retours, distributeurs) == */

/* Une liste où chaque élément est une carte d'une ligne, entièrement cliquable par son lien principal.
   Les colonnes se replient sous le titre quand la largeur manque : jamais de défilement de côté.
   Le lien principal s'étend à toute la ligne (`::after`) ; les actions secondaires passent au-dessus. */
.lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.ligne {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.75rem;
  padding: 1rem 1.25rem; border: 1px solid var(--navy-100); border-radius: 14px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 22, 61, 0.04); transition: border-color 0.12s, box-shadow 0.12s;
}
.ligne:hover { border-color: #9fb0c8; box-shadow: 0 6px 18px rgba(0, 22, 61, 0.08); }
.ligne:focus-within { outline: 2px solid var(--teal-700); outline-offset: 2px; }
.ligne__avatar { flex: none; }
.ligne__principal { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.ligne__lien { color: var(--navy); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.ligne__lien::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.ligne__lien:focus-visible { outline: none; }
.ligne__sous { color: #4a5a72; font-size: 0.85rem; overflow-wrap: anywhere; }
.ligne__meta { flex: 0 1 9rem; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.9rem; }
.ligne__meta--large { flex-basis: 12rem; }
.ligne__etiquette { color: #4a5a72; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.ligne__statut { flex: none; }
.ligne__actions { position: relative; z-index: 1; flex: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
.ligne__meta--chiffre { flex-basis: 5.5rem; }

/* Le logo de l'entreprise dans une ligne, ou ses initiales. */
.avatar-entreprise {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--navy-100); border-radius: 12px; background: var(--teal-100); color: var(--teal-700);
  font-size: 0.9rem; font-weight: 800;
}
.avatar-entreprise img { width: 100%; height: 100%; padding: 3px; object-fit: contain; background: #fff; }

/* Une action en icône : carrée, 40 px (cible tactile), nommée par son aria-label. */
.btn-icone {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; color: #33435c;
}
.btn-icone:hover { border-color: var(--navy-100); background: var(--navy-50); color: var(--navy); }
.btn-icone:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 1px; }
.btn-icone--danger:hover { border-color: #f1b4ae; background: #fde2e0; color: var(--danger); }

/* Les compteurs du haut de la liste des distributeurs, cliquables : quatre colonnes, deux sur un téléphone. */
.stats--liens.stats--quatre { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 56.25rem) { .stats--liens.stats--quatre { grid-template-columns: repeat(2, 1fr); } }
.stats--liens .stat[aria-current="page"] { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-100); }

/* Le vide d'une liste : ce qu'elle contiendra, et le geste pour commencer. */
.vide-carte {
  display: grid; justify-items: center; gap: 0.25rem; padding: 2.5rem 1.5rem; text-align: center;
  border: 1px dashed #c8d2e0; border-radius: 16px; background: #fff; color: var(--teal-700);
}
.vide-carte p { margin: 0.2rem 0; color: var(--navy); }
.vide-carte .muted { color: #4a5a72; max-width: 32rem; }
.vide-carte .btn { margin-top: 0.75rem; }

/* Filtres en pilules : chaque statut est un lien, avec son compte. */
.filtres-pilules { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.filtres-pilules a {
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.9rem;
  border: 1px solid #c8d2e0; border-radius: 999px; background: #fff; color: var(--navy);
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.filtres-pilules a:hover { border-color: var(--teal-700); }
.filtres-pilules a[aria-current="page"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.filtres-pilules__n { min-width: 1.5rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--navy-50); color: var(--navy); font-size: 0.78rem; font-weight: 700; text-align: center; }
.filtres-pilules a[aria-current="page"] .filtres-pilules__n { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ==================================================================== retours == */

.formulaire-retour { display: grid; gap: 1.25rem; max-width: 52rem; }
.carte-formulaire { padding: 1.5rem; border: 1px solid var(--navy-100); border-radius: 14px; background: #fff; }
.bloc-formulaire h2 { display: flex; align-items: center; gap: 0.65rem; }
.bloc-formulaire__numero {
  flex: none; width: 1.75rem; height: 1.75rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--teal-100); color: var(--teal-700); font-size: 0.85rem; font-weight: 800;
}
.formulaire-retour__envoi { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; }

/* Un dépôt de fichiers : tout le cadre est le champ (transparent par-dessus) — on y glisse des
   fichiers, ou on clique ; sur un téléphone, l'appareil photo est proposé. */
.bloc-formulaire .depot, .depot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 9rem; padding: 1.25rem; border: 2px dashed #9fb0c8; border-radius: 14px;
  background: var(--navy-50); color: var(--teal-700); text-align: center; font-weight: 400; cursor: pointer;
}
.depot:hover { border-color: var(--teal-700); background: var(--teal-100); }
.depot:focus-within { outline: 2px solid var(--teal-700); outline-offset: 2px; }
.depot input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.depot--compact { min-height: 5.5rem; margin-top: 1rem; }
.depot__titre { color: var(--navy); font-weight: 800; }
.depot__lien { color: var(--teal-700); font-weight: 700; text-decoration: underline; }
.depot__message { margin: 0; color: var(--navy); font-size: 0.88rem; }
.depot__message:empty { display: none; }

.galerie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.galerie:empty { display: none; }
.galerie li { aspect-ratio: 1; overflow: hidden; border: 1px solid var(--navy-100); border-radius: 12px; background: var(--navy-50); }
.galerie a { display: block; height: 100%; }
.galerie img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galerie a:hover img { opacity: 0.88; }
.galerie--apercu { margin-top: 0.75rem; }

/* La frise des étapes du retour. */
.frise { list-style: none; margin: 1.25rem 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; counter-reset: etape; }
.frise__etape {
  flex: 1 1 8rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem;
  border-radius: 10px; background: #fff; border: 1px solid var(--navy-100); color: #4a5a72; font-size: 0.85rem; font-weight: 600;
}
.frise__point { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid #9fb0c8; }
.frise__etape--faite { color: var(--navy); }
.frise__etape--faite .frise__point { border-color: var(--teal); background: var(--teal); }
.frise__etape--courante { border-color: var(--teal-700); background: var(--teal-100); color: var(--navy); font-weight: 800; }
.frise__etape--courante .frise__point { border-color: var(--teal-700); background: #fff; box-shadow: 0 0 0 3px rgba(0, 114, 122, 0.2); }
.frise__etape--refuse { border-color: #f1b4ae; background: #fde2e0; color: var(--danger); font-weight: 800; }
.frise__etape--refuse .frise__point { border-color: var(--danger); background: var(--danger); }

.dossier { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; }
.dossier__principal { flex: 3 1 28rem; min-width: 0; }
.dossier__cote { flex: 2 1 17rem; min-width: 0; }
.dossier .card { margin-bottom: 1.25rem; }
.facts--pile { grid-template-columns: 1fr; gap: 0.15rem; }
.facts--pile dt { margin-top: 0.6rem; color: #4a5a72; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.facts--pile dt:first-child { margin-top: 0; }
.numero-serie { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.reponse-equipe { border-color: var(--teal-700); background: var(--teal-100); }
.reponse-equipe__texte { margin: 0; white-space: pre-wrap; line-height: 1.55; }

/* Une garantie validée : les trois dates qui comptent, en un coup d'œil. */
.garantie-bandeau {
  display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; margin: 1.25rem 0 1.5rem; padding: 1rem 1.25rem;
  border: 1px solid var(--teal-700); border-radius: 14px; background: var(--teal-100);
}
.garantie-bandeau > div { display: flex; flex-direction: column; gap: 0.15rem; }
.garantie-bandeau strong { font-size: 1.15rem; }

.historique { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--navy-100); display: grid; gap: 1rem; }
.historique__evenement { position: relative; }
.historique__evenement::before {
  content: ""; position: absolute; left: calc(-1rem - 6px); top: 0.35rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #fff;
}
.historique__entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.historique__entete .muted { font-size: 0.82rem; }
.historique__texte { margin: 0.35rem 0 0; padding: 0.6rem 0.75rem; border-radius: 10px; background: var(--navy-50); white-space: pre-wrap; font-size: 0.9rem; }

@media (max-width: 640px) {
  .ligne { padding: 0.9rem 1rem; gap: 0.5rem 1.25rem; }
  .ligne__actions { margin-left: 0; }
  .frise__etape { flex-basis: 100%; }
}

/* ========================================================== signatures == */

/* Une empreinte se compare caractère par caractère : chasse fixe, et elle passe à la ligne n'importe où
   plutôt que de déborder sur un téléphone. */
.empreinte { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; overflow-wrap: anywhere; }

/* Dans un formulaire en pile, une case reste sur la ligne de son texte (`.stack label` est en grille). */
.stack label.check, .stack label.consentement { display: flex; flex-direction: row; align-items: flex-start; gap: 0.55rem; font-weight: 500; }
.stack label.check input, .stack label.consentement input { width: auto; flex: none; margin-top: 0.2rem; }

/* Le consentement : le texte exact auquel on s'engage, encadré, lisible avant de cocher. */
.stack label.consentement { padding: 0.85rem 1rem; border: 1px solid var(--navy-100); border-radius: 10px; background: var(--navy-50); line-height: 1.45; font-size: 0.95rem; }

.choix-documents { display: grid; gap: 0.45rem; margin: 0; padding: 0.75rem 1rem; border: 1px solid var(--navy-100); border-radius: 10px; max-height: 16rem; overflow-y: auto; }
.choix-documents legend { padding: 0 0.3rem; font-weight: 600; font-size: 0.9rem; }

.etapes-signature { margin: 0 0 1rem; padding-left: 1.2rem; line-height: 1.6; }


/* Un champ de date ouvre son calendrier où qu'on clique, pas seulement sur la petite icône de Chrome
   et d'Edge : l'indicateur, rendu invisible, couvre toute la case, et l'icône est redessinée en fond.
   Sans JavaScript ; Firefox et Safari ouvrent déjà le leur au clic. */
input[type="date"] {
  position: relative;
  padding-right: 2.4rem;
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2300727a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}

/* ------------------------------------------------------------ catalogue et commandes -- */
/* Le catalogue du distributeur : des cartes en grille fluide, sans défilement de côté. Un produit
   indisponible reste visible, grisé, sans bouton pour le commander. */
.catalogue { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.produit-carte {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--navy-100); border-radius: 16px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.produit-carte:hover { border-color: #9fb0c8; box-shadow: 0 8px 22px rgba(0, 22, 61, 0.08); }
.produit-carte__image, .fiche-produit__image {
  display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--navy-50); color: #9fb0c8;
}
.produit-carte__image img, .fiche-produit__image img { width: 100%; height: 100%; object-fit: contain; padding: 0.75rem; }
.produit-carte__corps { flex: 1; padding: 1rem 1.1rem 0.25rem; display: grid; align-content: start; gap: 0.3rem; }
.produit-carte__nom { color: var(--navy); font-weight: 800; font-size: 1.02rem; text-decoration: none; }
.produit-carte__nom:hover { text-decoration: underline; }
.produit-carte__description { margin: 0; color: #4a5a72; font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.produit-carte__pied { padding: 0.75rem 1.1rem 1.1rem; display: grid; gap: 0.6rem; }
.produit-carte--indisponible .produit-carte__image, .produit-carte--indisponible .fiche-produit__image { filter: grayscale(1); opacity: 0.55; }
.produit-carte--indisponible .produit-carte__nom, .produit-carte--indisponible .prix { color: #6b7a90; }
.produit-carte__indispo { justify-self: start; margin: 0; }

.prix { margin: 0; color: var(--navy); font-size: 1.25rem; font-weight: 800; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.45rem; }
.prix--grand { font-size: 1.7rem; }
.prix__note { color: #4a5a72; font-size: 0.75rem; font-weight: 600; }

.ajout-panier { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ajout-panier input[type="number"] { width: 5.5rem; }
.ajout-panier .btn { flex: 1 1 auto; }
.fiche-produit .ajout-panier label { font-weight: 600; font-size: 0.9rem; }

.fiche-produit { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.fiche-produit__image { flex: 1 1 20rem; max-width: 30rem; border: 1px solid var(--navy-100); border-radius: 16px; }
.fiche-produit__texte { flex: 1 1 20rem; min-width: 0; }
.fiche-produit__texte h1 { margin-bottom: 0.25rem; }
.fiche-produit__sous { margin-top: 0; color: var(--teal-700); font-weight: 700; }
.fiche-produit__achat { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid var(--navy-100); border-radius: 14px; background: #fff; display: grid; gap: 0.9rem; }

/* Le panier : des lignes dont la quantité se modifie sur place, puis la note et le total. */
.ligne__quantite input { width: 6rem; position: relative; z-index: 1; }
.ligne--panier .ligne__actions .btn-lien { background: none; border: 0; cursor: pointer; font: inherit; }
.panier__bas { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; margin-top: 1.25rem; }
.panier__note { flex: 2 1 20rem; display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.9rem; }
.panier__total {
  flex: 1 1 16rem; display: grid; gap: 0.5rem; padding: 1.25rem; border: 1px solid var(--navy-100);
  border-radius: 14px; background: #fff;
}
.panier__total p { margin: 0; }
.panier__boutons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.panier__boutons .btn { flex: 1 1 auto; text-align: center; }

.table--commande tfoot th, .table--commande tfoot td { border-top: 2px solid var(--navy-100); }
.table--commande .col-nombre { text-align: right; }
.champ-quantite { width: 5.5rem; text-align: right; }
.boutons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }

/* La grille des prix : des champs de montant étroits, la marge en face, en rouge sous le coûtant. */
.table--prix .champ-prix { width: 8rem; }
.table--prix td { vertical-align: middle; }
.table--prix select { max-width: 13rem; }
.choix-distributeur { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-weight: 600; font-size: 0.9rem; }
.choix-distributeur select { min-width: 16rem; max-width: 100%; }
.marge { color: #0b6b3a; font-weight: 700; white-space: nowrap; }
.marge--negative { color: var(--danger); }
.petit { font-size: 0.78rem; }
.barre-enregistrer { position: sticky; bottom: 0; margin: 0; padding: 0.75rem 0; background: var(--navy-50); text-align: right; }

.table--prix .marge { display: block; margin-top: 0.3rem; font-size: 0.8rem; }
.table--prix .usager-cellule__courriel { display: block; }

/* La fiche d'une commande, côté équipe : les produits sur toute la largeur, le traitement dessous. */
.commande-produits { margin-bottom: 1.25rem; }

@media (max-width: 640px) {
  /* Sur téléphone, une carte de produit devient une rangée : la vignette à gauche, le texte à droite. */
  .catalogue { grid-template-columns: 1fr; gap: 0.75rem; }
  .produit-carte { display: grid; grid-template-columns: 6rem 1fr; }
  .produit-carte__image { aspect-ratio: auto; grid-row: span 2; width: 100%; min-width: 0; }
  .produit-carte__corps { padding: 0.8rem 0.9rem 0; }
  .produit-carte__pied { padding: 0.5rem 0.9rem 0.9rem; }
  .ligne--panier .ligne__quantite { flex-basis: 7rem; }
  .table--prix .champ-prix { width: 6.5rem; }
}

/* ---------------------------------------------------------------- signatures (admin) -- */
/* L'atelier d'un modèle : l'éditeur et l'aperçu PDF côte à côte, empilés sur un écran étroit. */
.atelier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.atelier--simple { grid-template-columns: minmax(0, 40rem); }
.apercu-pdf { display: grid; gap: 0.75rem; }
.apercu-pdf h2 { margin: 0; }
.apercu-pdf iframe { width: 100%; height: 52rem; max-height: 85vh; border: 1px solid var(--navy-100); border-radius: 12px; background: #fff; }
.apercu-pour { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.apercu-pour label { flex: 1 1 14rem; display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 600; }
.editeur-lettre { font: 0.95rem/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; min-height: 22rem; }
.champs-aide { border: 1px solid var(--navy-100); border-radius: 10px; padding: 0.6rem 0.9rem; background: var(--navy-50); font-size: 0.88rem; }
.champs-aide summary { cursor: pointer; font-weight: 700; color: var(--teal-700); }
.champs-aide dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; margin: 0.6rem 0; }
.champs-aide dt, .champs-aide dd { margin: 0; }
.champs-aide code, .alert code { background: #fff; border: 1px solid var(--navy-100); border-radius: 5px; padding: 0 0.3rem; }
.bandeau-signataire { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 1rem; padding: 0.75rem 1rem; border: 1px solid var(--navy-100); border-radius: 12px; background: #fff; font-size: 0.92rem; }
.ligne__actions form { display: inline; }
.ligne__actions button.btn-lien { background: none; border: 0; cursor: pointer; font: inherit; }
.lignes--choix .ligne__choix { display: flex; align-items: center; gap: 0.8rem; flex: 1 1 18rem; min-width: 0; cursor: pointer; }
.lignes--choix .ligne__choix input { width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--teal-700); }
.lignes--choix .ligne:has(input:checked) { border-color: var(--teal-700); background: var(--teal-100); }
.lignes--choix .ligne__statut { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.options-envoi { margin-top: 1.25rem; max-width: 46rem; }
.etapes-envoi { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 1.25rem; padding: 0; counter-reset: etape; }
.etapes-envoi li { counter-increment: etape; padding: 0.35rem 0.8rem; border: 1px solid var(--navy-100); border-radius: 999px; background: #fff; color: #4a5a72; font-size: 0.85rem; font-weight: 600; }
.etapes-envoi li::before { content: counter(etape) " · "; }
.etapes-envoi__faite { color: var(--teal-700) !important; }
.etapes-envoi li[aria-current] { border-color: var(--teal-700); background: var(--teal-100); color: var(--navy); font-weight: 800; }
.recapitulatif { padding: 1rem 1.25rem; border: 1px solid var(--navy-100); border-radius: 12px; background: #fff; margin-bottom: 1rem; }
.recapitulatif p { margin: 0.25rem 0; }
.apercu-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.apercu-liens a { display: inline-block; padding: 0.3rem 0.7rem; border: 1px solid var(--navy-100); border-radius: 999px; background: #fff; font-size: 0.85rem; }
.apercu-courriel { white-space: pre-wrap; font: 0.85rem/1.5 ui-monospace, Consolas, monospace; background: var(--navy-50); padding: 0.9rem; border-radius: 10px; max-height: 24rem; overflow: auto; }
.envoi-final { margin-top: 1rem; }
.versions { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.carte-etroite { max-width: 36rem; }
.signature-actuelle { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.signature-actuelle img { max-height: 4.5rem; max-width: 16rem; border: 1px solid var(--navy-100); border-radius: 8px; padding: 0.3rem; background: #fff; }
@media (max-width: 64rem) {
  .atelier { grid-template-columns: minmax(0, 1fr); }
  .apercu-pdf iframe { height: 34rem; }
}

/* Les modèles prêts à l'emploi, et ce qui change à chaque envoi. */
.modeles-prets { margin-bottom: 1.25rem; }
.modeles-prets h2 { font-size: 1.05rem; margin: 0 0 0.6rem; }
.modeles-prets__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.modele-pret { display: grid; gap: 0.4rem; align-content: start; padding: 1.1rem 1.2rem; }
.modele-pret p { margin: 0 0 0.4rem; font-size: 0.9rem; }
.modele-pret .btn { justify-self: start; }
.editeur-lettre--court { min-height: 6rem; }
.details-envoi { margin: 0.6rem 0; }
.valeur-envoi { white-space: pre-line; }

/* Le document à signer, lisible dans la page du distributeur. */
.apercu-signature iframe { width: 100%; height: 56rem; max-height: 80vh; border: 1px solid var(--navy-100); border-radius: 12px; background: #fff; }
.apercu-signature .aide { margin: 0.6rem 0 0; }
.champ-montant { display: flex; align-items: center; gap: 0.5rem; max-width: 20rem; }
.champ-montant input { flex: 1; text-align: right; }
.champ-montant span { color: #4a5a72; font-weight: 700; white-space: nowrap; }

/* La fenêtre d'aperçu d'un document : large, le PDF dans un cadre. */
.modale--large .modale__boite { max-width: 60rem; width: 100%; }
.modale__apercu { display: block; width: 100%; height: 70vh; border: 1px solid var(--navy-100); border-radius: 10px; background: #fff; }
.lien-danger { color: var(--danger); }
.pousse-droite { margin-left: auto; }
