/* ============ Serverpaneel design ============ */
:root {
  --bg: #f5f6fa;
  --bg-soft: #eceef6;
  --card: #ffffff;
  --text: #171a26;
  --muted: #697086;
  --line: #e4e7f0;
  --accent: #5b5bd6;
  --accent-2: #4f7cff;
  --accent-soft: #ecebfd;
  --accent-text: #ffffff;
  --ok: #17a067; --ok-soft: #e3f6ed;
  --warn: #c98200; --warn-soft: #fdf3dc;
  --bad: #d64545; --bad-soft: #fde8e8;
  --code: #10131c; --code-text: #d5dcef;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 38, .05);
  --shadow: 0 1px 2px rgba(23, 26, 38, .04), 0 8px 24px rgba(23, 26, 38, .06);
  --shadow-lg: 0 24px 64px rgba(23, 26, 38, .22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017; --bg-soft: #151a24; --card: #151a24; --text: #e9ecf4; --muted: #8d94a8; --line: #232a38;
    --accent: #8b87ff; --accent-2: #6f95ff; --accent-soft: #24234a; --accent-text: #0d1017;
    --ok: #3ccf8e; --ok-soft: #12291f; --warn: #f0b429; --warn-soft: #2d2410; --bad: #ff6b6b; --bad-soft: #2e1616;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1 { font-size: clamp(1.5rem, 2.4vw + .8rem, 2.1rem); line-height: 1.2; margin: .15rem 0 .5rem; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0; }
p { margin: .3rem 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .86em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); min-height: 1.2em; margin: .6rem 0 0; font-size: .9rem; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.gap { gap: .6rem; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; }

/* ---------- merk ---------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: -.01em; }
.brand.big { font-size: 1.05rem; margin-bottom: 1.4rem; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: url(/icon.svg) center / cover; box-shadow: 0 4px 12px rgba(91, 91, 214, .35); }

/* ---------- knoppen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 550; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: .55rem 1rem; border-radius: 11px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, transform .05s, box-shadow .15s; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: linear-gradient(135deg, #5b5bd6, #4f7cff); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.sm { padding: .35rem .7rem; font-size: .86rem; border-radius: 9px; }
.btn.lg { padding: .75rem 1.2rem; font-size: 1rem; border-radius: 13px; }
.btn.wide { width: 100%; margin-top: 1rem; }
.btn.icon { padding: .4rem; width: 36px; height: 36px; }

/* ---------- formulieren ---------- */
.field { display: block; margin: .9rem 0; }
.field > span { display: block; font-size: .86rem; font-weight: 550; margin-bottom: .35rem; }
.field .hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .35rem; font-weight: 400; }
input, select, textarea { display: block; width: 100%; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: .65rem .8rem; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; display: inline; margin: 0; accent-color: var(--accent); }
.code-input { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.affix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 11px; background: var(--card); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.affix input { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; }
.affix .suffix, .affix .prefix { display: flex; align-items: center; padding: 0 .8rem; background: var(--bg-soft); color: var(--muted); font-size: .9rem; white-space: nowrap; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0; cursor: pointer; }
.check input { margin-top: .25rem; }

/* keuzetegels */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-top: .35rem; }
.choice { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 13px; padding: .75rem .85rem; cursor: pointer; background: var(--card); transition: border-color .15s, background .15s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice b { display: block; font-size: .92rem; }
.choice small { color: var(--muted); font-size: .8rem; line-height: 1.35; display: block; margin-top: .15rem; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

/* ---------- inloggen ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(700px 500px at 110% 110%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 2rem 1.8rem; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.6rem; }

/* ---------- bovenbalk ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: 1rem; }
.tabs { display: flex; gap: .2rem; background: var(--bg-soft); padding: 4px; border-radius: 12px; margin-left: auto; margin-right: auto; }
.tab-btn { font: inherit; font-weight: 550; font-size: .9rem; border: 0; background: transparent; color: var(--muted); padding: .42rem .9rem; border-radius: 9px; cursor: pointer; }
.tab-btn.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; gap: .5rem; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tab-btn { flex: 1; padding: .45rem .3rem; }
  #btn-logout { margin-left: auto; }
}
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 80px; }

/* ---------- hero ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; padding: 2rem 0 1.2rem; }
.hero.small { padding-bottom: .6rem; }
.hero > div:first-child { max-width: 620px; }
.eyebrow { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 640px) { .hero-actions, .hero-actions .btn { width: 100%; } }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .75rem; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: .84rem; color: var(--muted); box-shadow: var(--shadow-sm); }
.chip b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .chip.opt { display: none; } }
.chip a { font-weight: 600; }

/* ---------- kaarten ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .6rem; }
.icon-bubble { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid !important; place-items: center; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
@media (max-width: 400px) { .grid, .grid.two, .grid.three { grid-template-columns: 1fr; } }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 2rem 0 .8rem; gap: .6rem; }

/* site-kaart */
.site { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.site:hover { box-shadow: 0 2px 4px rgba(23, 26, 38, .05), 0 14px 34px rgba(23, 26, 38, .10); }
.site.drag { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.preview { position: relative; aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; border-bottom: 1px solid var(--line); }
.preview iframe { position: absolute; top: 0; left: 0; width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; background: #fff; }
.preview .tile { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 3.4rem; font-weight: 750; letter-spacing: -.03em; }
.preview .tile small { position: absolute; bottom: 12px; left: 14px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; opacity: .9; display: flex; align-items: center; gap: .35rem; }
.tile.g0 { background: linear-gradient(135deg, #5b5bd6, #4f7cff); } .tile.g1 { background: linear-gradient(135deg, #0ea5a4, #22c55e); }
.tile.g2 { background: linear-gradient(135deg, #f97362, #f59e0b); } .tile.g3 { background: linear-gradient(135deg, #db2777, #8b5cf6); }
.tile.g4 { background: linear-gradient(135deg, #0284c7, #06b6d4); } .tile.g5 { background: linear-gradient(135deg, #475569, #0f172a); }
.preview .status { position: absolute; top: 10px; right: 10px; }
.drop-hint { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 88%, transparent); color: #fff; display: grid; place-items: center; text-align: center; font-weight: 650; z-index: 2; padding: 1rem; }
.site-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.site-name { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; display: flex; align-items: center; gap: .5rem; }
.site-link { display: flex; align-items: center; gap: .35rem; font-size: .9rem; overflow-wrap: anywhere; }
.site-link.none { color: var(--muted); justify-content: flex-start; padding: .1rem 0; font-weight: 550; }
.site-link.none:hover { color: var(--accent); background: none; }
.site-meta { font-size: .82rem; color: var(--muted); display: flex; gap: .8rem; flex-wrap: wrap; }
.site-actions { display: flex; gap: .45rem; margin-top: auto; padding-top: .8rem; }
.site-actions .btn.primary { flex: 1; }

.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 650; padding: .22rem .6rem; border-radius: 99px; background: var(--card); color: var(--muted); box-shadow: var(--shadow-sm); white-space: nowrap; border: 1px solid var(--line); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.up { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.down, .pill.missing { color: var(--bad); } .pill.busy { color: var(--accent); }
.pill.busy::before { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.tag { font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 6px; background: var(--bg-soft); color: var(--muted); }

.empty { text-align: center; padding: 3rem 1rem; }
.empty-art { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty-art svg.i { width: 34px; height: 34px; }

/* statistieken */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; margin-top: .3rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat .sub { font-size: .84rem; color: var(--muted); }
.bar { height: 8px; background: var(--bg-soft); border-radius: 5px; margin-top: .7rem; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 5px; }
.bar.w0 > span { width: 2% } .bar.w1 > span { width: 10% } .bar.w2 > span { width: 20% } .bar.w3 > span { width: 30% } .bar.w4 > span { width: 40% } .bar.w5 > span { width: 50% } .bar.w6 > span { width: 60% } .bar.w7 > span { width: 70% } .bar.w8 > span { width: 80% } .bar.w9 > span { width: 90% } .bar.w10 > span { width: 100% }
.bar.high > span { background: var(--warn); }
.access .value { font-size: 1rem; }
.access .ok-dot { color: var(--ok); } .access .off { color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-soft); }

/* ---------- dialoog ---------- */
dialog { border: 1px solid var(--line); border-radius: 22px; padding: 0; background: var(--card); color: var(--text); width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lg); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(10, 12, 22, .5); backdrop-filter: blur(3px); }
#dialog-body { padding: 1.4rem 1.5rem 1.5rem; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .4rem; }
.dlg-head h3 { font-size: 1.2rem; letter-spacing: -.01em; }
.dlg-head p { color: var(--muted); font-size: .9rem; margin: .15rem 0 0; }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: 1.4rem; flex-wrap: wrap; }
.dlg-foot .right { display: flex; gap: .6rem; margin-left: auto; flex-wrap: wrap; }

/* stappen */
.steps { display: flex; gap: .4rem; margin: .4rem 0 1.2rem; }
.steps span { flex: 1; height: 5px; border-radius: 4px; background: var(--bg-soft); }
.steps span.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* upload-zone */
.drop { border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--card)); border-radius: 16px; padding: 1.8rem 1rem; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big-icon { width: 54px; height: 54px; margin: 0 auto .7rem; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.drop .big-icon svg.i { width: 26px; height: 26px; }
.drop .row { justify-content: center; gap: .5rem; margin-top: .9rem; }
.picked { display: flex; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; margin-top: .8rem; background: var(--card); text-align: left; }
.picked .icon-bubble { width: 38px; height: 38px; }
.picked b { display: block; }
.picked .grow { flex: 1; min-width: 0; }
.picked .grow .muted { margin-right: .4rem; }
.detected { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: .15rem .55rem; border-radius: 99px; margin-top: .25rem; }
.progress { height: 8px; background: var(--bg-soft); border-radius: 5px; overflow: hidden; margin-top: 1rem; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }

/* taak-voortgang */
.job-steps { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .55rem; }
.job-steps li { display: flex; gap: .7rem; align-items: flex-start; font-size: .93rem; }
.job-steps .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.job-steps .dot svg.i { width: 13px; height: 13px; stroke-width: 3; }
.job-steps li.now .dot { background: var(--accent-soft); }
.job-steps li.fail .dot { background: var(--bad-soft); color: var(--bad); }
.spinner { width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result { text-align: center; padding: .6rem 0 .2rem; }
.result .big { width: 64px; height: 64px; margin: .4rem auto .8rem; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.result .big svg.i { width: 30px; height: 30px; stroke-width: 2.5; }
.result.fail .big { background: var(--bad-soft); color: var(--bad); }
.result h3 { font-size: 1.3rem; }
.result .links { display: flex; flex-direction: column; gap: .5rem; align-items: center; margin-top: 1rem; }
.summary { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
.summary span { font-size: .8rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; background: var(--bg-soft); color: var(--muted); }
pre.log { background: var(--code); color: var(--code-text); padding: .9rem 1rem; border-radius: 12px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; margin: .6rem 0 0; }
details.more { margin-top: 1rem; }
details.more summary { cursor: pointer; color: var(--muted); font-size: .88rem; font-weight: 550; }
.note { display: flex; gap: .6rem; align-items: flex-start; background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: .7rem .9rem; font-size: .86rem; margin-top: .8rem; }
.note svg.i { color: var(--accent); margin-top: .1rem; }
.note.warn { background: var(--warn-soft); } .note.warn svg.i { color: var(--warn); }

.list { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 13px; }
.list li .grow { flex: 1; min-width: 0; }
.list li .grow b { display: block; overflow-wrap: anywhere; }
.list li .grow small { display: block; color: var(--muted); overflow-wrap: anywhere; font-size: .8rem; line-height: 1.4; }
.qr { display: block; margin: .8rem 0; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }

/* menu */
.menu { position: fixed; z-index: 60; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .35rem; }
.menu button { display: flex; width: 100%; align-items: center; gap: .6rem; font: inherit; font-size: .92rem; text-align: left; background: none; border: 0; color: var(--text); padding: .55rem .7rem; border-radius: 9px; cursor: pointer; }
.menu button:hover { background: var(--bg-soft); }
.menu button.danger { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: .3rem 0; }

.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; z-index: 80; max-width: calc(100vw - 32px); font-weight: 550; box-shadow: var(--shadow-lg); }

.ok-link { color: var(--ok); display: inline !important; font-weight: 600; }
.site-link + .site-meta { margin-top: -.25rem; font-size: .78rem; }

/* =====================================================================
   Layout met zijbalk (desktop) en balk onderaan (gsm)
   ===================================================================== */
:root { --series-1: #2a78d6; --series-2: #eb6834; --grid: #e8eaf1; --axis: #c9cdd8; --status-good: #0ca30c; --status-warning: #c98200; --status-serious: #d9652f; --status-critical: #d03b3b; --sidebar: 248px; }
@media (prefers-color-scheme: dark) { :root { --series-1: #3987e5; --series-2: #d95926; --grid: #222938; --axis: #343c4d; --status-good: #3ccf8e; --status-warning: #fab219; --status-serious: #ec835a; --status-critical: #ff6b6b; } }

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; width: var(--sidebar); flex: none; display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem .9rem; background: var(--card); border-right: 1px solid var(--line); }
.side-brand { padding: .2rem .6rem 1.2rem; font-size: 1.05rem; }
.side-nav { display: flex; flex-direction: column; gap: .2rem; }
.nav-item { display: flex; align-items: center; gap: .75rem; width: 100%; font: inherit; font-weight: 560; font-size: .95rem; color: var(--muted); background: none; border: 0; padding: .65rem .8rem; border-radius: 11px; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item svg.i { width: 20px; height: 20px; }
.side-logout { margin-top: .2rem; }
.side-status { margin-top: auto; border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; background: var(--bg); cursor: pointer; display: grid; gap: .45rem; min-height: 60px; }
.side-status:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.ss-head { display: flex; align-items: center; gap: .5rem; font-weight: 650; font-size: .88rem; }
.ss-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-good) 20%, transparent); }
.ss-dot.warn { background: var(--status-warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-warning) 20%, transparent); }
.ss-row { display: grid; grid-template-columns: 38px 1fr 36px; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); }
.ss-row b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.ss-row .meter { height: 5px; margin: 0; }
.main-wrap { flex: 1; min-width: 0; }
.main-wrap main { max-width: 1240px; margin: 0 auto; padding: 0 28px 80px; }
.mobile-top { display: none; }

@media (max-width: 860px) {
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; width: auto; z-index: 20; flex-direction: row; padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .side-brand, .side-status, .side-logout { display: none; }
  .side-nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: .15rem; font-size: .7rem; padding: .45rem .2rem; text-align: center; flex: 1; }
  .mobile-top { display: flex; justify-content: space-between; align-items: center; padding: .7rem 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .main-wrap main { padding: 0 16px 110px; }
}

/* ---------- paginakop ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap; padding: 2.2rem 0 1.3rem; }
.page-head > div:first-child { max-width: 680px; }
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 640px) { .head-actions { width: 100%; } .head-actions .btn { flex: 1; } .page-head { padding-top: 1.4rem; } }
.uptime { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.uptime svg.i { width: 15px; height: 15px; }
.live { display: inline-flex; align-items: center; gap: .35rem; margin-left: .5rem; color: var(--status-good); text-transform: none; letter-spacing: 0; font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.seg-toggle { display: inline-flex; background: var(--bg-soft); padding: 4px; border-radius: 12px; gap: 2px; }
.seg-toggle button { font: inherit; font-size: .88rem; font-weight: 560; border: 0; background: none; color: var(--muted); padding: .42rem .85rem; border-radius: 9px; cursor: pointer; }
.seg-toggle button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.section { margin-top: 1.1rem; }

/* ---------- KPI-tegels ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.kpi { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-label svg.i { width: 16px; height: 16px; }
.kpi-value { font-size: 1.75rem; font-weight: 720; letter-spacing: -.02em; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; line-height: 1.25; margin-top: .15rem; }
.kpi-value small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.kpi-value.sm { font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.kpi-value.net { font-size: 1.15rem; flex-direction: column; align-items: flex-start; gap: 0; }
.kpi-sub { font-size: .82rem; color: var(--muted); }
.kpi-spark { margin-top: auto; padding-top: .5rem; height: 46px; }
.kpi .meter { margin-top: auto; }

/* ---------- statuslabels (altijd icoon + tekst) ---------- */
.status { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 650; padding: .15rem .5rem .15rem .4rem; border-radius: 99px; letter-spacing: 0; }
.status svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.status.good { color: var(--status-good); background: color-mix(in srgb, var(--status-good) 12%, transparent); }
.status.warning { color: var(--status-warning); background: color-mix(in srgb, var(--status-warning) 14%, transparent); }
.status.serious { color: var(--status-serious); background: color-mix(in srgb, var(--status-serious) 14%, transparent); }
.status.critical { color: var(--status-critical); background: color-mix(in srgb, var(--status-critical) 12%, transparent); }

/* ---------- meters ---------- */
.meter { height: 8px; background: var(--bg-soft); border-radius: 5px; overflow: hidden; margin: .7rem 0 .2rem; }
.meter > span { display: block; height: 100%; border-radius: 5px; background: var(--series-1); width: 0; }
.meter.warning > span { background: var(--status-warning); }
.meter.critical > span { background: var(--status-critical); }

/* ---------- grafieken ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.chart-grid > .chart-card:first-child { grid-column: 1 / -1; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
.chart-card { padding: 1.1rem 1.1rem .9rem; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.legend { display: flex; gap: .9rem; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.lk { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .35rem; }
.lk.s1 { background: var(--series-1); } .lk.s2 { background: var(--series-2); }
.chart { position: relative; outline: none; border-radius: 8px; }
.chart:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .hair { stroke: var(--grid); stroke-width: 1; }
.chart-svg .base { stroke: var(--axis); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .stroke, .spark .stroke { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area, .spark .area { stroke: none; opacity: .12; }
.s1.stroke { stroke: var(--series-1); } .s2.stroke { stroke: var(--series-2); }
.s1.area { fill: var(--series-1); } .s2.area { fill: var(--series-2); }
.dot { stroke: var(--card); stroke-width: 2; }
.s1.dot { fill: var(--series-1); } .s2.dot { fill: var(--series-2); }
.chart-svg .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.spark { display: block; width: 100%; height: 38px; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 10px; padding: .5rem .7rem; font-size: .8rem; min-width: 140px; z-index: 3; }
.tip-time { color: var(--muted); font-size: .74rem; margin-bottom: .25rem; }
.tip-row { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.tip-row b { font-size: .92rem; font-variant-numeric: tabular-nums; }
.tip-name { color: var(--muted); }
.tip-key { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tip-key.s1 { background: var(--series-1); } .tip-key.s2 { background: var(--series-2); }
.chart-stats { display: grid; gap: .2rem; margin-top: .45rem; font-size: .8rem; color: var(--muted); }
.chart-stats > div { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.chart-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-empty { display: grid; place-items: center; min-height: 170px; color: var(--muted); font-size: .9rem; text-align: center; padding: 1rem; }

/* ---------- lijsten, kernen, schijven ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.rows li:last-child { border-bottom: 0; }
.rows li > span:first-child { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.rows li b { text-align: right; overflow-wrap: anywhere; font-weight: 600; }
.row-val { display: flex; align-items: center; gap: .6rem; flex: none; }
.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .3rem 1.2rem; }
.core { display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: .6rem; font-size: .85rem; }
.core .meter { margin: 0; height: 7px; }
.core b { text-align: right; font-variant-numeric: tabular-nums; }
.disk { display: flex; flex-direction: column; }
.disk-head { display: flex; align-items: center; gap: .8rem; }
.disk-head .grow { flex: 1; min-width: 0; }
.disk-head b { display: block; overflow-wrap: anywhere; }
.disk-head small { display: block; font-size: .8rem; }
.disk .meter { height: 10px; margin-top: 1rem; }
.disk-foot { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; font-size: .86rem; }

/* ---------- containers-tabel ---------- */
.table th.num, .table td.num { text-align: right; }
.cell-meter { display: flex; align-items: center; gap: .6rem; justify-content: flex-end; }
.cell-meter .meter { width: 70px; margin: 0; height: 6px; }
.cell-meter b { min-width: 44px; font-variant-numeric: tabular-nums; }
.table td .small { margin-top: .15rem; }
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .kpi { padding: .9rem; }
  .kpi-value { font-size: 1.35rem; }
  .kpi-value.net { font-size: .95rem; }
  .kpi-sub { font-size: .76rem; }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- widgets (server-pagina) ---------- */
.wgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; grid-auto-flow: dense; }
.widget { position: relative; min-width: 0; display: flex; flex-direction: column; }
.w-1 { grid-column: span 1; } .w-2 { grid-column: span 2; } .w-4 { grid-column: span 4; }
@media (max-width: 1100px) { .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .w-4 { grid-column: span 2; } }
@media (max-width: 700px) { .w-2 { grid-column: span 2; } }
@media (max-width: 380px) { .wgrid { grid-template-columns: minmax(0, 1fr); } .w-1, .w-2, .w-4 { grid-column: span 1; } }
.w-body { display: flex; flex-direction: column; flex: 1; gap: .2rem; min-width: 0; }
.kpi .w-body .meter, .kpi .w-body .kpi-spark { margin-top: auto; }
.chart-card .w-body { display: none; }
.disk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem 1.4rem; }
.disk-list .disk .meter { margin-top: .7rem; }
.access3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.access3 > div { display: grid; gap: .15rem; }

/* aanpas-modus */
#btn-customize.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.wgrid.editing .widget { outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; cursor: grab; }
.wgrid.editing .widget.dragging { opacity: .4; }
.wgrid.editing .widget.drop-before { box-shadow: -6px 0 0 -2px var(--accent), var(--shadow); }
.wgrid.editing .chart-box, .wgrid.editing .w-body { pointer-events: none; }
.w-tools { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin: -.4rem -.4rem .8rem; padding-bottom: .6rem; border-bottom: 1px dashed var(--line); }
.w-grip { color: var(--muted); display: inline-flex; padding: .2rem; cursor: grab; }
.w-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.w-btn:hover { border-color: var(--accent); color: var(--accent); }
.w-btn.danger { margin-left: auto; color: var(--bad); }
.w-btn svg.i { width: 16px; height: 16px; }
.w-sizes { display: inline-flex; background: var(--bg-soft); border-radius: 8px; padding: 2px; gap: 1px; }
.w-size { font: inherit; font-size: .74rem; font-weight: 600; border: 0; background: none; color: var(--muted); padding: .28rem .5rem; border-radius: 6px; cursor: pointer; }
.w-size.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow-sm); }
.add-panel { margin-bottom: 1rem; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); }
.add-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.add-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.add-item { display: inline-flex; align-items: center; gap: .55rem; font: inherit; font-size: .9rem; font-weight: 550; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: .35rem .7rem .35rem .35rem; border-radius: 12px; cursor: pointer; }
.add-item:hover { border-color: var(--accent); color: var(--accent); }
.add-item .icon-bubble { width: 30px; height: 30px; border-radius: 9px; }
.add-item .icon-bubble svg.i { width: 16px; height: 16px; }

/* =====================================================================
   Gsm-proof
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
button, a, input, select, label { -webkit-tap-highlight-color: transparent; }
.chart-svg rect { touch-action: pan-y; }

/* vingervriendelijke knoppen op aanraakschermen */
@media (pointer: coarse), (max-width: 640px) {
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; padding: .45rem .8rem; }
  .btn.icon { width: 44px; height: 44px; }
  .seg-toggle button { min-height: 40px; padding: .5rem .9rem; }
  .w-btn { width: 40px; height: 40px; }
  .w-size { padding: .55rem .7rem; font-size: .8rem; }
  .site-link.none { min-height: 40px; }
  .menu button { padding: .8rem .8rem; }
  .add-item { min-height: 44px; }
  .check input, .choice input { width: 20px; height: 20px; }
  .nav-item { min-height: 48px; }
}

@media (max-width: 640px) {
  /* iPhone zoomt in bij tekst kleiner dan 16px in invulvelden */
  input, select, textarea { font-size: 16px; }
  .code-input { font-size: 1.5rem; }

  /* dialogen worden een paneel dat van onderen openschuift */
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; border-bottom: 0; display: none; }
  dialog[open] { display: flex; flex-direction: column; animation: sheet .22s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
  #dialog-body { padding: .9rem 1.1rem calc(1rem + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; flex: 1; }
  #dialog-body::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto .8rem; }
  .dlg-head h3 { font-size: 1.12rem; }
  .dlg-foot { position: sticky; bottom: calc(-1rem - env(safe-area-inset-bottom)); background: var(--card); margin: 1rem -1.1rem calc(-1rem - env(safe-area-inset-bottom)); padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 2; }
  .dlg-foot .right { flex: 1; }
  .dlg-foot .right .btn { flex: 1; }
  .choices { grid-template-columns: 1fr; gap: .45rem; }
  .choice { padding: .65rem .8rem; }
  .drop { padding: 1.2rem .9rem; }
  .drop .row .btn { flex: 1; }
  .list li { flex-wrap: wrap; }
  .list li .btn { width: 100%; }
  .affix .prefix { display: none; }
  .affix .suffix { padding: 0 .6rem; font-size: .85rem; }

  /* chips: één rij om horizontaal te vegen */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 1rem; padding: 0 16px 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  /* paginakop compacter */
  .page-head { padding: 1.2rem 0 1rem; gap: .9rem; }
  .page-head h1 { font-size: 1.6rem; }
  .head-actions { flex-direction: column; align-items: stretch; }
  .head-actions .seg-toggle { width: 100%; }
  .head-actions .seg-toggle button { flex: 1; }
  #srv-sub { font-size: .9rem; }

  /* containers-tabel wordt kaartjes */
  #containers thead { display: none; }
  #containers, #containers tbody, #containers tr, #containers td { display: block; width: 100%; }
  #containers tr { padding: .9rem 1rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; }
  #containers tr:last-child { border-bottom: 0; }
  #containers td { border: 0; padding: 0; text-align: left; }
  #containers td[data-label="Container"] { grid-column: 1; }
  #containers td[data-label="Status"] { grid-column: 2; grid-row: 1; text-align: right; }
  #containers td[data-label="Status"] .small { display: none; }
  #containers td[data-label="Processor"], #containers td[data-label="Geheugen"], #containers td[data-label="Image"], #containers td[data-label="Poorten"] { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .85rem; }
  #containers td[data-label]:not([data-label="Container"]):not([data-label="Status"])::before { content: attr(data-label); color: var(--muted); font-size: .8rem; flex: none; }
  #containers td[data-label="Poorten"], #containers td[data-label="Image"] { overflow-wrap: anywhere; text-align: right; }
  .cell-meter .meter { width: 90px; }

  /* kaarten en menu */
  .site-actions { gap: .5rem; }
  .menu { left: 8px !important; right: 8px; width: auto; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 1.6rem 1.3rem; border-radius: 20px; }
  .w-tools { gap: .35rem; }
  .w-sizes { order: 5; width: 100%; justify-content: space-between; }
  .w-size { flex: 1; }
}
@media (max-width: 860px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }
@media (max-width: 640px) {
  .dlg-foot { flex-wrap: nowrap; }
  .dlg-foot .right { flex-wrap: nowrap; }
  .dlg-foot .right:has(.primary) > [data-close] { display: none; } /* sluiten kan met het kruisje bovenaan */
  .dlg-foot .btn.ghost { flex: none; }
}
@media (max-width: 640px) {
  .btn { white-space: normal; text-align: center; max-width: 100%; }
  .result .links { align-items: stretch; }
  .result .links .btn { width: 100%; overflow-wrap: anywhere; }
}

.side-version { margin: .2rem .8rem 0; font-size: .72rem; color: var(--muted); opacity: .8; }
.settings-version { margin: -.4rem 0 1rem; }
@media (max-width: 860px) { .side-version { display: none; } }
.live.off { color: var(--muted); }
.live.off i { animation: none; }

.ss-live { margin-left: auto; font-size: .7rem; font-weight: 600; color: var(--status-good); }
.side-status.offline .ss-live { color: var(--muted); }
.side-status.offline .ss-dot { background: var(--muted); box-shadow: none; }

.site-meta.auto { display: flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 550; }
.site-meta.auto svg.i { width: 14px; height: 14px; }
.site-meta.auto.ok { color: var(--status-good); }
.site-meta.auto.warn { color: var(--status-warning); }
.chip.warn-chip { color: var(--text); border-color: color-mix(in srgb, var(--status-warning) 50%, var(--line)); background: color-mix(in srgb, var(--status-warning) 10%, var(--card)); }
.chip.warn-chip svg.i { color: var(--status-warning); }
