/* Kassascherm. Groot, rustig, goed leesbaar aan de balie. Geen vaste schermstand:
   liggend kaart en mand naast elkaar, staand de mand als balk onderaan. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.loading { padding: 64px; text-align: center; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; user-select: none; touch-action: manipulation; transition: background .12s, transform .06s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 6px 18px rgb(240 138 75 / .18); }
.btn.primary[disabled] { box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.big { min-height: 64px; font-size: 19px; padding: 0 24px; }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 15px; }
.btn.icon { width: 52px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.input::placeholder { color: var(--ink-3); }
.input { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.input:focus { border-color: var(--focus); outline: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }

/* ---------- koppelen en inloggen ---------- */
.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 28px; width: 100%; max-width: 460px; text-align: center; }
.card h1 { margin: 0 0 6px; font: 500 30px/1.15 var(--display); }
.card p { color: var(--ink-2); margin: 0 0 16px; }
.pair-code { font: 700 56px/1 ui-monospace, Menlo, monospace; letter-spacing: .14em; margin: 18px 0; color: var(--accent); }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-top: 8px; }
.names .btn { min-height: 72px; font-size: 18px; flex-direction: column; gap: 2px; }
.names .btn small { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 8px; height: 20px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-msg { min-height: 24px; color: var(--danger); font-weight: 600; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 8px auto 0; }
.pad .btn { min-height: 64px; font-size: 24px; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- kassa ---------- */
.shell { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 14px 4px; }
.nav-pills { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--lift); }
.nav-pills .btn { border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); min-height: 44px; padding: 0 16px; font-weight: 600; box-shadow: none; }
.nav-pills .btn.primary { background: var(--pill); color: var(--pill-ink); font-weight: 700; }
.top .who { font-weight: 650; padding-left: 4px; }
.top .who small { display: block; color: var(--ink-3); font-weight: 500; font-size: 13px; }
.top .spacer { flex: 1; }
.work { display: grid; grid-template-columns: 1fr 380px; min-height: 0; padding: 0 14px 14px 0; gap: 2px; }
.menu { display: grid; grid-template-rows: auto auto 1fr; min-height: 0; }
.menu .search { padding: 10px 12px 0 14px; }
.menu .search .input { border-radius: 999px; padding-left: 20px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 12px 12px 14px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats .btn { min-height: 44px; border-radius: 999px; flex: none; }
.cats .btn { color: var(--ink-2); }
.cats .btn[aria-pressed="true"] { background: var(--pill); color: var(--pill-ink); border-color: var(--pill); font-weight: 700; }
.tiles { overflow-y: auto; padding: 2px 12px 16px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; grid-auto-rows: max-content; }
.tile { min-height: 104px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--lift); text-align: left; display: grid; align-content: space-between; gap: 6px; cursor: pointer; touch-action: manipulation; transition: transform .08s cubic-bezier(.2, .8, .2, 1), border-color .12s; }
.tile:active { transform: scale(.97); border-color: var(--accent); }
.tile .n { font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.tile .k { color: var(--ink-3); font-size: 14px; }
.tile .p { font-weight: 700; font-size: 17px; }
.tile .opt { font-size: 12.5px; color: var(--pill); font-weight: 600; }
.tile.has-img { padding-top: 0; grid-template-rows: auto 1fr auto; }
.tile img { display: block; width: calc(100% + 24px); margin: 0 -12px 4px; height: 112px; object-fit: cover; background: var(--surface-2); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.tile[disabled] { opacity: .5; cursor: not-allowed; }
.tile[disabled] .p::after { content: " · uitverkocht"; color: var(--danger); font-weight: 600; }

.basket { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-top: 10px; background: var(--surface); box-shadow: var(--lift); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.basket .head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 1px 0 rgb(255 240 225 / .08); }
.cust { display: flex; gap: 8px; align-items: center; font-size: 14.5px; color: var(--ink-2); }
.cust .btn { margin-left: auto; }
.lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.lines li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.lines .n { font-weight: 600; overflow-wrap: anywhere; }
.lines .m { color: var(--ink-3); font-size: 14px; grid-column: 1; }
.lines .note { color: var(--warn); font-size: 14px; font-weight: 600; grid-column: 1; }
.lines .t { font-weight: 650; text-align: right; }
.qty { display: flex; align-items: center; gap: 4px; grid-column: 1 / -1; }
.qty .btn { min-height: 40px; width: 44px; padding: 0; font-size: 20px; }
.qty b { min-width: 28px; text-align: center; }
.qty .btn.note-btn { width: auto; padding: 0 12px; font-size: 14px; margin-left: auto; }
.empty-basket { padding: 32px 16px; text-align: center; color: var(--ink-3); }
.foot { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; background: var(--surface-2); }
.totals { display: grid; gap: 2px; }
.totals .r { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 15px; }
.totals .grand { display: flex; justify-content: space-between; align-items: baseline; font-size: 28px; font-weight: 700; color: var(--ink); }
.problem { color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 8px 10px; font-size: 14.5px; font-weight: 600; }
.paybtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* iPad staand: kaart en mand blijven naast elkaar, de mand iets smaller. */
@media (max-width: 899px) and (min-width: 720px) {
  .work { grid-template-columns: 1fr 336px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .basket .cust { flex-wrap: wrap; }
}
/* smal (telefoon): mand als balk onderaan, uitklapbaar */
.basket-bar { display: none; }
@media (max-width: 719px) {
  /* Bovenbalk op twee regels; de pillen schuiven binnen hun eigen balk, de pagina nooit opzij. */
  .top { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px 2px; }
  .nav-pills { order: 3; width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav-pills::-webkit-scrollbar { display: none; }
  .nav-pills .btn { flex: 1 0 auto; padding: 0 12px; }
  .work { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: 0; gap: 0; }
  .basket { display: none; }
  .basket.open { display: grid; position: fixed; inset: 0; z-index: 30; border: 0; border-radius: 0; margin: 0; }
  .basket-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .basket-bar .sum { flex: 1; font-weight: 700; font-size: 18px; }
  .basket-bar .sum small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-3); }
}

/* ---------- vensters ---------- */
.scrim { position: fixed; inset: 0; background: rgb(8 5 3 / .68); z-index: 40; animation: fade .12s; }
.dialog { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow); padding: 22px; display: grid; gap: 14px; animation: pop .14s ease-out; }
.dialog.still, .scrim.still { animation: none; }
.dialog h2 { margin: 0; font: 500 26px/1.15 var(--display); }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dialog .actions .grow { flex: 1; }
/* Venster met meerdere keuzes: hoofdactie breed bovenaan, alternatieven in een raster, uitweg onderaan. */
.dialog .actions.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.dialog .actions.choices .wide { grid-column: 1 / -1; }
.dialog .actions.choices p { margin: 0; }
.btn.danger { color: var(--danger); }
.btn:not(.primary):hover { background: var(--surface-2); }
.btn.ghost:hover { background: var(--surface-2); }
.stack { display: grid; gap: 12px; }
.field small { color: var(--ink-3); font-size: 13px; }
.opts { display: grid; gap: 8px; }
.opts .grp { font-weight: 650; display: flex; justify-content: space-between; }
.opts .grp small { color: var(--ink-3); font-weight: 500; }
.opts label { display: flex; align-items: center; gap: 12px; min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; cursor: pointer; }
.opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opts input { width: 20px; height: 20px; accent-color: var(--accent); }
.opts label span { flex: 1; }
.pay-total { text-align: center; }
.pay-total small { display: block; color: var(--ink-3); font-size: 14px; }
.pay-total b { font-size: 40px; }
.tender { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; padding: 12px; background: var(--surface-2); border-radius: var(--radius); }
.tender small { display: block; color: var(--ink-3); font-size: 13px; }
.tender b { font-size: 26px; }
.tender .change b { color: var(--ok); }
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.quick .btn { min-height: 48px; padding: 0 6px; font-size: 15px; }
.cashpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cashpad .btn { min-height: 56px; font-size: 22px; }
.status { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 8px 0; }
.status .big { font-size: 56px; font-weight: 800; line-height: 1; }
.status .ok { color: var(--ok); }
.status .warn { color: var(--warn); }
.status .change { font-size: 32px; font-weight: 800; color: var(--ok); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%); } }

