/* De statuspagina van de Wachter: dezelfde beeldtaal als /beheer van de apps (docs/plan-2026-11-27, F5).
   Donker, monospace, panelen met dunne randen, kleine kolomkoppen, één kleur die iets zegt: de stand. */

:root {
  --bg: #16161e; --paneel: #1a1b26; --paneel-2: #1f2335; --hover: #24283b;
  --rand: #292e42; --rand-sterk: #3b4261;
  --tekst: #c0caf5; --tekst-2: #a9b1d6; --dim: #8089b8;
  --blauw: #7aa2f7; --groen: #9ece6a; --geel: #e0af68; --rood: #f7768e; --grijs: #8089b8;
  --mono: "JetBrains Mono", "JetBrainsMono Nerd Font", "CaskaydiaMono Nerd Font", "Cascadia Mono", "Fira Code",
    ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--tekst); font-family: var(--mono); font-size: .875rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100vh; min-height: 100dvh;
}
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--blauw); }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--blauw) 35%, transparent); }
:focus-visible { outline: 2px solid var(--blauw); outline-offset: 2px; }
.sla-over { position: absolute; left: -999px; top: 0; background: var(--blauw); color: var(--bg); padding: .5rem .8rem; z-index: 20; }
.sla-over:focus { left: .5rem; top: .5rem; }
.alleen-lezer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- bovenbalk: als een statusbalk ---- */
.balk { position: sticky; top: 0; z-index: 10; background: var(--paneel); border-bottom: 1px solid var(--rand); }
.balk-rij { max-width: 1240px; margin: 0 auto; padding: .55rem 1.25rem; display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
.merk { color: var(--tekst); font-weight: 700; letter-spacing: .02em; text-decoration: none; margin-right: .3rem; }
.merk::before { content: "◆ "; color: #bb9af7; }
.balk-naam { color: var(--dim); font-size: .75rem; }
.balk-rechts { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.ververst { color: var(--dim); font-size: .75rem; white-space: nowrap; }
.ververst.oud { color: var(--geel); }

.periode { display: inline-flex; border: 1px solid var(--rand-sterk); border-radius: 6px; overflow: hidden; }
.periode button { background: transparent; border: 0; border-right: 1px solid var(--rand-sterk); padding: .3rem .75rem; font-size: .75rem; cursor: pointer; color: var(--tekst-2); min-height: 32px; }
.periode button:last-child { border-right: 0; }
.periode button:hover { background: var(--hover); color: var(--tekst); }
.periode button[aria-pressed="true"] { background: var(--blauw); color: var(--bg); font-weight: 700; }
.periode button:focus-visible { outline-offset: -2px; }

.knop { font-size: .75rem; padding: .3rem .7rem; border: 1px solid var(--rand-sterk); border-radius: 5px; background: transparent; color: var(--tekst-2); cursor: pointer; min-height: 32px; text-decoration: none; display: inline-flex; align-items: center; }
.knop:hover { background: var(--hover); border-color: var(--blauw); color: var(--tekst); }
.balk form { margin: 0; }

/* ---- pagina ---- */
.hoofd { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }
.paginakop { display: flex; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.paginakop h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.paginakop .telling { color: var(--dim); font-size: .78rem; }
.terug { font-size: .78rem; text-decoration: none; display: inline-block; margin-bottom: .5rem; }
.terug:hover { text-decoration: underline; }

/* het oordeel: één regel, de kleur van de stand links */
.oordeel { display: flex; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; margin: 0 0 1rem; background: var(--paneel);
  border: 1px solid var(--rand); border-left: 3px solid var(--stand, var(--grijs)); border-radius: 8px; }
.oordeel .zin { font-size: 1.05rem; font-weight: 700; color: var(--stand, var(--grijs)); }
.oordeel .sub { color: var(--dim); font-size: .78rem; }
.groen { --stand: var(--groen); } .oranje { --stand: var(--geel); } .rood { --stand: var(--rood); } .grijs { --stand: var(--grijs); }

.chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; font-weight: 600; color: var(--stand, var(--grijs)); white-space: nowrap;
  padding: .1rem .55rem .1rem .45rem; border: 1px solid color-mix(in srgb, var(--stand, var(--grijs)) 45%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--stand, var(--grijs)) 10%, transparent); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--stand, var(--grijs)); }

.paneel { background: var(--paneel); border: 1px solid var(--rand); border-radius: 8px; min-width: 0; margin-bottom: .9rem; }
.paneel-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--rand); }
.paneel-kop h2 { font-size: .75rem; font-weight: 600; color: var(--tekst-2); letter-spacing: .06em; }
.paneel-kop h2::before { content: "~/"; color: var(--dim); font-weight: 400; }
.paneel-kop span { font-size: .75rem; color: var(--dim); }
.paneel-lijf { padding: 1rem 1.1rem; }
.uitleg { color: var(--dim); font-size: .78rem; max-width: 80ch; }
.leeg { color: var(--dim); padding: 1.2rem 1.1rem; font-size: .8125rem; }

