/* =========================================================================
   Lunchroom Kassa — premium design system
   Warme, smakelijke uitstraling; werkt op telefoon, tablet en desktop.
   ========================================================================= */

:root {
  /* Merk-/accentkleuren */
  --brand:        #2f4239;   /* diep salie-groen */
  --brand-deep:   #1f2a24;
  --accent:       #c8845a;   /* terracotta */
  --accent-warm:  #e7c46b;   /* honing */
  --leaf:         #7a9a5b;

  /* Neutralen (licht thema) */
  --bg:           #f6f1e9;   /* warme crème */
  --surface:      #ffffff;
  --surface-2:    #f0e9dd;
  --line:         #e4dccd;
  --text:         #26221c;
  --text-soft:    #6f675a;
  --text-mute:    #9a9184;

  /* Status */
  --ok:           #4f8a5b;
  --warn:         #d98b3a;
  --danger:       #c0533f;

  /* Vorm & schaduw */
  --r-sm: 10px;  --r: 16px;  --r-lg: 22px;  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(31,42,36,.06), 0 2px 8px rgba(31,42,36,.06);
  --sh-2: 0 6px 24px rgba(31,42,36,.12);
  --sh-3: 0 18px 48px rgba(31,42,36,.22);

  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --tap: 52px;               /* comfortabele raakdoelen */
}

/* Systeem-donker (tenzij gebruiker expliciet 'light' koos) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #14100b;
    --surface:   #201b14;
    --surface-2: #2a241b;
    --line:      #37301f;
    --text:      #f2ead9;
    --text-soft: #c3b8a2;
    --text-mute: #8f8471;
    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 6px 24px rgba(0,0,0,.45);
    --sh-3: 0 18px 48px rgba(0,0,0,.6);
  }
}
/* Expliciete donker-keuze (thema-knop) — wint altijd */
:root[data-theme="dark"] {
  --bg:        #14100b;
  --surface:   #201b14;
  --surface-2: #2a241b;
  --line:      #37301f;
  --text:      #f2ead9;
  --text-soft: #c3b8a2;
  --text-mute: #8f8471;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------------- Splash ---------------- */
.splash { position: fixed; inset: 0; display: grid; place-content: center; gap: 20px; justify-items: center;
  background: radial-gradient(120% 120% at 50% 0%, var(--brand) 0%, var(--brand-deep) 70%); }
.splash-mark { font-size: 64px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); animation: bob 1.6s ease-in-out infinite; }
.splash-dots { display: flex; gap: 8px; }
.splash-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-warm); opacity: .4; animation: pulse 1.2s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: .2s; }
.splash-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes pulse { 50% { opacity: 1; transform: scale(1.25); } }

