:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e3e8ef;
  --text: #17202b;
  --muted: #64748b;
  --accent: #1667d9;
  --accent-soft: #e6f0fd;
  --ok: #17a34a;
  --ok-soft: #e3f6ea;
  --warn: #d97706;
  --warn-soft: #fdf1df;
  --bad: #dc2626;
  --bad-soft: #fde6e6;
  --side: #0f1b2a;
  --side-text: #c6d2df;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d131b; --panel: #151d28; --panel-2: #1a2431; --line: #263243; --text: #e6edf5; --muted: #8b9bb0;
    --accent: #4c95ff; --accent-soft: #19304f; --ok: #34c46b; --ok-soft: #133523; --warn: #f0a33a; --warn-soft: #3a2a12;
    --bad: #f05d5d; --bad-soft: #3d1a1a; --side: #0a1016; --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    --series-1: #3987e5; --series-2: #d95926;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hr { height: 1px; background: var(--line); margin: 16px 0; }

/* layout */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: #fff; padding: 0 8px 18px; }
.brand.big { font-size: 22px; color: var(--text); justify-content: center; padding: 0 0 6px; }
.logo { width: 30px; height: 30px; background: url("logo.svg") center / contain no-repeat; flex: none; filter: drop-shadow(0 2px 4px rgba(212, 150, 28, .35)); }
.brand.big .logo { width: 44px; height: 44px; }
.brand-name { letter-spacing: -0.01em; white-space: nowrap; }
.brand-name b { font-weight: 700; background: linear-gradient(180deg, #ffe27a, #d4961c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand { font-size: 15px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.active { background: rgba(76,149,255,.18); color: #fff; }
.side nav i { width: 18px; height: 18px; display: inline-flex; }
.side nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 8px; }
.side-foot .btn { color: var(--side-text); border-color: rgba(255,255,255,.15); flex: 1; justify-content: center; }
.side-foot .me { display: flex; align-items: center; gap: 9px; padding: 0 2px 10px; color: #fff; }
.side-foot .me .av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #f5c542, #c0821a); color: #3a2604; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.side-foot .me .n { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .me .r { font-size: 11px; color: var(--side-text); opacity: .8; }

/* rechten per rol */
body:not([data-role="admin"]) .admin-only { display: none !important; }
body[data-role="viewer"] .edit-only,
body[data-role="viewer"] #pageActions > *,
body[data-role="viewer"] .dropzone,
body[data-role="viewer"] .mcard .acts,
body[data-role="viewer"] .modal-foot .btn.primary,
body[data-role="viewer"] .modal-foot .btn.danger,
body[data-role="viewer"] .modal-foot .left,
body[data-role="viewer"] [data-cmd], body[data-role="viewer"] [data-ov], body[data-role="viewer"] [data-clone],
body[data-role="viewer"] #pAdd, body[data-role="viewer"] #pDel, body[data-role="viewer"] .it .row { display: none !important; }
body[data-role="viewer"] #plEdit input, body[data-role="viewer"] #plEdit select, body[data-role="viewer"] .it,
body[data-role="viewer"] .modal-body input, body[data-role="viewer"] .modal-body select, body[data-role="viewer"] .modal-body textarea,
body[data-role="viewer"] .modal-body .chip, body[data-role="viewer"] .modal-body .seg, body[data-role="viewer"] #plEdit .chip, body[data-role="viewer"] #plEdit textarea { pointer-events: none; }
.ro-banner { background: var(--accent-soft); color: var(--accent); padding: 8px 28px; font-size: 13px; font-weight: 600; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.users-table tr:last-child td { border-bottom: 0; }
.users-table tr.off td { opacity: .5; }
.users-table tr:hover td { background: var(--panel-2); cursor: pointer; }

.main { overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 20px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page { padding: 24px 28px 60px; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.icon { padding: 5px 7px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 34px; width: 48px; }
textarea { min-height: 90px; resize: vertical; }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--panel); padding: 6px 11px; font: inherit; cursor: pointer; color: var(--text); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 12px; color: var(--text); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.side .badge { background: var(--warn); color: #fff; border: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* schermen */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 260px; }
.toolbar select { width: auto; }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dev { overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.dev:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.dev .thumb { aspect-ratio: 16/9; background: #0b1118; position: relative; container-type: size; display: flex; align-items: center; justify-content: center; color: #4b5d70; overflow: hidden; }
.dev .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dev .thumb .off { position: absolute; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-weight: 600; gap: 6px; }
.dev .thumb .tl { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.dev .thumb .tr { position: absolute; top: 8px; right: 8px; }
.dev .thumb svg { width: 42px; height: 42px; }
.dev .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dev .name { font-weight: 650; font-size: 15px; }
.dev .meta { color: var(--muted); font-size: 12px; }
.dev .now { font-size: 13px; }
.dev .now b { font-weight: 600; }
.dev .foot { display: flex; gap: 12px; color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--panel-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.progress.ok i { background: var(--ok); }

.pending { border-color: var(--warn); background: var(--warn-soft); padding: 14px 16px; margin-bottom: 20px; }
.pending .item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); }
.pending .item:first-of-type { border-top: 0; }
.code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .1em; font-size: 15px; }

/* media */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--panel); color: var(--muted); cursor: pointer; transition: all .15s; margin-bottom: 16px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone b { color: var(--text); }
.uploads { margin-bottom: 16px; display: grid; gap: 6px; }
.upload { display: grid; grid-template-columns: 1fr 160px 60px; gap: 10px; align-items: center; font-size: 13px; padding: 8px 12px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.mcard { overflow: hidden; position: relative; }
.mcard .mt { aspect-ratio: 16/9; background: #0b1118 center/cover no-repeat; position: relative; display: flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; container-type: size; }
.mcard .mt .slide { font-size: 1px; }
.mcard .mt .type { position: absolute; bottom: 6px; left: 6px; }
.mcard .mt .dur { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.mcard .mb { padding: 8px 10px; }
.mcard .mn { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .acts { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; }
.mcard:hover .acts { display: flex; }
.mcard .acts .btn { background: rgba(255,255,255,.92); color: #111; border: 0; }
.mcard.sel { outline: 3px solid var(--accent); }
.mcard .selmark { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.mcard.sel .selmark { display: flex; }

/* playlists */
.split { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.plist { padding: 6px; }
.plist .pi { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.plist .pi:hover { background: var(--panel-2); }
.plist .pi.active { background: var(--accent-soft); }
.plist .pi .n { font-weight: 600; }
.items { display: flex; flex-direction: column; gap: 6px; }
.it { display: grid; grid-template-columns: 22px 96px 1fr 120px auto; gap: 12px; align-items: center; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.it.drag { opacity: .4; }
.it.over { border-color: var(--accent); box-shadow: 0 -2px 0 var(--accent); }
.it .handle { cursor: grab; color: var(--muted); text-align: center; user-select: none; }
.it .tn { width: 96px; aspect-ratio: 16/9; border-radius: 5px; background: #0b1118 center/cover; overflow: hidden; position: relative; container-type: size; }
.it .tn .slide { font-size: 1px; }
.it .dur { display: flex; align-items: center; gap: 6px; }
.it .dur input { width: 70px; }

/* planning */
.cal { overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 52px repeat(7, 1fr); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cal-head div { padding: 8px; font-size: 12px; font-weight: 650; text-align: center; color: var(--muted); }
.cal-head div.today { color: var(--accent); }
.cal-body { display: grid; grid-template-columns: 52px repeat(7, 1fr); position: relative; height: 720px; overflow-y: auto; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 6px; font-size: 10px; color: var(--muted); transform: translateY(-50%); }
.cal-day { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% calc(100% / 24); }
.cal-day.today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cal-ev { position: absolute; border-radius: 5px; padding: 3px 5px; font-size: 11px; color: #fff; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2); line-height: 1.25; border: 1px solid rgba(255,255,255,.35); }
.cal-ev b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.def { background: repeating-linear-gradient(45deg, var(--panel-2), var(--panel-2) 6px, var(--bg) 6px, var(--bg) 12px) !important; color: var(--muted); border: 1px dashed var(--line); cursor: default; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; }
.sched-list .s { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.sched-list .s:first-child { border-top: 0; }
.sched-list .s:hover { background: var(--panel-2); }
.sched-list .bar { width: 6px; height: 100%; min-height: 34px; border-radius: 3px; }
.sched-list .s.off { opacity: .55; }

/* power rules */
.rules { display: flex; flex-direction: column; gap: 8px; }
.rule { display: grid; grid-template-columns: 1fr 100px 100px auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.rule input[type=time] { padding: 5px 6px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(9, 14, 22, .55); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow: auto; animation: fadein .12s; }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .15s; }
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1200px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 14px 14px; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -18px -20px 16px; padding: 0 16px; }
.tabs button { border: 0; background: none; padding: 11px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--accent); border-color: var(--accent); }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

.preview-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; background: #000; display: block; }
.preview-frame.portrait { width: auto; height: min(72vh, 900px); max-width: 100%; aspect-ratio: 9/16; margin: 0 auto; }
.slide-preview { aspect-ratio: 16/9; position: relative; border-radius: 8px; overflow: hidden; container-type: size; background: #000; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.actions-grid .btn { justify-content: center; }
pre.code-block { background: var(--side); color: #d9e6f2; padding: 12px 14px; border-radius: 8px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }

/* toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--side); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .15s; max-width: 360px; }
.toast.err { background: var(--bad); }

/* login */
.login { height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at top, #1b2d44, #0b1118 70%); }
.login-card { background: var(--panel); padding: 30px; border-radius: 16px; width: 340px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); }
.login-card p { margin: 0 0 4px; text-align: center; color: var(--muted); }
.error { color: var(--bad); font-size: 13px; min-height: 18px; text-align: center; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; padding: 8px; overflow-x: auto; align-items: center; }
  .side .brand { padding: 0 8px; }
  .side nav { flex-direction: row; }
  .side-foot { display: none; }
  .split { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .top { padding: 14px 16px; }
  .it { grid-template-columns: 22px 70px 1fr; }
  .it .tn { width: 70px; }
}

/* dashboard-layout editor */
.lay-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
.lay-form { max-height: 72vh; overflow: auto; padding-right: 6px; }
.lay-prevcol { position: sticky; top: 0; }
.lay-form .sec, .lay-form summary { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 6px; }
.lay-form summary { cursor: pointer; display: list-item; }
.lay-form details { border-top: 1px solid var(--line); padding-top: 10px; }
.tile-ed { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel-2); }
.field .lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.mcard .mt .lay, .it .tn .lay, .dev .thumb .lay { pointer-events: none; }
.slide-preview.portrait { aspect-ratio: 9/16; height: min(70vh, 760px); width: auto; max-width: 100%; margin: 0 auto; }
.slide-preview [data-place="bg"], .slide-preview .lay-slot:not(.empty) { cursor: grab; touch-action: none; }
.slide-preview.dragging, .slide-preview.dragging * { cursor: grabbing !important; }
.lay-portrait-frame { position: relative; height: 100%; aspect-ratio: 9/16; margin: 0 auto; container-type: size; overflow: hidden; }
@media (max-width: 1000px) { .lay-editor { grid-template-columns: 1fr; } .lay-prevcol { position: static; order: -1; } }

/* monitoring */
.badge svg { flex: none; }
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mtile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.mtile .l { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mtile .v { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.mtile .s { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtile.warn { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.mtile.bad { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.mtile.warn .v::after { content: " · let op"; font-size: 12px; font-weight: 600; color: var(--warn); }
.mtile.bad .v::after { content: " · kritiek"; font-size: 12px; font-weight: 600; color: var(--bad); }
.alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.alert { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); }
.alert b { white-space: nowrap; }
.alert.bad { background: var(--bad-soft); border-color: transparent; } .alert.bad svg, .alert.bad b { color: var(--bad); }
.alert.warn { background: var(--warn-soft); border-color: transparent; } .alert.warn svg, .alert.warn b { color: var(--warn); }
.alert.ok { background: var(--ok-soft); border-color: transparent; margin-bottom: 12px; } .alert.ok svg, .alert.ok b { color: var(--ok); }
#monAlerts .alert { cursor: pointer; }
.warnbox { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; color: var(--warn); }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.chart-card { padding: 12px 12px 6px; }
.chart-title { font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .lbl { font-size: 10px; font-weight: 600; fill: var(--text); }
.chart .xh { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .xd { stroke: var(--panel); stroke-width: 2; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.chart-legend i, .chart-tip i { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.chart-tip { position: absolute; top: 18px; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 6px 9px; font-size: 12px; z-index: 3; min-width: 120px; }
.chart-tip .tt-h { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.chart-tip .tt-r { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip .tt-r b { font-variant-numeric: tabular-nums; }
.chart-tip .tt-r span { color: var(--muted); }
.chart-empty { color: var(--muted); font-size: 12px; padding: 34px 0; text-align: center; }
.mon-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.mon-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mon-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mon-table tr:last-child td { border-bottom: 0; }
.mon-table tbody tr { cursor: pointer; } .mon-table tbody tr:hover td { background: var(--panel-2); }
.mon-table tr.off td { opacity: .6; }
.mv.warn { color: var(--warn); font-weight: 650; } .mv.warn::after { content: " ⚠"; }
.mv.bad { color: var(--bad); font-weight: 700; } .mv.bad::after { content: " ⚠"; }
.evlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; }
.ev { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.out-pre { max-height: 60vh; overflow: auto; white-space: pre-wrap; }
.dev .thumb .selbox { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.92); border-radius: 6px; padding: 3px 5px; display: flex; z-index: 2; cursor: pointer; }
.dev .thumb .selbox input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.bulkbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 12px; padding: 10px 12px; animation: pop .15s; }
.bulkbar b { margin-right: 6px; }
.bulkbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.side nav #healthBadge { background: var(--bad); }
