*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:    #1e3a5f;
  --navy2:   #16304f;
  --cream:   #faf7f2;
  --warm:    #f0ebe1;
  --border:  #e0d8cc;
  --text:    #1a1a1a;
  --text2:   #5a5248;
  --text3:   #9a9088;
  --green:   #2d7a4f;
  --green-bg:#e8f5ee;
  --red:     #c0392b;
  --red-bg:  #fdecea;
  --blue-bg: #e8f0fb;
  --blue-fg: #1a4a8a;
  --radius:  10px;
  --shadow:  0 1px 3px rgba(0,0,0,.08);
}
html, body {
  height: 100%; width: 100%;
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px; color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
#app {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: 100vh;
  overflow: hidden;
}
@media (max-width: 700px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #right { border-left: none; border-top: 1px solid var(--border); max-height: 42vh; }
}
#left { display: flex; flex-direction: column; overflow: hidden; background: var(--cream); }
#topbar {
  background: var(--navy); color: #fff;
  padding: 0 16px; height: 52px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#topbar .brand { font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
#topbar .brand span { opacity: .5; font-weight: 400; margin-left: 6px; font-size: 13px; }
#topbar .right-info { display: flex; align-items: center; gap: 16px; }
#clock { font-size: 13px; opacity: .75; font-variant-numeric: tabular-nums; }
#tabs { display: flex; background: var(--navy2); flex-shrink: 0; }
.tab {
  flex: 1; padding: 9px 0; text-align: center;
  font-size: 11px; font-weight: 500; color: rgba(255,255,255,.5);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all .15s; letter-spacing: .04em; text-transform: uppercase;
}
.tab.active { color: #fff; border-bottom-color: #6aabf7; }
#cats {
  display: flex; gap: 6px; padding: 10px 14px;
  overflow-x: auto; flex-shrink: 0;
  background: var(--warm); border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#cats::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0; padding: 12px 24px; border-radius: 24px;
  border: 1px solid var(--border); background: #fff;
  font-size: 16px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.cat-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
#items-wrap { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; padding: 14px; align-content: start;
}
.item-btn {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 10px 12px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow); transition: transform .1s, box-shadow .1s;
  -webkit-user-select: none;
}
.item-btn:active { transform: scale(.95); box-shadow: none; }
.item-swatch { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.item-name { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.3; }
.item-price { font-size: 14px; color: var(--text3); }
#right {
  display: flex; flex-direction: column;
  background: #fff; border-left: 1px solid var(--border); overflow: hidden;
}
#order-hdr {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; background: var(--warm);
}
#order-hdr .label { font-size: 13px; font-weight: 600; }
#item-count { font-size: 12px; color: var(--text3); }
#order-lines { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#order-empty { padding: 40px 20px; text-align: center; color: var(--text3); font-size: 13px; line-height: 1.6; }
#order-empty .hint { font-size: 28px; margin-bottom: 10px; }
.order-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid #f5f0ea; }
.order-row:last-child { border-bottom: none; }
.o-qty {
  min-width: 28px; height: 28px; border-radius: 7px;
  background: var(--blue-bg); color: var(--blue-fg);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.o-name { flex: 1; font-size: 13px; }
.o-price { font-size: 13px; color: var(--text2); font-variant-numeric: tabular-nums; }
.o-del {
  width: 26px; height: 26px; border: none; background: none;
  color: var(--text3); font-size: 18px; cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; transition: background .1s, color .1s; flex-shrink: 0;
}
.o-del:hover { background: var(--red-bg); color: var(--red); }
#totals { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--warm); flex-shrink: 0; }
.tot-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.tot-row.grand { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); margin-bottom: 0; }
#pay-area { padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-shrink: 0; border-top: 1px solid var(--border); }
.pay-btn { padding: 13px 8px; border-radius: var(--radius); border: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .12s, transform .1s; }
.pay-btn:active { opacity: .82; transform: scale(.97); }
#btn-cash { background: var(--navy); color: #fff; }
#btn-card { background: var(--green); color: #fff; }
#btn-payconiq { grid-column: 1/-1; background: #e5194f; color: #fff; }
/* Sits right under Payconiq. Dormant by default — it only lights up for a
   klant-app order Mollie confirmed as paid, so it never books phantom revenue. */