/* ---------------- App-layout ---------------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.app[data-loading="1"] > *:not(.splash) { display: none; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; background: var(--brand-deep); color: #f4ecdb;
  box-shadow: var(--sh-2); position: sticky; top: 0; z-index: 20;
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.topbar .brand img { width: 30px; height: 30px; border-radius: 8px; }
.topbar .spacer { flex: 1; }
.topbar .nav { display: flex; gap: 6px; background: rgba(255,255,255,.08); padding: 4px; border-radius: var(--r-pill); }
.topbar .nav button {
  border: 0; background: transparent; color: #e9dfca; padding: 8px 16px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px; transition: .15s;
}
.topbar .nav button.active { background: var(--accent-warm); color: #2a2213; }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #d9cfb9; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-content: center;
  background: var(--accent); color: #fff; font-weight: 700; }
.icon-btn { border: 0; background: rgba(255,255,255,.1); color: #f4ecdb; width: 40px; height: 40px;
  border-radius: 12px; font-size: 18px; display: grid; place-content: center; }

/* Kassa-iconen (SVG) — strak op maat in knoppen en tegels */
.icon-btn svg { width: 20px; height: 20px; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.pay-methods .m-ico svg { width: 24px; height: 24px; }
.cart-empty .big svg { width: 40px; height: 40px; opacity: .5; }
.kds-empty svg { width: 22px; height: 22px; vertical-align: -4px; margin-right: 4px; }
.tile .t-ph svg { width: 28px; height: 28px; }
.l-note svg, .note-add svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------------- Buttons ---------------- */
.btn {
  border: 0; border-radius: var(--r); padding: 0 20px; height: var(--tap);
  font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); color: var(--text); box-shadow: var(--sh-1); transition: transform .06s, filter .15s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: linear-gradient(180deg, #37503f, var(--brand)); color: #fff; }
.btn.accent  { background: linear-gradient(180deg, #d0925f, var(--accent)); color: #fff; }
.btn.pay     { background: linear-gradient(180deg, #58975f, var(--ok)); color: #fff; }
.btn.ghost   { background: transparent; box-shadow: none; color: var(--text-soft); }
.btn.danger  { background: transparent; color: var(--danger); box-shadow: none; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.lg { height: 60px; font-size: 18px; }

/* ---------------- Login ---------------- */
.login { min-height: 100dvh; display: grid; place-content: center; padding: 24px;
  background: radial-gradient(140% 120% at 50% -10%, #35493d 0%, var(--brand-deep) 60%); }
.login-card { width: min(440px, 92vw); background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); padding: 26px; }
.login-card h1 { margin: 4px 0 2px; font-size: 22px; }
.login-card .sub { color: var(--text-mute); margin: 0 0 18px; font-size: 14px; }
.staff-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
.staff-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r);
  border: 2px solid var(--line); background: var(--surface); text-align: left; transition: .15s; }
.staff-tile:hover { border-color: var(--accent); }
.staff-tile.sel { border-color: var(--brand); background: var(--surface-2); }
.staff-tile .role { font-size: 12px; color: var(--text-mute); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pinpad button { height: 62px; font-size: 24px; font-weight: 700; border-radius: var(--r);
  border: 0; background: var(--surface-2); color: var(--text); box-shadow: var(--sh-1); }
.pin-display { text-align: center; letter-spacing: 12px; font-size: 30px; height: 40px; margin: 8px 0; color: var(--brand); }

/* ---------------- Kassa ---------------- */
.kassa { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; min-height: 0; }
.menu-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 14px; gap: 12px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { border: 0; background: var(--surface); color: var(--text-soft);
  padding: 12px 18px; border-radius: var(--r-pill); font-weight: 700; font-size: 15px;
  box-shadow: var(--sh-1); white-space: nowrap; }
.cat-chip.active { background: var(--brand); color: #fff; }

.products { flex: 1; overflow-y: auto; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-content: start; padding-bottom: 12px; }
.tile { position: relative; border: 0; text-align: left; background: var(--surface); color: var(--text); border-radius: var(--r);
  padding: 0; overflow: hidden; box-shadow: var(--sh-1); display: flex; flex-direction: column;
  transition: transform .06s, box-shadow .15s; }
.tile:active { transform: translateY(1px) scale(.98); box-shadow: var(--sh-2); }
.tile .t-img { height: 110px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.tile .t-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .t-ph { font-size: 28px; opacity: .45; }
.tile .t-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.tile .t-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.tile .t-price { color: var(--text-soft); font-weight: 700; margin-top: auto; }
.tile .t-badge { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: var(--r-pill); background: var(--accent); color: #fff; font-weight: 800; font-size: 13px;
  display: grid; place-content: center; box-shadow: var(--sh-2); }

/* Order-paneel (mandje) */
.cart { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  min-height: 0; box-shadow: -6px 0 24px rgba(31,42,36,.06); }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.cart-head h2 { margin: 0; font-size: 17px; }
.cart-head .oid { color: var(--text-mute); font-size: 13px; }
.seg { display: flex; background: var(--surface-2); border-radius: var(--r-pill); padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; color: var(--text-soft); padding: 7px 12px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 13px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

.cart-meta { padding: 10px 16px; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.cart-meta select { flex: 1; min-width: 120px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); padding: 0 10px; }

.lines { flex: 1; overflow-y: auto; padding: 8px 8px 4px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 8px; border-radius: var(--r-sm); }
.line:hover { background: var(--surface-2); }
.line .l-name { font-weight: 600; }
.line .l-note { grid-column: 1 / -1; font-size: 12px; color: var(--text-mute); }
.line .l-price { font-weight: 700; text-align: right; align-self: center; }
.stepper { display: inline-flex; align-items: center; gap: 4px; grid-column: 1 / -1; margin-top: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--surface-2);
  color: var(--text); font-size: 20px; font-weight: 700; box-shadow: var(--sh-1); }
.stepper .q { min-width: 30px; text-align: center; font-weight: 700; }
.stepper .rm { margin-left: auto; color: var(--danger); background: transparent; box-shadow: none; }
.stepper .note-add { width: auto; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--text-mute); background: transparent; box-shadow: none; }

/* Snelle notitie per orderregel */
.l-note { grid-column: 1 / -1; margin-top: 4px; text-align: left; border: 0; background: var(--surface-2);
  color: var(--text-soft); font-size: 12px; padding: 5px 9px; border-radius: 8px; cursor: pointer; }
.note-edit { grid-column: 1 / -1; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.note-edit input { flex: 1; min-width: 150px; height: 38px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; background: var(--surface); color: var(--text); }
.note-edit [data-act="note-save"] { height: 38px; padding: 0 14px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; font-weight: 700; }
.note-presets { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.note-presets button { border: 0; background: var(--surface-2); color: var(--text-soft); border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; }

.cart-empty { flex: 1; display: grid; place-content: center; color: var(--text-mute); text-align: center; gap: 6px; padding: 30px; }
.cart-empty .big { font-size: 40px; }

.totals { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 4px; }
.totals .row { display: flex; justify-content: space-between; color: var(--text-soft); font-size: 14px; }
.totals .row.grand { color: var(--text); font-size: 22px; font-weight: 800; margin-top: 4px; }
.totals .row.disc { color: var(--leaf); }
.cart-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; border-top: 1px solid var(--line); }

/* ---------------- Bestellingen-lijst ---------------- */
.orders { flex: 1; padding: 16px; overflow-y: auto; }
.orders-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.orders-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ocard { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-1); padding: 14px; border-left: 5px solid var(--text-mute); }
.ocard.open { border-left-color: var(--warn); }
.ocard.completed { border-left-color: var(--ok); }
.ocard.cancelled { border-left-color: var(--danger); opacity: .7; }
.ocard .o-top { display: flex; justify-content: space-between; align-items: baseline; }
.ocard .o-no { font-weight: 800; }
.ocard .o-total { font-weight: 800; font-size: 18px; }
.ocard .o-meta { color: var(--text-mute); font-size: 13px; margin: 6px 0 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); color: var(--text-soft);
  padding: 3px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; }
.chip.ch-pos { background: #e8efe6; color: #3f6b47; }
.chip.ch-thuisbezorgd { background: #ffe6cf; color: #9a5a23; }
.chip.ch-qr { background: #e3edf5; color: #35648a; }
.chip.paid { background: #dff0e2; color: #2f7a43; }
.chip.unpaid { background: #fbe6df; color: #a5432f; }
.ocard .o-actions { display: flex; gap: 8px; }
.ocard .o-actions .btn { height: 42px; font-size: 14px; padding: 0 14px; flex: 1; }

/* ---------------- Modal ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,16,11,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 96vw); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  overflow: hidden; animation: rise .18s ease; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.modal h3 { margin: 0; padding: 18px 20px 6px; font-size: 20px; }
.modal .m-body { padding: 8px 20px 4px; }
.modal .m-foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.modal .m-foot .btn { flex: 1; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.pay-methods button { height: 64px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pay-methods button.sel { border-color: var(--brand); background: var(--surface-2); }
.pay-methods .m-ico { font-size: 22px; }
.cash-calc { display: grid; gap: 8px; }
.cash-calc .field { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px;
  background: var(--surface-2); border-radius: var(--r); font-weight: 700; }
.cash-calc input { width: 130px; text-align: right; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px; background: var(--surface); color: var(--text); font-size: 18px; font-weight: 700; }
.change { color: var(--ok); font-size: 22px; }
.quick-cash { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-cash button { flex: 1; min-width: 70px; height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; }
.toast { background: var(--brand-deep); color: #f4ecdb; padding: 12px 18px; border-radius: var(--r-pill);
  box-shadow: var(--sh-3); font-weight: 600; animation: rise .2s; }
.toast.err { background: var(--danger); }
.toast.ok  { background: var(--ok); }

/* ---------------- Keuken (KDS) ---------------- */
.kds { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px; }
.kds-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.kds-head h2 { margin: 0; font-size: 20px; }
.kds-sub { color: var(--text-mute); font-weight: 700; }
.kds-grid { flex: 1; overflow-y: auto; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-content: start; }
.kds-empty { grid-column: 1 / -1; text-align: center; color: var(--text-mute); font-size: 18px; padding: 60px 20px; }
.kcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-1); padding: 14px;
  border-top: 5px solid var(--warn); display: flex; flex-direction: column; gap: 10px; }
.kcard.ch-qr { border-top-color: #35648a; }
.kcard.ch-thuisbezorgd { border-top-color: var(--accent); }
.k-top { display: flex; align-items: baseline; gap: 8px; }
.k-no { font-weight: 800; }
.k-where { color: var(--text-soft); font-weight: 600; }
.k-time { margin-left: auto; color: var(--text-mute); font-weight: 700; }
.k-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.k-items li { font-size: 16px; font-weight: 600; }
.k-qty { display: inline-block; min-width: 28px; color: var(--brand); font-weight: 800; }
.k-note { display: block; margin-left: 28px; font-size: 13px; font-weight: 700; color: var(--danger); }
.k-ready { margin-top: auto; height: 52px; font-size: 17px; }

/* ---------------- Afrekenen (tafels) ---------------- */
.pay-view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px; }
.pay-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pay-head h2 { margin: 0; font-size: 20px; }
.tafel-entry { display: flex; gap: 8px; }
.tafel-entry input { width: 120px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0 12px; background: var(--surface); color: var(--text); font-size: 18px; font-weight: 700; }
.pay-hint { color: var(--text-mute); margin: 8px 0 14px; }
.tables-grid { flex: 1; overflow-y: auto; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); align-content: start; }
.table-tile { border: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-1);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; border-left: 5px solid var(--warn); }
.table-tile:active { transform: translateY(1px) scale(.99); }
.tt-name { font-weight: 800; font-size: 17px; }
.tt-total { font-weight: 800; font-size: 22px; color: var(--brand); }
.tt-cnt { color: var(--text-mute); font-size: 13px; }
.bill-lines { max-height: 40vh; overflow-y: auto; margin-bottom: 12px; }
.bl { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.bl-note { font-size: 12px; color: var(--text-mute); padding: 0 0 6px; }

/* Plattegrond */
.pay-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.floor { position: relative; flex: 1; min-height: 60vh; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.tbl { position: absolute; transform: translate(-50%, -50%); width: 76px; height: 60px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--surface-2); box-shadow: var(--sh-1); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; cursor: pointer; touch-action: none; color: var(--text); }
.tbl.terras { border-radius: 50%; width: 64px; height: 64px; }
.tbl.has-bill { border-color: var(--warn); background: rgba(217, 139, 58, .18); }
.tbl.dragging { box-shadow: var(--sh-3); z-index: 5; opacity: .92; }
.tbl-name { font-weight: 800; font-size: 12.5px; }
.tbl-total { font-weight: 800; color: var(--warn); font-size: 12.5px; }
.tbl-seats { color: var(--text-mute); font-size: 11px; }

/* ---------------- Gast-bestelapp (QR) ---------------- */
.guest { min-height: 100dvh; background: var(--bg); color: var(--text); padding-bottom: 92px; }
.guest[data-loading="1"] > *:not(.splash) { display: none; }
.g-top { position: sticky; top: 0; z-index: 10; background: linear-gradient(180deg, #35493d, var(--brand-deep)); color: #f4ecdb;
  padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); box-shadow: var(--sh-2); }
.g-brand { font-weight: 800; font-size: 22px; letter-spacing: .2px; }
.g-table { color: #d9cfb9; font-size: 14px; margin-top: 3px; }
.g-top-row { display: flex; align-items: center; gap: 12px; }
.g-back { width: 46px; height: 46px; flex: 0 0 auto; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; font-weight: 800; }
.g-titles { min-width: 0; }
.g-sub { color: #d9cfb9; font-size: 14px; margin-top: 2px; }
.g-mode { margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #f4ecdb; padding: 11px 14px; font-weight: 700; font-size: 15px; }
.g-mode-edit { color: var(--honey); font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.g-mode-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.g-mode-ic { display: inline-flex; }
.g-mode-ic svg { width: 18px; height: 18px; }
.g-back svg { width: 24px; height: 24px; }
.t-ph svg { width: 30px; height: 30px; }
.g-line-img .t-ph svg { width: 22px; height: 22px; }
.g-modebtns .mb-ico svg { width: 26px; height: 26px; }
.g-check svg { width: 34px; height: 34px; }
.up-plus svg { width: 18px; height: 18px; }
.g-field textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface);
  color: var(--text); font-family: inherit; font-size: 16px; resize: vertical; min-height: 44px; }

/* Eten/Drinken groepskeuze */
.g-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; }
.g-group { position: relative; border: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 1/1; box-shadow: var(--sh-2); color: #fff; }
.g-group-img { position: absolute; inset: 0; background: var(--surface-2); }
.g-group-img img { width: 100%; height: 100%; object-fit: cover; }
.g-group::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,42,36,.1), rgba(31,42,36,.72)); }
.g-group span { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-weight: 800; font-size: 24px; z-index: 1; }

/* Categorie-tegels */
.g-cattiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px; }
.g-cattile { position: relative; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--sh-1); color: #fff; }
.g-ct-img { position: absolute; inset: 0; background: var(--surface-2); display: grid; place-items: center; }
.g-ct-img img { width: 100%; height: 100%; object-fit: cover; }
.g-ct-img .t-ph { font-size: 30px; opacity: .5; }
.g-cattile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,42,36,.06), rgba(31,42,36,.72)); }
.g-ct-name { position: absolute; left: 10px; right: 10px; bottom: 10px; text-align: center; font-weight: 800; font-size: 16px; z-index: 1; }
.g-products { padding: 16px; }

/* Mode-popup + mandje-mode-balk */
.g-modebar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); padding: 12px 14px; font-weight: 700; margin: 6px 0 12px; }
.g-modepop .g-modebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.g-modebtns button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 700; color: var(--text); }
.g-modebtns button.sel { border-color: var(--brand); background: var(--surface-2); }
.g-modebtns .mb-ico { font-size: 26px; }

/* Checkout-sheet schuifbaar op telefoon + regel met foto */
.g-sheet { max-height: 92vh; display: flex; flex-direction: column; }
.g-sheet .m-body { overflow-y: auto; }
.g-line-img { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; display: grid; place-items: center; }
.g-line-img img { width: 100%; height: 100%; object-fit: cover; }
.g-line-img .t-ph { font-size: 22px; opacity: .5; }
.g-line-main { flex: 1; min-width: 0; }
.g-cats { position: sticky; top: 62px; z-index: 9; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--bg); }
.g-products { padding: 12px 16px; }

