/* Écran de caisse : pensé pour une tablette en paysage, utilisé au doigt. */

:root {
  --fond: #eef3f9;
  --carte: #ffffff;
  --brun: #12284a;        /* bleu nuit : barre du haut, bouton principal */
  --brun-clair: #2a5aa0;  /* bleu moyen : onglet et choix actifs */
  --or: #8cc4ff;          /* bleu clair : nom de la caisse */
  --texte: #12284a;
  --texte-doux: #5f7189;
  --bordure: #d3deeb;
  --vert: #2e7d32;
  --rouge: #b3261e;
  --orange: #c26a00;
  --rayon: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; cursor: pointer; }

/* --- Barre du haut --- */
.barre {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--brun);
  color: #fff;
}
.barre-gauche, .barre-droite { display: flex; align-items: center; gap: 16px; }
.marque { font-weight: 700; letter-spacing: 0.04em; color: var(--or); }
.poste { opacity: 0.85; }
.horloge { font-variant-numeric: tabular-nums; opacity: 0.85; }
.statut {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.12);
}
.statut.en-ligne { background: var(--vert); }
.statut.hors-ligne { background: var(--orange); }
.statut.erreur { background: var(--rouge); }
.bouton-icone {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  padding: 8px;
}

/* --- Mise en page --- */
.ecran {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100% - 56px);
}

.vente {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  gap: 12px;
}

/* --- Catégories --- */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.categorie {
  flex-shrink: 0;
  padding: 14px 20px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--carte);
  color: var(--texte);
  font-weight: 600;
}
.categorie.active {
  background: var(--brun-clair);
  border-color: var(--brun-clair);
  color: #fff;
}

/* --- Produits --- */
.produits {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: 110px;
  gap: 10px;
  align-content: start;
}
.produit {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--carte);
  color: var(--texte);
  text-align: left;
}
.produit:active { transform: scale(0.97); background: #e6eef8; }
.produit-nom { font-weight: 600; line-height: 1.2; }
.produit-prix { color: var(--brun-clair); font-weight: 700; }
.vide {
  grid-column: 1 / -1;
  color: var(--texte-doux);
  padding: 24px;
  text-align: center;
}

/* --- Ticket --- */
.ticket {
  display: flex;
  flex-direction: column;
  background: var(--carte);
  border-left: 1px solid var(--bordure);
  min-height: 0;
}
.ticket h2 { margin: 0; padding: 16px; font-size: 20px; border-bottom: 1px solid var(--bordure); }
.lignes { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; }
.ticket-vide { flex: 1; padding: 24px 16px; color: var(--texte-doux); }
.ligne {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bordure);
}
.ligne-nom { font-weight: 600; }
.ligne-montant { font-weight: 700; text-align: right; }
.ligne-detail { color: var(--texte-doux); font-size: 15px; align-self: center; }
.quantite { display: flex; align-items: center; gap: 10px; }
.quantite button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--bordure);
  background: var(--fond);
  font-size: 22px;
  line-height: 1;
}
.quantite span { min-width: 24px; text-align: center; font-weight: 700; }

.ticket-bas { padding: 16px; border-top: 2px solid var(--bordure); }
.total {
  display: flex;
  justify-content: space-between;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}
