*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f0f;
  --surface:   #1a1a1a;
  --border:    #2a2a2a;
  --accent:    #f5a623;
  --accent2:   #e8951f;
  --green:     #2ecc71;
  --blue:      #3498db;
  --red:       #e74c3c;
  --text:      #f0f0f0;
  --muted:     #888;
  --radius:    10px;
}

html.light {
  --bg:      #f0f0f0;
  --surface: #ffffff;
  --border:  #d0d0d0;
  --text:    #111111;
  --muted:   #666666;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── LAYOUT ── */
#app {
  display: grid;
  grid-template-rows: 100px 1fr;
  grid-template-columns: 1fr 420px;
  height: 100vh;
}

/* ── CATEGORIES ── */
#categories {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
}

#categories::-webkit-scrollbar { display: none; }

#admin-btn {
  flex-shrink: 0;
  padding: 22px 36px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 8px;
  touch-action: manipulation;
}
#admin-btn:active { border-color: var(--accent); color: var(--accent); }

/* ── ADMIN OVERLAY ── */
#admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#admin-overlay.open { opacity: 1; pointer-events: all; }

#admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#admin-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#admin-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

#admin-sluiten {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  touch-action: manipulation;
}
#admin-sluiten:active { border-color: var(--red); color: var(--red); }

@media print {
  #admin-overlay { opacity: 1 !important; pointer-events: all !important; background: #fff !important; }
  #admin-panel { width: 100% !important; max-height: none !important; border: none !important; background: #fff !important; color: #000 !important; }
  #admin-header { display: none !important; }
  body > *:not(#admin-overlay) { display: none !important; }
}

#admin-content {
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

/* ── ACTIE GRID ── */
.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 24px;
  width: 100%;
}

.admin-action-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  cursor: pointer;
  touch-action: manipulation;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.admin-action-btn:active { transform: scale(0.97); border-color: var(--accent); }
.admin-action-btn.act-danger:active { border-color: var(--red); }
.admin-action-btn.act-success { border-color: #27ae60; }
.admin-action-btn.act-success:active { border-color: #1e8449; }
.admin-action-btn.act-warning { border-color: #e67e22; }
.admin-action-btn.act-warning:active { border-color: #d35400; }
.admin-action-btn:disabled { opacity: .5; }

.admin-kassier-naam {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  padding: 8px 0 4px;
}

.act-icon  { font-size: 1.6rem; line-height: 1; }
.act-label { font-size: 1rem; font-weight: 700; margin-top: 4px; }
.act-sub   { font-size: 0.78rem; color: var(--muted); }

/* ── WEEK VIEW ── */
.admin-back-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .85rem;
  font-family: inherit;
  padding: 8px 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.admin-back-btn:active { border-color: var(--accent); color: var(--accent); }

/* ── PIN NUMPAD ── */
.pin-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

.pin-label { font-size: 0.95rem; color: var(--muted); }
.pin-error { font-size: 0.9rem; color: var(--red); font-weight: 600; }

.pin-dots { display: flex; gap: 12px; }

.pin-dots span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: background 0.1s, border-color 0.1s;
}

.pin-dots span.filled { background: var(--accent); border-color: var(--accent); }

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  gap: 14px;
}

.pin-key {
  height: 100px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 2rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.pin-key:active { transform: scale(0.93); background: var(--surface); }
.pin-key-del { font-size: 1.2rem; color: var(--muted); }
.pin-key-ok  { background: var(--green); border-color: var(--green); color: #fff; }
.pin-key-ok:active { background: #27ae60; }

.pin-reset-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  touch-action: manipulation;
}
.pin-reset-btn:active { color: var(--text); }


.staaf-grafiek {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
  padding-top: 20px;
}
.staaf-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.staaf-bar-wrap {
  width: 100%;
  display: flex;
  align-items: flex-end;
  height: 80px;
}
.staaf-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--border);
  min-height: 3px;
  transition: background 0.2s;
}
.staaf-bar.vandaag { background: var(--accent); }
.staaf-bedrag {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  min-height: 14px;
}
.staaf-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.staaf-label.vandaag { color: var(--accent); font-weight: 700; }


.cat-btn {
  flex-shrink: 0;
  padding: 22px 52px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.cat-btn:active { border-color: var(--accent); color: var(--text); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }

/* ── PRODUCTS ── */
#products {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  padding: 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  align-content: start;
  touch-action: pan-y;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  justify-content: center;
  touch-action: manipulation;
}

.product-card:active { transform: scale(0.96); }

/* ── VLEES KLEUREN ── */
.vlees-kip    { background: rgba(255, 210, 0,   0.35); border-color: #f5c400; border-width: 2px; }
.vlees-rund   { background: rgba(231, 76,  60,  0.35); border-color: #e74c3c; border-width: 2px; }
.vlees-vis    { background: rgba(52,  152, 219, 0.35); border-color: #3498db; border-width: 2px; }
.vlees-veggie { background: rgba(46,  204, 113, 0.35); border-color: #2ecc71; border-width: 2px; }
.vlees-gemengd{ background: rgba(155, 89,  182, 0.35); border-color: #9b59b6; border-width: 2px; }

.vlees-kip:active    { background: rgba(255, 210, 0,   0.55); }
.vlees-rund:active   { background: rgba(231, 76,  60,  0.55); }
.vlees-vis:active    { background: rgba(52,  152, 219, 0.55); }
.vlees-veggie:active { background: rgba(46,  204, 113, 0.55); }
.vlees-gemengd:active{ background: rgba(155, 89,  182, 0.55); }

.product-name {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.drink-card {
  padding: 0;
  overflow: hidden;
  border: none;
}

.drink-card:active { transform: scale(0.96); }

.drink-logo {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
  border-radius: calc(var(--radius) - 1px);
  pointer-events: none;
}

/* ── RECEIPT ── */
#receipt {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

#receipt-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#receipt-header h2 { font-size: 1.15rem; font-weight: 700; }

#receipt-klok {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
#receipt-klok #klok-tijd { font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; }
#receipt-klok #klok-datum { font-size: 0.7rem; color: var(--muted); }

#clear-btn {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 2px solid var(--red);
  background: transparent;
  color: var(--red);
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
#clear-btn:active { background: var(--red); color: #fff; }

#order-type-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.order-type-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .15s, color .15s;
}
.order-type-btn.active {
  background: var(--accent);
  color: #000;
}
.order-type-btn:first-child { border-right: 1px solid var(--border); }

#receipt-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: pan-y;
}

#receipt-items::-webkit-scrollbar { width: 4px; }
#receipt-items::-webkit-scrollbar-track { background: transparent; }
#receipt-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.receipt-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
}

.receipt-item-name { font-size: 1.1rem; font-weight: 500; }

.receipt-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.qty-btn:active { border-color: var(--accent); color: var(--accent); transform: scale(0.92); }

.qty-num {
  font-size: 1.3rem;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.receipt-item-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 70px;
  text-align: right;
}

#receipt-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  gap: 8px;
}

/* ── TOTAAL + BTW ── */
#receipt-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#btw-overzicht {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

#btw-overzicht span { display: flex; justify-content: space-between; }

#totaal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

#totaal-label { font-size: 0.9rem; color: var(--muted); }
#totaal-bedrag { font-size: 2.4rem; font-weight: 700; color: var(--text); }

#betaal-knoppen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 10px;
}

.betaal-btn {
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
  font-family: inherit;
}
.betaal-btn:active { transform: scale(0.96); }
.betaal-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.betaal-icon { line-height: 1; }

/* Cash en Kaart: groot */
#cash-btn, #kaart-btn {
  padding: 22px 8px;
  font-size: 1.5rem;
}
#cash-btn .betaal-icon, #kaart-btn .betaal-icon { font-size: 2rem; }

/* Cheque en Bon: compacter */
#cheque-btn, #bon-btn {
  padding: 14px 6px;
  font-size: 1.1rem;
}
#cheque-btn .betaal-icon, #bon-btn .betaal-icon { font-size: 1.5rem; }

#cash-btn    { background: var(--green);  color: #fff; }
#kaart-btn   { background: var(--blue);   color: #fff; }
#cheque-btn  { background: #8e44ad;       color: #fff; }
#bon-btn     { background: #d35400;       color: #fff; }
#cash-btn:not(:disabled):active    { background: #27ae60; }
#kaart-btn:not(:disabled):active   { background: #2980b9; }
#cheque-btn:not(:disabled):active  { background: #7d3c98; }
#bon-btn:not(:disabled):active     { background: #ba4a00; }

/* Gesplitst: volle breedte, derde rij */
.betaal-split {
  grid-column: 1 / -1;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px;
}
.betaal-split:not(:disabled):active { background: var(--border); color: var(--text); }

/* ── SPLIT OVERLAY ── */
#split-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#split-overlay.open { opacity: 1; pointer-events: all; }

#split-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#split-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1rem;
}