/* ---- Bestelpagina op groter scherm: centreren & tegels temmen ---- */
.g-top-row, .g-mode, .g-groups, .g-cattiles, #gprods, .g-msg, .g-order-btn {
  max-width: 1060px; margin-left: auto; margin-right: auto;
}
@media (min-width: 760px) {
  /* Branded achtergrond: zachte glow boven, gekleurde flanken links/rechts */
  .guest {
    background:
      radial-gradient(1100px 460px at 50% -6%, rgba(74, 120, 84, .20), transparent 62%),
      linear-gradient(90deg, rgba(48, 82, 58, .24), rgba(48, 82, 58, 0) 15%, rgba(48, 82, 58, 0) 85%, rgba(48, 82, 58, .24)),
      var(--bg);
    background-attachment: fixed;
  }
  /* De bestelkolom als subtiel verhoogd paneel zodat de flanken 'm omlijsten */
  .g-groups, .g-cattiles, #gprods {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    margin-top: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .16);
  }
  .g-group { aspect-ratio: 16 / 9; }
  .g-groups { gap: 18px; }
  .g-cattiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  #gprods { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  #gprods .t-img { height: 148px; }
  /* Tegels binnen het paneel iets lichter tillen t.o.v. de paneelkleur */
  #gprods .tile, .g-cattile { background: var(--surface-2); }
}
@media (min-width: 1100px) {
  .g-groups { grid-template-columns: 1fr 1fr; }
  .g-group { aspect-ratio: 2 / 1; }
}

