:root {
  color-scheme: light;
  --bg: #eef2f0;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --line: #d6ded8;
  --text: #17231d;
  --muted: #617067;
  --accent: #0f766e;
  --accent-2: #f2b705;
  --nav: #18221f;
  --nav-soft: #26332f;
  --green: #15803d;
  --orange: #b45309;
  --red: #b91c1c;
  --unknown: #64748b;
  --shadow: 0 16px 36px rgba(22, 35, 29, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}

body[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #d9e0ea;
  --text: #172033;
  --muted: #667085;
  --accent: #1a73e8;
  --accent-2: #0ea5e9;
  --nav: #111827;
  --nav-soft: #1f2937;
}

body[data-theme="duinrell"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fffdf2;
  --line: #eadf9d;
  --text: #173d2d;
  --muted: #5a6f45;
  --accent: #1f8a4c;
  --accent-2: #ffd43b;
  --nav: #1f6b3b;
  --nav-soft: #2f7f4b;
  --green: #15803d;
  --orange: #b7791f;
  --red: #b83232;
  --unknown: #718096;
  --shadow: 0 16px 36px rgba(61, 87, 40, .14);
}

body[data-theme="night"] {
  color-scheme: dark;
  --bg: #111816;
  --surface: #17211e;
  --surface-2: #1f2b27;
  --line: #34433e;
  --text: #eef7f1;
  --muted: #9fb0a8;
  --accent: #34d399;
  --accent-2: #facc15;
  --nav: #0b1110;
  --nav-soft: #1a2521;
  --shadow: 0 18px 42px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); display: flex; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent), white 30%); outline-offset: 2px; }

.auth-page { display: grid; place-items: center; background: var(--bg); }
.auth-shell { width: min(440px, calc(100vw - 32px)); }
.login-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 24px; font-size: 28px; }
.login-logo { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto 20px; }
.form-stack, .form-grid { display: grid; gap: 14px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.form-grid.compact { max-width: 720px; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0; }
legend { color: var(--muted); font-size: 13px; font-weight: 800; padding: 0 6px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; min-height: 40px; padding: 8px 10px; color: var(--text); background: var(--surface); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
textarea { min-height: 86px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); }
.feature-checkboxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 14px 0 18px; }
.check input { width: 18px; min-height: 18px; }

