:root { --bg:#f5f6f8; --card:#fff; --ink:#1d2330; --muted:#6b7385; --line:#e3e6ec; --accent:#2f5bea; --ok:#1f9d55; --bad:#d64545; --warn:#c77d00; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--bg); min-height:100vh; display:flex; flex-direction:column; }
header { display:flex; align-items:center; gap:24px; padding:10px 18px; background:#fff; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.brand strong { font-size:18px; } .ver { color:var(--muted); font-size:12px; margin-left:6px; }
nav { display:flex; gap:6px; flex:1; }
nav button { border:0; background:none; padding:8px 12px; border-radius:8px; cursor:pointer; font:inherit; color:var(--muted); }
nav button.on { background:#eaf0ff; color:var(--accent); font-weight:600; }
.badges { display:flex; gap:6px; }
.badge { font-size:12px; padding:3px 8px; border-radius:99px; background:#eef0f4; color:var(--muted); }
.badge.live { background:#e3f6ea; color:var(--ok); } .badge.warn { background:#fff1d6; color:var(--warn); }
main { flex:1; padding:16px 18px; }
footer { padding:10px 18px; color:var(--muted); font-size:12px; border-top:1px solid var(--line); background:#fff; }
.tab { display:none; } .tab.on { display:block; }
.pos { display:grid; grid-template-columns: 1fr 340px; gap:16px; }
@media (max-width: 800px) { .pos, .two { grid-template-columns: 1fr !important; } }
.filter { display:flex; gap:6px; margin-bottom:10px; }
.filter button, button { font:inherit; border:1px solid var(--line); background:#fff; padding:8px 14px; border-radius:8px; cursor:pointer; }
.filter button.on { background:var(--accent); color:#fff; border-color:var(--accent); }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; }
button.ghost { border-color:transparent; color:var(--muted); } button.small { padding:3px 8px; font-size:12px; }
button:disabled { opacity:.5; cursor:not-allowed; }
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap:10px; }
.tile { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 12px; text-align:left; min-height:84px; display:flex; flex-direction:column; justify-content:space-between; }
.tile:hover { border-color:var(--accent); } .tile .n { font-weight:600; } .tile .p { color:var(--muted); } .tile .k { font-size:11px; color:var(--accent); text-transform:uppercase; letter-spacing:.04em; }
.tile.out { opacity:.45; }
.cart, .card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; }
.card { margin-bottom:16px; } h2 { margin:0 0 10px; font-size:16px; display:flex; align-items:center; gap:10px; justify-content:space-between; }
.cart-lines { min-height:120px; margin-bottom:10px; } .cl { display:flex; align-items:center; gap:8px; padding:6px 0; border-bottom:1px solid var(--line); }
.cl .nm { flex:1; } .cl button { padding:2px 9px; } .empty { color:var(--muted); padding:20px 0; text-align:center; }
.row { display:flex; flex-direction:column; gap:4px; margin:10px 0; font-size:13px; color:var(--muted); }
select, input { font:inherit; padding:8px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.total { display:flex; justify-content:space-between; font-size:20px; margin:12px 0; }
.pay { display:grid; gap:8px; } .pay .primary { padding:14px; font-size:16px; }
.msg { min-height:1.2em; font-size:13px; color:var(--bad); margin:8px 0 0; } .msg.ok { color:var(--ok); }
table { width:100%; border-collapse:collapse; font-size:14px; } th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:500; font-size:12px; } .r { text-align:right; } .muted { color:var(--muted); font-size:13px; font-weight:400; }
.two { display:grid; grid-template-columns: 1.4fr 1fr; gap:16px; }
.inline { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.st { padding:2px 8px; border-radius:99px; font-size:12px; background:#eef0f4; } .st.paid, .st.done { background:#e3f6ea; color:var(--ok); }
.st.failed, .st.canceled { background:#fde8e8; color:var(--bad); } .st.pending, .st.dry_run { background:#fff1d6; color:var(--warn); }
dialog { border:0; border-radius:14px; padding:22px; width:min(420px, 92vw); box-shadow:0 20px 60px rgba(0,0,0,.25); } dialog::backdrop { background:rgba(20,25,40,.45); }
.big { font-size:20px; margin:14px 0; } .sim { display:flex; gap:8px; align-items:center; padding:10px; background:#f3f4f8; border-radius:8px; }
.dlg-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; } .hidden { display:none !important; }
.ticket { font-family: ui-monospace, monospace; font-size:13px; white-space:pre; background:#fafafa; border:1px dashed var(--line); padding:10px; border-radius:8px; max-height:240px; overflow:auto; }
dl.kv { display:grid; grid-template-columns: 1fr auto; gap:2px 10px; margin:0 0 12px; } dl.kv dd { margin:0; text-align:right; } dl.kv dt { color:var(--muted); }
@media print { header, footer, main > section:not(.printing), nav { display:none; } }

/* agenda */
.agenda-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; } .agenda-bar #ag-new { margin-left:auto; }
.chk { font-size:13px; color:var(--muted); display:flex; gap:6px; align-items:center; }
.ag-grid { display:grid; overflow-x:auto; border:1px solid var(--line); border-radius:10px; background:#fff; }
.ag-head { box-sizing:border-box; height:40px; position:sticky; top:0; padding:8px; font-weight:600; text-align:center; border-bottom:1px solid var(--line); border-left:1px solid var(--line); background:#fafbfc; }
.ag-times { position:relative; } .ag-times span { position:absolute; right:6px; font-size:11px; color:var(--muted); transform:translateY(-6px); }
.ag-body { position:relative; border-left:1px solid var(--line); cursor:cell;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, #f1f3f6 1px, transparent 1px);
  background-size: 100% 96px, 100% 24px; }
.appt { position:absolute; left:3px; right:3px; border-radius:7px; padding:3px 6px; font-size:12px; overflow:hidden; color:#fff; cursor:pointer; line-height:1.25; box-shadow:0 1px 2px rgba(0,0,0,.15); }
.appt b { display:block; } .appt small { opacity:.9; }
.appt.afgerond { opacity:.55; } .appt.afgerond::after { content:'✔'; position:absolute; right:6px; top:3px; }
.appt.no_show, .appt.geannuleerd { background:repeating-linear-gradient(45deg,#9aa1b0,#9aa1b0 6px,#b4bac6 6px,#b4bac6 12px) !important; color:#fff; }
.fgrid { display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-bottom:10px; } .fgrid label, .row { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
.fgrid input, .fgrid select, .row textarea { font:inherit; padding:8px; border:1px solid var(--line); border-radius:8px; }
fieldset { border:1px solid var(--line); border-radius:8px; margin:0 0 10px; } legend { font-size:12px; color:var(--muted); padding:0 6px; }
.checks { display:grid; grid-template-columns: 1fr 1fr; gap:4px 12px; } .checks label { display:flex; gap:6px; align-items:center; color:var(--ink); font-size:14px; }
.dlg-actions.wrap { flex-wrap:wrap; } dialog#appt-dialog { width:min(560px,94vw); }
.clickrow { cursor:pointer; } .clickrow:hover { background:#f6f8ff; }
.stats { display:flex; gap:18px; flex-wrap:wrap; margin:6px 0 12px; } .stats div { background:#f3f4f8; border-radius:8px; padding:8px 12px; } .stats b { display:block; font-size:18px; }
textarea.notes { width:100%; min-height:90px; font:inherit; padding:8px; border:1px solid var(--line); border-radius:8px; }

.import{margin-top:14px;padding:10px 12px;border:1px dashed var(--line);border-radius:10px}.import summary{cursor:pointer;font-weight:600}.import div,.import p{margin:8px 0}
.payload{background:#0f172a;color:#e2e8f0;padding:12px;border-radius:8px;overflow:auto;max-height:340px;font-size:12px}
.appt.afwezigheid{background-image:repeating-linear-gradient(45deg,rgba(255,255,255,.35) 0 6px,transparent 6px 12px)!important;opacity:.75}

/* agenda: openingsuren, hover-uur, huidig moment (zoals Optios) */
.ag-body .closed { position:absolute; left:0; right:0; background:rgba(110,125,140,.28); pointer-events:auto; }
.ag-body .slot-hover { position:absolute; left:0; right:0; height:24px; background:#eaf0ff; border-top:1px solid #b9ccff; border-bottom:1px solid #b9ccff; color:var(--accent); font-size:11px; padding:3px 6px; box-sizing:border-box; pointer-events:none; z-index:1; }
.slot-hover.hidden { display:none; }
.ag-times .hover-time { right:6px; font-weight:700; color:var(--accent); background:#eaf0ff; padding:0 3px; border-radius:4px; z-index:3; }
.ag-times .now-time { right:6px; color:#e03131; font-weight:700; z-index:2; background:#fff; }
.now-line { position:absolute; left:0; right:0; height:0; border-top:2px solid #e03131; pointer-events:none; z-index:2; }

/* dubbele afspraken: naast elkaar i.p.v. over elkaar */
.appt.dbl { box-sizing:border-box; border:2px dashed rgba(255,255,255,.85); outline:2px solid #e03131; outline-offset:-2px; z-index:1; }
.appt.dbl:hover, .appt.dbl.grp-on { z-index:3; box-shadow:0 0 0 3px #ffd43b, 0 3px 8px rgba(0,0,0,.35); }
.dbl-tag { position:absolute; right:3px; top:2px; font-style:normal; font-size:10px; font-weight:700; background:#e03131; color:#fff; border-radius:8px; padding:0 5px; }