/* Zijpanelen op ruime schermen: merk-info links, live mandje rechts */
.g-rail { display: none; }
@media (min-width: 1200px) {
  .g-body { display: grid; grid-template-columns: 264px minmax(0, 760px) 300px;
    gap: 24px; justify-content: center; align-items: start; padding: 0 20px; }
  .g-center { min-width: 0; }
  .g-rail { display: block; position: sticky; top: 132px; }
  .g-bar { display: none; }              /* rechter rail heeft de afrekenknop */
  .guest { padding-bottom: 24px; }
  /* binnen de kolommen niet nog eens centreren/beperken */
  .g-groups, .g-cattiles, #gprods, .g-msg { max-width: none; margin-top: 0; }
}
.rail-card { background: var(--surface); color: var(--text); border-radius: 18px; padding: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .16); }
.rail-hero { border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; margin-bottom: 14px; background: var(--surface-2); }
.rail-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-brand { font-weight: 800; font-size: 20px; }
.rail-tag { color: var(--text-soft); font-size: 14px; margin-top: 2px; }
.rail-usps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rail-usps li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--text-soft); }
.rail-usps li svg { width: 20px; height: 20px; color: var(--brand); flex: 0 0 auto; }
.rail-hours { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; }
.rail-hours span { font-size: 12px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .03em; }
.rail-hours strong { color: var(--text); font-size: 16px; }
/* Rechter mandje */
.cart-rail-head { font-weight: 800; font-size: 17px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cart-rail-head span { background: var(--accent-warm); color: #2a2213; border-radius: var(--r-pill);
  min-width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; padding: 0 8px; font-weight: 800; }
.cart-rail-empty { display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-mute); padding: 26px 0; text-align: center; }
.cart-rail-empty svg { width: 34px; height: 34px; opacity: .55; }
.cart-rail-lines { display: flex; flex-direction: column; gap: 11px; max-height: 44vh; overflow-y: auto; }
.crl { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; font-size: 14px; align-items: baseline; }
.crl-q { color: var(--text-soft); font-weight: 700; }
.crl-n { min-width: 0; }
.crl-n em { display: block; font-style: normal; color: var(--text-mute); font-size: 12px; }
.crl-p { font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-rail-total { display: flex; justify-content: space-between; align-items: center; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.cart-rail-total strong { font-size: 18px; }
.cart-rail-btn { margin-top: 14px; height: 52px; }
.g-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface);
  box-shadow: 0 -6px 24px rgba(31, 42, 36, .14); }
