/* Police des tickets, livrée avec l'application (Arimo, licence Apache 2.0) :
   le reçu sort identique sur toutes les machines, quelle que soit la police installée. */
@font-face { font-family: "MAM Ticket"; src: url("../polices/ticket-400.woff2") format("woff2"); font-weight: 100 600; font-display: block; }
@font-face { font-family: "MAM Ticket"; src: url("../polices/ticket-700.woff2") format("woff2"); font-weight: 601 1000; font-display: block; }

/* =====================================================================
   MAIN A MAIN — Style
   Pensé pour un téléphone d'entrée de gamme, au guichet, en plein jour :
   gros contrastes, grandes zones à toucher, une seule couleur vive
   (le jaune de l'étiquette) réservée à la marque et à l'action principale.
   ===================================================================== */

:root {
  --encre: #1B2430;
  --encre-douce: #4F5B6A;
  --fond: #EEF1EC;
  --papier: #FFFFFF;
  --trait: #CDD5CC;
  --etiquette: #F2C230;
  --etiquette-fonce: #D9A814;
  --scelle: #0E7C5A;
  --alerte: #C8322B;
  --alerte-fond: #FBEAE8;

  --police: "Archivo", "Arial Narrow", "MAM Ticket", Arial, sans-serif;
  --rayon: 10px;
  --toucher: 52px;
  --marge: clamp(16px, 4vw, 24px);

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-stretch: 85%; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }

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

[hidden] { display: none !important; }

/* ---------- Marque : l'étiquette ----------------------------------- */

.etiquette {
  --h: 64px;
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--h);
  padding: 0 22px 0 calc(var(--h) * 0.62);
  background: var(--etiquette);
  color: var(--encre);
  font-weight: 800;
  font-stretch: 70%;
  font-size: calc(var(--h) * 0.48);
  letter-spacing: 0.01em;
  white-space: nowrap;
  clip-path: polygon(calc(var(--h) * 0.32) 0, 100% 0, 100% 100%, calc(var(--h) * 0.32) 100%, 0 50%);
  border-radius: 0 6px 6px 0;
}
.etiquette::before {
  content: "";
  position: absolute;
  left: calc(var(--h) * 0.24);
  top: 50%;
  width: calc(var(--h) * 0.16);
  height: calc(var(--h) * 0.16);
  margin-top: calc(var(--h) * -0.08);
  border-radius: 50%;
  background: var(--fond);
}
.etiquette--petite { --h: 34px; padding-right: 12px; }
.entete .etiquette::before { background: var(--encre); }

/* ---------- Mise en page -------------------------------------------- */

.vue {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px var(--marge) 48px;
  outline: none;
}
.pile > * + * { margin-top: 16px; }
.pile-serree > * + * { margin-top: 8px; }

.retour {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--encre-douce);
  font-weight: 600;
  text-decoration: none;
}

.doux { color: var(--encre-douce); }

/* ---------- Connexion ------------------------------------------------ */

.connexion {
  min-height: calc(100dvh - 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}
.connexion__marque { display: grid; gap: 14px; }
.connexion__marque .etiquette { --h: 76px; justify-self: start; }
.connexion__marque p { max-width: 30ch; font-size: 1.1rem; color: var(--encre-douce); }

/* ---------- Formulaires ---------------------------------------------- */

.champ { display: grid; gap: 6px; }
.champ label { font-weight: 650; font-size: 0.95rem; }
.champ small { color: var(--encre-douce); font-size: 0.85rem; }

input, select, textarea {
  width: 100%;
  min-height: var(--toucher);
  padding: 0 14px;
  border: 1.5px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--papier);
  color: var(--encre);
  font: inherit;
}
input:focus, select:focus { border-color: var(--encre); outline: none; box-shadow: 0 0 0 3px rgb(27 36 48 / 0.15); }
input[aria-invalid="true"] { border-color: var(--alerte); }

.code-pin { letter-spacing: 0.4em; font-size: 1.3rem; font-weight: 700; }

.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .rangee { grid-template-columns: 1fr; } }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--toucher);
  padding: 0 18px;
  border: 0;
  border-radius: var(--rayon);
  background: var(--etiquette);
  color: var(--encre);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.bouton:hover { background: var(--etiquette-fonce); }
.bouton:disabled { opacity: 0.55; cursor: wait; }
.bouton--sobre { background: var(--papier); border: 1.5px solid var(--trait); font-weight: 650; }
.bouton--sobre:hover { background: var(--fond); }
.bouton--lien { width: auto; min-height: 40px; padding: 0 8px; background: none; color: var(--encre-douce); font-weight: 600; text-decoration: underline; }
.bouton--lien:hover { background: none; color: var(--encre); }

.erreur {
  padding: 12px 14px;
  border-left: 4px solid var(--alerte);
  border-radius: 0 var(--rayon) var(--rayon) 0;
  background: var(--alerte-fond);
  color: #7A1B16;
  font-weight: 600;
}

/* ---------- Accueil : actions du rôle -------------------------------- */

.bonjour p { color: var(--encre-douce); margin-top: 4px; }

.actions { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--trait); }
.actions li { border-bottom: 1.5px solid var(--trait); }
.action {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  min-height: 76px;
  padding: 14px 4px;
  color: inherit;
  text-decoration: none;
}
.action strong { font-size: 1.1rem; font-weight: 700; }
.action span { grid-column: 1; color: var(--encre-douce); font-size: 0.92rem; }
.action::after { content: "›"; grid-row: 1 / span 2; grid-column: 2; font-size: 1.8rem; line-height: 1; color: var(--encre-douce); }
a.action:hover strong { text-decoration: underline; }
.action--bientot { opacity: 0.6; }
.action--bientot::after { content: none; }
.pastille {
  grid-row: 1 / span 2;
  grid-column: 2;
  padding: 3px 8px;
  border: 1.5px solid var(--trait);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--encre-douce);
  white-space: nowrap;
}

/* ---------- Listes (agences, équipe) --------------------------------- */

.liste { list-style: none; margin: 0; padding: 0; background: var(--papier); border: 1.5px solid var(--trait); border-radius: var(--rayon); }
.liste li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--trait); }
.liste li:first-child { border-top: 0; }
.liste__texte { flex: 1; min-width: 0; }
.liste__texte strong { display: block; font-weight: 700; }
.liste__texte span { display: block; color: var(--encre-douce); font-size: 0.9rem; }
.liste__inactif { opacity: 0.5; }
.liste__vide { padding: 20px 14px; color: var(--encre-douce); }

.code-agence {
  flex: none;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--encre);
  color: var(--etiquette);
  font-weight: 800;
  font-stretch: 75%;
  text-align: center;
  letter-spacing: 0.05em;
}

.role { flex: none; font-size: 0.8rem; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--fond); }

details.ajout { background: var(--papier); border: 1.5px solid var(--trait); border-radius: var(--rayon); }
details.ajout summary { min-height: var(--toucher); display: flex; align-items: center; padding: 0 14px; font-weight: 700; cursor: pointer; list-style: none; }
details.ajout summary::before { content: "+"; width: 1.4em; font-size: 1.3rem; }
details.ajout[open] summary::before { content: "−"; }
details.ajout form { padding: 4px 14px 16px; }

/* PIN affiché une seule fois après création */
.pin-cree {
  padding: 16px;
  border: 2px dashed var(--scelle);
  border-radius: var(--rayon);
  background: #E6F3EE;
}
.pin-cree strong { display: block; font-size: 2rem; letter-spacing: 0.3em; font-weight: 800; color: var(--scelle); }

/* ---------- Messages éphémères --------------------------------------- */

.messages { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; z-index: 20; padding: 0 16px; }
.message {
  max-width: 560px;
  padding: 12px 16px;
  border-radius: var(--rayon);
  background: var(--encre);
  color: var(--papier);
  font-weight: 600;
  box-shadow: 0 6px 20px rgb(27 36 48 / 0.25);
}
.message--erreur { background: var(--alerte); }
.message--ok { background: var(--scelle); }

