* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f1f5f9;
  color: #1f2937;
  user-select: none;
}
.ecran { min-height: 100vh; display: flex; flex-direction: column; }
.cache { display: none; }

/* ── Écran PIN ── */
#ecran-pin { align-items: center; justify-content: center; background: #0f172a; }
.pin-box { width: 320px; max-width: 90vw; text-align: center; color: #fff; }
.pin-box h1 { font-size: 26px; margin: 0 0 4px; }
.sous-titre { color: #94a3b8; margin: 0 0 18px; }
.pin-affichage {
  height: 44px; font-size: 34px; letter-spacing: 12px;
  display: flex; align-items: center; justify-content: center; min-height: 44px;
}
.pin-erreur { color: #f87171; height: 20px; font-size: 14px; margin-bottom: 8px; }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.touche {
  font-size: 26px; padding: 18px 0; border: none; border-radius: 14px;
  background: #1e293b; color: #fff; cursor: pointer;
}
.touche:active { background: #334155; }
.touche-sec { background: #475569; }
.touche-ok { background: #16a34a; }

/* ── Barres ── */
.barre {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff; padding: 14px 16px; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 5;
}
.barre-titre { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }
.btn-deco, .btn-retour, .btn-tout {
  border: 1px solid #cbd5e1; background: #fff; color: #334155;
  padding: 10px 14px; border-radius: 10px; font-size: 15px; cursor: pointer;
}
.btn-deco { color: #b91c1c; border-color: #fecaca; }

/* ── Liste menus ── */
.liste-menus { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.carte-menu {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px;
  cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.carte-menu:active { background: #f8fafc; }
.carte-menu .nom { font-size: 17px; font-weight: 700; }
.carte-menu .meta { color: #64748b; font-size: 14px; }

/* ── Liste plats ── */
.liste-plats { padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plat {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 2px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; cursor: pointer;
}
.plat.coche { border-color: #16a34a; background: #f0fdf4; }
.plat .case {
  width: 28px; height: 28px; border-radius: 8px; border: 2px solid #cbd5e1;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.plat.coche .case { background: #16a34a; border-color: #16a34a; }
.plat .infos { flex: 1; }
.plat .nom { font-size: 17px; font-weight: 600; }
.plat .sous { color: #64748b; font-size: 13px; margin-top: 2px; }
.ns { font-weight: 700; color: #fff; border-radius: 6px; padding: 2px 9px; font-size: 15px; }
.ns-A { background: #038141; } .ns-B { background: #85BB2F; }
.ns-C { background: #FECB02; color:#1f2937; } .ns-D { background: #EE8100; } .ns-E { background: #E63E11; }

/* ── Pied ── */
.pied {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e2e8f0;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.compteur { color: #475569; font-size: 15px; }
.btn-imprimer {
  background: #16a34a; color: #fff; border: none; border-radius: 12px;
  padding: 14px 22px; font-size: 17px; font-weight: 700; cursor: pointer;
}
.btn-imprimer:disabled { background: #cbd5e1; cursor: default; }
.vide { text-align: center; color: #94a3b8; padding: 40px 16px; }