#split-sluiten {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}
#split-sluiten:active { border-color: var(--red); color: var(--red); }

#split-content { padding: 18px; display: flex; flex-direction: column; gap: 16px; }

.split-totaal-rij {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.split-totaal-rij strong { font-size: 1.4rem; font-weight: 700; color: var(--accent); }

.split-blok { display: flex; flex-direction: column; gap: 10px; }

.split-blok-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}

.split-m-knoppen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.split-m-btn {
  padding: 16px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.split-m-btn.actief { border-color: var(--accent); color: var(--text); background: rgba(245,166,35,0.1); }
.split-m-btn:active { transform: scale(0.97); }

.split-numpad-display {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 700;
  padding: 14px 0 6px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.split-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.split-num-key {
  padding: 18px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.split-num-key:active { background: var(--border); transform: scale(0.96); }
.split-num-del { color: var(--muted); font-size: 1.2rem; }
.split-num-00  { font-size: 1.2rem; }

.split-rest-rij {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--muted);
}
.split-rest-rij strong { font-size: 1.3rem; font-weight: 700; color: var(--accent); }

.split-bevestig-btn {
  width: 100%;
  padding: 20px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}
.split-bevestig-btn:active { background: #27ae60; }
.split-bevestig-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── LOADING / ERROR ── */
#status-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
}

#status-screen.hidden { display: none; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#status-msg { font-size: 0.95rem; color: var(--muted); }

#retry-btn {
  padding: 10px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  touch-action: manipulation;
}

/* ── PRINT (POS80 — 80mm thermisch) ── */
@media print {
  @page { size: 80mm auto; margin: 0; }
  body * { visibility: hidden; }
  #print-ticket, #print-ticket * { visibility: visible; }
  #print-ticket {
    position: fixed;
    top: 0; left: 0;
    width: 80mm;
    box-sizing: border-box;
    padding: 4mm;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
}

/* ── LOGIN SCHERM ── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#login-screen.hidden { display: none; }

#login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-logo {
  font-size: 2.5rem;
  text-align: center;
}

#login-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
}

#login-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: -10px;
}

#login-versie {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 16px;
  opacity: 0.5;
}

#login-error {
  background: rgba(231,76,60,.15);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.login-field input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.login-field input:focus {
  border-color: var(--accent);
}

#login-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  margin-top: 4px;
}

#login-btn:hover { background: var(--accent2); }
#login-btn:disabled { opacity: .6; cursor: not-allowed; }
