/* Copyright (c) 2026 Level Nul. Alle rechten voorbehouden.
   Eigendom van Level Nul; gebruik alleen onder licentie. Zie LICENSE. */
/* nulsensor-server — opmaak. Kleuren als variabelen: huisstijl aanpassen = alleen :root wijzigen. */
/* Huisstijl Level Nul (2.5.14): gelijk aan website en brochures. Navy
   (#0f1d2e, #1a2d44) met signaaloranje (#f28c28), lichtgrijs-blauwe vlakken.
   Groen/rood alleen als statuskleur. */
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root {
  --coal: #0f1d2e;          /* navy: kop */
  --navy2: #1a2d44;         /* tweede navy: meters, focus */
  --brand: #f28c28;         /* signaaloranje: accenten, primaire knoppen */
  --brand-hover: #f6a24f;
  --accent: #1a2d44;        /* meters, balkjes */
  --accent-soft: #fdeedd;   /* licht oranje: actief menu, meldingen */
  --link: #a85a0e;          /* donker signaaloranje: leesbaar op wit (contrast 5:1) */
  --ink: #1e2a36;
  --muted: #5b6b7b;
  --line: #dfe5eb;
  --field: #c9d4df;         /* rand van invoervelden en knoppen */
  --bg: #f4f6f9;
  --card: #ffffff;
  --head-text: #c9d4df;     /* tekst op navy */
  --head-muted: #8a9bad;
  --head-line: #2c4260;
  --ok: #2d7a3e;
  --warn: #b5620b;
  --bad: #b3261e;
  --radius: 8px;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 14px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 16px; margin: 24px 0 8px; font-weight: 600; }