.g-order-btn { width: 100%; height: 58px; border: 0; border-radius: var(--r-pill);
  background: linear-gradient(180deg, #37503f, var(--brand)); color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 18px; gap: 12px; }
.g-order-btn .g-count { background: var(--accent-warm); color: #2a2213; border-radius: var(--r-pill);
  min-width: 30px; height: 30px; display: grid; place-items: center; }
.g-sheet .g-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.g-l-top { display: flex; justify-content: space-between; font-weight: 700; }
.g-note { width: 100%; margin-top: 6px; height: 36px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; background: var(--surface); color: var(--text); }
.g-success { position: fixed; inset: 0; z-index: 60; background: rgba(20, 16, 11, .6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; }
.g-success-card { background: var(--surface); border-radius: var(--r-lg); padding: 30px; text-align: center;
  max-width: 360px; box-shadow: var(--sh-3); }
.g-check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 36px;
  display: grid; place-items: center; margin: 0 auto 12px; }
.g-sub { color: var(--text-mute); }
.g-msg { padding: 40px; text-align: center; color: var(--text-mute); }
.g-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-weight: 600; color: var(--text-soft); }
.g-field span { font-size: 13px; }
.g-field input, .g-field select { height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 16px; }
.g-type { margin-bottom: 12px; }
.g-warn { color: var(--danger); font-weight: 700; font-size: 13px; margin-top: 6px; }
/* Upselling */
.up-sell { margin: 10px 0 14px; }
.up-title { font-weight: 700; margin-bottom: 8px; color: var(--text); }
.up-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.up-card { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 8px 8px; min-width: 210px; text-align: left; }
.up-card:active { transform: scale(.98); }
.up-img { width: 46px; height: 46px; border-radius: 9px; overflow: hidden; background: var(--surface); flex: 0 0 auto; }
.up-img img { width: 100%; height: 100%; object-fit: cover; }
.up-info { display: flex; flex-direction: column; }
.up-name { font-weight: 700; font-size: 14px; }
.up-price { color: var(--accent); font-weight: 700; font-size: 13px; }
.up-plus { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }

/* ---------------- QR-codes per tafel ---------------- */
.qr-view { flex: 1; overflow-y: auto; padding: 16px; }
.qr-head { display: flex; align-items: center; gap: 12px; }
.qr-head h2 { margin: 0; font-size: 20px; }
.qr-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 12px; }
.qr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-biz { font-weight: 800; }
.qr-name { font-size: 22px; font-weight: 800; color: var(--brand); }
.qr-img { background: #fff; padding: 10px; border-radius: 10px; }
.qr-img img, .qr-img canvas { display: block; }
.qr-cap { color: var(--text-mute); font-size: 12px; }
@media print {
  .topbar, .no-print { display: none !important; }
  .qr-view { padding: 0; overflow: visible; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .qr-card { break-inside: avoid; border: 1px dashed #999; }
  body, .app, #main { background: #fff !important; }
}

/* ---------------- Beheer (admin) ---------------- */
.admin-view { flex: 1; overflow-y: auto; padding: 16px; }
.admin-head { margin-bottom: 14px; }
.admin-toolbar { margin-bottom: 14px; }
.p-group { margin-bottom: 18px; }
.p-group h3 { margin: 0 0 8px; font-size: 13px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .5px; }
.p-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px;
  margin-bottom: 6px; text-align: left; cursor: pointer; color: var(--text); }
.p-row:hover { border-color: var(--accent); }
.p-row.inactive { opacity: .55; }
.p-name { font-weight: 700; }
.p-off { color: var(--danger); font-weight: 600; font-size: 12px; }
.p-price { color: var(--text-soft); font-weight: 700; white-space: nowrap; }
.admin-form { max-width: 640px; }
.admin-form h3 { margin: 18px 0 10px; font-size: 16px; }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-row .g-field { flex: 1; min-width: 130px; }
.admin-check { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 600; color: var(--text-soft); }
.admin-check input { width: 20px; height: 20px; }
.admin-hint { font-size: 12.5px; color: var(--text-mute); margin: 6px 0 0; line-height: 1.45; }
.g-field small { font-weight: 400; color: var(--text-mute); }
.g-check.g-check-wait { background: var(--warn, #d9930b); animation: gpulse 1s ease-in-out infinite; }
@keyframes gpulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.admin-actions { margin-top: 18px; }

/* ---- Facturen ---- */
.inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.inv-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inv-no { font-weight: 700; }
.inv-to { color: var(--text-mute); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.inv-badge.paid { background: #dff3e4; color: #1c7a44; }
.inv-badge.open { background: #fdefd2; color: #9a6b06; }
.inv-badge.cancel { background: #f3d9d9; color: #a12a2a; }
.inv-lhead, .inv-lrow { display: grid; grid-template-columns: 1fr 70px 90px 70px 34px; gap: 6px; align-items: center; }
.inv-lhead { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; padding: 0 2px; }
.inv-lrow { margin-bottom: 6px; }
.inv-lrow input, .inv-lrow select { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; }
.inv-lrow .il-del { border: 0; background: var(--surface-2); color: var(--text-mute); border-radius: 8px; font-size: 18px; cursor: pointer; height: 36px; }
.inv-total-preview { margin-top: 14px; text-align: right; font-size: 15px; color: var(--text-soft); }
.inv-detail { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; font-size: 15px; }
.inv-detail .lbl { display: inline-block; min-width: 72px; color: var(--text-mute); font-size: 13px; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-actions .btn { flex: 1 1 auto; }
.inv-msg { margin-top: 14px; font-size: 13px; color: var(--text-soft); word-break: break-all; }
.prod-photo { display: flex; align-items: center; gap: 12px; }
.pp-preview { width: 80px; height: 80px; border-radius: 10px; background: var(--surface-2); display: grid;
  place-items: center; overflow: hidden; color: var(--text-mute); font-size: 12px; flex: 0 0 auto; }
.pp-preview img { width: 100%; height: 100%; object-fit: cover; }
.pp-none { color: var(--text-mute); }
.pp-btn { height: 44px; }
#logoPrev { width: 130px; }
#logoPrev img { object-fit: contain; }
.pos-wait { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pos-spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: pos-rot .8s linear infinite; }
@keyframes pos-rot { to { transform: rotate(360deg); } }
.pp-hint { color: var(--text-mute); font-size: 13px; margin: 4px 0; }

/* Rapportages */
.rep-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.rep-dates { display: flex; align-items: center; gap: 8px; }
.rep-dates input { height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--text); }
.rep-dates .btn { height: 42px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1); }
.kpi-l { display: block; color: var(--text-mute); font-size: 13px; font-weight: 600; }
.kpi-v { display: block; font-size: 26px; font-weight: 800; margin-top: 4px; }
.rep-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh-1); margin-bottom: 16px; }
.rep-card h3 { margin: 0 0 12px; font-size: 15px; }
.rep-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rep-tbl { width: 100%; border-collapse: collapse; }
.rep-tbl td { padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.rep-tbl td.r { text-align: right; color: var(--text-soft); white-space: nowrap; }
.chart-scroll { overflow-x: auto; }
.rep-empty { color: var(--text-mute); }
@media (max-width: 760px) { .kpi-row { grid-template-columns: 1fr; } .rep-cols { grid-template-columns: 1fr; } }

/* ---------------- Mobiel ---------------- */
.cart-fab { display: none; }
@media (max-width: 900px) {
  .kassa { grid-template-columns: minmax(0, 1fr); }
  .cart { position: fixed; inset: 0; top: 0; z-index: 40; border-left: 0;
    transform: translateY(100%); transition: transform .25s ease; }
  .app[data-cart="open"] .cart { transform: translateY(0); }
  .cart-fab { display: flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 35;
    height: 58px; padding: 0 22px; border-radius: var(--r-pill); border: 0; align-items: center; gap: 10px;
    background: linear-gradient(180deg, #37503f, var(--brand)); color: #fff; box-shadow: var(--sh-3); font-weight: 800; font-size: 16px; }
  .cart-fab .cf-count { background: var(--accent-warm); color: #2a2213; border-radius: var(--r-pill);
    min-width: 26px; height: 26px; display: grid; place-content: center; font-size: 14px; }
  .cart-close { display: inline-flex !important; }
}
.cart-close { display: none; }