#btn-online { grid-column: 1/-1; background: var(--cream); color: var(--text3); border: 1px dashed var(--border); }
#btn-online.paid-ready { background: #e8f5e9; color: #1b5e20; border: 1px solid #2e7d32; }
#btn-online:disabled { cursor: not-allowed; }
#btn-online:disabled:active { opacity: 1; transform: none; }
#btn-void { grid-column: 1/-1; background: none; border: 1px solid #e0c0bc; color: var(--red); padding: 9px; font-size: 12px; }
#statusbar { background: var(--navy2); color: rgba(255,255,255,.55); font-size: 11px; padding: 5px 16px; display: flex; justify-content: space-between; flex-shrink: 0; }

/* ── Scrollable content views ── */
.content-view { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; display: none; }
.content-view.active { display: block; }
#pos-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

/* ── Shared card / section styles ── */
.section-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.panel-hdr { padding: 10px 14px; background: var(--warm); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text2); display: flex; align-items: center; justify-content: space-between; }
.panel-row { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid #f5f0ea; font-size: 13px; }
.panel-row:last-child { border-bottom: none; }

/* ── Report ── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-card .lbl { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.stat-card .val { font-size: 22px; font-weight: 700; }
.stat-card .sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.rpt-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid #f5f0ea; font-size: 12px; }
.rpt-row:last-child { border-bottom: none; }
.rpt-time { color: var(--text3); min-width: 44px; font-variant-numeric: tabular-nums; }
.rpt-items { flex: 1; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpt-amt { font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; flex-shrink: 0; }
.badge-cash { background: var(--green-bg); color: var(--green); }
.badge-card { background: var(--blue-bg); color: var(--blue-fg); }
.badge-payconiq { background: #fde8ee; color: #e5194f; }
.top-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid #f5f0ea; font-size: 12px; }
.top-row:last-child { border-bottom: none; }
.bar-wrap { flex: 1; margin: 0 10px; background: var(--warm); border-radius: 4px; height: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 4px; transition: width .4s; }
.qty-lbl { color: var(--text3); min-width: 28px; text-align: right; }

/* ── Settings / actions ── */
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #f5f0ea; gap: 12px; }
.setting-row:last-child { border-bottom: none; }
.setting-row label { font-size: 13px; color: var(--text); }
.setting-row input[type=text],
.setting-row input[type=number],
.setting-row input[type=password] {
  width: 200px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; background: var(--cream); color: var(--text); text-align: right;
}
#cfg-addr { width: 260px; }
.action-btn {
  width: 100%; padding: 11px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--cream); font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; margin-bottom: 8px; text-align: left;
  display: flex; align-items: center; gap: 10px; transition: background .12s;
}
.action-btn:hover { background: var(--warm); }
.action-btn .ico { font-size: 18px; }
.action-btn.danger { color: var(--red); border-color: #e0c0bc; }

/* ── Product catalogue management ── */
#catalogue-view { display: none; }
#catalogue-view.active { display: block; }

/* sub-tabs inside catalogue */
.sub-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.sub-tab {
  padding: 12px 24px; border-radius: 24px; border: 1px solid var(--border);
  background: #fff; font-size: 16px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .12s;
}
.sub-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* product list rows */
.prod-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid #f5f0ea;
}
.prod-row:last-child { border-bottom: none; }
.prod-emoji { font-size: 26px; width: 40px; text-align: center; flex-shrink: 0; }
.prod-info { flex: 1; }
.prod-info .pname { font-size: 16px; font-weight: 600; }
.prod-info .pcat  { font-size: 13px; color: var(--text3); }
.prod-price { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text2); min-width: 46px; text-align: right; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--cream); font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .1s, color .1s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--warm); }
.icon-btn.del:hover { background: var(--red-bg); color: var(--red); border-color: #e0c0bc; }
.icon-btn:disabled { opacity: .3; cursor: default; background: var(--cream); }
/* Must out-specify .icon-btn.del:hover, or a disabled delete still lights up red. */
.icon-btn.del:disabled:hover { background: var(--cream); color: inherit; border-color: var(--border); }

/* ── Maker's credit ──
   Defined here rather than in customer/css/order.css because the klant-app
   loads this stylesheet too (customer/index.html), so both apps share it. */
.made-by { text-align: center; font-size: 11px; color: var(--text3); padding: 14px 10px; line-height: 1.5; }
.made-by a { color: inherit; font-weight: 600; text-decoration: underline; }
.made-by a:hover { color: var(--navy); }
/* The PIN box is a white card (the dim is the overlay behind it), so the
   default muted grey is right — only the spacing needs adjusting. */
#pin-box .made-by { padding: 16px 10px 0; }

/* openingsuren rows (Instellingen → Online bestellen) */
.hours-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.hours-day { min-width: 88px; font-size: 12px; font-weight: 600; }
.hours-closed { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text3); min-width: 78px; cursor: pointer; }
.hours-closed input { width: 14px; height: 14px; cursor: pointer; }
.hours-row input[type="time"] { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.hours-sep { color: var(--text3); font-size: 12px; }

/* category list rows */
.cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid #f5f0ea;
}
.cat-row:last-child { border-bottom: none; }
.cat-color-swatch { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
.cat-name { flex: 1; font-size: 13px; font-weight: 500; }
.cat-count { font-size: 12px; color: var(--text3); }

/* add-form inline */
.add-form {
  background: var(--cream); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.add-form h3 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.form-grid.full { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.form-field input,
.form-field select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; background: #fff; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.form-field input:focus,
.form-field select:focus { outline: none; border-color: var(--navy); }
.form-actions { display: flex; gap: 8px; }
.btn-primary {
  flex: 1; padding: 10px; border-radius: var(--radius); border: none;
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity .12s;
}
.btn-primary:active { opacity: .8; }
.btn-secondary {
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: #fff; color: var(--text2); font-size: 13px; cursor: pointer; transition: background .12s;
}
.btn-secondary:hover { background: var(--warm); }

/* emoji picker row */
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.emoji-opt {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .1s;
}
.emoji-opt.selected { border-color: var(--navy); background: var(--blue-bg); }

/* ── Receipt modal ── */
#modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
}
#modal-overlay.show { display: flex; }
#modal { background: #fff; border-radius: 16px; width: 100%; max-width: 340px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#modal-hdr { background: var(--navy); color: #fff; padding: 16px 20px; }
#modal-hdr .m-title { font-size: 15px; font-weight: 600; }
#modal-hdr .m-sub { font-size: 12px; opacity: .65; margin-top: 2px; }
#modal-body { padding: 16px 20px; }
.receipt-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); padding: 3px 0; }
.receipt-divider { border: none; border-top: 1px dashed var(--border); margin: 10px 0; }
.receipt-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; padding: 6px 0 0; }
#modal-footer { padding: 0 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-btn { padding: 11px; border-radius: var(--radius); border: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .12s; }
.modal-btn:active { opacity: .8; }
#modal-btn-new { background: var(--navy); color: #fff; grid-column: 1/-1; }
#modal-btn-print { background: var(--warm); color: var(--text); border: 1px solid var(--border); grid-column: 1/-1; }

