/* Borne Sandwich
   Idée : une borne tactile jaune « papier d'emballage ». Les boutons sont des touches épaisses
   (ombre pleine vers le bas), la commande est un ticket de caisse au bord dentelé. */
:root {
  --bg: #ffd23f;          /* jaune moutarde, fond de la borne */
  --surface: #ffffff;     /* cartes et ticket */
  --ink: #1a1613;         /* noir chaud : texte, contours */
  --muted: #5f5246;
  --line: #e6dcc3;        /* séparateurs à l'intérieur des cartes */
  --edge: #1a1613;
  --accent: #d63a24;      /* rouge tomate : valider, payer */
  --accent-ink: #ffffff;
  --leaf: #1a7f45;        /* vert laitue : choisi */
  --soft: #fff0b8;
  --danger: #a8141e;
  --font-display: "Lilita One", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(26, 22, 19, .09) 1.6px, transparent 1.7px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { padding-block: 16px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1280px; margin: 0 auto; }
h1, h2, h3, .brand, .card .name, .tile .name, .total, .hero .big, .agg b, .offline h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: .01em; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.1; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- bandeau du haut ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 20px; padding: 12px 16px; background: var(--ink); color: var(--bg); border-radius: 18px; box-shadow: 0 5px 0 rgba(26, 22, 19, .25); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: clamp(1.6rem, 4.2vw, 2.3rem); line-height: 1; }
.brand::before { content: ""; width: 1.25em; height: 1.25em; background: url("icon.svg") center / contain no-repeat; border-radius: 8px; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 800; font-size: .95rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- boutons : des touches ---------- */
.btn { min-height: 50px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--edge); background: var(--surface); color: var(--ink); font-weight: 800; box-shadow: 0 4px 0 var(--edge); transition: transform .07s, box-shadow .07s; }
.btn:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); box-shadow: 0 4px 0 var(--danger); background: var(--surface); }
.btn.small { min-height: 38px; padding: 0 13px; font-size: .9rem; border-radius: 11px; box-shadow: 0 3px 0 var(--edge); }
.btn.small:active:not([disabled]) { transform: translateY(3px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.top .btn { border-color: var(--bg); box-shadow: 0 3px 0 var(--bg); }
.top .btn.primary { background: var(--bg); color: var(--ink); }
.seg { display: inline-flex; border: 2px solid var(--bg); border-radius: 14px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; color: var(--ink); background: transparent; min-height: 44px; padding: 0 16px; font-weight: 800; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.drawer-body .seg { border-color: var(--edge); }

/* ---------- menu ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 4px 10px; margin: 0 -4px 14px; scrollbar-width: thin; }
.tab { flex: none; min-height: 54px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); font-weight: 800; font-size: 1.05rem; box-shadow: 0 4px 0 var(--edge); transition: transform .07s, box-shadow .07s; }
.tab:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 18px; }
.card { text-align: left; display: flex; flex-direction: column; gap: 8px; justify-content: space-between; min-height: 130px; padding: 12px; border-radius: 18px; border: 2px solid var(--edge); background: var(--surface); box-shadow: 0 5px 0 var(--edge); transition: transform .07s, box-shadow .07s; }
.card:active:not([disabled]) { transform: translateY(5px); box-shadow: 0 0 0 var(--edge); }
.card .name { font-size: 1.35rem; line-height: 1.08; }
.card .desc { color: var(--muted); font-size: .88rem; }
.card .price, .tile .price { align-self: flex-start; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 3px 13px; font-weight: 800; }
.card.off { cursor: not-allowed; background: repeating-linear-gradient(135deg, #fff 0 9px, #efe8d6 9px 18px); box-shadow: 0 3px 0 var(--muted); border-color: var(--muted); color: var(--muted); }
.card.off .name { text-decoration: line-through; }
.card.deal { background: var(--ink); color: var(--bg); }
.card.deal .desc { color: #f3e9c8; }
.card.deal .price { background: var(--bg); color: var(--ink); }
.card.deal .tag { background: var(--accent); color: var(--accent-ink); }
.card.custom { background: var(--accent); color: var(--accent-ink); }
.card.custom .desc { color: #ffe9e3; }
.card.custom .name { font-size: 1.7rem; }
.card.custom .price { background: var(--bg); color: var(--ink); }
.card.custom .tag { background: var(--bg); color: var(--ink); }
@media (min-width: 640px) { .card.custom { grid-column: span 2; } }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); }
.img, .img-prev { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 2px solid var(--edge); background: var(--soft); display: block; }
.img-prev { max-width: 200px; }

/* ---------- panneaux ---------- */
.panel { background: var(--surface); border: 2px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 1.6rem; }
.panel .btn:not(.small) { width: 100%; }

/* le panier est un ticket de caisse */
.layout > aside.panel, .hero { position: relative; border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: none; margin-bottom: 14px; padding-bottom: 22px; }
.layout > aside.panel::after, .hero::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 100%; height: 10px;
  background: conic-gradient(from -45deg at bottom, #0000, var(--surface) 1deg 89deg, #0000 90deg) 50% 0 / 20px 100%;
  filter: drop-shadow(0 2.5px 0 var(--edge));
}
@media (min-width: 861px) { .layout > aside.panel { position: sticky; top: 16px; } }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding-bottom: 10px; border-bottom: 2px dashed var(--line); }
.line .opts { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--edge); background: var(--bg); font-weight: 800; box-shadow: 0 3px 0 var(--edge); }
.qty button:active { transform: translateY(3px); box-shadow: none; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.9rem; border-top: 2px dashed var(--edge); padding-top: 10px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 800; font-size: .92rem; }
input[type="text"], input[type="password"], input[type="number"], select, textarea { min-height: 46px; border-radius: 12px; border: 2px solid var(--edge); background: var(--surface); padding: 8px 12px; width: 100%; }
textarea { min-height: 90px; }
select { appearance: auto; }
.empty { padding: 28px; border: 2px dashed var(--edge); border-radius: 16px; background: rgba(255, 255, 255, .6); color: var(--ink); text-align: center; font-weight: 600; }
.demo { font-size: .8rem; color: var(--muted); }

/* ---------- écran de confirmation : le ticket s'imprime ---------- */
.hero { text-align: center; align-items: center; gap: 14px; padding: 44px 20px 40px; background: var(--surface); border: 2px solid var(--edge); border-bottom: 0; max-width: 640px; margin-inline: auto; }
.hero .big { font-size: clamp(4.2rem, 17vw, 8.5rem); line-height: 1; color: var(--accent); text-shadow: 4px 4px 0 var(--edge); }
.hero h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
@keyframes print { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.hero { animation: print .45s steps(6, end) both; }

/* ---------- tableau des commandes ---------- */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; align-items: start; }
.group h3 { font-size: 1.4rem; }
.agg { display: flex; flex-direction: column; gap: 4px; font-size: 1.15rem; font-weight: 700; }
.agg b { font-size: 1.6rem; color: var(--accent); margin-right: 6px; }
.orders { display: flex; flex-direction: column; gap: 8px; border-top: 2px dashed var(--line); padding-top: 10px; }
.order { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .92rem; }
.order .who { min-width: 0; overflow-wrap: anywhere; }
.pill { font-size: .78rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 2px solid var(--edge); }
.pill.nouvelle { background: var(--bg); }
.pill.prête { background: #bfe8c9; }
.pill.livrée { background: #e7e2d4; color: var(--muted); border-color: var(--muted); }

/* ---------- tiroir de personnalisation, fenêtres ---------- */
.scrim { position: fixed; inset: 0; background: rgba(26, 22, 19, .62); z-index: 30; display: flex; justify-content: flex-end; }
.scrim.center { justify-content: center; align-items: center; padding: 16px; z-index: 40; }
.drawer { width: min(620px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); border-left: 3px solid var(--edge); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; background: var(--ink); color: var(--bg); }
.drawer-head h2 { font-size: 1.7rem; }
.drawer-head .btn { border-color: var(--bg); box-shadow: 0 3px 0 var(--bg); }
.drawer-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.drawer-body > *, .drawer-body > * > * { flex-shrink: 0; }
.modal { background: var(--surface); border: 2px solid var(--edge); border-radius: 20px; box-shadow: 0 6px 0 var(--edge); padding: 20px; width: min(470px, 100%); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; box-shadow: 0 3px 0 var(--edge); }
.item-row .meta { min-width: 0; }
.item-row .meta b { overflow-wrap: anywhere; }
.item-row.off .meta { opacity: .55; }
@media (max-width: 560px) { .item-row { grid-template-columns: minmax(0, 1fr); } .item-row .row { justify-content: flex-start !important; } }
.sw { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 800; }
.sw input { width: 22px; height: 22px; accent-color: var(--leaf); }
.flash { background: var(--danger); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.err { color: var(--danger); font-weight: 700; }

/* ---------- sandwich personnalisé ---------- */
.wiz { display: flex; flex-direction: column; gap: 18px; }
.wiz h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.dot { padding: 5px 14px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); font-weight: 800; font-size: .88rem; }
.dot.on { background: var(--ink); color: var(--bg); }
.dot.done { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.tile { text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 104px; padding: 14px; border-radius: 16px; border: 2px solid var(--edge); background: var(--surface); box-shadow: 0 4px 0 var(--edge); transition: transform .07s, box-shadow .07s; }
.tile:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.tile .name { font-size: 1.25rem; line-height: 1.1; }
.tile .price { background: var(--soft); color: var(--ink); }
.tile[aria-pressed="true"] { background: var(--leaf); color: #fff; }
.tile[aria-pressed="true"] .price { background: #fff; color: var(--leaf); }
.tile[aria-pressed="true"]::after { content: "\2713  Choisi"; font-weight: 800; font-size: .85rem; }
.tile[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.bar { position: sticky; bottom: max(10px, env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; background: var(--surface); border: 2px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge); padding: 12px 16px; }
.bar .num { font-weight: 400 !important; font-size: 1.9rem !important; line-height: 1; }

/* ---------- connexion, coupure réseau, tablette ---------- */
.login-wrap { max-width: 420px; margin: 8vh auto 0; }
.offline { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background-color: var(--bg); background-image: radial-gradient(rgba(26, 22, 19, .09) 1.6px, transparent 1.7px); background-size: 22px 22px; color: var(--ink); }
.offline h2 { font-size: clamp(1.8rem, 6vw, 3rem); }
.offline .muted { color: var(--ink); font-weight: 600; }
body.kiosk { -webkit-user-select: none; user-select: none; touch-action: manipulation; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.kiosk input, body.kiosk textarea { -webkit-user-select: text; user-select: text; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- clôture et liste à imprimer ---------- */
.closure { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.closure-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1 1 320px; padding: 10px 14px; background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; box-shadow: 0 3px 0 var(--edge); }
.closure-item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.closure-item.shut { background: #ffd9d3; }
.closure-item.shut .pill { background: var(--accent); color: #fff; border-color: var(--accent); }
.hero.closed .big { font-size: clamp(2.6rem, 10vw, 5.5rem); }
.sheet { background: var(--surface); border: 2px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge); padding: 20px; margin-bottom: 20px; }
.sheet h2 { font-size: 1.8rem; }
.sheet-slot { font-size: 1.3rem; margin: 18px 0 8px; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th { text-align: left; font-size: .85rem; color: var(--muted); border-bottom: 2px solid var(--edge); padding: 4px 8px; }
.sheet-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet-table .nm { font-weight: 800; white-space: nowrap; }
.sheet-table .r { text-align: right; white-space: nowrap; }
.sheet-table .chk { text-align: center; width: 60px; font-size: 1.3rem; }
.sheet-total { text-align: right; margin-top: 12px; font-size: 1.1rem; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; background-image: none !important; color: #000; font-size: 12pt; }
  .top, .noprint, #drawer, #modal, .scrim, .offline { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .sheet { border: 0; box-shadow: none; padding: 0; margin: 0; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet-table tr { break-inside: avoid; }
  .sheet-table td, .sheet-table th { border-color: #000; }
  .muted { color: #000; }
}
.top select { color: var(--ink); }
.sheet-table th.chk { font-size: .85rem; }
.hero.closed { background: var(--accent); color: #fff; border-color: var(--edge); }
.hero.closed .big { color: #fff; text-shadow: 4px 4px 0 var(--edge); }
.hero.closed .muted { color: #ffe9e3; }
.hero.closed::after { background: conic-gradient(from -45deg at bottom, #0000, var(--accent) 1deg 89deg, #0000 90deg) 50% 0 / 20px 100%; }

/* ---------- statistiques, livraison ---------- */
.deliv { background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 14px; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 2px solid var(--edge); border-radius: 16px; box-shadow: 0 4px 0 var(--edge); padding: 14px 16px; }
.stat .sv { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: var(--accent); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .92rem; }
.barrow .bl { font-weight: 700; overflow-wrap: anywhere; }
.barrow .bt { background: var(--soft); border: 2px solid var(--edge); border-radius: 999px; height: 16px; overflow: hidden; }
.barrow .bf { display: block; height: 100%; background: var(--accent); }
.barrow .bv { text-align: right; white-space: nowrap; color: var(--muted); font-weight: 700; }
@media (max-width: 560px) { .barrow { grid-template-columns: minmax(0, 1fr) auto; } .barrow .bt { grid-column: 1 / -1; order: 3; } }
.linkcard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; box-shadow: 0 3px 0 var(--edge); }
.linkcard code { overflow-wrap: anywhere; user-select: text; font-size: .9rem; background: var(--soft); padding: 6px 8px; border-radius: 8px; }
.linkcard a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- tableau : une carte par commande ---------- */
.bgroups { display: flex; flex-direction: column; gap: 26px; }
.bhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--ink); color: var(--bg); border-radius: 16px; }
.bhead h3 { font-size: 1.5rem; }
.bhead .muted { color: #f3e9c8; }
.bhead .btn { border-color: var(--bg); box-shadow: 0 4px 0 var(--bg); }
.recap { margin: 10px 2px 0; }
.recap summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
.recap .agg { padding: 8px 0 0 4px; }
.ocards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 14px; align-items: start; }
.ocard { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--edge); border-radius: 18px; box-shadow: 0 5px 0 var(--edge); }
.ocard.prête { border-color: var(--leaf); box-shadow: 0 5px 0 var(--leaf); }
.ocard.livrée { opacity: .75; }
.ohead { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.oname { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; overflow-wrap: anywhere; }
.onum { color: var(--accent); }
.olines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 1.05rem; }
.olines li { padding-bottom: 6px; border-bottom: 2px dashed var(--line); }
.olines li:last-child { border-bottom: 0; padding-bottom: 0; }
.olines b { color: var(--accent); }
.olines .muted { font-size: .85rem; }
.ofoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 2px solid var(--edge); padding-top: 10px; }