@media (prefers-reduced-motion: no-preference) {
  .message { animation: monter 180ms ease-out; }
  @keyframes monter { from { transform: translateY(8px); opacity: 0; } }
}

/* =====================================================================
   Étape 2 — Guichet
   ===================================================================== */

fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 12px; }
legend {
  width: 100%;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--encre);
  font-size: 1.1rem;
  font-weight: 800;
  font-stretch: 85%;
}
.formulaire-colis > * + * { margin-top: 28px; }

.photo { display: grid; gap: 10px; }
.photo__bouton { position: relative; min-height: 64px; border-style: dashed; }
.photo__fichier { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo__apercu { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--rayon); border: 1.5px solid var(--trait); }

.bouton--whatsapp { background: var(--scelle); color: var(--papier); text-decoration: none; text-align: center; }
.bouton--whatsapp:hover { background: #0B6549; }
a.bouton { text-decoration: none; }

.confirmation {
  padding: 22px 18px;
  border-radius: var(--rayon);
  background: var(--encre);
  color: var(--papier);
  text-align: center;
}
.confirmation .doux { color: #B8C2CE; }
.confirmation__code {
  margin: 6px 0;
  color: var(--etiquette);
  font-size: clamp(1.6rem, 8vw, 2.2rem);
  font-weight: 800;
  font-stretch: 75%;
  letter-spacing: 0.04em;
}

.resume { display: flex; flex-wrap: wrap; gap: 10px; }
.resume > div { flex: 1 1 140px; padding: 12px 14px; border-radius: var(--rayon); background: var(--papier); border: 1.5px solid var(--trait); }
.resume strong { display: block; font-size: 1.3rem; font-weight: 800; font-stretch: 85%; }
.resume span { color: var(--encre-douce); font-size: 0.9rem; }

/* =====================================================================
   Suivi public
   ===================================================================== */

.suivi { padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
.suivi__code { font-stretch: 75%; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.suivi__trajet { font-size: 1.2rem; font-weight: 700; }

.frise { list-style: none; margin: 0; padding: 0; }
.frise li {
  position: relative;
  padding: 0 0 18px 34px;
  color: var(--encre-douce);
}
.frise li::before {
  content: "";
  position: absolute;
  left: 6px; top: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--trait);
  background: var(--fond);
}
.frise li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px; top: 22px; bottom: 0;
  width: 2px;
  background: var(--trait);
}
.frise li.fait { color: var(--encre); }
.frise li.fait::before { border-color: var(--scelle); background: var(--scelle); }
.frise li.fait::after { background: var(--scelle); }
.frise li.actuel { color: var(--encre); font-weight: 800; }
.frise li.actuel::before { width: 20px; height: 20px; left: 3px; top: 2px; border: 4px solid var(--etiquette); background: var(--encre); }

.historique { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--trait); }
.historique li { display: grid; padding: 10px 0; border-bottom: 1.5px solid var(--trait); }
.historique span { color: var(--encre-douce); font-size: 0.9rem; }

.carte-agence { padding: 14px; border-radius: var(--rayon); background: var(--papier); border: 1.5px solid var(--trait); }
.carte-agence a { color: var(--encre); font-weight: 700; font-size: 1.1rem; }

/* =====================================================================
   Impression 58 mm : étiquettes et reçu
   ===================================================================== */

#impression { display: none; }

@media print {
  body { background: #fff; min-height: 0; padding: 0; }
  body > *:not(#impression) { display: none !important; }
  #impression { display: block; }

  .ticket {
    width: 54mm;
    color: #000;
    font-family: "MAM Ticket", Arial, sans-serif;
    font-size: 9pt;
    line-height: 1.3;
    text-align: center;
    break-after: page;
    page-break-after: always;
  }
  .ticket:last-child { break-after: auto; page-break-after: auto; }
  .ticket p { margin: 0 0 1.5mm; }
  .ticket .qr { width: 34mm; margin: 0 auto 2mm; }
  .ticket .qr svg { display: block; width: 100%; height: auto; }
  .ticket__code { font-size: 13pt; font-weight: 800; letter-spacing: 0.5pt; }
  .ticket__trajet { font-size: 15pt; font-weight: 800; text-transform: uppercase; }
  .ticket__pied { display: flex; justify-content: space-between; font-size: 7.5pt; border-top: 0.3mm solid #000; padding-top: 1mm; }
  .ticket__entete { font-size: 11pt; font-weight: 800; }
  .ticket--recu dl { display: grid; grid-template-columns: auto 1fr; gap: 0.6mm 2mm; margin: 2mm 0; text-align: left; }
  .ticket--recu dt { font-weight: 700; }
  .ticket--recu dd { margin: 0; overflow-wrap: anywhere; }
  .ticket__montant { font-weight: 800; }
  .ticket__pied-texte { font-size: 7.5pt; }
  /* v1.20 : destination très lisible, contenu en gras, numéro de réclamation */
  .ticket__destination { font-size: 18pt; font-weight: 800; text-transform: uppercase; line-height: 1.1; margin-bottom: 0.5mm; overflow-wrap: anywhere; }
  .ticket__depuis { font-size: 9pt; }
  .ticket__nature { font-size: 11pt; font-weight: 800; border: 0.4mm solid #000; padding: 1mm; }
  .ticket__reclamation { font-size: 9pt; font-weight: 800; margin-top: 1.5mm; }
}

/* =====================================================================
   Étape 3 — Lots, bordereaux, réception
   ===================================================================== */

.carte { padding: 14px; border-radius: var(--rayon); background: var(--papier); border: 1.5px solid var(--trait); }

.succes, .info {
  padding: 12px 14px;
  border-radius: 0 var(--rayon) var(--rayon) 0;
  font-weight: 600;
}
.succes { border-left: 4px solid var(--scelle); background: #E6F3EE; color: #0A4F3A; }
.info { border-left: 4px solid var(--encre-douce); background: var(--papier); }

/* Scanner */
.scanner { display: grid; gap: 10px; padding: 14px; border-radius: var(--rayon); background: var(--encre); color: var(--papier); }
.scanner h2 { font-size: 1.05rem; }
.scanner__ecran { position: relative; border-radius: 8px; overflow: hidden; background: #000; }
.scanner__ecran:has(video[hidden]) { display: none; }
.scanner__video { display: block; width: 100%; max-height: 46vh; object-fit: cover; }
.scanner__visee {
  position: absolute; inset: 18% 22%;
  border: 3px solid var(--etiquette);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgb(0 0 0 / 0.35);
}
.scanner .bouton--sobre { background: transparent; color: var(--papier); border-color: #4F5B6A; }
.scanner .bouton--sobre:hover { background: rgb(255 255 255 / 0.06); }
.scanner__formulaire { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.scanner__saisie { font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.scanner__ok { width: auto; min-width: 72px; }
.scanner__resultat:empty { display: none; }
.scanner__resultat { padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.scanner__resultat--ok { background: var(--scelle); }
.scanner__resultat--erreur { background: var(--alerte); }
.scanner__resultat--info { background: #3A4656; }

/* Listes et pastilles */
.compteur {
  flex: none; min-width: 40px; padding: 4px 8px; border-radius: 6px;
  background: var(--etiquette); color: var(--encre); font-weight: 800; text-align: center;
}
.pastille-statut { flex: none; font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.pastille-statut--ouvert { background: #FDF3D0; color: #6B5100; }
.pastille-statut--ferme { background: #E6F3EE; color: #0A4F3A; }
.liste--attente li { padding-top: 8px; padding-bottom: 8px; opacity: 0.75; }

/* Choix des lots du bordereau */
.groupe-cases { display: grid; gap: 6px; }
.groupe-cases__titre { font-weight: 800; font-size: 1.05rem; margin-top: 6px; }
.case {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--toucher); padding: 8px 12px;
  border: 1.5px solid var(--trait); border-radius: var(--rayon); background: var(--papier);
  cursor: pointer;
}
.case:has(input:checked) { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); }
.case input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--encre); }

/* Signature */
.signature { display: grid; justify-items: end; gap: 4px; }
.signature__zone {
  width: 100%; height: 180px;
  border: 2px dashed var(--encre-douce); border-radius: var(--rayon);
  background: var(--papier);
  touch-action: none;
}

/* Progression de la réception */
.progression { display: grid; gap: 6px; }
.progression__barre { height: 12px; border-radius: 999px; background: var(--trait); overflow: hidden; }
.progression__barre span { display: block; height: 100%; background: var(--scelle); transition: width 200ms ease; }
.progression strong { font-size: 1.3rem; }

details > summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }

@media print {
  .ticket__gare { margin-top: 2mm; padding-top: 1.5mm; border-top: 0.4mm solid #000; text-align: left; }
  .ticket__gare .ticket__trajet { text-align: center; font-size: 12pt; }
  .ticket__lot { margin-bottom: 1.5mm; }
  .ticket__liste { font-size: 7.5pt; word-spacing: 2pt; overflow-wrap: anywhere; }
  .ticket__signature-titre { margin-top: 3mm !important; font-weight: 700; }
  .ticket__signature { display: block; width: 100%; max-height: 22mm; object-fit: contain; border: 0.3mm solid #000; }
  .ticket__ligne { margin-top: 5mm !important; padding-bottom: 6mm; border-bottom: 0.3mm dotted #000; text-align: left; }
}

/* =====================================================================
   Étapes 4 et 5 — Retrait, contrôle, direction
   ===================================================================== */

textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--trait); border-radius: var(--rayon); font: inherit; background: var(--papier); color: var(--encre); resize: vertical; }
.texte-alerte { color: var(--alerte); font-weight: 700; }
.liste li.liste__bloc { display: grid; gap: 10px; align-items: stretch; }
.liste__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.liste__actions .bouton { width: auto; flex: 1 1 auto; }
.lien-bloc { color: inherit; text-decoration: none; }
.lien-bloc:hover strong { text-decoration: underline; }
.champ--bas { align-content: end; }

.a-encaisser { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: #FDF3D0; }
.a-encaisser strong { font-size: 1.15rem; }

.titre-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.titre-ligne input { width: auto; }

.indicateurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.indicateur { display: grid; gap: 2px; padding: 14px; border-radius: var(--rayon); background: var(--papier); border: 1.5px solid var(--trait); color: inherit; text-decoration: none; }
.indicateur strong { font-size: 1.6rem; font-weight: 800; font-stretch: 80%; line-height: 1.1; }
.indicateur span { color: var(--encre-douce); font-size: 0.88rem; }
.indicateur--alerte { border-color: var(--alerte); background: var(--alerte-fond); }
.indicateur--alerte strong { color: var(--alerte); }
a.indicateur:hover { border-color: var(--encre); }

.tableau-defilant { overflow-x: auto; border: 1.5px solid var(--trait); border-radius: var(--rayon); background: var(--papier); }
.tableau { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tableau th, .tableau td { padding: 10px 12px; border-bottom: 1px solid var(--trait); text-align: right; white-space: nowrap; }
.tableau th:first-child { text-align: left; }
.tableau thead th { font-size: 0.82rem; color: var(--encre-douce); font-weight: 650; }
.tableau tbody tr:last-child > * { border-bottom: 0; }

.fiche { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 14px; border-radius: var(--rayon); background: var(--papier); border: 1.5px solid var(--trait); }
.fiche dt { font-weight: 700; color: var(--encre-douce); }
.fiche dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .fiche { grid-template-columns: 1fr; } .fiche dd { margin-bottom: 6px; } }

.journal { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 3px solid var(--trait); }
.journal li { position: relative; display: grid; padding: 0 0 14px 6px; }
.journal li::before { content: ""; position: absolute; left: -26px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--encre); border: 3px solid var(--fond); }
.journal span { color: var(--encre-douce); font-size: 0.9rem; }

/* =====================================================================
   Version 1.1 — Coque, navigation, rapports
   ===================================================================== */

:root {
  --ombre: 0 1px 2px rgb(27 36 48 / 0.06), 0 2px 8px rgb(27 36 48 / 0.05);
  --barre-bas: 64px;
}

/* ---------- En-tête et navigation ----------------------------------- */

.entete {
  position: sticky; top: 0; z-index: 10;
  background: var(--encre); color: var(--papier);
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
}
.entete__barre {
  display: flex; align-items: center; gap: 14px;
  max-width: 1200px; margin: 0 auto; padding: 10px var(--marge);
}
.entete__barre > a { flex: none; text-decoration: none; }
.entete__lieu { flex: 1; min-width: 0; line-height: 1.25; }
.entete__lieu strong { display: block; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entete__lieu span { color: #B8C2CE; font-size: 0.84rem; }
.entete__compte { display: flex; align-items: center; gap: 10px; }
.entete__nom { display: none; text-align: right; font-size: 0.9rem; font-weight: 650; line-height: 1.2; }
.entete__nom small { display: block; color: #B8C2CE; font-weight: 500; }
.entete__compte button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px;
  border: 1px solid #3A4656; border-radius: var(--rayon);
  background: transparent; color: var(--papier); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.entete__compte button:hover { background: rgb(255 255 255 / 0.06); }
.entete__quitter { display: none; }
.entete .etiquette::before { background: var(--encre); }

.navigation { display: flex; }
.navigation__lien {
  display: flex; align-items: center; gap: 8px;
  color: #B8C2CE; text-decoration: none; font-weight: 650;
}
.navigation__lien:hover { color: var(--papier); }
.navigation__lien--actif { color: var(--etiquette); }

/* Téléphone : barre d'icônes fixée en bas */
@media (max-width: 899px) {
  .navigation {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    justify-content: space-around;
    height: calc(var(--barre-bas) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--encre);
    box-shadow: 0 -2px 10px rgb(0 0 0 / 0.15);
  }
  .navigation__lien { flex: 1; flex-direction: column; justify-content: center; gap: 3px; font-size: 0.72rem; }
  .navigation__lien--actif { box-shadow: inset 0 3px 0 var(--etiquette); }
  .navigation__long { display: none; }
  body.avec-navigation .vue { padding-bottom: calc(var(--barre-bas) + 32px + env(safe-area-inset-bottom, 0px)); }
  body.avec-navigation .messages { bottom: calc(var(--barre-bas) + 12px + env(safe-area-inset-bottom, 0px)); }
}

/* Ordinateur : onglets sous l'en-tête, comme un logiciel de gestion */
@media (min-width: 900px) {
  .entete__nom, .entete__quitter { display: block; }
  .navigation { max-width: 1200px; margin: 0 auto; padding: 0 var(--marge); gap: 4px; }
  .navigation__lien { padding: 12px 16px; border-bottom: 3px solid transparent; font-size: 0.95rem; }
  .navigation__lien--actif { border-bottom-color: var(--etiquette); background: rgb(255 255 255 / 0.04); }
  .navigation__court { display: none; }
}

/* Pages larges (tableaux, rapports) */
.vue--large { max-width: 1200px; }
.vue { padding-top: 24px; }

/* ---------- Surfaces ------------------------------------------------- */

.liste, .carte, .panneau, .indicateur, .resume > div, details.ajout, .fiche, .tableau-defilant, .case, .carte-agence {
  box-shadow: var(--ombre);
}
.liste, .carte, .panneau, .tableau-defilant, .fiche { border-color: #E1E6E0; }

.panneau { display: grid; gap: 14px; padding: 18px; border-radius: 12px; background: var(--papier); border: 1.5px solid #E1E6E0; min-width: 0; }
.panneau__titre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.grille-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grille-2 { grid-template-columns: 1fr 1fr; } }

.graphique { position: relative; width: 100%; }

/* Indicateurs */
.indicateurs--4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.indicateur { border-radius: 12px; border-color: #E1E6E0; padding: 16px; gap: 4px; }
.indicateurs--4 .indicateur span { order: -1; font-weight: 650; }
.variation { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 0.82rem; }
.variation--hausse { color: var(--scelle); }
.variation--baisse { color: var(--alerte); }

/* Filtres et période */
.barre-filtres { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; padding: 14px; border-radius: 12px; background: var(--papier); border: 1.5px solid #E1E6E0; box-shadow: var(--ombre); }
.barre-filtres .champ { flex: 1 1 150px; }
.barre-filtres--donnees .champ:last-child { flex: 2 1 220px; }
.periode { display: grid; gap: 10px; flex: 3 1 420px; }
.periode__dates { display: flex; gap: 12px; }
.periode__dates .champ { flex: 1; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce {
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--trait); background: var(--papier); color: var(--encre);
  font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer;
}
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--papier); }

.bouton--compact { width: auto; min-height: 40px; padding: 0 14px; font-size: 0.9rem; }
.bouton-icone { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: var(--encre); }
.bouton-icone:hover { background: var(--fond); }

/* Onglets */
.onglets { display: flex; gap: 4px; border-bottom: 2px solid var(--trait); overflow-x: auto; }
.onglet { padding: 10px 14px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--encre-douce); font-weight: 700; text-decoration: none; white-space: nowrap; }
.onglet[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--etiquette); }

/* Tableaux de données */
.tableau--donnees td, .tableau--donnees th { text-align: left; vertical-align: top; white-space: normal; }
.tableau--donnees tbody tr:hover { background: #F7F9F6; }
.statut { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; background: var(--fond); }
.statut--enregistre, .statut--en_sac { background: #EEF0F3; color: #3A4656; }
.statut--en_route { background: #FDF3D0; color: #6B5100; }
.statut--arrive { background: #E3EEFB; color: #1D4F91; }
.statut--remis { background: #E6F3EE; color: #0A4F3A; }
.statut--annule { background: #EEE; color: #666; text-decoration: line-through; }
.statut--en_anomalie { background: var(--alerte-fond); color: #7A1B16; }

/* Sur téléphone, chaque ligne de tableau devient une fiche */
@media (max-width: 699px) {
  .tableau--donnees thead { display: none; }
  .tableau--donnees, .tableau--donnees tbody, .tableau--donnees tr, .tableau--donnees td, .tableau--donnees th { display: block; }
  .tableau--donnees tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--trait); }
  .tableau--donnees td, .tableau--donnees th { padding: 2px 0; border: 0; }
  .tableau--donnees th { font-size: 1.05rem; }
  .tableau--donnees td[data-label]::before { content: attr(data-label) " : "; color: var(--encre-douce); font-size: 0.85rem; }
  .tableau--donnees td:last-child { position: absolute; top: 8px; right: 8px; }
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; }

/* Classements */
.rang { margin: 0; padding: 0; list-style: none; counter-reset: rang; }
.rang[start="4"] { counter-reset: rang 3; }
.rang li { counter-increment: rang; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.rang li::before { content: counter(rang); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fond); font-weight: 800; font-size: 0.85rem; }
.rang li span { flex: 1; }
.rang--alerte li::before { background: var(--alerte-fond); color: var(--alerte); }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; }
.podium__marche { display: grid; justify-items: center; gap: 4px; padding: 14px 8px; border-radius: 12px 12px 4px 4px; background: var(--fond); text-align: center; }
.podium__marche strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.podium__marche--1 { min-height: 170px; background: #FDF3D0; }
.podium__marche--2 { min-height: 140px; }
.podium__marche--3 { min-height: 120px; }
.podium__rang { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--encre); color: var(--papier); font-weight: 800; }
.podium__marche--1 .podium__rang { background: var(--etiquette); color: var(--encre); }
.podium__valeur { font-weight: 800; font-stretch: 85%; }

/* Hub des paramètres */
.cartes-liens { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.carte-lien { display: grid; gap: 6px; padding: 18px; border-radius: 12px; background: var(--papier); border: 1.5px solid #E1E6E0; box-shadow: var(--ombre); color: inherit; text-decoration: none; }
.carte-lien:hover { border-color: var(--encre); }
.carte-lien span:last-child { color: var(--encre-douce); font-size: 0.92rem; }
.carte-lien__icone { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--encre); color: var(--etiquette); }

/* Accueil des agents : cartes plutôt qu'une liste nue */
@media (min-width: 700px) {
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border: 0; }
  .actions li { border: 0; }
  .action { height: 100%; padding: 16px; border-radius: 12px; background: var(--papier); border: 1.5px solid #E1E6E0; box-shadow: var(--ombre); }
  a.action:hover { border-color: var(--encre); }
}
@media (max-width: 599px) {
  .indicateurs--4 { grid-template-columns: 1fr 1fr; }
  .indicateurs--4 .indicateur strong { font-size: 1.2rem; }
  .indicateurs--4 .variation { font-size: 0.75rem; }
}

/* ---------- Bagages ------------------------------------------------- */
.pas-a-pas { display: grid; grid-template-columns: 52px 1fr 52px; gap: 6px; }
.pas-a-pas .bouton { width: 52px; padding: 0; font-size: 1.4rem; }
.compteur-saisie { text-align: center; font-size: 1.25rem; font-weight: 800; }
.prix-bagages { display: grid; gap: 4px; padding: 14px; border-radius: var(--rayon); background: #FDF3D0; border: 1.5px solid #F0DC8E; }
.prix-bagages__total { margin-top: 4px; font-size: 1.3rem; font-weight: 800; font-stretch: 85%; }
.prix-bagages__indication { margin-top: 4px; font-weight: 650; color: #6B5100; }
.alerte-controle { display: grid; gap: 10px; padding: 14px; border-radius: var(--rayon); background: var(--alerte-fond); border: 1.5px solid #F0C4C0; }

/* =====================================================================
   Version 1.3 — Logo et fonds
   ===================================================================== */

/* Trame de points très légère derrière toute l'application */
body {
  background-color: var(--fond);
  background-image: radial-gradient(rgb(27 36 48 / 0.07) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-attachment: fixed;
}

/* Marque dans l'en-tête */
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--papier); text-decoration: none; }
.marque img { display: block; }
.marque__nom { font-weight: 800; font-stretch: 75%; font-size: 1.25rem; letter-spacing: 0.01em; white-space: nowrap; }
@media (max-width: 420px) { .marque__nom { display: none; } }

/* Écran de connexion : fond encre et réseau de gares */
body.page-connexion {
  background-color: var(--encre);
  background-image: url("../img/fond-reseau.svg"), radial-gradient(circle at 20% 10%, #263243 0%, var(--encre) 60%);
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
  color: var(--papier);
}
.page-connexion .vue { max-width: 480px; }
.connexion { min-height: 100dvh; padding: 32px 0; gap: 24px; }
.connexion__marque { gap: 10px; }
.connexion__logo { width: min(100%, 380px); height: auto; margin-left: -8px; }
.connexion__marque p { color: #C9D2DC; }
.connexion__carte {
  display: grid; gap: 18px;
  padding: 24px; border-radius: 16px;
  background: var(--papier); color: var(--encre);
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.35);
}
.connexion__pied { color: #8D99A8; font-size: 0.88rem; }

/* Page de suivi publique */
.suivi__logo { width: min(100%, 300px); height: auto; margin-left: -6px; }

/* Impression : papier blanc, sans trame ni fond, quel que soit l'écran */
@media print {
  @page { margin: 3mm; }
  html, body, body.page-connexion { background: #fff !important; background-image: none !important; }
}

/* ---------- Fenêtres (détails, annulation) -------------------------- */
.fenetre {
  width: min(92vw, 520px); max-height: 88dvh; padding: 0;
  border: 0; border-radius: 16px; background: var(--papier); color: var(--encre);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
  display: flex; flex-direction: column; overflow: hidden;
}
.fenetre:not([open]) { display: none; }
.fenetre--large { width: min(94vw, 680px); }
.fenetre::backdrop { background: rgb(27 36 48 / 0.55); }
.fenetre__entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--trait); }
.fenetre__fermer { width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; font-size: 1.8rem; line-height: 1; color: var(--encre-douce); cursor: pointer; }
.fenetre__fermer:hover { background: var(--fond); }
.fenetre__corps { padding: 18px 20px; overflow-y: auto; }
.fenetre__pied { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--trait); background: #FAFBF9; }
.fenetre__pied .bouton { width: auto; }

.details { width: 100%; border-collapse: collapse; }
.details th, .details td { padding: 10px 6px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: top; }
.details th { width: 42%; font-weight: 600; color: var(--encre-douce); }
.details td { overflow-wrap: anywhere; }
.details__fort th, .details__fort td { color: var(--alerte); font-weight: 800; font-size: 1.05rem; }
.details__code th, .details__code td { color: var(--scelle); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; }

.actions-ligne { display: flex; gap: 4px; justify-content: flex-end; }
.bouton-icone { border: 0; background: none; cursor: pointer; }
.bouton-icone--danger { color: var(--alerte); }
.bouton-icone--danger:hover { background: var(--alerte-fond); }
.bouton--danger { background: var(--alerte); color: var(--papier); }
.bouton--danger:hover { background: #A8261F; }
.case--compacte { min-height: 44px; padding: 6px 12px; flex: 0 0 auto; align-self: end; box-shadow: none; }

/* ---------- Panneau latéral (fiche visuelle) ------------------------ */
.fenetre--tiroir {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(100vw, 460px);
  border-radius: 0; box-shadow: -12px 0 40px rgb(0 0 0 / 0.25);
}
@media (prefers-reduced-motion: no-preference) {
  .fenetre--tiroir[open] { animation: glisser 220ms ease-out; }
  @keyframes glisser { from { transform: translateX(40px); opacity: 0; } }
}
@media (max-width: 599px) {
  .fenetre--tiroir { margin: auto 0 0; width: 100vw; max-width: 100vw; height: auto; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes glisser { from { transform: translateY(40px); opacity: 0; } }
  }
}
.fenetre--tiroir .fenetre__corps { padding: 0; background: var(--fond); }

.fiche-visuelle { display: grid; gap: 12px; padding-bottom: 16px; }

.bandeau { display: grid; gap: 8px; padding: 18px 20px 20px; background: var(--encre); color: var(--papier); }
.bandeau__haut { display: flex; justify-content: space-between; align-items: center; }
.bandeau__haut small { color: #B8C2CE; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; font-size: 0.75rem; }
.bandeau__code { font-size: 1.6rem; font-weight: 800; font-stretch: 75%; letter-spacing: 0.03em; color: var(--etiquette); }
.bandeau__etape { color: #C9D2DC; font-size: 0.92rem; }
.trajet { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 6px; }
.trajet strong { font-size: 0.98rem; }
.trajet__ligne { position: relative; display: flex; justify-content: space-between; align-items: center; height: 14px; }
.trajet__ligne::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: #3A4656; }
.trajet__ligne span { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #3A4656; }
.trajet__ligne span.fait { background: var(--etiquette); }
.trajet__ligne span.actuel { width: 14px; height: 14px; background: var(--etiquette); box-shadow: 0 0 0 4px rgb(242 194 48 / 0.25); }
.trajet__ligne--alerte span.actuel { background: var(--alerte); box-shadow: 0 0 0 4px rgb(200 50 43 / 0.3); }

.bloc-fiche { display: grid; gap: 10px; margin: 0 14px; padding: 14px; border-radius: 12px; background: var(--papier); border: 1.5px solid #E1E6E0; }
.bloc-fiche h3 { font-size: 0.95rem; }
.bloc-fiche--discret { gap: 4px; background: transparent; border: 0; padding: 4px 14px; color: var(--encre-douce); font-size: 0.9rem; }

.personnes { gap: 0; padding: 4px 14px; }
.personne { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.personne + .personne { border-top: 1px solid var(--trait); }
.personne__avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--encre); color: var(--etiquette); font-weight: 800; font-size: 0.9rem; }
.personne__texte { flex: 1; min-width: 0; display: grid; }
.personne__texte small { color: var(--encre-douce); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.personne__texte strong { overflow-wrap: anywhere; }
.personne__texte span { color: var(--encre-douce); font-size: 0.9rem; }
.personne__actions { display: flex; gap: 6px; }
.bouton-rond { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--trait); color: var(--encre); text-decoration: none; }
.bouton-rond:hover { border-color: var(--encre); }
.bouton-rond--whatsapp { color: var(--scelle); }

.pastilles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pastille-info { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--fond); }
.pastille-info small { color: var(--encre-douce); font-size: 0.78rem; }
.pastille-info strong { font-size: 0.98rem; overflow-wrap: anywhere; }
.pastille-info--fort { background: #FDF3D0; }
.citation { padding: 8px 12px; border-left: 3px solid var(--etiquette); color: var(--encre-douce); font-style: italic; }

.bouton-icone--inactif { color: #B5BDB4; }
.bouton-icone--inactif:hover { background: var(--fond); color: var(--encre-douce); }

/* ---------- Mon point du jour --------------------------------------- */
.point__total { display: grid; gap: 4px; padding: 20px; border-radius: 14px; background: var(--encre); color: var(--papier); box-shadow: var(--ombre); }
.point__total small { color: #B8C2CE; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; font-size: 0.78rem; }
.point__total > strong { font-size: 2.2rem; font-weight: 800; font-stretch: 80%; color: var(--etiquette); line-height: 1.1; }
.point__total > p { color: #C9D2DC; }
.point__cloture { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: rgb(255 255 255 / 0.07); font-size: 0.9rem; }
.point__cloture--ok { background: rgb(14 124 90 / 0.35); color: var(--papier) !important; }
.point__ligne { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--trait); }
.point__ligne:last-child { border-bottom: 0; }
.exports { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Données : activité par gare ----------------------------- */
.cartes-gares { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.carte-gare { display: grid; gap: 12px; padding: 16px; border-radius: 14px; background: var(--papier); border: 1.5px solid #E1E6E0; box-shadow: var(--ombre); }
.carte-gare__entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.carte-gare__entete h2 { font-size: 1.3rem; }
.carte-gare__entete small { color: var(--encre-douce); }
.carte-gare__recette { font-size: 1.5rem; font-weight: 800; font-stretch: 85%; }
.carte-gare__recette small { font-size: 0.85rem; font-weight: 500; color: var(--encre-douce); }
.carte-gare__groupe { display: grid; gap: 6px; }
.carte-gare__groupe h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-douce); }
.stats-gare { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.stat-gare { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--fond); }
.stat-gare strong { font-size: 1.2rem; font-weight: 800; }
.stat-gare span { font-size: 0.78rem; color: var(--encre-douce); line-height: 1.2; }
.stat-gare--alerte { background: #FDF3D0; }
.carte-gare__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.carte-gare__actions .bouton { flex: 1; }
.badge-alerte { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--alerte-fond); color: var(--alerte); font-weight: 700; font-size: 0.8rem; text-decoration: none; }

/* ---------- Suivi : bandeau d'état ---------------------------------- */
.suivi__bandeau { padding: 14px 16px; border-radius: 12px; font-weight: 700; font-size: 1.05rem; line-height: 1.35; }
.suivi__bandeau--ok { background: #E6F3EE; color: #0A4F3A; border-left: 5px solid var(--scelle); }
.suivi__bandeau--info { background: #FDF3D0; color: #5C4600; border-left: 5px solid var(--etiquette); }
.suivi__bandeau--alerte { background: var(--alerte-fond); color: #7A1B16; border-left: 5px solid var(--alerte); }
.suivi__maj { font-size: 0.85rem; }
.point__activite { display: grid; gap: 10px; }
.point__total--bagages { background: #2A3446; }
.caisse-bloc { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--fond); }
.caisse-bloc__titre { font-weight: 800; }
.bloc-activite { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1.5px solid #E1E6E0; }
.bloc-activite--bagages { background: #F7F9FC; }
.bloc-activite__titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bloc-activite__titre h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-douce); }
.bloc-activite__titre strong { font-size: 1.25rem; font-weight: 800; font-stretch: 85%; }
@media print {
  .ticket__codes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3mm 1.5mm; font-size: 7pt; font-family: "Courier New", monospace; }
}

/* Alerte dépliable (tableau de bord) */
details.alerte-depliable { display: grid; gap: 10px; }
details.alerte-depliable > summary { font-size: 1.15rem; list-style: none; gap: 8px; }
details.alerte-depliable > summary::before { content: "▸"; transition: transform .15s; }
details.alerte-depliable[open] > summary::before { transform: rotate(90deg); }
details.alerte-depliable > summary::-webkit-details-marker { display: none; }

/* =====================================================================
   Version 1.19 — Finition premium
   Effets légers en CSS seul (aucune image, aucune vidéo). Les écrans de
   travail restent sobres. Tout mouvement s'arrête si le téléphone est
   réglé sur « réduire les animations ».
   ===================================================================== */

@keyframes mm-derive-a { from { transform: translate(-10%, -6%) scale(1); } to { transform: translate(12%, 10%) scale(1.25); } }
@keyframes mm-derive-b { from { transform: translate(8%, 12%) scale(1.1); } to { transform: translate(-14%, -8%) scale(0.9); } }
@keyframes mm-reflet   { from { transform: translateX(-25%); } to { transform: translateX(25%); } }
@keyframes mm-pouls    { from { box-shadow: 0 0 0 0 rgb(242 194 48 / 0.7); } to { box-shadow: 0 0 0 12px rgb(242 194 48 / 0); } }

/* ---- Connexion : deux lueurs qui dérivent lentement, carte vitrée ---- */
body.page-connexion { position: relative; overflow-x: hidden; }
body.page-connexion::before,
body.page-connexion::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
}
body.page-connexion::before {
  width: 900px; height: 900px; left: -260px; top: -320px;
  background: radial-gradient(circle, rgb(242 194 48 / 0.26) 0%, rgb(242 194 48 / 0) 65%);
  animation: mm-derive-a 22s ease-in-out infinite alternate;
}
body.page-connexion::after {
  width: 1000px; height: 1000px; right: -340px; bottom: -420px;
  background: radial-gradient(circle, rgb(56 104 160 / 0.42) 0%, rgb(56 104 160 / 0) 65%);
  animation: mm-derive-b 28s ease-in-out infinite alternate;
}
body.page-connexion > .vue { position: relative; z-index: 1; }
.connexion__carte {
  background: rgb(27 36 48 / 0.62); color: var(--papier);
  border: 1px solid rgb(255 255 255 / 0.12);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.45);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.connexion__carte label, .connexion__carte h1 { color: var(--papier); }
.connexion__carte small { color: #B8C2CE; }
.connexion__carte input {
  background: rgb(255 255 255 / 0.07); color: var(--papier);
  border-color: rgb(255 255 255 / 0.2);
}
.connexion__carte input::placeholder { color: #8D99A8; }
.connexion__carte input:focus { border-color: var(--etiquette); box-shadow: 0 0 0 3px rgb(242 194 48 / 0.25); }
.connexion__carte .bouton {
  background: linear-gradient(180deg, #F7CF4A, var(--etiquette)); color: var(--encre);
  box-shadow: 0 8px 24px rgb(242 194 48 / 0.3);
}
.connexion__carte .erreur { background: rgb(200 50 43 / 0.18); color: #FFD9D5; border-color: rgb(200 50 43 / 0.5); }

/* ---- En-tête : reflet lumineux. Animé sur grand écran seulement
        (direction, ordinateurs) ; fixe sur les téléphones des agents. ---- */
.entete { overflow-x: clip; }
.entete::before {
  content: ""; position: absolute; inset: 0 -40%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 50%, rgb(242 194 48 / 0.16), rgb(242 194 48 / 0) 55%),
    radial-gradient(ellipse at 72% 40%, rgb(56 104 160 / 0.3), rgb(56 104 160 / 0) 55%);
}
.entete__barre { position: relative; z-index: 1; }
@media (min-width: 900px) { .entete .navigation { position: relative; z-index: 1; } }
@media (min-width: 900px) {
  .entete::before { animation: mm-reflet 20s ease-in-out infinite alternate; }
}

/* ---- Indicateurs : ombre douce, léger relief au survol des liens ---- */
.indicateur { box-shadow: 0 6px 20px rgb(27 36 48 / 0.06); }
.indicateur--alerte { background: linear-gradient(160deg, #FFF1EE, #FCE3DE); box-shadow: 0 6px 20px rgb(200 50 43 / 0.08); }
a.indicateur { transition: transform .18s ease, box-shadow .18s ease; }
a.indicateur:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgb(27 36 48 / 0.12); }

/* ---- Suivi client : lueur en haut de page, étape actuelle qui pulse ---- */
body:has(.suivi)::before {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  width: 620px; height: 620px; left: -200px; top: -340px; border-radius: 50%;
  background: radial-gradient(circle, rgb(242 194 48 / 0.28), rgb(242 194 48 / 0) 62%);
  animation: mm-derive-a 18s ease-in-out infinite alternate;
}
.suivi { position: relative; z-index: 1; }
.frise li.actuel::before { animation: mm-pouls 1.8s ease-out infinite; }
.suivi .carte-agence { box-shadow: 0 12px 30px rgb(27 36 48 / 0.08); }

/* Alerte dépliable : flèche qui tourne à l'ouverture */
details.alerte-depliable > summary::before { transition: transform .2s ease; }

/* ---- Économie : aucun mouvement si l'appareil le demande, ni à l'impression ---- */
@media (prefers-reduced-motion: reduce) {
  body.page-connexion::before, body.page-connexion::after, .entete::before,
  body:has(.suivi)::before, .frise li.actuel::before { animation: none !important; }
  a.indicateur { transition: none; }
}
@media print {
  body.page-connexion::before, body.page-connexion::after, .entete::before, body:has(.suivi)::before { display: none !important; }
}

/* =====================================================================
   Version 1.17 — Journal des erreurs
   ===================================================================== */

.trace {
  margin: 4px 0 0; padding: 8px 10px; max-height: 180px; overflow: auto;
  border-radius: 8px; background: var(--fond); color: var(--encre-douce);
  font-size: 0.78rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.historique .liste__actions { margin-top: 6px; }

/* v1.25 : écran de vérification au guichet, champ rempli automatiquement */
.recapitulatif { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.recapitulatif dt { font-weight: 700; color: var(--encre-douce); }
.recapitulatif dd { margin: 0; overflow-wrap: anywhere; }
.recapitulatif__fort { font-size: 1.15rem; font-weight: 800; color: var(--encre); }
.champ--rempli { background: #FFF8DC; }

/* v1.26 : choix « Propriétaire » ou « Livreur » au guichet */
.choix-expediteur { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix-expediteur__bouton {
  min-height: 52px; border-radius: var(--rayon); border: 2px solid var(--trait); background: var(--papier);
  color: var(--encre); font: inherit; font-size: 1.05rem; font-weight: 750; cursor: pointer;
}
.choix-expediteur__bouton[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--etiquette); }

/* v1.31 : liste compacte des colis d'un bordereau */
.liste--serree li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; font-size: 0.92rem; }

/* v1.35 : caméra dans la page (pas de sortie vers l'appareil photo du téléphone) */
.camera__video { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; border-radius: var(--rayon); }
.photo__bouton { min-height: 56px; }

/* =====================================================================
   v1.36 — Tickets premium : deux exemplaires identiques et complets
   Noir et blanc, lisibles sur imprimante thermique 58 mm.
   ===================================================================== */
@media print {
  .ticket { width: 54mm; text-align: center; }
  .ticket__bandeau {
    display: flex; justify-content: space-between; align-items: center; gap: 2mm;
    margin: 0 0 2mm; padding: 1.2mm 2mm; background: #000; color: #fff;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .ticket__bandeau strong { font-size: 10.5pt; font-weight: 800; text-align: left; line-height: 1.15; }
  .ticket__bandeau span { font-size: 7.5pt; font-weight: 800; letter-spacing: 1.2pt; border: 0.3mm solid #fff; padding: 0.3mm 1.2mm; }
  .ticket .qr { width: 36mm; }
  .ticket__code { font-size: 12.5pt; letter-spacing: 0.8pt; margin-bottom: 1mm; }
  .ticket__infos {
    display: grid; grid-template-columns: auto 1fr; gap: 0.8mm 2mm; margin: 2mm 0 0; padding-top: 1.5mm;
    border-top: 0.3mm solid #000; text-align: left; font-size: 8.5pt; line-height: 1.25;
  }
  .ticket__infos dt { font-weight: 700; font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.3pt; padding-top: 0.2mm; }
  .ticket__infos dd { margin: 0; overflow-wrap: anywhere; }
  .ticket__fort { font-weight: 800; font-size: 9.5pt; }
  .ticket__bas { margin-top: 2mm; padding-top: 1.5mm; border-top: 0.3mm solid #000; }
  .ticket__bas .ticket__reclamation { margin: 0 0 1mm; }
  .ticket__politique { font-size: 6.8pt; line-height: 1.25; text-align: justify; margin: 0 0 1mm; }
  .ticket__exemplaire { font-size: 6.8pt; font-style: italic; margin: 0; }
}
@media print {
  .ticket__tel { white-space: nowrap; font-weight: 700; }
  .ticket__mode { font-weight: 400; font-size: 8pt; white-space: nowrap; }
}

/* =====================================================================
   v1.37 — Tickets compacts : même contenu, environ deux fois plus courts
   ===================================================================== */
@media print {
  .ticket--compact { font-size: 8pt; line-height: 1.2; }
  .ticket--compact .ticket__bandeau { margin-bottom: 1.2mm; padding: 0.8mm 1.5mm; }
  .ticket--compact .ticket__bandeau strong { font-size: 9.5pt; }
  .ticket--compact .ticket__bandeau span { font-size: 7pt; }
  .ticket__tete { display: flex; align-items: center; gap: 2mm; text-align: left; margin-bottom: 1.2mm; }
  .ticket--compact .ticket__tete .qr { flex: none; width: 24mm; margin: 0; }
  .ticket__tete-texte { min-width: 0; flex: 1; }
  .ticket__tete-texte p { margin: 0 0 0.6mm; }
  .ticket--compact .ticket__code { font-size: 7.6pt; letter-spacing: 0; white-space: nowrap; }
  .ticket--compact .ticket__destination { font-size: 13pt; line-height: 1.05; margin-bottom: 0.4mm; }
  .ticket--compact .ticket__depuis { font-size: 7.5pt; }
  .ticket__date { font-size: 7.5pt; font-weight: 700; }
  .ticket--compact .ticket__nature { font-size: 9pt; padding: 0.6mm 1mm; margin: 0 0 1.2mm; }
  .ticket--compact .ticket__infos { display: block; margin: 0; padding-top: 1mm; font-size: 8pt; }
  .ticket__info { margin: 0 0 0.5mm !important; text-align: left; overflow-wrap: anywhere; }
  .ticket__lib { font-size: 6.8pt; text-transform: uppercase; letter-spacing: 0.2pt; }
  .ticket__sep { font-weight: 700; }
  .ticket--compact .ticket__fort { font-size: 8.5pt; }
  .ticket--compact .ticket__bas { margin-top: 1mm; padding-top: 1mm; }
  .ticket--compact .ticket__reclamation { font-size: 8pt; margin: 0 0 0.6mm; }
  .ticket--compact .ticket__politique { font-size: 6.2pt; line-height: 1.15; margin: 0 0 0.6mm; text-align: left; }
  .ticket--compact .ticket__exemplaire { font-size: 6.2pt; }
}
@media print {
  .ticket--compact .ticket__tete .qr { width: 22mm; }
  .ticket--compact .ticket__code { font-size: 7pt; }
  .ticket--compact .ticket__destination { font-size: 12pt; overflow-wrap: normal; word-break: normal; hyphens: none; }
  .ticket--compact .ticket__destination--long { font-size: 9pt; }
}
@media print {
  .ticket--compact .ticket__tete { margin-bottom: 0.6mm; }
  .ticket--compact .ticket__tete .qr { width: 21mm; }
  .ticket--compact .ticket__code { font-size: 8pt; white-space: normal; overflow-wrap: anywhere; }
  .ticket--compact .ticket__destination { text-align: center; white-space: nowrap; line-height: 1.05; margin: 0 0 1mm; }
}
@media print { .ticket--compact .ticket__code { font-size: 7.5pt; white-space: nowrap; overflow-wrap: normal; } }

/* =====================================================================
   v1.38 — Exemplaire à coller : zones réservées au scotch, QR protégé
   ===================================================================== */
.ticket__scotch { display: none; }
@media print {
  .ticket--a-coller { padding-top: 0 !important; padding-bottom: 0 !important; }
  .ticket__scotch {
    display: flex; align-items: center; justify-content: center;
    height: 6mm; border: 0.3mm dashed #000; border-left: 0; border-right: 0;
    font-size: 6pt; font-weight: 700; letter-spacing: 1pt; color: #000;
  }
  .ticket__scotch--haut { margin-bottom: 1.5mm; }
  .ticket__scotch--bas { margin-top: 1.5mm; }
  /* Marge blanche autour du QR : aucun bord de ruban ne touche le carré. */
  .ticket--compact .ticket__tete { gap: 1.5mm; }
  .ticket--compact .ticket__tete .qr { box-sizing: content-box; width: 21mm; padding: 1mm; }
}
/* v1.38.1 — destination au-dessus du QR */
@media print {
  .ticket--compact .ticket__destination { margin: 0 0 1mm; }
  .ticket--compact .ticket__tete { margin-bottom: 1.2mm; }
  .ticket--compact .ticket__code { font-size: 7pt; }
}
/* v1.39 — second QR en bas à droite (diagonale opposée au premier) */
@media print {
  .ticket__bas--double { display: flex; align-items: flex-end; gap: 1.5mm; }
  .ticket__bas-texte { flex: 1; min-width: 0; }
  .ticket__bas-texte .ticket__exemplaire { text-align: left; }
  .ticket__bas-qr { flex: none; width: 17mm; text-align: center; }
  .ticket--compact .ticket__bas-qr .qr { width: 15mm; margin: 0 auto; padding: 1mm; box-sizing: content-box; }
  .ticket__code-petit { font-size: 5.2pt; font-weight: 700; margin: 0.3mm 0 0; white-space: nowrap; letter-spacing: -0.1pt; }
}
/* v1.39.1 — code, gare et date centrés dans l'espace à droite du QR */
@media print {
  .ticket--compact .ticket__tete { align-items: stretch; }
  .ticket--compact .ticket__tete-texte { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
  .ticket--compact .ticket__tete-texte p { margin: 0.4mm 0; }
}
/* v1.39.2 — code sous le QR, date en grand */
@media print {
  .ticket__qr-bloc { flex: none; display: flex; flex-direction: column; align-items: center; }
  .ticket--compact .ticket__qr-bloc .ticket__code { font-size: 6.8pt; margin: 0.6mm 0 0; white-space: nowrap; }
  .ticket--compact .ticket__tete-texte { justify-content: space-between; padding: 1mm 0; }
  .ticket--compact .ticket__depuis { font-size: 8pt; }
  .ticket__date--grande { display: flex; flex-direction: column; align-items: center; line-height: 1.05; border: 0.4mm solid #000; border-radius: 1mm; padding: 1mm 1.5mm; }
  .ticket__date--grande span:first-child { font-size: 10.5pt; font-weight: 800; }
  .ticket__date--grande span:last-child { font-size: 13pt; font-weight: 800; }
}
/* v1.39.3 — date sous la politique ; code et gare de départ ajustés */
@media print {
  .ticket--compact .ticket__qr-bloc .ticket__code { font-size: 7.6pt; margin-top: 0.8mm; letter-spacing: 0.1pt; }
  .ticket--compact .ticket__tete-texte { justify-content: center; padding: 0; }
  .ticket__depuis-titre { font-size: 6.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4pt; margin: 0 !important; }
  .ticket--compact .ticket__depuis { font-size: 10pt; font-weight: 700; margin: 0 !important; }
  .ticket__date-bas { font-size: 7.2pt; font-weight: 800; margin: 0.6mm 0 0.3mm; text-align: left; }
}
/* v1.39.4 — QR et départ regroupés au centre du ticket */
@media print {
  .ticket--compact .ticket__tete { justify-content: center; gap: 4mm; }
  .ticket--compact .ticket__tete-texte { flex: none; }
}

/* =====================================================================
   v1.40 — Mode hors connexion : bandeau réseau
   ===================================================================== */
.reseau { position: sticky; top: 0; z-index: 30; }
.reseau button {
  display: block; width: 100%; border: 0; padding: 10px 16px; text-align: center;
  font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; color: #fff;
}
.reseau--coupe button { background: #b42318; }
.reseau--envoi button { background: #b54708; }
.confirmation--attente { box-shadow: inset 0 0 0 3px #F79009; }
.confirmation__attente { font-weight: 600; color: #FEC84B; font-size: 0.95rem; }
@media print { .reseau { display: none !important; } }

/* v1.42 — Retraits : listes de colis à toucher */
.liste--touche { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.liste__bouton {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--bordure, #d9dde3); border-radius: 12px;
  background: var(--carte, #fff); color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.liste__bouton:hover, .liste__bouton:focus-visible { border-color: var(--accent, #f0b429); }
.liste__bouton .doux { font-size: 0.9rem; }
details.carte > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }

/* v1.42.1 — numéro de réclamation jamais coupé sur le TPE */
@media print {
  .ticket__reclamation-tel { white-space: nowrap; font-size: 9.5pt; letter-spacing: 0.2px; }
}
.ticket__reclamation-tel { white-space: nowrap; }
@media print { .ticket__bas .ticket__reclamation { text-align: left; } }

/* v1.43 — Imprimante avec lame : rien ne change (un ticket = une page, la machine coupe).
   TPE sans lame : un ticket par lancement, plus une marge pour qu'il sorte en entier. */
@media print {
  #impression.impression--tpe .ticket { break-after: auto; page-break-after: auto; }
  #impression .ticket-fin { display: block; width: 54mm; height: 14mm; position: relative; }
  #impression .ticket-fin::after { content: "."; position: absolute; bottom: 0; left: 50%; font-size: 5pt; color: #000; }
}
.ticket-fin { display: none; }
.suite-impression {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1000;
  display: grid; gap: 10px; padding: 16px; border-radius: 16px;
  background: var(--papier, #fff); color: var(--encre, #111);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.35); border: 2px solid #F5C400;
  max-width: 520px; margin: 0 auto;
}
.suite-impression p { margin: 0; font-weight: 700; }
@media print { .suite-impression { display: none !important; } }
.choix-impression { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.choix-impression input { margin-top: 4px; width: 20px; height: 20px; flex: none; }

/* v1.44 — Ticket colis « classique » (disposition validée le 27/11/2026) */
@media print {
  .ticket--classique { padding: 0; }
  .ticket--classique .ticket__bandeau { margin: 0 0 1.5mm; padding: 1mm 2mm; }
  .ticket--classique .ticket__bandeau strong { font-size: 10pt; }
  .ticket--classique .ticket__bandeau span { font-size: 7pt; }
  /* QR principal : un peu plus petit, avec une marge blanche (zone de silence) pour bien se lire */
  .ticket--classique > .qr { width: 27mm; padding: 1.5mm; margin: 0 auto 0.5mm; box-sizing: content-box; background: #fff; }
  .ticket--classique .ticket__code { font-size: 12.5pt; font-weight: 800; letter-spacing: 0.6pt; margin: 0 0 0.6mm; white-space: nowrap; }
  .ticket--classique .ticket__destination { font-weight: 900; line-height: 1.05; margin: 0 0 0.3mm; white-space: nowrap; }
  .ticket--classique .ticket__depuis { font-size: 8pt; margin: 0 0 1.5mm; }
  .ticket--classique .ticket__nature { border: 0.35mm solid #000; padding: 0.8mm 1.5mm; margin: 0 0 1.5mm;
    font-size: 9.5pt; font-weight: 800; line-height: 1.2; }
  .ticket__tableau { display: grid; grid-template-columns: max-content minmax(0, auto); justify-content: center; gap: 0.7mm 2.5mm; margin: 0;
    padding: 1.3mm 0; border-top: 0.5mm double #000; border-bottom: 0.3mm solid #000; text-align: left; font-size: 8.5pt; line-height: 1.2; }
  .ticket__tableau dt { font-size: 6.6pt; white-space: nowrap; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2pt; padding-top: 0.4mm; }
  .ticket__tableau dd { margin: 0; overflow-wrap: anywhere; }
  .ticket__tableau .ticket__tel { font-weight: 800; letter-spacing: 0.2pt; white-space: nowrap; }
  .ticket__paye { font-size: 10pt; font-weight: 900; }
  .ticket__reclamation-ligne { font-size: 8.5pt; font-weight: 700; margin: 1.2mm 0 0.8mm; white-space: nowrap; }
  .ticket__reclamation-ligne b { font-weight: 900; letter-spacing: 0.3pt; }
  .ticket__pied { display: flex; gap: 1.5mm; align-items: flex-start; text-align: left; }
  .ticket__pied-texte { flex: 1; min-width: 0; }
  /* Politique de la compagnie : 5 lignes au plus, pour que le ticket ne s'allonge jamais */
  .ticket--classique .ticket__politique { font-size: 6.6pt; line-height: 1.22; margin: 0; text-align: left;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
  .ticket__pied-qr { flex: none; }
  .ticket__pied-qr .qr { width: 13mm; padding: 1mm; margin: 0; box-sizing: content-box; background: #fff; }
  .ticket__pied:not(:has(.ticket__politique)) { justify-content: center; }
  .ticket__fin-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 2mm; margin: 1mm 0 0; white-space: nowrap;
    font-size: 6.8pt; font-style: italic; }
  .ticket__fin-ligne span:last-child { font-style: normal; font-weight: 800; white-space: nowrap; }
}

/* v1.44.1 — cadre d'affichage d'un écran (n'influence pas la mise en page) */
.vue__cadre { display: contents; }