/* ── Payconiq QR payment ── */
#qr-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 110;
  align-items: center; justify-content: center; padding: 20px;
}
#qr-overlay.show { display: flex; }
#qr-box { background: #fff; border-radius: 16px; width: 100%; max-width: 340px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#qr-hdr { background: #e5194f; color: #fff; padding: 16px 20px; font-size: 15px; font-weight: 600; }

/* ── Edit product modal ── */
#edit-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 110;
  align-items: center; justify-content: center; padding: 20px;
}
#edit-overlay.show { display: flex; }
#edit-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 380px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#edit-modal-hdr { background: var(--navy); color: #fff; padding: 14px 18px; font-size: 14px; font-weight: 600; }
#edit-modal-body { padding: 16px 18px; }
#edit-modal-footer { padding: 0 18px 18px; display: flex; gap: 8px; }

/* ── PIN modal ── */
#pin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; }
#pin-overlay.show { display: flex; }
#pin-box { background: #fff; border-radius: 16px; padding: 28px 24px; width: 280px; text-align: center; }
#pin-box h2 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
#pin-box p { font-size: 13px; color: var(--text3); margin-bottom: 20px; }
#pin-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); transition: background .15s, border-color .15s; }
.pin-dot.filled { background: var(--navy); border-color: var(--navy); }
#pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-key { padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--cream); font-size: 18px; font-weight: 600; cursor: pointer; transition: background .1s; }
.pin-key:active { background: var(--warm); }
.pin-key.del { font-size: 14px; color: var(--text3); }
#pin-error { font-size: 12px; color: var(--red); margin-top: 10px; min-height: 18px; }