/* ---- de vloot: een kaart per app ---- */
.kaart { display: block; color: inherit; text-decoration: none; padding: 1rem 1.1rem 1.1rem; border-top: 1px solid var(--rand); }
.kaart:first-child { border-top: 0; }
.kaart:hover { background: var(--hover); }
.kaart:focus-visible { outline-offset: -2px; }
.kaart-kop { display: flex; align-items: center; gap: .3rem .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.kaart-kop h2 { font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.kaart-kop .meta { color: var(--dim); font-size: .75rem; margin-left: auto; }
.reden { flex-basis: 100%; color: var(--stand, var(--dim)); font-size: .78rem; margin-top: -.2rem; }
.signalen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.tegel { min-width: 0; border: 1px solid var(--rand); border-radius: 8px; padding: .8rem .95rem .7rem; background: var(--bg); background: color-mix(in srgb, var(--bg) 55%, var(--paneel)); }
.tegel .kop { font-size: .6875rem; letter-spacing: .08em; color: var(--dim); margin-bottom: .3rem; }
.tegel .getal { font-size: 1.55rem; font-weight: 700; line-height: 1.15; color: var(--tekst); overflow-wrap: anywhere; }
.tegel .getal small { font-size: .75rem; font-weight: 400; color: var(--dim); margin-left: .25rem; }
.tegel .sub { color: var(--dim); font-size: .72rem; min-height: 1.1rem; margin-bottom: .35rem; overflow-wrap: anywhere; }
.vonk { display: block; width: 100%; height: 34px; color: var(--blauw); overflow: visible; }
.vonk path.lijn { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.vonk path.vlak { fill: currentColor; opacity: .12; stroke: none; }
.vonk .nul { stroke: var(--rand-sterk); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.vonk-klein { height: 20px; min-width: 70px; }
.wachterkaart { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .9rem 1.1rem; border-top: 1px solid var(--rand); }
.wachterkaart h2 { font-size: .9rem; font-weight: 700; }
.wachterkaart .meta { color: var(--dim); font-size: .75rem; }

/* ---- detail: de grote grafieken ---- */
.grafieken { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-bottom: .9rem; }
.grafieken .paneel { margin: 0; }
.grafieken .breed { grid-column: 1 / -1; }
.kernen { display: flex; gap: .4rem 1.6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.kernen div { min-width: 0; }
.kernen dt { font-size: .6875rem; letter-spacing: .08em; color: var(--dim); }
.kernen dd { font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
.kernen dd small { font-size: .72rem; font-weight: 400; color: var(--dim); margin-left: .25rem; }
.grafiek { position: relative; width: 100%; min-height: 168px; }
.grafiek svg { display: block; width: 100%; touch-action: pan-y; }
.grafiek svg:focus-visible { outline-offset: 0; border-radius: 4px; }
.grafiek .as text { fill: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.grafiek .raster { stroke: var(--rand); stroke-width: 1; }
.grafiek .l1 { fill: none; stroke: var(--blauw); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.grafiek .l2 { fill: none; stroke: var(--tekst-2); stroke-width: 1.3; stroke-dasharray: 4 3; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.grafiek .vlak { fill: var(--blauw); opacity: .1; }
.grafiek .kruis { stroke: var(--rand-sterk); stroke-width: 1; }
.grafiek .punt1 { fill: var(--blauw); stroke: var(--paneel); stroke-width: 2; }
.grafiek .punt2 { fill: var(--tekst-2); stroke: var(--paneel); stroke-width: 2; }
.grafiek .leeg-tekst { fill: var(--dim); font-size: 12px; font-family: var(--mono); }
.tip { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; background: var(--paneel-2); border: 1px solid var(--rand-sterk); border-radius: 6px;
  padding: .35rem .6rem; font-size: .72rem; line-height: 1.45; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.tip[hidden] { display: none; }
.tip .t { color: var(--dim); }
.legenda { display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; color: var(--dim); font-size: .72rem; margin-top: .4rem; }
.legenda i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--blauw); vertical-align: middle; margin-right: .4rem; }
.legenda i.streep { border-top: 2px dashed var(--tekst-2); }

/* ---- tabellen ---- */
.schuif { overflow-x: auto; }
.tabel { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.tabel th { text-align: left; font-size: .6875rem; font-weight: 500; letter-spacing: .08em; color: var(--dim); padding: .55rem 1.1rem; border-bottom: 1px solid var(--rand); white-space: nowrap; text-transform: lowercase; }
.tabel td { padding: .6rem 1.1rem; border-bottom: 1px solid color-mix(in srgb, var(--rand) 60%, transparent); vertical-align: top; }
.tabel tr:last-child td { border-bottom: 0; }
.tabel tbody tr:hover { background: var(--hover); }
.tabel .num { text-align: right; white-space: nowrap; }
.tabel td:nth-child(2) { white-space: nowrap; }
.paneel-kop h2 { white-space: nowrap; }
.tabel tr.groep td { padding: .5rem 1.1rem; color: var(--tekst-2); font-size: .72rem; letter-spacing: .06em; background: var(--paneel-2); }
.tabel tr.groep:hover { background: var(--paneel-2); }
.naam { color: var(--tekst); font-weight: 600; }
.meta { color: var(--dim); font-size: .75rem; }
.fout-tekst { color: var(--rood); }
.stip { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .45rem; vertical-align: 1px; background: var(--stand, var(--grijs)); }
.etiket { display: inline-block; font-size: .6875rem; font-weight: 600; padding: .05rem .4rem; border-radius: 4px; color: var(--geel); background: color-mix(in srgb, var(--geel) 14%, transparent); margin-left: .4rem; }
.tabel td.cel-vonk { min-width: 110px; }
.tabel th:first-child, .tabel td:first-child { position: sticky; left: 0; background: var(--paneel); z-index: 1; }
.tabel tbody tr:hover td:first-child { background: var(--hover); }
.tabel tr.groep td:first-child { background: var(--paneel-2); }

.machine { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; padding: 1rem 1.1rem; }

.voet { color: var(--dim); font-size: .72rem; border-top: 1px solid var(--rand); padding-top: .8rem; margin-top: 1.2rem; }
.melding { padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid var(--rand); border-left: 3px solid var(--geel); border-radius: 8px; background: var(--paneel); color: var(--geel); font-size: .8125rem; }

/* ---- inloggen ---- */
.inlog { max-width: 26rem; margin: 14vh auto 0; padding: 0 1.25rem; }
.inlog .paneel { padding: 1.6rem 1.5rem 1.5rem; }
.inlog h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: .3rem; }
.inlog h1::before { content: "◆ "; color: #bb9af7; }
.inlog p { color: var(--dim); font-size: .8125rem; margin-bottom: 1.1rem; }
.inlog label { display: block; font-size: .75rem; color: var(--tekst-2); margin-bottom: .35rem; }
.inlog input { width: 100%; font: inherit; font-size: .9rem; color: var(--tekst); background: var(--bg); border: 1px solid var(--rand-sterk); border-radius: 5px; padding: .6rem .7rem; min-height: 44px; }
.inlog input:focus { border-color: var(--blauw); outline: 1px solid var(--blauw); }
.inlog button { margin-top: 1rem; width: 100%; min-height: 44px; border-radius: 5px; border: 1px solid var(--blauw); background: var(--blauw); color: var(--bg); font-weight: 700; cursor: pointer; }
.inlog button:hover { background: #89b4fa; }
.inlog .fout { color: var(--rood); font-size: .8125rem; margin: .8rem 0 0; }

@media (max-width: 62rem) {
  .signalen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .machine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grafieken { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 34rem) {
  .balk-rij { padding: .5rem 1rem; }
  .balk-rechts { margin-left: auto; }
  .periode { order: 5; flex: 1 1 100%; }
  .periode button { flex: 1; min-height: 40px; }
  .knop { min-height: 40px; }
  .hoofd { padding: 1rem 1rem 2.5rem; }
  .signalen { gap: .6rem; }
  .tegel { padding: .65rem .7rem .6rem; }
  .tegel .getal { font-size: 1.3rem; }
  .kaart { padding: .9rem .85rem 1rem; }
  .kaart-kop .meta { margin-left: 0; flex-basis: 100%; }
  .oordeel { padding: .85rem 1rem; }
  .tabel th, .tabel td { padding-left: .8rem; padding-right: .8rem; }
  .paneel-lijf { padding: .9rem .85rem; }
  .kernen dd { font-size: 1.15rem; }
  .machine { padding: .85rem; gap: .6rem; }
  .paneel-kop .omschrijving { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .kaart, .knop, .periode button { transition: background-color .12s, border-color .12s; }
}
@media (prefers-contrast: more) {
  :root { --dim: #b4bcea; --rand: #4a5070; }
}

/* context in de grote grafieken: alarmbanden en drempels, geen accent */
.grafiek .band { fill: var(--tekst-2); opacity: .13; pointer-events: all; }
.grafiek .band:hover { opacity: .22; }
.grafiek .drempel { stroke: var(--tekst-2); stroke-width: 1; stroke-dasharray: 2 4; opacity: .8; }
.grafiek .as .drempel-tekst, .grafiek .drempel-tekst { fill: var(--dim); font-size: 10px; font-family: var(--mono); }

/* sprongen vanuit een alarm: de rij of het paneel licht even op, onder de vaste balk */
tr[id], section[id] { scroll-margin-top: 4.5rem; }
tr:target td { background: color-mix(in srgb, var(--blauw) 14%, transparent); }
.zin-link { color: inherit; text-decoration: none; }
.zin-link:hover { text-decoration: underline; }
.naam { overflow-wrap: normal; }

.tabel td:first-child { white-space: nowrap; }
.tabel-slices td:nth-child(3) { min-width: 9rem; }
.fout-regel { display: block; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meer { display: block; width: 100%; padding: .7rem 1.1rem; background: transparent; border: 0; border-top: 1px solid var(--rand); color: var(--blauw); font-size: .78rem; text-align: left; cursor: pointer; }
.meer:hover { background: var(--hover); }
.meer:focus-visible { outline-offset: -2px; }

.tabel-slices th, .tabel-slices td { padding-left: .75rem; padding-right: .75rem; }
.tabel-slices th:first-child, .tabel-slices td:first-child { padding-left: 1.1rem; }

.tabel .naam-link { color: var(--tekst); font-weight: 600; text-decoration: none; }
.tabel .naam-link:hover { text-decoration: underline; }
.tabel-alarmen td:nth-child(3) { white-space: normal; min-width: 14rem; }

/* smal scherm: een tabelrij is een compact blok, nooit zijwaarts scrollen */
@media (max-width: 34rem) {
  .schuif { overflow-x: visible; }
  .tabel thead { display: none; }
  .tabel, .tabel tbody, .tabel tr, .tabel td { display: block; width: 100%; }
  .tabel tr { position: relative; padding: .75rem .85rem; border-bottom: 1px solid color-mix(in srgb, var(--rand) 60%, transparent); }
  .tabel tr:last-child { border-bottom: 0; }
  .tabel td, .tabel td:first-child { display: inline-block; width: auto; padding: 0 .9rem 0 0; border: 0; text-align: left; white-space: normal; position: static; background: transparent; }
  .tabel td:first-child { display: block; width: 100%; font-size: .875rem; margin-bottom: .15rem; }
  .tabel td.num { text-align: left; }
  .tabel td::before { content: attr(data-l) " "; color: var(--dim); font-size: .6875rem; letter-spacing: .04em; margin-right: .25rem; }
  .tabel td:first-child::before, .tabel td.cel-vonk { content: none; display: none; }
  .tabel td:first-child::before { display: none; }
  .tabel tr.groep td { display: block; padding: 0; }
  .tabel tr.groep { padding: .5rem .85rem; }
  .tabel-slices td:nth-child(3) { display: block; width: 100%; min-width: 0; padding: .15rem 0; }
  .fout-regel { max-width: 100%; }
  .tabel td:empty { display: none; }
  /* alarmen: tijd, stip, tekst; de duur rechtsboven */
  .tabel-alarmen td::before { content: none; display: none; }
  .tabel-alarmen td:nth-child(1) { color: var(--dim); font-size: .75rem; }
  /* the time and the duration share the first line: time left, duration right, never on top of each other */
  .tabel-alarmen tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .6rem; }
  /* first line: time · app (or severity · part) left, duration right; then the text over the full width */
  .tabel-alarmen td { order: 2; width: auto; }
  .tabel-alarmen td:first-child { order: 1; width: auto; margin-bottom: 0; }
  .tabel-alarmen td:last-child { order: 3; margin-left: auto; padding: 0; color: var(--dim); font-size: .75rem; }
  .tabel-alarmen td.wat { order: 4; }
  .tabel-alarmen td.num { text-align: left; }
  .tabel-alarmen td:not(.wat):not(:first-child):not(:last-child) { font-size: .75rem; }
  .tabel-alarmen td.wat { flex: 1 1 100%; min-width: 0; margin-top: .2rem; font-size: .8125rem; }
}
.inlog input + label { margin-top: .9rem; }
