:root {
  --ink: #1B2129; --ink2: #2A313B; --muted: #5A6370; --line: #DEDFD9; --line2: #C9CBC4;
  --page: #F2F1EC; --card: #FFFFFF; --soft: #FAFAF7; --accent: #1F4E96; --accent-d: #163A70;
  --warn: #C2410C; --warn-d: #9A3412; --danger: #B42318; --ok: #1E6B3A;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--accent); }
a:hover { color: var(--accent-d); }
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, .time { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 24px; background: var(--ink); color: #fff; }
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; }
.mainnav a { padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.mainnav a[aria-current="page"], .mainnav a:hover { background: rgba(255,255,255,.14); }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.usermenu .muted { color: #C9CDD3; }
.usermenu form { margin: 0; }

.wrap { max-width: 1600px; margin: 0 auto; padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line2); background: #fff; color: var(--ink); border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #F4F4F0; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); color: #fff; }
.btn.danger { border: 2px solid var(--danger); color: var(--danger); }
.btn.icon { width: 44px; padding: 0; font-size: 20px; }
.btn.big { min-height: 48px; font-size: 16px; padding: 0 22px; }
.btn[disabled] { opacity: .35; cursor: default; }
.topbar .btn { min-height: 40px; }

.flashes { display: flex; flex-direction: column; gap: 6px; }
.flash { padding: 10px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.flash.ok { background: #E3F1E8; border-color: #9CC9AB; color: #134A27; }
.flash.warn { background: #FFF1E4; border-color: #E8B98C; color: #7A3410; }
.flash.error { background: #FDECEA; border-color: #E9A39B; color: #7A1E14; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.narrow, .panel.login { max-width: 440px; width: 100%; align-self: center; }
.panel.login { margin-top: 8vh; }
.panelhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--soft); }
.panelhead h2 { margin: 0; }
.pad { padding: 18px 20px; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { font-weight: 600; font-size: 14px; margin-top: 6px; }
input[type=text], input:not([type]), input[type=password], input[type=date], select, textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid #A9ADB2; border-radius: 8px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; width: 100%;
}
textarea { padding: 10px 12px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 14px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; min-height: 44px; }
.check input { width: 20px; height: 20px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline select, .inline input { width: auto; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.mini { min-height: 40px; padding: 0 12px; border: 1px solid var(--line2); background: #fff; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.mini:hover, .mini.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chipradio input { position: absolute; opacity: 0; }
.chipradio span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 2px solid var(--line2); border-radius: 8px; font-weight: 600; cursor: pointer; background: #fff; }
.chipradio input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chipradio input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.formactions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters .lbl { margin-right: 4px; }
.filters .sep { width: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 4px 14px; border: 2px solid var(--line2); border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; }
.chip small { font-size: 13px; opacity: .85; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:hover { color: inherit; border-color: var(--ink); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }
.stats { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; color: #3A424D; }
.warntext { color: var(--warn-d); font-weight: 600; }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }

.weekscroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.weekgrid { min-width: 1080px; display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); }
.daycol { display: flex; flex-direction: column; min-width: 0; }
.daycol + .daycol { border-left: 1px solid var(--line); }
.daycol.dragover { background: #EEF3FB; }
.dayhead { padding: 10px 10px 8px; border-bottom: 2px solid var(--ink); background: var(--soft); display: flex; flex-direction: column; gap: 6px; }
.dayline { display: flex; align-items: center; gap: 6px; }
.daynum { font-family: ui-monospace, Consolas, monospace; font-size: 26px; line-height: 1; }
.daytxt { display: flex; flex-direction: column; line-height: 1.15; }
.mon { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.addday { margin-left: auto; width: 36px; height: 36px; border-radius: 8px; border: 1px dashed #A9ADB2; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 20px; color: var(--ink); }
.addday:hover { background: var(--ink); color: #fff; }
.counts { display: flex; flex-wrap: wrap; gap: 4px; }
.cnt { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--bar); }
.cnt.zero { background: transparent; color: #8A9099; border: 1px dashed var(--line2); }
.dropzone { display: flex; flex-direction: column; gap: 6px; padding: 8px; flex: 1; min-height: 120px; }
.middag { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.middag::before, .middag::after { content: ""; flex: 1; border-top: 1px dashed #A9ADB2; }
.card { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 7px 8px; border-radius: 7px; background: var(--bg); border-left: 5px solid var(--bar); color: var(--ink); text-decoration: none; cursor: grab; }
.card:hover { color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.card.dragging { opacity: .5; }
.card.mee { background: #F1F1EC; border-left: 0; outline: 2px dashed var(--bar); outline-offset: -2px; }
.card.warn { box-shadow: inset 0 0 0 2px var(--warn); }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.card .time { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.who { flex: none; background: var(--bar); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.cust { display: flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task { display: flex; align-items: flex-start; gap: 5px; font-size: 13px; font-weight: 600; }
.task span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ic { width: 15px; height: 15px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.num.big { width: 30px; height: 30px; font-size: 14px; }
.badge { align-self: flex-start; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.badge.alert { background: var(--warn); }
.badge.light { background: #E9EAEC; color: var(--ink); }
.empty { color: #6B7380; text-align: center; margin: 12px 0; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.openlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.openitem { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: #F6F6F2; border-left: 5px solid #8A9099; color: var(--ink); text-decoration: none; }

.stop { display: grid; grid-template-columns: 34px 100px 150px minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid #E4E5DF; }
.stop.late { background: #FFF4E8; box-shadow: inset 4px 0 0 var(--warn); }
.updown { display: flex; gap: 4px; }
.updown form { margin: 0; }
.stopmain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stopmain a { color: var(--ink); }
.place { display: flex; flex-direction: column; }

.personrow, .userrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px; border-bottom: 1px solid #E4E5DF; }
.personrow form, .userrow form { margin: 0; }
.personform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.personform .field, .addrow .field { margin: 0; }
.personrow .meta { flex-basis: 100%; }
.swatch { width: 16px; height: 44px; border-radius: 6px; }
.swatch.off { opacity: .35; }
.swatches { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.swatches legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.sw { position: relative; }
.sw input { position: absolute; opacity: 0; }
.sw span:first-of-type { display: block; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line2); cursor: pointer; }
.sw input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.sw input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.addrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 20px; background: var(--soft); margin: 0; }
.addrow h3 { flex-basis: 100%; }

@media (max-width: 700px) {
  .wrap { padding: 16px; }
  .stop { grid-template-columns: 34px 1fr; }
  .stop .time, .stop .place { grid-column: 2; }
  .usermenu { margin-left: 0; }
}

/* Magazijn */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: 14px; color: #3A424D; }
.tile b { font-size: 30px; font-family: ui-monospace, Consolas, monospace; }
.tile.warn { background: #FFF1E4; border-color: #E8B98C; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 860px; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #E4E5DF; vertical-align: top; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #F1F1EC; color: #3A424D; border: 1px solid var(--line2); }
.pill.green { background: #E3F1E8; color: #134A27; border-color: #9CC9AB; }
.pill.orange { background: #FFF1E4; color: #7A3410; border-color: #E8B98C; }
.rowactions { text-align: right; white-space: nowrap; }
.rowactions form { display: inline-block; margin: 0 0 0 6px; }
details.pop { display: inline-block; position: relative; text-align: left; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
.popbody { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 320px; background: #fff; border: 1px solid var(--line2); border-radius: 10px; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: 10px; white-space: normal; }
.popbody form { margin: 0; display: flex; }
.popbody form.stack { display: flex; }
.popbody .btn { width: 100%; }
details.addrow { display: block; }
details.addrow > summary { list-style: none; display: inline-flex; }
details.addrow > summary::-webkit-details-marker { display: none; }
details.addrow[open] > summary { margin-bottom: 12px; }
.wrapgap { align-items: flex-end; gap: 12px 16px; }
.wrapgap .field { margin: 0; }
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.logrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #E4E5DF; margin: 0; }
.logrow input { flex: 1; }
.logright { display: flex; align-items: center; gap: 8px; }
.logright form { margin: 0; }
.badge.green { background: #1E6B3A; }