h3 { font-size: 14px; margin: 16px 0 6px; font-weight: 600; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
td.url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Kop en menu */
header.top { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 20px; background: var(--coal); color: #fff; border-bottom: 3px solid var(--brand); position: sticky; top: 0; z-index: 10; }
header.top .brand { color: #fff; }
header.top .customer { color: var(--head-text); border-left-color: var(--head-line); }
header.top .who { color: var(--head-muted); }
header.top button.link { color: var(--brand); }
header.top .v6toggle .pill { background: transparent; border-color: var(--head-line); }
header.top .v6toggle .pill.on { color: var(--brand); border-color: var(--brand); }
header.top .v6toggle .pill.off { color: var(--head-muted); }
.brand { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; font-size: 16px; flex-shrink: 0; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand.big { font-size: 22px; justify-content: center; margin-bottom: 4px; }
.logo { width: 28px; height: 28px; max-width: none; border-radius: 6px; display: block; flex-shrink: 0; }
.brand.big .logo { width: 40px; height: 40px; border-radius: 8px; }
.customer { color: var(--muted); border-left: 1px solid var(--line); padding-left: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
header.top > form, header.top .v6toggle { flex-shrink: 0; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; }
.shell { display: flex; min-height: calc(100vh - 52px); }
nav.side { width: 200px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); padding: 12px 0; position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; }
nav.side a { display: block; padding: 8px 20px; color: var(--ink); border-left: 3px solid transparent; }
nav.side a:hover { background: var(--bg); text-decoration: none; }
nav.side a.on { border-left-color: var(--brand); background: var(--accent-soft); font-weight: 600; }
nav.side .ver { padding: 16px 20px; color: var(--muted); font-size: 11px; }
main { flex: 1; padding: 24px 28px 60px; min-width: 0; }

/* Blokken */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .grid.c2 { grid-template-columns: 1fr; } }
.kpi .v { font-size: 28px; font-weight: 600; margin-top: 4px; }
a.kpi { color: var(--ink); }
a.kpi:hover { text-decoration: none; border-color: var(--brand); }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi.bad .v { color: var(--bad); }
.kpi.warn .v { color: var(--warn); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; background: #f8fafc; position: sticky; top: 52px; }
tr:hover td { background: #fbfcfc; }
.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
dl.fields { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; }
dl.fields dt { color: var(--muted); }
dl.fields dd { margin: 0; }

/* Labels */
.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); margin: 0 2px 2px 0; }
.src { font-size: 11px; color: var(--muted); margin-left: 6px; }
.sev-hoog, .st-niet-toegestaan { color: #fff; background: var(--bad); border-color: var(--bad); }
.sev-midden { color: #fff; background: var(--warn); border-color: var(--warn); }
.sev-laag { color: var(--ink); background: #e6ecf2; }
.st-toegestaan, .st-actief, .st-opgelost { color: #fff; background: var(--ok); border-color: var(--ok); }
.st-open { color: var(--bad); border-color: var(--bad); background: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }

/* Formulieren */
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--field); border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--navy2); }
textarea { width: 100%; min-height: 70px; }
label { display: block; font-size: 12.5px; color: var(--muted); }
label input, label select, label textarea { display: block; width: 100%; margin-top: 3px; color: var(--ink); }
.stack > * + * { margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
button, .button { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--field); background: #fff; color: var(--ink); cursor: pointer; display: inline-block; }
button:hover, .button:hover { background: var(--bg); text-decoration: none; }
button.primary, .button.primary { background: var(--brand); color: var(--coal); border-color: var(--brand); font-weight: 600; }
button.primary:hover, .button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--coal); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.link { border: none; background: none; color: var(--link); padding: 0; }
button.small, .button.small { padding: 3px 9px; font-size: 12.5px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.filters label { min-width: 140px; }

/* Meldingen */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: #e6f4ec; color: var(--ok); }
.flash.err { background: #fbe9e7; color: var(--bad); }
.notice { background: var(--accent-soft); border-left: 3px solid var(--brand); border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }

/* Inlogpagina's */
body.plain { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 12px; }
.card.login { width: 380px; padding: 28px; }
.card.login h1 { text-align: center; margin-top: 16px; }
input.code { font-size: 22px; letter-spacing: 6px; text-align: center; }
.qr { border: 1px solid var(--line); border-radius: 6px; }
.secret { font-size: 14px; letter-spacing: 1px; }
ol.steps { padding-left: 20px; color: var(--muted); }

/* Paginering, tabs */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

/* Netwerkkaart */
#graph { height: calc(100vh - 220px); min-height: 480px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 4px; }
.graph-info { min-height: 40px; }

/* Balkjes (server-side grafieken) */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 60px; }
.bars span { flex: 1; background: var(--accent); opacity: .75; min-height: 1px; border-radius: 2px 2px 0 0; }
.meter { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }

.htmx-request { opacity: .6; transition: opacity .2s; }
.hidden { display: none !important; }
pre { overflow-x: auto; }
details > summary { cursor: pointer; }
.tablewrap th { top: 0; }
label input[type=checkbox], label input[type=radio] { display: inline-block; width: auto; margin: 0 6px 0 0; vertical-align: middle; }
/* Licentiemelding */
.licbar { padding: 9px 14px; border-radius: 6px; margin-bottom: 14px; background: #fff4e0; color: #7a4a00; border: 1px solid #f0d49c; }
.licbar.bad { background: #fbe9e7; color: var(--bad); border-color: #f1b8b2; }
.bigid { font-size: 20px; letter-spacing: 2px; }

/* IPv6-schakelaar in de bovenbalk */
.v6toggle { margin: 0; }
.v6toggle .pill { border-radius: 999px; padding: 3px 10px; font-size: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.v6toggle .pill.on { color: var(--ok); border-color: currentColor; }
.v6toggle .pill.off { color: var(--muted); }

/* Zonekeuze op de netwerkkaart */
.zonepick { display: flex; flex-direction: column; gap: 4px; }
.zonepick .lbl { font-size: 12px; color: var(--muted); }
details.dropdown { position: relative; }
details.dropdown > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: 7px 28px 7px 10px; background: var(--card); min-width: 150px; position: relative; }
details.dropdown > summary::after { content: "▾"; position: absolute; right: 10px; top: 7px; color: var(--muted); }
details.dropdown > summary::-webkit-details-marker { display: none; }
details.dropdown .dropdown-body { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 300px; max-height: 360px; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.dropdown-body label.check { display: flex; gap: 8px; align-items: center; padding: 3px 0; color: var(--ink); font-size: 13px; }
.dropdown-body label.check input { width: auto; margin: 0; }
.dropdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
ul.steps { list-style: none; padding: 0; margin: 0 0 10px; font-size: 13px; }
ul.steps li { padding: 3px 0; overflow-wrap: anywhere; }
ul.steps li.ok { color: var(--ok); } ul.steps li.bad { color: var(--bad); font-weight: 600; }
.card h3 { font-size: 14px; margin: 18px 0 6px; }
.card label.row { margin: 8px 0; }

/* Console (2.4.0): tegels per klant en toestand */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--muted); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); }
.tile:hover { text-decoration: none; border-color: var(--brand); }
.tile > div + div { margin-top: 4px; }
.tile.st-groen { border-left-color: var(--ok); }
.tile.st-oranje { border-left-color: var(--warn); }
.tile.st-rood { border-left-color: var(--bad); }
.state { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); }
.state.st-groen { color: #fff; background: var(--ok); border-color: var(--ok); }
.state.st-oranje { color: #fff; background: var(--warn); border-color: var(--warn); }
.state.st-rood { color: #fff; background: var(--bad); border-color: var(--bad); }
.card.request { border-left: 4px solid var(--brand); }

/* Smal scherm (telefoon, tablet staand): menu boven als scrollbare balk. */
@media (max-width: 760px) {
  header.top { padding: 0 12px; gap: 10px; }
  header.top .customer { display: none; }
  .shell { flex-direction: column; }
  nav.side { width: auto; height: auto; position: sticky; top: 52px; z-index: 9; display: flex; overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
  nav.side a { padding: 10px 12px; border-left: 0; border-bottom: 3px solid transparent; }
  nav.side a.on { border-bottom-color: var(--brand); }
  nav.side .ver { display: none; }
  main { padding: 16px 16px 48px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  pre, .mono, code { overflow-wrap: anywhere; word-break: break-word; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }
  dl.fields { grid-template-columns: 1fr; gap: 2px 0; }
  dl.fields dd { margin-bottom: 8px; }
}
details.remove { display: inline-block; margin-left: 6px; vertical-align: top; }
details.remove > summary { color: var(--bad); cursor: pointer; list-style: none; }
details.remove > summary::-webkit-details-marker { display: none; }
details.remove[open] { display: block; margin: 6px 0 0; }

/* IOC-dashboard: staafjes per dag */
.iocbars { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 6px 0 4px; }
.iocbar { flex: 1; height: 100%; display: flex; align-items: flex-end; background: var(--bg); border-radius: 2px; }
.iocbar span { display: block; width: 100%; background: var(--bad, #b3261e); border-radius: 2px; min-height: 0; }
.matrix select.changed { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Gezondheid (2.11.0): grafieken van CPU, geheugen en schijven */
.hs-charts { margin-top: 12px; }
.hchart { position: relative; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 8px; }
.hchart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.hchart svg { display: block; width: 100%; height: auto; overflow: visible; }
.hchart .hc-grid { stroke: var(--line); stroke-width: 1; }
.hchart .hc-base, .hchart .hc-tick { stroke: var(--field); stroke-width: 1; }
.hchart .hc-ylab { font-size: 10px; fill: var(--muted); text-anchor: end; }
.hchart .hc-xlab { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.hchart .hc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hchart .hc-lim-warn { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 3; fill: var(--warn); }
.hchart .hc-lim-bad { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 3; fill: var(--bad); }
.hchart text.hc-limlab { stroke: none; font-size: 10px; }
.hchart .hc-cross { stroke: var(--muted); stroke-width: 1; }
.hchart .hc-dot { stroke: var(--card); stroke-width: 2; }
.hc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink); margin-top: 4px; }
.hc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.hc-tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; box-shadow: 0 2px 8px rgba(15,29,46,.12); white-space: nowrap; z-index: 5; }
.hc-tip b { font-weight: 600; }
.hc-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.hs-meter.warn span { background: var(--warn); } .hs-meter.bad span { background: var(--bad); }
.hs-warn { color: var(--warn); } .hs-bad { color: var(--bad); }
.hs-overview tr.on td { background: var(--accent-soft); }
.seg { display: inline-flex; border: 1px solid var(--field); border-radius: 6px; overflow: hidden; }
.seg a { padding: 4px 12px; font-size: 13px; color: var(--ink); }
.seg a + a { border-left: 1px solid var(--field); }
.seg a.on { background: var(--accent-soft); font-weight: 600; }
.seg a:hover { text-decoration: none; background: var(--bg); }
.hs-na .v { color: var(--muted); }

/* 2.12.0: submenu (Ruimtes onder Zones en conduits, BIO2 onder Rapporten). */
nav.side a.sub { padding: 5px 20px 5px 36px; font-size: 13px; color: var(--muted); }
nav.side a.sub.on { color: var(--ink); }
@media (max-width: 760px) { nav.side a.sub { padding: 10px 12px; font-size: inherit; } }
.asset-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin-bottom: 8px; }
.asset-rules label { display: flex; gap: 6px; align-items: center; color: var(--ink); font-size: 13px; margin: 0; }
.asset-rules input { width: auto; }
.notify-dest { margin-bottom: 10px; }
.notify-dest h3 { font-size: 15px; }
.cert-modes { display: grid; gap: 8px; }
.cert-modes label { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); margin: 0; }
.cert-modes input { width: auto; margin-top: 3px; }
