:root {
  --bg: #0f172a; --panel: #1e293b; --panel2: #273449; --line: #334155; --text: #e2e8f0; --muted: #94a3b8;
  --accent: #22c55e; --accent2: #16a34a; --warn: #f59e0b; --danger: #ef4444; --info: #3b82f6;
  --radius: 12px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-tap-highlight-color: transparent; user-select: none; }
input, select, textarea { user-select: text; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--panel2); color: var(--text); }
button:hover { filter: brightness(1.12); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent2); color: #fff; font-weight: 600; }
button.danger { background: var(--danger); color: #fff; }
button.warn { background: var(--warn); color: #111; }
button.info { background: var(--info); color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); }
input, select, textarea { font: inherit; background: #0b1222; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
h2 { margin: 0 0 12px; font-size: 20px; }
h3 { margin: 16px 0 8px; font-size: 16px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.hidden { display: none !important; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--panel2); }
.badge.green { background: #14532d; color: #bbf7d0; } .badge.red { background: #7f1d1d; color: #fecaca; }
.badge.amber { background: #78350f; color: #fde68a; } .badge.blue { background: #1e3a8a; color: #bfdbfe; }

/* Bovenbalk */
#top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #020617; border-bottom: 1px solid var(--line); height: 54px; }
#top .brand { font-weight: 700; margin-right: 10px; white-space: nowrap; }
#top nav { display: flex; gap: 4px; overflow-x: auto; }
#top nav button { background: transparent; padding: 8px 12px; white-space: nowrap; }
#top nav button.active { background: var(--panel2); }
#top nav .count { background: var(--danger); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
#net { font-size: 12px; padding: 4px 8px; border-radius: 99px; white-space: nowrap; }
#net.on { background: #14532d; } #net.off { background: #7f1d1d; }
main { height: calc(100% - 54px); overflow: hidden; }
.view { height: 100%; overflow: auto; padding: 12px; }

/* Kassa */
#v-kassa { display: grid; grid-template-columns: 1fr 380px; gap: 10px; padding: 10px; overflow: hidden; }
#cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
#cats button { white-space: nowrap; border-left: 5px solid transparent; }
#cats button.active { outline: 2px solid #fff; }
#prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; overflow: auto; max-height: calc(100% - 52px); align-content: start; }
.prod { height: 88px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; border-top: 5px solid #475569; }
.prod b { font-weight: 600; line-height: 1.15; } .prod span { color: var(--muted); }
#cart { background: var(--panel); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
#cart .types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px; }
#cart .types button.active { background: var(--info); color: #fff; }
#lines { flex: 1; overflow: auto; padding: 0 8px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.line .q { display: flex; gap: 4px; align-items: center; }
.line .q button { padding: 4px 10px; }
.line small { color: var(--warn); }
#cart .sum { padding: 10px; border-top: 1px solid var(--line); }
#cart .total { display: flex; justify-content: space-between; font-size: 26px; font-weight: 700; margin: 6px 0; }
#cart .actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
#cart .pay { width: 100%; margin-top: 6px; padding: 16px; font-size: 20px; }
#custinfo { padding: 0 8px 6px; font-size: 13px; color: var(--muted); }

/* Bestellingen */
#board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 10px; height: 100%; }
.col { background: var(--panel); border-radius: var(--radius); padding: 8px; overflow: auto; }
.col h3 { margin: 4px 4px 8px; display: flex; justify-content: space-between; }
.card { background: var(--panel2); border-radius: 10px; padding: 10px; margin-bottom: 8px; border-left: 5px solid var(--info); }
.card.new { border-left-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(239,68,68,.4); } }
.card .hd { display: flex; justify-content: space-between; font-weight: 700; }
.card ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.card .btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.card .btns button { padding: 6px 10px; font-size: 13px; }

/* Levering */
#v-levering { display: grid; grid-template-columns: 420px 1fr; grid-template-rows: minmax(0, 1fr); gap: 10px; padding: 10px; overflow: hidden; }
#dlist { overflow: auto; }
#map { border-radius: var(--radius); min-height: 300px; height: 100%; }
.drv { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Tabellen / beheer */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button.active { background: var(--info); color: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.box { background: var(--panel); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
code, .code { background: #020617; padding: 6px 8px; border-radius: 6px; display: block; font-size: 12px; word-break: break-all; user-select: all; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border-radius: var(--radius); padding: 12px; } .kpi b { display: block; font-size: 24px; margin-top: 4px; }

/* Dialogen */
.modal { position: fixed; inset: 0; background: rgba(2,6,23,.75); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 12px; }
.modal > div { background: var(--panel); border-radius: 16px; padding: 18px; width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.keypad button { padding: 18px; font-size: 22px; }
.pin-dots { font-size: 32px; letter-spacing: 10px; text-align: center; height: 44px; }
.paygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.paygrid button { padding: 18px 8px; font-size: 17px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #020617; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 2000; }

/* Login */
#login { max-width: 420px; margin: 6vh auto; background: var(--panel); padding: 22px; border-radius: 16px; }

/* Bon (browserprint, 80 mm) */
#print { display: none; }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body * { visibility: hidden; }
  #print, #print * { visibility: visible; }
  #print { display: block; position: absolute; left: 0; top: 0; width: 72mm; padding: 2mm; color: #000; background: #fff; font: 12px/1.3 "Courier New", monospace; }
  #print .c { text-align: center; } #print .b { font-weight: bold; } #print .big { font-size: 16px; }
  #print .r { display: flex; justify-content: space-between; } #print hr { border: 0; border-top: 1px dashed #000; }
}

@media (max-width: 900px) {
  #v-kassa { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #cart { max-height: 48vh; }
  #board { grid-template-columns: repeat(4, 80vw); overflow-x: auto; }
  #v-levering { grid-template-columns: 1fr; grid-template-rows: 300px 1fr; }
  #v-levering #map { order: -1; }
  .grid2 { grid-template-columns: 1fr; }
}
