/* ---------- Base ---------- */
:root {
  --fond: #f3f4f6;
  --surface: #ffffff;
  --texte: #111111;
  --texte-doux: #4b5563;
  --bord: #d1d5db;
  /* Couleurs du logo O'Crousti Poulet : noir, blanc, jaune */
  --primaire: #000000;
  --primaire-texte: #ffffff;
  --marque: #ffec01;
  --marque-texte: #000000;
  --marque-clair: #fff8b3;
  --succes: #15803d;
  --urgent: #dc2626;
  --urgent-fond: #fee2e2;
  --alerte: #d97706;
  --rayon: 14px;
  --ombre: 0 1px 3px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation; /* pas de zoom au double tap */
}

button {
  font: inherit;
  color: inherit;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled { opacity: 0.45; cursor: default; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
}

.topbar {
  background: #000;
  color: #fff;
  border-bottom-color: #000;
}

.topbar h1 { font-size: 1.3rem; margin: 0; margin-right: auto; color: var(--marque); }

.topbar .logo { width: 44px; height: 44px; flex: none; }

.topbar .btn-secondaire { background: #fff; color: #000; border-color: #fff; }

.topbar .btn-secondaire[aria-pressed="true"] { background: var(--marque); color: #000; border-color: var(--marque); }

.statut {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--urgent-fond);
  color: var(--urgent);
  white-space: nowrap;
}

.statut.ok { background: #dcfce7; color: var(--succes); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 150%);
  max-width: calc(100% - 32px);
  padding: 14px 22px;
  border-radius: var(--rayon);
  background: #111827;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, visibility 0.2s;
  visibility: hidden;
  z-index: 50;
}

.bandeau-consigne {
  padding: 10px 16px;
  background: var(--marque);
  color: #000;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

.toast.visible { transform: translate(-50%, 0); visibility: visible; }
.toast.succes { background: var(--succes); }
.toast.erreur { background: var(--urgent); }

/* ---------- Accueil ---------- */
.accueil {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
}

.accueil h1 { margin: 0; text-align: center; }

.accueil-choix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  width: min(640px, 100%);
}

.accueil-choix a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border-radius: var(--rayon);
  background: var(--marque);
  color: var(--marque-texte);
  font-size: 2rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--ombre);
}