.button, .icon-button { border: 1px solid var(--line); background: var(--surface); min-height: 40px; border-radius: 6px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; font-weight: 800; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.compact { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button.danger { color: var(--red); }
.icon-button { width: 36px; min-height: 36px; padding: 0; font-size: 12px; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.logout-button { color: var(--muted); background: var(--surface-2); }
.logout-button:hover { color: var(--red); border-color: color-mix(in srgb, var(--red), white 55%); background: color-mix(in srgb, var(--red), var(--surface) 90%); }
.small-link { color: var(--accent); font-size: 14px; }
.alert { background: #fff2f0; color: var(--red); border: 1px solid #ffccc7; border-radius: 6px; padding: 10px; }
.alert.green { background: #f0fbf4; color: #0f766e; border-color: #b7e4c7; }

.nav { width: 248px; min-height: 100vh; background: var(--nav); color: white; padding: 16px 12px; position: sticky; top: 0; }
.brand { font-weight: 900; padding: 8px 10px 18px; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-2); color: #17231d; }
.brand-logo { max-width: 100%; max-height: 56px; height: auto; width: auto; display: block; object-fit: contain; }
.brand-logo-app { background: #fff; border-radius: 8px; padding: 6px 10px; max-height: 48px; }
.nav-link { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 6px; text-decoration: none; color: #d9e3df; font-weight: 700; }
.nav-link:hover { background: var(--nav-soft); color: white; }
.page { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { min-height: 66px; background: color-mix(in srgb, var(--surface), transparent 5%); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 2; backdrop-filter: blur(10px); }
.muted { color: var(--muted); margin-left: 12px; }
.topbar-controls { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-picker, .language-picker { display: flex; align-items: center; gap: 8px; }
.theme-picker select { min-height: 34px; width: 132px; }
.language-picker select { min-height: 34px; width: 92px; }
.theme-picker .custom-select { width: 132px; }
.main-content { padding: 24px; display: grid; gap: 20px; min-width: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar-end { justify-content: flex-end; }
.toolbar h1 { font-size: 28px; margin: 0; }
.page-intro { margin: 6px 0 0; color: var(--muted); }
.toolbar-actions, .search { display: flex; align-items: end; gap: 8px; }
.widget-toolbar { display: flex; align-items: center; gap: 8px; }
.widget-status { color: var(--muted); font-size: 13px; font-weight: 800; min-width: 180px; }
.add-widget-button { background: var(--accent); color: white; border-color: var(--accent); }

.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.status-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--unknown); border-radius: 8px; padding: 16px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.metric strong { font-size: 32px; }
.metric small { color: var(--muted); }
.metric.green { border-top-color: var(--green); }
.metric.orange { border-top-color: var(--orange); }
.metric.red { border-top-color: var(--red); }

.widget-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 18px; min-width: 0; }
.widget-frame { display: grid; gap: 12px; position: relative; }
.widget-frame.dragging, .widget-frame.resizing { opacity: .42; }
.widget-frame.drag-ghost, .widget-frame.resize-ghost { position: fixed; z-index: 40; pointer-events: none; opacity: .88; box-shadow: 0 22px 54px rgba(15, 23, 42, .18); }
.widget-frame.drag-ghost { transform: rotate(.4deg); }
.widget-frame.resize-ghost { transition: width .12s ease, height .12s ease; }
.widget-drop-placeholder { border: 2px dashed color-mix(in srgb, var(--accent), white 38%); border-radius: 8px; background: color-mix(in srgb, var(--accent), transparent 90%); min-height: 92px; }
.widget-frame.size-1x1 { grid-column: span 1; }
.widget-frame.size-1x2 { grid-column: span 1; grid-row: span 2; }
.widget-frame.size-2x1 { grid-column: span 2; }
.widget-frame.size-2x2 { grid-column: span 2; grid-row: span 2; }
.widget-frame.size-full { grid-column: 1 / -1; }
.widget-drop-placeholder.size-1x1 { grid-column: span 1; }
.widget-drop-placeholder.size-1x2 { grid-column: span 1; grid-row: span 2; }
.widget-drop-placeholder.size-2x1 { grid-column: span 2; }
.widget-drop-placeholder.size-2x2 { grid-column: span 2; grid-row: span 2; }
.widget-drop-placeholder.size-full { grid-column: 1 / -1; }
.widget-frame.drag-over { outline: 3px solid color-mix(in srgb, var(--accent), white 40%); outline-offset: 4px; border-radius: 8px; }
.widget-header { display: flex; align-items: center; gap: 6px; color: var(--muted); height: 30px; min-height: 30px; overflow: hidden; }
.widget-board.editing .widget-frame { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; background: color-mix(in srgb, var(--surface), transparent 25%); min-width: 0; }
.widget-placeholder .panel { border-style: dashed; background: color-mix(in srgb, var(--accent), var(--surface) 94%); }
.widget-header strong { margin-right: auto; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 30px; }
.widget-grip { cursor: grab; touch-action: none; }
.widget-grip:active { cursor: grabbing; }
.widget-grip, .widget-menu { width: 28px; min-height: 28px; color: color-mix(in srgb, var(--muted), var(--text) 20%); border-color: transparent; background: transparent; }
.widget-grip svg, .widget-menu svg { width: 15px; height: 15px; }
.widget-grip:hover, .widget-menu:hover, .widget-menu.active { color: var(--accent); background: var(--surface-2); border-color: var(--line); }
.widget-resize-handle { display: none; position: absolute; right: 5px; bottom: 5px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: color-mix(in srgb, var(--muted), transparent 20%); cursor: nwse-resize; padding: 0; align-items: center; justify-content: center; touch-action: none; }
.widget-board.editing .widget-resize-handle { display: inline-flex; }
.widget-resize-handle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.widget-resize-handle:hover, .widget-resize-handle.active { color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line) inset; }
.is-resizing-widget, .is-resizing-widget *, .is-dragging-widget, .is-dragging-widget * { user-select: none; }
.is-resizing-widget, .is-resizing-widget * { cursor: nwse-resize !important; }
.is-dragging-widget, .is-dragging-widget * { cursor: grabbing !important; }
.widget-remove { color: var(--red); }
.widget-settings-popover { position: fixed; z-index: 10; width: min(300px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); padding: 8px; display: grid; gap: 4px; }
.widget-settings-popover h3 { margin: 6px 8px; font-size: 15px; }
.widget-settings-popover button { justify-content: flex-start; }
.custom-select { display: grid; gap: 6px; }
.native-select-hidden { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }
.custom-select__button { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); padding: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 800; }
.custom-select__button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.custom-select.open .custom-select__button svg { transform: rotate(180deg); }
.custom-select__panel { position: fixed; z-index: 30; display: grid; gap: 4px; width: min(280px, calc(100vw - 24px)); padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.custom-select__panel[hidden] { display: none; }
.custom-select__option { min-height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--text); padding: 0 10px; text-align: left; cursor: pointer; font-weight: 800; }
.custom-select__option:hover, .custom-select__option.active { color: var(--accent); background: var(--surface-2); }

/* Datum- en tijdkiezer: vervangt de native datetime-local invoer. */
.datetime-field { display: grid; gap: 6px; }
.datetime-field__button { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); padding: 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 800; text-align: left; }
.datetime-field__button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.datetime-field.is-empty .datetime-field__button { color: var(--muted); }
.datetime-field.open .datetime-field__button { border-color: var(--accent); }
.datetime-panel { position: fixed; z-index: 30; display: grid; gap: 10px; width: min(320px, calc(100vw - 24px)); padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.datetime-panel[hidden] { display: none; }
.datetime-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.datetime-panel__header strong { font-size: 14px; text-transform: capitalize; }
.datetime-panel__nav { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.datetime-panel__nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.datetime-panel__nav:hover { color: var(--accent); border-color: var(--accent); }
.datetime-panel__weekdays, .datetime-panel__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datetime-panel__weekdays span { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.datetime-panel__day { aspect-ratio: 1; min-height: 32px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-weight: 700; font-size: 13px; }
.datetime-panel__day:hover { background: var(--surface-2); color: var(--accent); }
.datetime-panel__day.is-outside { color: var(--muted); opacity: .5; }
.datetime-panel__day.is-today { border-color: var(--accent); }
.datetime-panel__day.is-selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.datetime-panel__time { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.datetime-panel__time-label { font-size: 12px; font-weight: 800; color: var(--muted); }
.datetime-panel__time select { width: auto; flex: none; min-width: 62px; min-height: 32px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-weight: 800; }
.datetime-panel__colon { font-weight: 900; color: var(--muted); }
.datetime-panel__actions { display: flex; gap: 6px; margin-left: auto; }
.datetime-panel__actions .button { min-height: 32px; padding: 0 12px; font-size: 12px; }
.ui-tooltip { position: fixed; z-index: 60; max-width: min(260px, calc(100vw - 24px)); padding: 7px 9px; border-radius: 6px; background: #111827; color: white; font-size: 12px; font-weight: 800; box-shadow: 0 12px 28px rgba(15, 23, 42, .24); pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity .14s ease, transform .14s ease; }
.ui-tooltip.visible { opacity: 1; transform: translateY(0); }
.widget-frame.size-1x1 .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.widget-frame.size-1x1 .metric { padding: 12px; }
.widget-frame.size-1x1 .metric strong { font-size: 24px; }
.widget-frame.size-1x2 .status-grid { grid-template-columns: 1fr; }
.widget-frame.size-2x1 .status-grid, .widget-frame.size-2x2 .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.widget-frame.size-full .status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.widget-frame.size-1x1 .hero-panel, .widget-frame.size-1x2 .hero-panel { display: grid; }
.widget-frame.size-1x1 .panel h2, .widget-frame.size-1x2 .panel h2 { font-size: 24px; }
.widget-frame.size-1x1 .table-shell, .widget-frame.size-1x2 .table-shell, .widget-frame.size-2x1 .table-shell { max-height: 360px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(15, 23, 42, .38); padding: 18px; }
.modal-backdrop[hidden] { display: none; }
.widget-modal { width: min(760px, 100%); max-height: min(720px, calc(100vh - 36px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 28px 80px rgba(0,0,0,.24); padding: 18px; display: grid; gap: 16px; }
.widget-modal header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.widget-modal h2 { margin: 4px 0 0; }
.widget-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.widget-catalog button { min-height: 96px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); display: grid; align-content: center; gap: 6px; text-align: left; padding: 14px; cursor: pointer; }
.widget-catalog button strong { font-size: 16px; }
.widget-catalog button span { color: var(--muted); font-size: 13px; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .9fr .95fr; gap: 16px; align-items: stretch; }
.admin-grid { display: grid; grid-template-columns: minmax(320px, 540px) minmax(300px, 1fr); gap: 18px; align-items: start; }
.hero-panel { display: flex; justify-content: space-between; gap: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--surface), var(--accent) 8%), var(--surface)); }
.panel h2 { font-size: 30px; margin: 8px 0 6px; }
.panel p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 12px; text-transform: uppercase; font-weight: 900; letter-spacing: .08em; }
.connection { align-self: start; border-radius: 999px; padding: 7px 10px; font-weight: 900; font-size: 12px; }
.connection.online, .ok { background: #dcfce7; color: var(--green); }
.connection.offline, .paused { background: #fee2e2; color: var(--red); }
.bar-list, .camera-list { display: grid; gap: 10px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 46px 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row div { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar-row i { display: block; height: 100%; background: var(--accent-2); border-radius: inherit; }
.camera-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; border: 1px solid var(--line); border-radius: 8px; padding: 11px; background: var(--surface-2); }
.camera-item span { color: var(--muted); font-size: 13px; }
.camera-item em { grid-row: 1 / span 2; grid-column: 2; align-self: center; border-radius: 999px; padding: 4px 8px; font-style: normal; font-weight: 900; font-size: 12px; }
.admin-note { min-height: 100%; }
.field-hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.gateway-flash { margin: 6px 0 0; padding: 10px 12px; border-radius: 6px; font-weight: 700; border: 1px solid var(--line); }
.gateway-flash.is-ok { color: var(--green); border-color: color-mix(in srgb, var(--green), white 55%); background: color-mix(in srgb, var(--green), var(--surface) 90%); }
.gateway-flash.is-error { color: var(--red); border-color: color-mix(in srgb, var(--red), white 55%); background: color-mix(in srgb, var(--red), var(--surface) 90%); }
.admin-hosts { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-hosts span { color: var(--muted); font-weight: 800; }
.admin-hosts strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

.split { display: grid; grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-split { grid-template-columns: minmax(320px, 560px) minmax(280px, 1fr); }
.camera-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 18px; }
.camera-card { align-content: start; }
.resource-table-panel { display: grid; gap: 14px; }
.resource-table-panel > form { margin: 0; }
.resource-table-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.resource-table-header h2 { margin: 4px 0 0; font-size: 24px; }
.resource-inline-form { display: grid; grid-template-columns: 1fr 1.1fr 1fr 120px 120px 110px auto 40px; gap: 8px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); }
/* Kentekenformulier. Alles op één regel vraagt ruim 1500px; daaronder gaat het naar
   twee regels (zie de media query). De grenzen sluiten op elkaar aan in plaats van
   elkaar te overschrijven, want klasse-selectors winnen het van een `> *`-reset. */
.resource-inline-form.plate-inline-form { grid-template-columns: 120px minmax(120px, 1fr) 115px minmax(120px, 1fr) 200px 200px auto; column-gap: 14px; row-gap: 12px; padding: 14px; }
.resource-inline-form.plate-inline-form .form-buttons { flex-wrap: nowrap; justify-content: flex-end; align-self: end; gap: 8px; }
.resource-inline-form.plate-inline-form .form-buttons .button { min-height: 36px; padding: 0 12px; font-size: 13px; }
/* Extra lucht tussen 'Geldig vanaf' en 'Geldig tot', zodat het paar als paar leest. */
.resource-inline-form.plate-inline-form .field-valid-until,
.resource-inline-form.plate-inline-form .form-buttons { margin-left: 8px; }

/* Gebruikersformulier: vier velden en de knoppen passen samen op één regel. */
.resource-inline-form.user-inline-form { grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.4fr) minmax(150px, 1fr) 84px auto; column-gap: 14px; row-gap: 12px; padding: 14px; }
.resource-inline-form.user-inline-form .form-buttons { flex-wrap: nowrap; justify-content: flex-end; align-self: end; gap: 8px; margin-left: 8px; }
.resource-inline-form.user-inline-form .form-buttons .button { min-height: 36px; padding: 0 12px; font-size: 13px; }
/* Zonder dit rekt de globale input-regel een vinkje op tot volle kolombreedte. */
.resource-inline-form input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 9px 0; justify-self: start; accent-color: var(--accent); }

/* Tussenbreedtes: velden op de eerste regel, knoppen eronder. Anders duwen de
   knoppen de rij breder dan het scherm. */
@media (min-width: 901px) and (max-width: 1259px) {
  .resource-inline-form.user-inline-form { grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.3fr) minmax(120px, 1fr) 70px; }
  .resource-inline-form.user-inline-form .form-buttons { grid-column: 1 / -1; margin-left: 0; }
}

/* Twee regels: personalia boven, geldigheid en knoppen eronder. Twaalf kolommen
   houden beide regels onderling uitgelijnd. */
@media (min-width: 901px) and (max-width: 1559px) {
  .resource-inline-form.plate-inline-form { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .resource-inline-form.plate-inline-form .field-plate { grid-column: span 3; }
  .resource-inline-form.plate-inline-form .field-firstname { grid-column: span 3; }
  .resource-inline-form.plate-inline-form .field-prefix { grid-column: span 2; }
  .resource-inline-form.plate-inline-form .field-surname { grid-column: span 4; }
  .resource-inline-form.plate-inline-form .field-valid-from { grid-column: span 4; }
  .resource-inline-form.plate-inline-form .field-valid-until { grid-column: span 4; margin-left: 0; }
  .resource-inline-form.plate-inline-form .form-buttons { grid-column: span 4; margin-left: 0; }
}
.resource-inline-form.token-inline-form { grid-template-columns: minmax(220px, 420px) 40px; justify-content: start; }
.resource-inline-form[hidden] { display: none; }
.resource-table table { min-width: 980px; }
.resource-table input, .resource-table select, .resource-inline-form input, .resource-inline-form select { min-height: 34px; padding: 6px 8px; }
.resource-table .plate-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 900; letter-spacing: 0; }
.resource-table .custom-select__button, .resource-inline-form .custom-select__button { min-height: 34px; }
.resource-table .check { min-height: 34px; white-space: nowrap; }
.side-stack { display: grid; gap: 14px; }
.table-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: auto; box-shadow: var(--shadow); }
.table-search { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table-search input[type="search"] { width: auto; flex: 1; max-width: 360px; min-height: 38px; }
.table-empty { margin: 0; padding: 22px 16px; color: var(--muted); text-align: center; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; white-space: nowrap; }
th { color: var(--muted); background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.plate { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; font-weight: 900; letter-spacing: 0; }
.chip { border-radius: 999px; padding: 4px 9px; background: #e2e8f0; color: #334155; font-weight: 900; font-size: 12px; }
.chip.green, .scan-result.green { background: #dcfce7; color: var(--green); }
.chip.orange, .scan-result.orange { background: #ffedd5; color: var(--orange); }
.chip.red, .scan-result.red { background: #fee2e2; color: var(--red); }
.chip.unknown, .scan-result.unknown { background: #e2e8f0; color: var(--unknown); }
.scan-result { border-radius: 8px; padding: 22px; display: flex; align-items: center; gap: 18px; max-width: 720px; }
.topbar-identity { display: flex; align-items: baseline; gap: 6px; }
.form-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-narrow { max-width: 480px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
#admin-tenants-table .row-actions,
#admin-barriers-table .row-actions,
#admin-users-table .row-actions { justify-content: flex-end; }
.row-actions form { margin: 0; }

.public-screen { display: block; background: #111816; color: #eef7f1; }
.incoming-screen { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; gap: 26px; padding: clamp(24px, 4vw, 54px); background: radial-gradient(circle at 20% 0%, rgba(242, 183, 5, .18), transparent 32%), #111816; }
.incoming-hero h1 { margin: 10px 0 8px; font-size: clamp(34px, 6vw, 76px); line-height: 1; }
.incoming-logo { max-width: 180px; max-height: 90px; object-fit: contain; margin-bottom: 14px; }
.incoming-hero p { color: #b9c8c1; font-size: clamp(18px, 2vw, 28px); margin: 0; }
.incoming-latest { border-radius: 8px; padding: clamp(26px, 5vw, 64px); display: grid; gap: 10px; background: #1f2b27; border-left: 12px solid var(--unknown); box-shadow: 0 26px 70px rgba(0, 0, 0, .28); }
.incoming-latest.green { border-left-color: var(--green); }
.incoming-latest.orange { border-left-color: var(--orange); }
.incoming-latest.red { border-left-color: var(--red); }
.incoming-latest span { color: #b9c8c1; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.incoming-latest strong { font-size: clamp(58px, 13vw, 170px); line-height: .95; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.incoming-latest em { font-style: normal; color: #f2b705; font-size: clamp(22px, 3vw, 42px); font-weight: 900; }
.incoming-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.incoming-list article { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; padding: 16px; display: grid; gap: 6px; }
.incoming-list strong, .incoming-list em { font-style: normal; color: #b9c8c1; }

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .widget-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .incoming-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body { display: block; }
  .nav { width: 100%; min-height: auto; position: static; display: flex; overflow-x: auto; }
  .brand { white-space: nowrap; padding: 6px 12px; }
  .topbar { position: static; flex-wrap: wrap; padding: 12px 16px; }
  .status-grid, .split, .form-grid { grid-template-columns: 1fr; }
  .widget-board, .widget-catalog { grid-template-columns: 1fr; }
  .widget-frame.size-1x1, .widget-frame.size-1x2, .widget-frame.size-2x1, .widget-frame.size-2x2, .widget-frame.size-full { grid-column: 1 / -1; grid-row: auto; }
  .camera-admin-grid { grid-template-columns: 1fr; }
  .resource-inline-form { grid-template-columns: 1fr; }
  .resource-inline-form.plate-inline-form,
  .resource-inline-form.user-inline-form { grid-template-columns: 1fr; }
  .resource-inline-form.plate-inline-form .field-valid-until,
  .resource-inline-form.plate-inline-form .form-buttons,
  .resource-inline-form.user-inline-form .form-buttons { margin-left: 0; }
  .toolbar, .search, .toolbar-actions { align-items: stretch; flex-direction: column; }
  .incoming-list { grid-template-columns: 1fr; }
  .widget-grip, .widget-menu { width: 34px; min-height: 34px; }
  .widget-resize-handle { width: 34px; height: 34px; }
}