/* ---------- bestellingen ---------- */
.orders { overflow-y: auto; padding: 12px; display: grid; gap: 8px; align-content: start; max-width: 900px; width: 100%; margin: 0 auto; }
.order { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--lift); text-align: left; cursor: pointer; }
.order .no { font-size: 22px; font-weight: 800; min-width: 52px; }
.order .info small { display: block; color: var(--ink-3); font-size: 14px; }
.chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 14px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: fade .15s; font-weight: 500; }
.toast.error { background: var(--danger); color: var(--danger-ink); }
.status > span svg { width: 56px; height: 56px; }
.basket .head .back { justify-self: start; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.checkrow { display: flex; gap: 12px; align-items: center; min-height: 48px; font-weight: 600; cursor: pointer; }
.checkrow input { width: 22px; height: 22px; accent-color: var(--accent); }
.dialog .actions .full { flex-basis: 100%; margin: 0; }

/* ---------- keukenbord ---------- */
.top .count:empty { display: none; }
.top .count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 12.5px; padding: 0 7px; min-width: 20px; }
.top .btn.primary .count { background: var(--accent-ink); color: var(--accent); }
.board { overflow-y: auto; padding: 12px; display: grid; gap: 12px; align-content: start; }
.board-head { display: flex; align-items: center; gap: 10px; }
.board-head h2 { margin: 0; font: 500 32px/1.1 var(--display); }
.board-head .spacer { flex: 1; }
.tickets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--lift); display: grid; gap: 8px; padding: 12px 14px; }
.ticket.flash { animation: flash 1.6s ease-out 2; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ticket header { display: flex; align-items: baseline; gap: 10px; }
.ticket .no { font-size: 26px; font-weight: 800; }
.ticket .when { flex: 1; }
.ticket header small { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.ticket .tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ticket .cust { font-weight: 600; }
.ticket .addr { font-size: 15px; color: var(--ink-2); }
.ticket .addr a { color: inherit; font-weight: 600; }
.ticket .dishes { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.ticket .dishes li { display: grid; grid-template-columns: 34px 1fr; font-size: 18px; }
.ticket .dishes .q { font-weight: 800; }
.ticket .dishes .n { font-weight: 650; }
.ticket .dishes .k { display: block; font-size: 20px; }
.ticket .dishes .m { display: block; font-size: 15px; color: var(--ink-2); }
.ticket .note { display: block; background: var(--warn-soft, #fff4d6); color: var(--warn, #8a5a00); border-radius: 6px; padding: 4px 8px; font-size: 15px; font-weight: 600; margin-top: 2px; }
.ticket footer { display: flex; gap: 8px; }
.ticket footer .grow { flex: 1; }
.chip.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty-board { text-align: center; padding: 48px 0; font-size: 18px; }
.ticket.done > :not(footer) { opacity: .5; }
.ticket.done .dishes, .ticket.done .tags { text-decoration: line-through; }

/* ---------- oefenmodus ---------- */
.practice-bar { background: var(--warn); color: var(--warn-ink); text-align: center; font-weight: 700; font-size: 14px; padding: 4px 12px; }
.shell:has(.practice-bar) { grid-template-rows: auto auto 1fr; }

/* ---------- order die nog op betaling wacht ---------- */
.unpaid-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: var(--warn-soft); color: var(--warn); font-weight: 650; padding: 8px 12px; border-radius: 8px; }

/* ---------------- tafels ---------------- */
.tables-screen { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; padding: 12px 14px; overflow: hidden; }
.tables-screen .plan { min-width: 0; overflow-y: auto; }
.open-bills { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--lift); padding: 14px; overflow-y: auto; min-height: 0; }
.open-bills h2 { margin: 2px 4px 12px; font: 500 22px/1.2 var(--display); }
.open-bills h2 .muted { font: 500 15px system-ui; margin-left: 4px; }
.open-bills ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.open-bills p { margin: 4px; }
.bill-row { width: 100%; min-height: 56px; display: flex; gap: 10px; align-items: center; justify-content: space-between; text-align: left; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.bill-row .n { font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.bill-row small { display: block; color: var(--ink-3); font-weight: 500; font-size: 13.5px; }
.bill-row b { font-variant-numeric: tabular-nums; }
.table-head { display: flex; align-items: center; gap: 10px; }
.table-head h2 { margin: 0; flex: 1; min-width: 0; font: 500 24px/1.15 var(--display); overflow-wrap: anywhere; }
.bill-scroll { overflow-y: auto; min-height: 0; }
.bill-scroll .lines { overflow: visible; }
.bill-lines { padding: 4px 14px 8px; }
.bill-lines ul { list-style: none; margin: 0; padding: 0; }
.bill-lines li { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 6px; padding: 5px 0; font-size: 15px; color: var(--ink-2); }
.bill-lines .q { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bill-lines .t { font-variant-numeric: tabular-nums; }
.bill-lines small { display: block; color: var(--ink-3); font-size: 13.5px; }
.bill-lines small.note { color: var(--warn); }
.bill-scroll h3 { margin: 10px 0 2px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.bill-scroll h3.new-round { margin: 8px 14px 4px; color: var(--pill); }
.wide-btn { width: 100%; }
@media (max-width: 899px) {
  .tables-screen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(160px, 1fr); overflow-y: auto; overflow-x: hidden; }
  .tables-screen .plan { overflow: visible; }
}

.bill-lines li:has(.void-btn) { grid-template-columns: 30px 1fr auto auto; align-items: center; }
.void-btn { min-height: 36px; padding: 0 10px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.bill-lines .voided li { color: var(--ink-3); }
.bill-lines .voided s { text-decoration-thickness: 1px; }
.void-qty { display: flex; align-items: center; gap: 12px; }

.signup { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.signup p { margin: 0; }
