:root {
  --bleu: #2a7d1f; --orange-banque: #b55916; --bleu-clair: #e8f0f8; --vert: #157347; --orange: #c76a00; --rouge: #b42318;
  --gris: #5b6675; --fond: #f4f6f9; --carte: #fff; --bord: #d8dee6;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, Arial, sans-serif; background: var(--fond); color: #1c2430; }
h1, h2 { margin: 0 0 .5em; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: .7em 1.2em; background: var(--bleu); color: #fff; }
button:disabled { opacity: .45; cursor: default; }
button.secondaire { background: #fff; color: var(--bleu); border: 2px solid var(--bleu); }
button.danger { background: var(--rouge); }
input { font: inherit; padding: .7em .9em; border: 2px solid var(--bord); border-radius: 10px; width: 100%; }
input:focus { outline: none; border-color: var(--bleu); }
label { display: block; font-weight: 600; margin-bottom: .3em; }
.ruban-demo { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 50; background: #b42318; color: #fff;
  font-weight: 800; letter-spacing: .08em; padding: .25em 1.2em; border-radius: 0 0 10px 10px; font-size: 1rem; pointer-events: none; }
.ecran .ruban-demo { font-size: 1.6vw; top: auto; bottom: 3.6vw; left: 1vw; transform: none; border-radius: 1vw; }
.ecran .bouton-deconnexion { right: auto; left: 50%; transform: translateX(-50%); bottom: 4vw; }
.bouton-deconnexion { position: fixed; right: 1em; bottom: 1em; z-index: 40; background: #fff; color: var(--bleu);
  border: 2px solid var(--bleu); padding: .45em .9em; font-size: .9em; }
.bandeau { background: var(--bleu); color: #fff; padding: .8em 1.4em; display: flex; justify-content: space-between; align-items: center; }
.bandeau .marque { font-weight: 700; font-size: 1.15em; }
.bandeau .note { font-size: .85em; opacity: .85; }
.bandeau { border-bottom: 5px solid var(--orange-banque); gap: 1em; }
.bandeau .gauche { display: flex; align-items: center; gap: .9em; }
.logo { background: #fff; border-radius: 8px; padding: 3px 8px; height: 60px; width: auto; display: block; }
.ecran .logo { height: 7vw; border-radius: 1vw; padding: .3vw .8vw; }
.ecran header { align-items: center; }
.ecran header .gauche { display: flex; align-items: center; gap: 1.2vw; }
#ticket-impression .logo-ticket { width: 40mm; height: auto; margin: 0 auto 1mm; display: block; }
.conteneur { max-width: 960px; margin: 0 auto; padding: 1.5em; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 1.4em; }
.grille { display: grid; gap: 1em; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.erreur { color: var(--rouge); font-weight: 600; min-height: 1.4em; }
.petit { color: var(--gris); font-size: .9em; }
a.tuile { display: block; text-decoration: none; color: inherit; }
a.tuile:hover .carte { border-color: var(--bleu); box-shadow: 0 2px 10px rgba(42,125,31,.15); }

/* ---- Borne ---- */
.borne { min-height: calc(100vh - 52px); display: flex; align-items: center; justify-content: center; padding: 2em; }
.borne .carte { width: min(720px, 100%); padding: 2.2em; font-size: 1.25em; }
.borne label { display: block; font-weight: 600; margin: .8em 0 .3em; }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8em; margin-top: 1.2em; }
.services button { padding: 1.4em .5em; font-size: 1.1em; font-weight: 700; border-radius: 14px; }
.ticket-ecran { text-align: center; }
.ticket-ecran .num { font-size: 5em; font-weight: 800; color: var(--bleu); line-height: 1.1; }

/* ---- Ticket imprimé (80 mm) ---- */
#ticket-impression { display: none; }
@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body { background: #fff; }
  body > *:not(#ticket-impression) { display: none !important; }
  #ticket-impression { display: block; width: 72mm; font-family: Arial, sans-serif; text-align: center; color: #000; }
  #ticket-impression .num { font-size: 40pt; font-weight: 800; margin: 2mm 0; }
  #ticket-impression hr { border: 0; border-top: 1px dashed #000; }
}

/* ---- Écran de salle ---- */
.ecran { background: #0e3b17; color: #fff; min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; }
.defilant { background: var(--orange-banque); overflow: hidden; white-space: nowrap; font-size: 2.2vw; font-weight: 600; padding: .5vw 0; }
.defilant[hidden] { display: none; }
.defilant-texte { display: inline-block; padding-left: 100%; animation: defiler linear infinite; }
.defilant-texte .sep { margin: 0 2.5vw; opacity: .7; }
@keyframes defiler { to { transform: translateX(-100%); } }
.ecran header { display: flex; justify-content: space-between; padding: 1.2vw 2vw; font-size: 1.6vw; opacity: .9; }
.ecran main { display: grid; grid-template-columns: 2fr 1fr; gap: 2vw; padding: 0 2vw 2vw; }
.appel-courant { background: #1d6b25; border-radius: 2vw; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2vw; }
.appel-courant .num { font-size: 12vw; font-weight: 800; line-height: 1; }
.appel-courant .nom { font-size: 4vw; margin: 1vw 0; }
.appel-courant .poste { font-size: 4.5vw; font-weight: 700; color: #f6a04d; }
.appel-courant.flash { animation: flash 1s ease-in-out 3; }
@keyframes flash { 50% { background: #3a9a2c; } }
.historique { background: rgba(255,255,255,.06); border-radius: 2vw; padding: 1.5vw; font-size: 2vw; }
.historique h2 { font-size: 1.8vw; opacity: .8; }
.historique li { display: flex; justify-content: space-between; padding: .6vw 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.historique ul { list-style: none; margin: 0; padding: 0; }
.ecran footer { display: flex; gap: 3vw; justify-content: center; padding: 1vw; font-size: 1.6vw; background: rgba(0,0,0,.25); }
.activer-son { position: fixed; inset: 0; background: rgba(14,59,23,.94); display: flex; align-items: center; justify-content: center; }
.activer-son button { font-size: 2em; padding: 1em 2em; }

/* ---- Poste ---- */
.client { text-align: center; padding: 2em 1em; }
.client .num { font-size: 4.5em; font-weight: 800; color: var(--bleu); }
.client .nom { font-size: 1.8em; font-weight: 600; }
.actions { display: flex; gap: .8em; justify-content: center; flex-wrap: wrap; margin-top: 1.2em; }
.actions button { font-size: 1.15em; padding: .9em 1.6em; }
.compteur { font-size: 2.6em; font-weight: 800; color: var(--bleu); }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: .55em .4em; border-bottom: 1px solid var(--bord); }