.ticket-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* --- Boutons --- */
.bouton {
  min-height: 64px;
  padding: 12px 18px;
  border-radius: var(--rayon);
  border: 2px solid transparent;
  font-weight: 700;
}
.bouton.principal { background: var(--brun); color: #fff; }
.bouton.secondaire { background: var(--fond); border-color: var(--bordure); color: var(--texte); }
.bouton:disabled { opacity: 0.4; cursor: default; }

/* --- Fenêtres --- */
.fond-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 40, 74, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.fond-modal[hidden] { display: none; }
.modal {
  width: min(560px, 92vw);
  background: var(--carte);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal h2 { margin: 0; }
.modal.centre { text-align: center; align-items: center; }
.modal label { font-weight: 600; }
.modal input {
  font: inherit;
  font-size: 28px;
  padding: 12px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  width: 100%;
}
.modal-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 8px; }
.choix-mode { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bouton.mode { background: var(--fond); border-color: var(--bordure); font-size: 22px; min-height: 80px; }
.bouton.mode.actif { background: var(--brun-clair); border-color: var(--brun-clair); color: #fff; }
.billets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.billets .bouton { min-height: 56px; background: var(--fond); border-color: var(--bordure); }
.rendu { font-size: 24px; }
.grand { font-size: 28px; margin: 0; }
.rendu-final { color: var(--vert); font-weight: 800; }
.message { margin: 0; min-height: 1.4em; color: var(--rouge); }
.message.ok { color: var(--vert); }

/* Tablette en portrait ou petit écran : ticket en dessous */
@media (max-width: 820px) {
  .ecran { grid-template-columns: 1fr; grid-template-rows: 1fr 45%; }
  .ticket { border-left: none; border-top: 1px solid var(--bordure); }
}

/* --- Vente à peser --- */
.categorie.a-peser {
  background: var(--or);
  border-color: var(--or);
  color: var(--brun);
}
.modal.large { width: min(640px, 94vw); }
.etapes { display: flex; gap: 6px; }
.etapes span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bordure);
}
.etapes span.faite { background: var(--brun-clair); }
.affichage {
  font-size: 44px;
  font-weight: 800;
  text-align: right;
  padding: 10px 16px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  font-variant-numeric: tabular-nums;
}
.pave {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.pave button {
  min-height: 64px;
  font-size: 26px;
  font-weight: 700;
  border-radius: var(--rayon);
  border: 2px solid var(--bordure);
  background: var(--fond);
  color: var(--texte);
}
.choix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.choix button {
  min-height: 90px;
  padding: 12px;
  border-radius: var(--rayon);
  border: 2px solid var(--bordure);
  background: var(--fond);
  color: var(--texte);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.choix button strong { font-size: 22px; }
.choix button small { color: var(--texte-doux); font-size: 15px; }
.choix button:disabled { opacity: 0.35; }
.recap { width: 100%; border-collapse: collapse; font-size: 20px; }
.recap td { padding: 8px 4px; border-bottom: 1px solid var(--bordure); }
.recap td:last-child { text-align: right; font-weight: 700; }
.recap tr.total-pesee td { font-size: 30px; border-bottom: none; color: var(--brun-clair); }
.retirer {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--bordure);
  background: var(--fond);
  font-size: 18px;
  color: var(--rouge);
}
.message.info { color: var(--texte-doux); }

/* --- Historique --- */
.bouton-barre {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
}
.bouton.petit { min-height: 48px; padding: 8px 16px; }
.modal-actions.egal { grid-template-columns: 1fr 1fr; width: 100%; }
.modal select {
  font: inherit;
  font-size: 20px;
  padding: 12px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--carte);
}
.panneau {
  width: 96vw;
  height: 94vh;
  background: var(--carte);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panneau-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bordure);
}
.panneau-haut h2 { margin: 0; font-size: 22px; }
.jour { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.jour #historique-date { min-width: 200px; text-align: center; }
.bouton-rond {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--bordure);
  background: var(--fond);
  font-size: 26px;
  line-height: 1;
}
.resume {
  display: flex;
  gap: 24px;
  padding: 12px 20px;
  background: var(--fond);
  font-size: 16px;
}
.resume strong { font-size: 20px; }
#historique-message { padding: 0 20px; margin: 6px 0 0; }
.panneau-corps {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 0;
}
.liste-ventes { list-style: none; margin: 0; padding: 0; overflow-y: auto; border-right: 1px solid var(--bordure); }
.liste-ventes li button {
  width: 100%;
  display: grid;
  grid-template-columns: 90px 60px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 20px;
  border: none;
  border-bottom: 1px solid var(--bordure);
  background: var(--carte);
  color: var(--texte);
  text-align: left;
}
.liste-ventes li button.choisie { background: #e1ebf7; }
.liste-ventes .numero { font-weight: 700; }
.liste-ventes .heure { color: var(--texte-doux); }
.liste-ventes .qui { color: var(--texte-doux); font-size: 15px; }
.liste-ventes .qui strong { color: var(--texte); }
.liste-ventes .somme { font-weight: 700; text-align: right; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.detail-vente { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.detail-vente h3 { margin: 0; font-size: 22px; }
.detail-vente .sous-titre { color: var(--texte-doux); margin: 0; }
.detail-vente table { width: 100%; border-collapse: collapse; }
.detail-vente td { padding: 8px 4px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.detail-vente td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.detail-vente .petit-texte { color: var(--texte-doux); font-size: 14px; }
.detail-vente .total-ligne td { font-size: 22px; border-bottom: none; }
.carte-client {
  padding: 12px 14px;
  border-radius: var(--rayon);
  background: var(--fond);
}
.apercu {
  margin: 0;
  padding: 16px;
  max-height: 60vh;
  overflow: auto;
  background: #fffef8;
  border: 1px dashed var(--bordure);
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  white-space: pre;
}
@media (max-width: 820px) {
  .panneau-corps { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .panneau-haut { flex-wrap: wrap; }
}

/* --- Clients --- */
.client-ticket { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.bouton.client {
  flex: 1;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--fond);
  border-color: var(--bordure);
  color: var(--texte);
  text-align: left;
}
.bouton.client.lie { background: #e1ebf7; border-color: var(--brun-clair); }
.client-icone { font-size: 20px; }
.recherche {
  flex: 1;
  font: inherit;
  font-size: 20px;
  padding: 10px 14px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  min-width: 0;
}
#clients-message { padding: 0 20px; margin: 8px 0 0; }
.liste-clients { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.liste-clients li button {
  width: 100%;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border: none;
  border-bottom: 1px solid var(--bordure);
  background: var(--carte);
  color: var(--texte);
  text-align: left;
}
.liste-clients li button:active { background: #e1ebf7; }
.liste-clients .nom-client { font-weight: 700; }
.liste-clients .doux { color: var(--texte-doux); }
.liste-clients .points { text-align: right; font-weight: 700; color: var(--brun-clair); white-space: nowrap; }
.formulaire-client { padding: 16px 20px; overflow-y: auto; }
.formulaire-client h3 { margin: 0 0 12px; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.champs label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.champs label.large { grid-column: 1 / -1; }
.champs label.case { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.champs label.case input { width: 26px; height: 26px; }
.champs input[type=text], .champs input[type=tel], .champs input[type=email] {
  font: inherit;
  font-size: 20px;
  padding: 10px 12px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
}
.points-gagnes { color: var(--brun-clair); font-weight: 700; margin: 0; white-space: pre-line; }

/* --- Arrondi aux 5 cents (espèces) --- */
.arrondi { color: var(--texte-doux); font-size: 16px; margin: 0; }
.arrondi strong { color: var(--texte); font-size: 22px; }

/* --- Clients professionnels --- */
.choix-type { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; max-width: 520px; }
.choix-type .bouton.mode { min-height: 56px; font-size: 18px; }
.champs.pro { padding: 14px; border-radius: var(--rayon); background: var(--fond); }
.champs.pro[hidden] { display: none; }
.champs textarea {
  font: inherit;
  font-size: 18px;
  padding: 10px 12px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  resize: vertical;
}
.badge-pro {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brun-clair);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.facture-a-faire { color: var(--orange); font-weight: 700; margin: 0; }
.champs > .large { grid-column: 1 / -1; }

/* --- Factures clients pros --- */
.compteur {
  display: inline-block;
  min-width: 24px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
.compteur[hidden] { display: none; }
.filtres { display: flex; gap: 8px; }
.filtres .bouton.mode { min-height: 48px; font-size: 16px; }
#factures-message { padding: 0 20px; margin: 6px 0 0; }
.statut-facture {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.statut-facture.a_envoyer { background: #fde7cf; color: var(--orange); }
.statut-facture.envoyee { background: #dcefdc; color: var(--vert); }
.statut-facture.attente { background: var(--fond); color: var(--texte-doux); }
.liste-factures-ligne { display: flex; flex-direction: column; gap: 2px; }
.bloc-facture { padding: 12px 14px; border-radius: var(--rayon); background: var(--fond); white-space: pre-line; }
.bloc-facture h4 { margin: 0 0 6px; font-size: 14px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: 0.04em; }
.bouton.envoyee { background: var(--vert); color: #fff; }
.liste-factures li button { grid-template-columns: 80px 100px 1fr auto; }

/* --- Message d'erreur de la page --- */
.erreur-page {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  padding: 12px 16px;
  background: var(--rouge);
  color: #fff;
  font-weight: 700;
}
.erreur-page[hidden] { display: none; }

/* --- Article libre --- */
.categorie.article-libre {
  background: var(--carte);
  border: 2px dashed var(--brun-clair);
  color: var(--brun-clair);
}
.choix-tva { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bouton.tva {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 72px;
  font-size: 24px;
  background: var(--fond);
  border-color: var(--bordure);
  color: var(--texte);
}
.bouton.tva small { font-size: 13px; font-weight: 600; opacity: 0.8; }
.bouton.tva.actif { background: var(--brun-clair); border-color: var(--brun-clair); color: #fff; }

/* --- Ouverture / clôture de caisse --- */
.bouton-barre.caisse-fermee { background: var(--orange); border-color: var(--orange); }
.panneau-haut .sous-titre { color: var(--texte-doux); flex: 1; }
.comptage-corps { grid-template-columns: 1.6fr 1fr; }
.comptage-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 12px 20px;
  overflow-y: auto;
  border-right: 1px solid var(--bordure);
}
.comptage-colonnes h3 { margin: 4px 0 8px; font-size: 16px; color: var(--texte-doux); text-transform: uppercase; }
.coupures { list-style: none; margin: 0; padding: 0; }
.coupures li {
  display: grid;
  grid-template-columns: 70px auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--bordure);
}
.coupures .valeur { font-weight: 800; font-size: 18px; }
.coupures .compteur-coupure { display: flex; align-items: center; gap: 6px; }
.coupures .compteur-coupure button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--bordure);
  background: var(--fond);
  font-size: 22px;
  line-height: 1;
  color: var(--texte);
}
.coupures input {
  width: 64px;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  border: 2px solid var(--bordure);
  border-radius: 10px;
}
.coupures .sous-total { text-align: right; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.comptage-resume { padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.total-compte { display: flex; justify-content: space-between; align-items: baseline; }
.total-compte strong { font-size: 34px; }
.resume-cloture { width: 100%; border-collapse: collapse; }
.resume-cloture td { padding: 7px 2px; border-bottom: 1px solid var(--bordure); }
.resume-cloture td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.resume-cloture tr.ecart td { font-size: 22px; border-bottom: none; }
.ecart-ok { color: var(--vert); }
.ecart-plus { color: var(--orange); }
.ecart-moins { color: var(--rouge); }
.comptage-resume label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.comptage-resume textarea {
  font: inherit;
  padding: 10px;
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  resize: vertical;
}

/* Réglage imprimante et avis d'impression */
#modal-config label.case { display: flex; align-items: center; gap: .5rem; font-weight: normal; margin-top: .6rem; }
#modal-config label.case input { width: auto; }
#config-tester { margin-top: .9rem; width: 100%; }
.avis-impression {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--brun); color: #fff; padding: .8rem 1.3rem; border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 1000; max-width: 90vw; font-size: 1.05rem;
}
.avis-impression.erreur { background: #b3261e; }
.avis-impression[hidden] { display: none; }

#modal-config .ligne-bt { display: flex; gap: .5rem; }
#modal-config .ligne-bt select { flex: 1; }
#modal-config .ligne-bt .bouton { padding: 0 1rem; }
#modal-config .aide { font-size: .9rem; color: #5a6b85; margin: .3rem 0 0; }
#config-changer-adresse { width: 100%; margin-top: .4rem; }

/* --- Barre du haut : plus de boutons, on serre un peu ---------------------- */
.barre-droite { gap: 10px; }
.bouton-barre { padding: 8px 13px; }
.compteur.urgent { background: var(--rouge); animation: clignote 1.6s ease-in-out infinite; }
@keyframes clignote { 50% { transform: scale(1.18); } }

/* --- Ticket : trois boutons, commande en cours de retrait ------------------ */
.ticket-actions { grid-template-columns: 1fr 1.2fr 2fr; }
.ticket-commande {
  margin: 10px 16px 0;
  padding: 10px 12px;
  border-radius: var(--rayon);
  background: #fff4e5;
  color: var(--orange);
  font-weight: 700;
}
.ticket-commande[hidden] { display: none; }

/* --- Boutons d'action ------------------------------------------------------ */
.bouton.danger { background: var(--rouge); color: #fff; }
.bouton.danger-doux { background: #fff; border-color: #e7b6b2; color: var(--rouge); }
.actions-trois { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 10px; margin-top: 8px; }
.actions-commande { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-commande .bouton { flex: 1 1 200px; }
.boite-confirmation {
  padding: 14px;
  border-radius: var(--rayon);
  background: #e1ebf7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.boite-confirmation p { margin: 0; }
.boite-confirmation.annulation { background: #fbeceb; }
.motifs { display: flex; flex-wrap: wrap; gap: 8px; }
.motifs .bouton.mode { min-height: 48px; font-size: 16px; flex: 1 1 auto; }
.champ-motif {
  font: inherit;
  padding: 10px 12px;
  border: 2px solid var(--bordure);
  border-radius: 10px;
}

/* --- Historique : tickets annulés ------------------------------------------ */
.liste-ventes li button.annulee .numero,
.liste-ventes li button.annulee .somme { text-decoration: line-through; color: var(--texte-doux); }
.badge.gris { background: var(--texte-doux); }
.badge.rouge { background: var(--rouge); }
.alerte-annulation {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--rayon);
  background: #fbeceb;
  color: var(--rouge);
  font-weight: 700;
}

/* --- Clients : bouton « Fiche », fiche, bons ------------------------------- */
.liste-clients li.ligne-client { display: flex; border-bottom: 1px solid var(--bordure); }
.liste-clients li.ligne-client > button:first-child { flex: 1; border-bottom: none; }
.liste-clients li .bouton-fiche {
  width: auto;
  display: block;
  padding: 0 22px;
  border: none;
  border-left: 1px solid var(--bordure);
  background: var(--fond);
  color: var(--brun-clair);
  font-weight: 700;
}
.fiche-client, .vue-bons { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.fiche-client[hidden], .vue-bons[hidden] { display: none; }
.fiche-haut { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.fiche-haut h3 { margin: 0; font-size: 24px; }
.fiche-actions { display: flex; gap: 8px; }
.fiche-chiffres { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.chiffre {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  background: var(--fond);
}
.chiffre span { color: var(--texte-doux); font-size: 14px; }
.chiffre strong { font-size: 22px; }
.bloc-fiche h4 { margin: 0 0 6px; font-size: 14px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: 0.04em; }
.table-fiche, .table-bons { width: 100%; border-collapse: collapse; }
.table-fiche th, .table-bons th {
  text-align: left; font-size: 13px; color: var(--texte-doux); padding: 6px 8px; border-bottom: 2px solid var(--bordure);
}
.table-fiche td, .table-bons td { padding: 9px 8px; border-bottom: 1px solid var(--bordure); }
.table-fiche tr.annulee td { text-decoration: line-through; color: var(--texte-doux); }
.table-fiche tr.annulation td { color: var(--rouge); }
tr.bon-utilise td, tr.bon-expire td { color: var(--texte-doux); }
tr.bon-valide td:last-child { color: var(--vert); font-weight: 700; }
.bouton.lien, button.lien {
  border: none; background: none; padding: 0; color: var(--brun-clair); font-weight: 700; text-align: left;
}
#bons-filtres { flex-wrap: wrap; }

/* --- Commandes et demandes -------------------------------------------------- */
.bandeau { padding: 0 20px; margin: 6px 0 0; }
.liste-commandes li button { grid-template-columns: 80px 80px 1fr auto; }
.liste-commandes li button.urgente { box-shadow: inset 5px 0 0 var(--orange); }
.titre-jour {
  padding: 10px 20px 6px;
  background: var(--fond);
  color: var(--texte-doux);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--bordure);
}
.statut-commande {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.statut-commande.a_preparer, .statut-commande.en_attente { background: #fde7cf; color: var(--orange); }
.statut-commande.prete { background: #e1ebf7; color: var(--brun-clair); }
.statut-commande.retiree, .statut-commande.prevenu { background: #dcefdc; color: var(--vert); }
.statut-commande.annulee { background: var(--fond); color: var(--texte-doux); }
.paye-ok { margin: 0; color: var(--vert); font-weight: 700; }
.liste-demandes li button { grid-template-columns: 1fr auto auto; }
.demande-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.demande-texte .doux { color: var(--texte-doux); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.telephone {
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: var(--rayon);
  background: var(--brun);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}
.detail-vente .champs textarea, .modal .champs textarea {
  font: inherit; padding: 10px 12px; border: 2px solid var(--bordure); border-radius: 10px; resize: vertical;
}
.detail-vente .champs input, .modal .champs input[type=date] {
  font: inherit; padding: 10px 12px; border: 2px solid var(--bordure); border-radius: 10px;
}
.detail-vente .champs .modal-actions { grid-column: 1 / -1; }
.detail-vente .champs .message { grid-column: 1 / -1; }
#modal-commande .champs input { margin: 0; }
.ticket-actions { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 1.5fr); gap: 8px; }
.ticket-actions .bouton { padding-left: 6px; padding-right: 6px; min-width: 0; }
.liste-commandes li button { grid-template-columns: 96px 80px 1fr auto; }
.bouton-barre, .poste, .statut { white-space: nowrap; }
@media (max-width: 1180px) {
  .marque { display: none; }
  .barre-droite { gap: 6px; }
  .bouton-barre { padding: 7px 10px; font-size: 15px; }
  .statut { font-size: 12px; }
  .ticket-actions .bouton { font-size: 15px; }
}
@media (max-width: 1000px) {
  .horloge { display: none; }
}
#statut { cursor: pointer; }