/* ── Admin panel ── */
#admin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
#admin-overlay.show { display: flex; }
#admin-box { background: #fff; border-radius: 16px; width: 100%; max-width: 360px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
#admin-hdr { background: var(--navy); color: #fff; padding: 14px 18px; font-size: 15px; font-weight: 600; }
.admin-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.admin-section-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text3); letter-spacing: .5px; margin-bottom: 8px; }
.admin-danger-btn { width: 100%; padding: 9px 14px; background: #fff0f0; border: 1px solid #f5c6c6; color: var(--red); border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.admin-danger-btn:hover { background: #ffe0e0; }
.admin-save-btn { padding: 8px 14px; background: var(--navy); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.admin-save-btn:hover { background: #1a3860; }
.admin-close-btn { display: block; width: calc(100% - 36px); margin: 14px 18px; padding: 10px; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; cursor: pointer; }
.admin-close-btn:hover { background: var(--warm); }

/* ── Toast ── */
#toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1a1a1a; color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 13px; opacity: 0; transition: all .3s; z-index: 300; white-space: nowrap; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Product photo ── */
.product-img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; display: block; }
.prod-img-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; display: block; }

/* ── Print ── */
@media print {
  #app, #modal-overlay, #pin-overlay, #edit-overlay, #admin-overlay, #qr-overlay, #preorder-overlay, #dayclose-overlay, #discount-overlay, #invoice-overlay, #payconfirm-overlay, #invoice-preview-overlay, #toast { display: none !important; }
  #print-area { display: block !important; }
}
#print-area { display: none; font-family: 'Courier New', monospace; font-size: 12px; max-width: 300px; margin: 0 auto; padding: 10px; }
#print-area .p-hdr { text-align: center; font-weight: bold; font-size: 14px; margin-bottom: 4px; }
#print-area .p-logo { display: block; max-width: 200px; max-height: 80px; margin: 0 auto 4px; object-fit: contain; }
#print-area .p-sub { text-align: center; font-size: 11px; margin-bottom: 4px; }
#print-area .p-line { display: flex; justify-content: space-between; margin-bottom: 2px; }
#print-area .p-item { display: flex; margin-bottom: 2px; }
#print-area .p-item .p-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 4px; }
#print-area .p-item .p-item-price, #print-area .p-item .p-item-total { flex-shrink: 0; width: 54px; text-align: right; }
#print-area .p-div { border-top: 1px dashed #000; margin: 8px 0; }
#print-area .p-tot { display: flex; justify-content: space-between; font-weight: bold; font-size: 14px; }
#print-area .p-ft { text-align: center; margin-top: 8px; font-size: 11px; }
#print-area .p-fc { display: flex; justify-content: space-between; margin-bottom: 2px; font-size: 12px; }

/* ── Stock badges on POS product buttons ── */
.item-btn { position: relative; }
.item-stock { position: absolute; top: 5px; right: 5px; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 10px; background: var(--green-bg); color: var(--green); }
.item-stock.low { background: #fff3e0; color: #b26a00; }
.item-stock.out { background: var(--red-bg); color: var(--red); }
.item-btn.sold-out { opacity: .5; }
.item-btn.sold-out .item-swatch { filter: grayscale(1); }

/* ── Tab badge (today's pickups count) ── */
.tab-badge { display: inline-block; min-width: 16px; padding: 1px 5px; border-radius: 10px; background: #e5194f; color: #fff; font-size: 10px; font-weight: 700; text-align: center; vertical-align: middle; }

/* ── POS pickup banner ── */
#pickup-banner { margin: 0 0 10px; padding: 10px 14px; background: #fff3e0; border: 1px solid #f0d9b0; border-radius: var(--radius); color: #7a4500; font-size: 13px; font-weight: 600; cursor: pointer; }
#pickup-banner:active { opacity: .85; }

/* ── Stock management rows ── */
.stock-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.stock-row .s-name { flex: 1; min-width: 0; }
.stock-row input[type=number] { width: 62px; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.stock-row .s-track { width: 16px; height: 16px; cursor: pointer; }

/* ── Pre-order cards ── */
.po-daygroup { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); background: var(--cream); padding: 7px 14px 4px; }
.po-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.po-card .po-info { flex: 1; min-width: 0; }
.po-card .po-cust { font-weight: 600; font-size: 13px; }
.po-card .po-meta { font-size: 11px; color: var(--text3); margin-top: 1px; }
/* Must be hard to miss: ringing this order up again would charge the customer twice. */
.po-card .po-paid { font-size: 11px; font-weight: 600; color: #2e7d32; margin-top: 2px; }
.po-status { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.po-status.open { background: #fff3e0; color: #b26a00; }
.po-status.ready { background: var(--blue-bg); color: var(--blue-fg); }
.po-status.collected { background: var(--green-bg); color: var(--green); }
.po-status.cancelled { background: var(--red-bg); color: var(--red); }

/* ── Pre-order & day-close modals (reuse edit-modal look) ── */
#preorder-overlay, #dayclose-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 120; align-items: center; justify-content: center; padding: 20px; }
#preorder-overlay.show, #dayclose-overlay.show { display: flex; }
#preorder-box, #dayclose-box { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#preorder-hdr, #dayclose-hdr { background: var(--navy); color: #fff; padding: 14px 18px; font-size: 15px; font-weight: 600; position: sticky; top: 0; }
#preorder-modal-body, #dayclose-body { padding: 16px 18px; }
#preorder-modal-footer, #dayclose-footer { padding: 0 18px 18px; display: flex; gap: 8px; flex-wrap: wrap; }
#preorder-modal-footer .btn-primary, #dayclose-footer .btn-primary { flex: 1; }

/* ── Qty calculator (quantity-first entry on the POS) ── */
#pos-main { display: flex; flex: 1; overflow: hidden; min-height: 0; }
#qty-pad {
  width: 190px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 12px;
  background: var(--warm); border-right: 1px solid var(--border);
  overflow-y: auto;
}
.qty-pad-lbl { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); }
#qty-display {
  height: 58px; border-radius: 10px;
  background: #fff; border: 2px solid var(--border);
  font-size: 30px; font-weight: 700; color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
#qty-display.set { color: var(--navy); border-color: var(--navy); background: var(--blue-bg); }
#qty-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qty-key {
  padding: 15px 0; border-radius: 10px;
  border: 1px solid var(--border); background: #fff;
  font-size: 20px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .1s;
  box-shadow: var(--shadow);
}
.qty-key:active { background: var(--warm); }
.quick-amount-btn {
  flex: 1; padding: 10px 0; border-radius: 8px;
  border: 1px solid var(--border); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .1s;
}
.quick-amount-btn:active { background: var(--warm); }
.qty-key.qty-clear { color: var(--red); font-size: 16px; }
@keyframes qtyFlash { 0%,100% { background: var(--warm); } 50% { background: #ffe2b8; } }
#qty-pad.flash { animation: qtyFlash .4s ease 2; }
@media (max-width: 700px) {
  #qty-pad { width: 132px; padding: 10px 8px; }
  .qty-key { padding: 10px 0; font-size: 17px; }
  #qty-display { height: 44px; font-size: 22px; }
}

/* ── Payment confirm modal (contant / bancontact) ── */
#payconfirm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 110;
  align-items: center; justify-content: center; padding: 20px;
}
#payconfirm-overlay.show { display: flex; }
#payconfirm-box { background: #fff; border-radius: 16px; width: 100%; max-width: 340px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#payconfirm-hdr { background: var(--navy); color: #fff; padding: 16px 20px; font-size: 15px; font-weight: 600; }

/* ── Korting & Factuur pay buttons ── */
#btn-discount { background: #fff3e0; color: #b26a00; border: 1px solid #f0d9b0; }
#btn-discount.active { background: #b26a00; color: #fff; border-color: #b26a00; }
#btn-invoice { background: var(--blue-bg); color: var(--blue-fg); border: 1px solid #c3d6f2; }
#btn-preorder { grid-column: 1/-1; }
.badge-invoice { background: var(--blue-bg); color: var(--blue-fg); }

/* ── Korting & Factuur modals ── */
#discount-overlay, #invoice-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 120;
  align-items: center; justify-content: center; padding: 20px;
}
#discount-overlay.show, #invoice-overlay.show { display: flex; }
#discount-box { background: #fff; border-radius: 16px; width: 100%; max-width: 340px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#invoice-box  { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#discount-hdr { background: #b26a00; color: #fff; padding: 14px 18px; font-size: 15px; font-weight: 600; }
#invoice-hdr  { background: var(--navy); color: #fff; padding: 14px 18px; font-size: 15px; font-weight: 600; }

/* ── Invoice (A4-style document via #print-area.invoice) ── */
#print-area.invoice {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px; max-width: 700px; padding: 24px;
}
#print-area.invoice .inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
#print-area.invoice .inv-shop { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
#print-area.invoice .inv-title { text-align: right; }
#print-area.invoice .inv-nr { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
#print-area.invoice .inv-muted { color: #555; font-size: 12px; }
#print-area.invoice .inv-lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #888; margin-bottom: 3px; }
#print-area.invoice .inv-cust { margin-bottom: 20px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; display: inline-block; min-width: 240px; }
#print-area.invoice .inv-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
#print-area.invoice .inv-table th, #print-area.invoice .inv-table td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; font-size: 12px; }
#print-area.invoice .inv-table th { background: #f2f2f2; font-weight: 600; }
#print-area.invoice .inv-table .r { text-align: right; }
#print-area.invoice .inv-totals { margin-left: auto; max-width: 280px; }
#print-area.invoice .inv-trow { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
#print-area.invoice .inv-grand { font-size: 15px; font-weight: 700; border-top: 2px solid #000; margin-top: 6px; padding-top: 6px; }
#print-area.invoice .inv-foot { margin-top: 28px; font-size: 12px; }

/* ── Factuur quick view (on-screen preview, not print) ── */
#invoice-preview-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 120;
  align-items: center; justify-content: center; padding: 20px;
}
#invoice-preview-overlay.show { display: flex; }
#invoice-preview-box { background: #fff; border-radius: 16px; width: 100%; max-width: 760px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
#invoice-preview-hdr { background: var(--navy); color: #fff; padding: 14px 18px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
#invoice-preview-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; opacity: .8; }
#invoice-preview-close:hover { opacity: 1; }
#invoice-preview-body {
  overflow-y: auto; padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px; color: var(--text1);
}
#invoice-preview-body .inv-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
#invoice-preview-body .inv-shop { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
#invoice-preview-body .inv-title { text-align: right; }
#invoice-preview-body .inv-nr { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
#invoice-preview-body .inv-muted { color: #555; font-size: 12px; }
#invoice-preview-body .inv-lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #888; margin-bottom: 3px; }
#invoice-preview-body .inv-cust { margin-bottom: 20px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; display: inline-block; min-width: 240px; }
#invoice-preview-body .inv-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
#invoice-preview-body .inv-table th, #invoice-preview-body .inv-table td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; font-size: 12px; }
#invoice-preview-body .inv-table th { background: #f2f2f2; font-weight: 600; }
#invoice-preview-body .inv-table .r { text-align: right; }
#invoice-preview-body .inv-totals { margin-left: auto; max-width: 280px; }
#invoice-preview-body .inv-trow { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
#invoice-preview-body .inv-grand { font-size: 15px; font-weight: 700; border-top: 2px solid #000; margin-top: 6px; padding-top: 6px; }
#invoice-preview-body .inv-foot { margin-top: 28px; font-size: 12px; }
#invoice-preview-footer { padding: 14px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); }