.accueil-choix a.secondaire { background: #fff; color: #000; }

.nom-restaurant { margin: -8px 0 0; color: var(--marque); font-size: 1.2rem; font-weight: 700; text-align: center; }

.portail { width: min(640px, 100%); display: flex; flex-direction: column; gap: 24px; }

.portail.compact .accueil-choix a { min-height: 100px; font-size: 1.6rem; }

.cartes-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.carte-app { padding: 14px; border-radius: var(--rayon); background: #161616; border: 1px solid #333; }

.carte-app h2 { margin: 0 0 10px; font-size: 1.05rem; color: #d4d4d4; }

.carte-app .accueil-choix { grid-template-columns: 1fr; gap: 8px; }

.portail .carte-app .accueil-choix a { min-height: 64px; font-size: 1.25rem; }

.rubrique-app h2 { margin: 0 0 10px; font-size: 1.2rem; color: #d4d4d4; }

.vide-portail { color: #d4d4d4; text-align: center; }

.pied-accueil { display: flex; align-items: center; gap: 16px; margin: 0; color: #8a8a8a; font-size: 0.9rem; }

body.page-accueil { background: #000; color: #fff; }

.accueil .logo { width: min(220px, 50vw); height: auto; }

.champs-pin input.champ-texte { width: 240px; letter-spacing: normal; font-size: 1.1rem; }

.btn-lien {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--primaire);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.page-accueil .lien-reglages { color: #bdbdbd; }

/* ---------- Caisse ---------- */
/* En-tête, bandeau éventuel des consignes, puis l'écran qui occupe le reste de la hauteur. */
body.page-caisse, body.page-cuisine { display: flex; flex-direction: column; }

.caisse {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 16px;
  padding: 16px;
  flex: 1;
  min-height: 0;
}

.caisse .plats { overflow-y: auto; }

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.plat {
  position: relative;
  min-height: 110px;
  padding: 12px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 2px solid var(--bord);
  box-shadow: var(--ombre);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.plat:active { transform: scale(0.97); }

.plat.choisi { border-color: #000; background: var(--marque-clair); box-shadow: 0 0 0 1px #000; }

.plat.epuise {
  flex-direction: column;
  gap: 6px;
  background: var(--fond);
  border-style: dashed;
  color: var(--texte-doux);
  box-shadow: none;
  cursor: not-allowed;
}

.plat.epuise:active { transform: none; }

.plat.epuise .nom-plat { text-decoration: line-through; }

.mention-epuise {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--urgent);
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
}

.organiser .plat { border-style: dashed; padding-bottom: 56px; cursor: default; }

.plat .fleches {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 8px;
}

.plat .fleches button {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  background: var(--fond);
  border: 1px solid var(--bord);
  font-size: 1.2rem;
}

.btn-secondaire {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--fond);
  border: 1px solid var(--bord);
  font-weight: 600;
}

a.btn-secondaire { color: var(--texte); text-decoration: none; }

.btn-secondaire[aria-pressed="true"] { background: var(--primaire); color: #fff; border-color: var(--primaire); }

.aide-organiser {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--marque-clair);
  color: #000;
  font-weight: 600;
}

.panneau {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.panneau h2 { margin: 0; font-size: 1.1rem; color: var(--texte-doux); }

.choix {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--marque-clair);
  color: #000;
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
}

.choix.vide { background: var(--fond); color: var(--texte-doux); font-weight: 600; font-size: 1.2rem; }

.quantite { display: flex; align-items: center; justify-content: center; gap: 16px; }

.quantite button {
  width: 72px;
  height: 72px;
  border-radius: var(--rayon);
  background: var(--fond);
  border: 1px solid var(--bord);
  font-size: 2.2rem;
  font-weight: 700;
}

.quantite output { min-width: 80px; text-align: center; font-size: 3rem; font-weight: 900; }

.qte-rapide { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

.qte-rapide button {
  height: 54px;
  border-radius: 10px;
  background: var(--fond);
  border: 1px solid var(--bord);
  font-size: 1.3rem;
  font-weight: 700;
}

.qte-rapide button[aria-pressed="true"] { background: var(--primaire); color: #fff; border-color: var(--primaire); }

.vide { margin: 0; color: var(--texte-doux); }

.btn-urgent {
  padding: 14px;
  border-radius: var(--rayon);
  border: 3px solid var(--urgent);
  background: var(--surface);
  color: var(--urgent);
  font-size: 1.2rem;
  font-weight: 800;
}

.btn-urgent[aria-pressed="true"] { background: var(--urgent); color: #fff; }

.btn-envoyer {
  padding: 20px;
  border-radius: var(--rayon);
  background: var(--marque);
  color: var(--marque-texte);
  border: 2px solid #000;
  font-size: 1.5rem;
  font-weight: 800;
}

.btn-envoyer.urgent { background: var(--urgent); color: #fff; border-color: var(--urgent); }

.attente { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.attente li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--fond);
  border-left: 6px solid var(--bord);
}

.attente li.urgent { border-left-color: var(--urgent); background: var(--urgent-fond); }

.attente li { flex-wrap: wrap; }

.attente .resume { flex: 1 1 180px; min-width: 0; }

.attente .resume strong { display: block; }

.attente .resume span { color: var(--texte-doux); font-size: 0.95rem; }

.attente button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--urgent);
  background: var(--surface);
  color: var(--urgent);
  font-weight: 700;
  white-space: nowrap;
}

.attente button[aria-pressed="true"] { background: var(--urgent); color: #fff; }

.attente button.annuler { border-color: var(--texte-doux); color: var(--texte-doux); }

.attente button.annuler.confirmer { background: var(--texte); border-color: var(--texte); color: #fff; }

/* ---------- Réglages ---------- */
.reglages { width: min(720px, 100%); margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.option .texte { flex: 1; }

.option h2 { margin: 0 0 4px; font-size: 1.15rem; }

.option p { margin: 0; color: var(--texte-doux); }

.interrupteur {
  flex: none;
  width: 72px;
  height: 40px;
  border-radius: 999px;
  background: var(--bord);
  position: relative;
  transition: background 0.15s;
}

.interrupteur::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--ombre);
  transition: transform 0.15s;
}

.interrupteur[aria-checked="true"] { background: var(--succes); }

.interrupteur[aria-checked="true"]::after { transform: translateX(32px); }

.choix-valeur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

.choix-valeur span { font-weight: 600; }

.choix-valeur button {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--fond);
  border: 1px solid var(--bord);
  font-weight: 700;
}

.choix-valeur button[aria-pressed="true"] { background: var(--primaire); border-color: var(--primaire); color: #fff; }

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

.titre-section { margin: 12px 0 0; font-size: 1.3rem; }

/* Sons des alertes (Réglages généraux) */
.son-alerte { align-items: flex-start; }

.son-alerte.coupe .reglage-son { opacity: 0.55; }

.reglage-son { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 12px 0 4px; }

.reglage-son label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }

.reglage-son output { font-weight: 400; color: var(--texte-doux); }

.reglage-son select {
  min-height: 48px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
}

.reglage-son input[type="range"] { width: 170px; min-height: 48px; accent-color: var(--primaire); }

.btn-ecouter {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--fond);
  border: 2px solid var(--primaire);
  color: var(--texte);
  font-weight: 700;
}

.liste-options { display: flex; flex-direction: column; gap: 12px; }

.note { margin: 0; color: var(--texte-doux); }

.ajout-plat, .plat-edition form { display: flex; gap: 8px; flex-wrap: wrap; }

.ajout-plat input, .plat-edition input {
  flex: 1 1 200px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 10px;
  border: 2px solid var(--bord);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 1.1rem;
  user-select: text;
  -webkit-user-select: text;
}

.ajout-plat input:focus, .plat-edition input:focus { outline: none; border-color: var(--primaire); }

.ajout-plat button, .gestion-plats button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--primaire);
  color: #fff;
  font-weight: 700;
}

.gestion-plats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.gestion-plats li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.gestion-plats .nom { flex: 1 1 160px; font-size: 1.15rem; font-weight: 700; }

.gestion-plats .nom-cuisine { display: block; margin-top: 2px; color: var(--texte-doux); font-size: 0.95rem; font-weight: 500; }

.gestion-plats .plat-edition form { width: 100%; }

.gestion-plats button.secondaire { background: var(--fond); color: var(--texte); border: 1px solid var(--bord); }

.gestion-plats button.danger { background: var(--surface); color: var(--urgent); border: 2px solid var(--urgent); }

.gestion-plats button.danger.confirmer { background: var(--urgent); color: #fff; }

.alerte-pin {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--rayon);
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.champs-pin { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }

.champs-pin label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }

.champs-pin input {
  width: 160px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 10px;
  border: 2px solid var(--bord);
  font: inherit;
  font-size: 1.3rem;
  letter-spacing: 0.3em;
  user-select: text;
  -webkit-user-select: text;
}

.champs-pin button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--primaire);
  color: #fff;
  font-weight: 700;
}

.overlay.verrou { background: var(--fond); }

.pave {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.pave h2 { margin: 0; font-size: 1.6rem; }

.points { margin: 0; min-height: 2.5rem; font-size: 2rem; letter-spacing: 0.4em; }

.touches { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.touches button {
  height: 72px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 1px solid var(--bord);
  box-shadow: var(--ombre);
  font-size: 1.8rem;
  font-weight: 700;
}

.touches button:active { transform: scale(0.96); }

.touches .valider { background: var(--succes); color: #fff; border-color: var(--succes); }

.onglets { display: flex; gap: 8px; border-bottom: 2px solid var(--bord); }

.onglets button {
  min-height: 52px;
  padding: 0 18px;
  margin-bottom: -2px;
  background: none;
  border-bottom: 3px solid transparent;
  color: var(--texte-doux);
  font-size: 1.1rem;
  font-weight: 700;
}

.onglets button[aria-selected="true"] { color: var(--primaire); border-bottom-color: var(--primaire); }

.panneau-onglet { display: flex; flex-direction: column; gap: 12px; }

.barre-stats { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

.periodes { display: flex; flex-wrap: wrap; gap: 8px; }

.periodes button {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--bord);
  font-weight: 700;
}

.periodes button[aria-pressed="true"] { background: var(--primaire); border-color: var(--primaire); color: #fff; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.tuile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.tuile-titre { color: var(--texte-doux); font-size: 0.9rem; font-weight: 600; }

.tuile-valeur { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tuile-detail { color: var(--texte-doux); font-size: 0.85rem; min-height: 1.1em; }

.carte-stats {
  position: relative;
  padding: 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.carte-stats h3 { margin: 0 0 12px; font-size: 1.1rem; }

.table-defilante { overflow-x: auto; }

.table-stats { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

.table-stats th, .table-stats td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--fond); }

.table-stats thead th { color: var(--texte-doux); font-size: 0.85rem; font-weight: 600; }

.table-stats tbody th { font-weight: 700; white-space: nowrap; }

.table-stats .num { text-align: right; white-space: nowrap; }

.table-stats td:nth-child(2) { width: 45%; min-width: 140px; }

.barre-ligne { display: flex; align-items: center; gap: 8px; }

.barre-ligne .piste { flex: 1; min-width: 0; }

.barre-ligne .valeur { min-width: 3ch; }

.barre {
  display: block;
  min-width: 2px;
  height: 14px;
  border-radius: 0 4px 4px 0; /* extrémité arrondie, base droite */
  background: var(--primaire);
}

.barre-ligne .valeur { font-weight: 700; }

.histo {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 220px;
  border-bottom: 1px solid var(--bord);
}

.histo .vide { align-self: center; margin: 0 auto; }

.colonne {
  flex: 1 1 0;
  min-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
  cursor: default;
}

.colonne:focus-visible .barre-v { outline: 2px solid var(--texte); outline-offset: 2px; }

.etiquette-haut { height: 1.3em; font-size: 0.85rem; font-weight: 700; }

.zone-barre { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }

.barre-v {
  display: block;
  width: min(70%, 36px);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--primaire);
}

.colonne.active .barre-v { background: var(--marque); box-shadow: 0 0 0 1px #000; }

.etiquette-heure {
  margin-bottom: -1.6em;
  padding-top: 4px;
  font-size: 0.8rem;
  color: var(--texte-doux);
  white-space: nowrap;
}

.details-table { margin-top: 32px; }

.details-table summary { cursor: pointer; color: var(--texte-doux); font-weight: 600; }

.infobulle {
  position: absolute;
  transform: translateY(-100%);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--texte);
  color: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

.lien-reglages { color: var(--texte-doux); font-weight: 600; }

/* Tablette en position verticale ou téléphone : plats au-dessus, demande en dessous. */
@media (max-width: 900px) {
  body.page-caisse { display: block; }
  .caisse { grid-template-columns: 1fr; height: auto; }
  .caisse .plats { overflow: visible; }
}

/* ---------- Cuisine (thème sombre : lisible de loin, moins de reflets) ---------- */
body.page-cuisine {
  --fond: #0a0a0a;
  --surface: #1c1c1c;
  --texte: #ffffff;
  --texte-doux: #9ca3af;
  --bord: #3a3a3a;
  --urgent-fond: #3b0d0d;
  overflow: hidden;
}

.page-cuisine .topbar h1 { font-size: 1.5rem; }

.compteur { font-size: 1.2rem; font-weight: 700; color: var(--texte-doux); }

.page-cuisine main { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.carte {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  border-left: 10px solid #6b6b6b;
}

.carte.age-1 { border-left-color: var(--alerte); }
.carte.age-2 { border-left-color: var(--urgent); }

.carte.urgent {
  border-left-color: var(--urgent);
  background: var(--urgent-fond);
  box-shadow: 0 0 0 3px var(--urgent) inset;
}

.carte .info { display: flex; flex-direction: column; gap: 6px; }

.carte .num { font-size: 1.1rem; color: var(--texte-doux); font-weight: 700; }

.carte .temps { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.carte.age-1 .temps { color: #fbbf24; }
.carte.age-2 .temps { color: #f87171; }

.badge-urgent {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--urgent);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.carte .quoi { margin: 0; font-size: 2.6rem; font-weight: 800; line-height: 1.1; }

.carte .quoi .q { color: var(--marque); font-weight: 900; margin-right: 0.3ch; }

.btn-fait {
  min-width: 150px;
  min-height: 90px;
  padding: 0 20px;
  border-radius: var(--rayon);
  background: var(--succes);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 900;
}

.vide-cuisine { margin-top: 20vh; text-align: center; font-size: 1.8rem; color: var(--texte-doux); }

.btn-ruptures {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 2px solid var(--bord);
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-ruptures.actif { border-color: var(--urgent); color: #fca5a5; }

.feuille {
  width: min(720px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--texte);
}

.feuille header { display: flex; align-items: center; gap: 12px; }

.feuille h2 { margin: 0; margin-right: auto; font-size: 1.6rem; }

.feuille p { color: var(--texte-doux); font-size: 1.05rem; }

.btn-fermer {
  min-height: 56px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--primaire);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.liste-ruptures { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.rupture {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
  border-radius: var(--rayon);
  background: #14532d;
  border: 2px solid #22c55e;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: left;
}

.rupture strong { font-size: 1rem; color: #86efac; }

.rupture.epuise { background: var(--urgent-fond); border-color: var(--urgent); }

.rupture.epuise span { text-decoration: line-through; }

.rupture:active { transform: scale(0.98); }

.rupture.epuise strong { color: #fca5a5; }

.bandeau-retablir {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  border-radius: var(--rayon);
  background: #f9fafb;
  color: #111827;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 60;
}

.bandeau-retablir span { flex: 1; }

.bandeau-retablir button {
  min-height: 64px;
  padding: 0 24px;
  border-radius: 10px;
  background: var(--alerte);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 900;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
}

.overlay > button {
  padding: 40px 48px;
  border-radius: 20px;
  background: var(--marque);
  color: var(--marque-texte);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.3;
}

.overlay small { display: block; font-size: 1.1rem; font-weight: 500; opacity: 0.9; }

.flash { animation: flash 0.9s ease-out 2; }

.carte.augmentee .quoi { animation: augmentee 0.6s ease-in-out 4; }

@keyframes augmentee {
  50% { color: #facc15; }
}

@keyframes flash {
  0% { background: #facc15; }
  100% { background: var(--fond); }
}

@media (max-width: 760px) {
  .carte { grid-template-columns: 1fr; }
  .carte .info { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .carte .quoi { font-size: 2rem; }
  .btn-fait { width: 100%; min-height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .flash, .carte.augmentee .quoi { animation: none; }
  .toast { transition: none; }
}

/* ---------- Minuteurs de vitrine ---------- */
.vitrine { display: flex; flex-direction: column; gap: 8px; padding: 16px; }

.vitrine .titre-section { margin: 4px 0 10px; }

.produit { flex-direction: column; gap: 4px; min-height: 96px; }

.produit .plus { font-size: 1.6rem; line-height: 1; font-weight: 900; }

.produit.epuise-vitrine { border-style: dashed; background: var(--fond); }

.bacs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.bac {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  background: var(--surface);
  border-left: 10px solid var(--succes);
  box-shadow: var(--ombre);
}

.bac.bientot { border-left-color: var(--alerte); }

.bac.depasse { border-left-color: var(--urgent); background: var(--urgent-fond); animation: clignote 1s steps(2) infinite; }

@keyframes clignote { 50% { box-shadow: 0 0 0 3px var(--urgent) inset; } }

.bac-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.bac-info strong { font-size: 1.3rem; }

.bac-info > span { color: var(--texte-doux); }

.barre-temps { display: block; height: 8px; border-radius: 4px; background: var(--fond); overflow: hidden; }

.barre-temps span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--succes); }

.bac.bientot .barre-temps span { background: var(--alerte); }

.bac-temps { min-width: 120px; text-align: right; font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.bac.bientot .bac-temps { color: #b45309; }

.bac.depasse .bac-temps { color: var(--urgent); font-size: 1.3rem; }

.bac-actions { display: flex; gap: 8px; }

.bac-actions button { min-height: 60px; min-width: 96px; padding: 0 14px; border-radius: 12px; font-size: 1.15rem; font-weight: 800; }

.bac-actions .vendu { background: var(--succes); color: #fff; }

.bac-actions .jete { background: var(--surface); color: var(--texte); border: 2px solid var(--bord); }

/* Panneau des ruptures sur fond clair */
.page-vitrine .rupture { background: #dcfce7; border-color: var(--succes); color: #111; }

.page-vitrine .rupture strong { color: var(--succes); }

.page-vitrine .rupture.epuise { background: var(--urgent-fond); border-color: var(--urgent); }

.page-vitrine .rupture.epuise strong { color: var(--urgent); }

/* Réglages : ligne produit avec délai */
.ligne-produit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }

.ligne-produit .champ-nom { flex: 1 1 180px; }

.ligne-produit input, .ajout-plat .champ-delai {
  min-height: 52px;
  padding: 0 12px;
  border-radius: 10px;
  border: 2px solid var(--bord);
  font: inherit;
  font-size: 1.05rem;
  user-select: text;
  -webkit-user-select: text;
}

.champ-delai { width: 110px; }

.ajout-plat .champ-delai { flex: 0 0 140px; }

.champ-delai-libelle { display: flex; align-items: center; gap: 6px; font-weight: 600; }

.badge-exemple { padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 0.85rem; font-weight: 700; }

.ligne-produit button { min-height: 52px; padding: 0 16px; border-radius: 10px; background: var(--primaire); color: #fff; font-weight: 700; }

.ligne-produit button.danger { background: var(--surface); color: var(--urgent); border: 2px solid var(--urgent); }

.ligne-produit button.danger.confirmer { background: var(--urgent); color: #fff; }

@media (max-width: 760px) {
  .bac { grid-template-columns: 1fr auto; }
  .bac-actions { grid-column: 1 / -1; }
  .bac-actions button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bac.depasse { animation: none; box-shadow: 0 0 0 3px var(--urgent) inset; }
}

/* ---------- Écran TV des ruptures (lisible de loin, tailles relatives à l'écran) ---------- */
body.page-ecran { background: #000; color: #fff; overflow: hidden; cursor: none; }

.ecran { height: 100%; display: flex; align-items: center; justify-content: center; padding: 4vh 5vw; }

.ecran-accueil { display: flex; flex-direction: column; align-items: center; gap: 3vh; }

.ecran-accueil img { width: min(40vh, 60vw); height: auto; }

.ecran-nom { margin: 0; color: var(--marque); font-size: 4vh; font-weight: 700; }

.ecran-ruptures { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4vh; }

.ecran-ruptures header { display: flex; align-items: center; gap: 3vw; }

.ecran-ruptures header img { width: 12vh; height: 12vh; }

.ecran-ruptures h1 { margin: 0; font-size: 6vh; color: var(--marque); }

.ecran-ruptures ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5vh 3vw; }

.ecran-ruptures li {
  padding: 2vh 3vw;
  border: 0.6vh solid var(--marque);
  border-radius: 2vh;
  font-size: 7vh;
  font-weight: 800;
}

.ecran-ruptures ul.nombreuses li { font-size: 4.5vh; padding: 1.5vh 2vw; }

.ecran-excuse { margin: 0; color: #bdbdbd; font-size: 3.2vh; }

/* ---------- Prévision de production ---------- */
.methode { margin: 0; font-size: 1.1rem; }

.sous-titre { margin: 18px 0 8px; font-size: 1rem; color: var(--texte-doux); }

.prevision-valeur { font-size: 1.6rem; font-weight: 900; }

.table-prevision td:nth-child(2) { width: auto; min-width: 0; white-space: nowrap; }

.table-prevision .pic { white-space: nowrap; }

.dates-reference { font-weight: 400; }

.detail-valeurs { color: var(--texte-doux); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Suivi de l'huile ---------- */
.friteuses { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.friteuse {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  border-top: 10px solid var(--succes);
  box-shadow: var(--ombre);
}

.friteuse.bientot { border-top-color: var(--alerte); }

.friteuse.a-changer { border-top-color: var(--urgent); background: var(--urgent-fond); }

.friteuse.inconnu { border-top-color: var(--bord); }

.friteuse h2 { margin: 0; font-size: 1.4rem; }

.friteuse p { margin: 4px 0 0; }

.friteuse-statut { font-size: 1.5rem; font-weight: 800; color: var(--succes); }

.friteuse.bientot .friteuse-statut { color: #b45309; }

.friteuse.a-changer .friteuse-statut { color: var(--urgent); }

.friteuse.inconnu .friteuse-statut { color: var(--texte-doux); }

.friteuse-depuis, .friteuse-seuil { color: var(--texte-doux); }

.btn-huile {
  margin-top: auto;
  min-height: 72px;
  border-radius: var(--rayon);
  background: var(--primaire);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
}

.btn-huile.confirmer { background: var(--marque); color: #000; }

.historique-huile { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.historique-huile li { padding: 10px 14px; border-radius: 10px; background: var(--surface); }

/* ---------- Consignes du jour ---------- */
.form-consigne .texte { display: flex; flex-direction: column; gap: 10px; }

.titre-champ { font-weight: 700; font-size: 1.1rem; }

.form-consigne textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--bord);
  font: inherit;
  font-size: 1.15rem;
  resize: vertical;
  user-select: text;
  -webkit-user-select: text;
}

.form-consigne textarea:focus { outline: none; border-color: var(--primaire); }

.compteur-car { margin: 0; color: var(--texte-doux); text-align: right; }

.case-option { display: flex; align-items: center; gap: 10px; font-weight: 600; }

.case-option input { width: 24px; height: 24px; }

.actions-consigne { display: flex; flex-wrap: wrap; gap: 10px; }

.actions-consigne button { min-height: 56px; padding: 0 22px; border-radius: 10px; background: var(--primaire); color: #fff; font-weight: 800; font-size: 1.1rem; }

.actions-consigne button.secondaire { background: var(--surface); color: var(--texte); border: 2px solid var(--bord); }

/* Bouton plein écran (ajouté par commun.js) */
.btn-plein-ecran {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  flex: none;
  border-radius: 10px;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
}
.btn-plein-ecran[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: #000; }
.pied-accueil .btn-plein-ecran { border-color: #bdbdbd; color: #bdbdbd; vertical-align: middle; }

/* ---------- Appairage d'un appareil (mode en ligne) ---------- */
.carte-appairage {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--rayon);
  background: #161616;
  border: 1px solid #333;
}
.carte-appairage h1 { margin: 0; font-size: 1.5rem; color: var(--marque); text-align: left; }
.carte-appairage p { margin: 0; color: #d4d4d4; line-height: 1.45; }
.carte-appairage label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.carte-appairage input {
  min-height: 52px;
  padding: 0 14px;
  border-radius: 10px;
  border: 2px solid #444;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 1.15rem;
  user-select: text;
  -webkit-user-select: text;
}
.carte-appairage .champ-code { font-size: 1.6rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 700; }
.carte-appairage .facultatif { font-weight: 400; color: #9ca3af; }
.bouton-principal {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 12px;
  background: var(--marque);
  color: #000;
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
}
.bouton-lien { background: none; color: #bdbdbd; text-decoration: underline; padding: 8px; }

/* ---------- Administration (mode en ligne) ---------- */
.reglages.admin { width: min(980px, 100%); }
.resume-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.resume-admin div { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); }
.resume-admin strong { font-size: 1.8rem; }
.resume-admin span { color: var(--texte-doux); }
.liste-boutiques { display: flex; flex-direction: column; gap: 12px; }
.boutique-admin { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); }
.boutique-admin > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.boutique-admin h3 { margin: 0; font-size: 1.2rem; }
.boutique-admin .ville { color: var(--texte-doux); font-weight: 600; }
.code-appairage { margin: 4px 0 0; color: var(--texte-doux); }
.code-appairage strong { color: var(--texte); font-size: 1.1rem; letter-spacing: 0.08em; user-select: all; -webkit-user-select: all; }
.etat-boutique { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille { padding: 4px 10px; border-radius: 999px; background: var(--fond); border: 1px solid var(--bord); font-size: 0.9rem; font-weight: 600; }
.pastille.ok { background: #dcfce7; border-color: #bbf7d0; color: var(--succes); }
.pastille.alerte { background: var(--urgent-fond); border-color: #fecaca; color: var(--urgent); }
.pastille.neutre { color: var(--texte-doux); }
.consigne-admin { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--marque-clair); }
.detail-boutique { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--bord); padding-top: 12px; }
.detail-boutique h4 { margin: 0; }
.appareils { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.appareils li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--fond); }
.appareils li.vide, .liste-boutiques .vide { color: var(--texte-doux); background: none; }
.actions-boutique { display: flex; flex-wrap: wrap; gap: 8px; }
button.petit { padding: 8px 14px; border-radius: 10px; background: var(--fond); border: 1px solid var(--bord); font-weight: 600; }
button.petit.danger { color: var(--urgent); border-color: var(--urgent); background: var(--surface); }
button.petit.confirmer { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.note-admin, .version-admin { margin: 0; color: var(--texte-doux); font-size: 0.9rem; }
.page-admin { user-select: text; -webkit-user-select: text; }

.son-alerte .bouton-lien { color: var(--texte-doux); padding: 8px 0; }

/* Comptes du réseau (administration) */
.compte-admin { font-weight: 600; opacity: 0.8; white-space: nowrap; }

.actions-compte { display: flex; gap: 8px; flex-wrap: wrap; }

.appareils li form.champs-pin { flex-basis: 100%; margin-top: 4px; }

select.champ-texte { min-height: 48px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--bord); background: var(--surface); color: var(--texte); font: inherit; }
.appareils li { flex-wrap: wrap; }
