/* Lelibyte Monitor – aanvullingen op de huisstijl van de helpdesk (style.css) */
:root {
  --st-up: #15803d; --st-up-soft: #e2f5ea;
  --st-warn: #c2570c; --st-warn-soft: #fdf1dc;
  --st-down: #b42318; --st-down-soft: #fde6e3;
  --st-none: #94a3b8; --st-none-soft: #eef2f7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --st-up: #4ade80; --st-up-soft: #0f3324;
    --st-warn: #fb923c; --st-warn-soft: #3a2a10;
    --st-down: #f87171; --st-down-soft: #43191a;
    --st-none: #64748b; --st-none-soft: #16223f;
  }
}
:root[data-theme="dark"] {
  --st-up: #4ade80; --st-up-soft: #0f3324;
  --st-warn: #fb923c; --st-warn-soft: #3a2a10;
  --st-down: #f87171; --st-down-soft: #43191a;
  --st-none: #64748b; --st-none-soft: #16223f;
}

/* Status: stip + woord */
.st { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; white-space: nowrap; }
.st::before { content: ""; width: .62rem; height: .62rem; border-radius: 50%; background: var(--st-none); flex: none; }
.st-up::before { background: var(--st-up); }
.st-warn::before { background: var(--st-warn); }
.st-down::before { background: var(--st-down); box-shadow: 0 0 0 3px var(--st-down-soft); }
.st-up { color: var(--st-up); } .st-warn { color: var(--st-warn); } .st-down { color: var(--st-down); }
.st-onbekend, .st-pauze { color: var(--muted); }

/* Kop van het overzicht: één duidelijke regel over de hele omgeving */
.board-head { display: flex; align-items: stretch; gap: 1.25rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.verdict { flex: 1 1 320px; border-left: 6px solid var(--st-none); padding: .25rem 0 .25rem 1rem; }
.verdict-up { border-color: var(--st-up); } .verdict-warn { border-color: var(--st-warn); }
.verdict-down { border-color: var(--st-down); }
.verdict h1 { font-size: 2rem; }
.verdict p { margin: .25rem 0 0; color: var(--muted); }
.tally { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.tally div { display: flex; flex-direction: column; }
.tally strong { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tally span { font-size: .85rem; color: var(--muted); }
.tally .t-down strong { color: var(--st-down); } .tally .t-warn strong { color: var(--st-warn); }
.tally .t-up strong { color: var(--st-up); }

/* Apparaatregels met een rij sensortegels */
.board { list-style: none; margin: 0; padding: 0; }
.board li + li { border-top: 1px solid var(--line); }
.dev { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 13rem; gap: 1rem; align-items: center;
       padding: .7rem 0; }
.dev-name { min-width: 0; }
.dev-name a { font-weight: 500; color: var(--ink); text-decoration: none; }
.dev-name a:hover { text-decoration: underline; }
.dev-name .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiles { display: flex; flex-wrap: wrap; gap: 4px; }
.tile { width: 22px; height: 22px; border-radius: 4px; background: var(--st-none-soft); border: 2px solid var(--st-none);
        display: block; }
.tile-up { background: var(--st-up); border-color: var(--st-up); }
.tile-warn { background: var(--st-warn-soft); border-color: var(--st-warn); }
.tile-down { background: var(--st-down); border-color: var(--st-down); }
.tile-pauze { background: repeating-linear-gradient(45deg, var(--st-none-soft) 0 3px, transparent 3px 6px); }
.tile:hover, .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dev-side { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; }
.group-title { font-family: var(--display); font-size: .95rem; color: var(--muted); margin: 0 0 .25rem; font-weight: 600; }
.group-title + .board { margin-bottom: 1.25rem; }

/* Problemen bovenaan */
.problems { list-style: none; margin: 0; padding: 0; }
.problems li { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: .75rem; padding: .5rem 0;
               align-items: baseline; }
.problems li + li { border-top: 1px solid var(--line); }
.problems .msg { color: var(--muted); }

/* Sensortabel op de apparaatpagina */
table.sensors td { vertical-align: middle; }
table.sensors .val { font-family: var(--mono); font-size: .88rem; white-space: nowrap; }
table.sensors .msg { color: var(--muted); font-size: .9rem; max-width: 34ch; }
.spark { display: block; }
.spark-empty { font-size: .8rem; color: var(--muted); }
tr.is-paused td { opacity: .6; }

/* Grafiek */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--sans); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.chart .dot { fill: var(--accent); }
.chart .lim-warn { stroke: var(--st-warn); stroke-dasharray: 5 4; }
.chart .lim-crit { stroke: var(--st-down); stroke-dasharray: 5 4; }
.chart .lim-warn-t { fill: var(--st-warn); } .chart .lim-crit-t { fill: var(--st-down); }

/* Tijdlijn van gebeurtenissen */
.evs { list-style: none; margin: 0; padding: 0; }
.evs li { display: grid; grid-template-columns: 8.5rem 9rem minmax(0, 1fr); gap: .75rem; padding: .45rem 0; font-size: .93rem; }
.evs li + li { border-top: 1px solid var(--line); }
.evs .when { color: var(--muted); white-space: nowrap; }
.evs .what { min-width: 0; }

/* Agent-opdrachten */
.cmd { position: relative; background: var(--side); color: #e2e8f0; border-radius: 8px; padding: .9rem 1rem;
       font-family: var(--mono); font-size: .82rem; line-height: 1.55; white-space: pre-wrap; word-break: break-all;
       margin: .5rem 0 1rem; }
.cmd button { position: absolute; top: .5rem; right: .5rem; font: inherit; font-family: var(--sans); font-size: .78rem;
              background: rgba(255,255,255,.08); color: #e2e8f0; border: 1px solid rgba(255,255,255,.2);
              border-radius: 5px; padding: .15rem .55rem; cursor: pointer; }
.cmd button:hover { background: rgba(255,255,255,.16); }
.steps { margin: .25rem 0 1rem 1.2rem; padding: 0; }
.steps li { margin: .2rem 0; }

/* Keuze van het sensortype */
.typepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; margin-bottom: 1.25rem; }
.typepick a { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; text-decoration: none;
              color: var(--ink); background: var(--surface); }
.typepick a:hover { border-color: var(--accent); }
.typepick a[aria-current] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.typepick strong { display: block; font-weight: 500; }
.typepick span { font-size: .82rem; color: var(--muted); }

.pick-list { list-style: none; margin: 0 0 1rem; padding: 0; columns: 2 300px; }
.pick-list li { break-inside: avoid; padding: .2rem 0; }
.pick-list label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.pick-list input { width: auto; }

.pill.prio-kritiek { background: var(--st-down-soft); color: var(--st-down); border-color: transparent; }
.pill.prio-hoog { background: var(--st-warn-soft); color: var(--st-warn); border-color: transparent; }
.big-num { font-family: var(--display); font-size: 1.5rem; font-weight: 600; }
.notice { background: var(--warn-bg); color: var(--warn-ink); padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.notice a { color: inherit; }
.inline { display: inline; }
.fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; margin: 0; }
.fieldset legend { font-family: var(--display); font-weight: 600; padding: 0 .35rem; }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }

@media (max-width: 860px) {
  .dev { grid-template-columns: 1fr; gap: .4rem; }
  .dev-side { justify-content: flex-start; }
  .problems li, .evs li { grid-template-columns: 1fr; gap: .1rem; }
  table.sensors .spark-cell { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .st-down::before { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
}

/* Switch uitlezen */
.vlan-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip { font: inherit; font-size: .88rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
        border-radius: 999px; padding: .2rem .75rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.pick-actions { display: flex; gap: 1rem; margin: 0 0 .5rem; }
table.ports td { vertical-align: middle; }
table.ports select { width: auto; padding: .3rem .45rem; font-size: .88rem; }
table.ports input[type=checkbox] { width: auto; }
table.ports .vl .pill { margin-right: .3rem; }

/* Beveiliging */
.sec-tally { margin-bottom: 1.5rem; gap: 2rem; }
.sec-tally span { max-width: 13rem; }
table.sec td { vertical-align: top; }
details.upd summary { cursor: pointer; display: inline; }
details.upd ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .88rem; max-width: 60ch; }
.sec-list li { grid-template-columns: 9rem minmax(0, 1fr); }
details.upd summary { color: var(--accent); text-decoration: underline; }
.grid2 + .hint { margin-top: 1.25rem; }

/* ---------- Boomweergave (zoals PRTG) ---------- */
.view-switch { display: flex; align-items: center; gap: .25rem; margin: 0 0 .75rem; flex-wrap: wrap; }
.view-switch a { padding: .25rem .8rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none;
                 color: var(--ink); background: var(--surface); font-size: .9rem; }
.view-switch a[aria-current] { background: var(--accent); color: #fff; border-color: var(--accent); }
.view-switch .linkish { margin-left: .75rem; font-size: .88rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tree { padding-top: .75rem; }
.tnode > summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .3rem 0;
                   min-height: 2rem; }
.tnode > summary::-webkit-details-marker { display: none; }
.tbox { width: 13px; height: 13px; border: 1px solid var(--muted); border-radius: 2px; position: relative; flex: none;
        background: var(--surface); }
.tbox::before, .tbox::after { content: ""; position: absolute; background: var(--muted); }
.tbox::before { left: 2px; right: 2px; top: 5px; height: 1px; }
.tbox::after { top: 2px; bottom: 2px; left: 5px; width: 1px; }
.tnode[open] > summary .tbox::after { display: none; }
.ticon { width: 20px; height: 20px; flex: none; display: inline-flex; color: var(--muted); }
.ticon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ticon svg .fill { fill: currentColor; stroke: none; }
.st-c-down { color: var(--st-down); } .st-c-warn { color: var(--st-warn); }
.tname { font-weight: 500; color: var(--ink); text-decoration: none; }
a.tname:hover { text-decoration: underline; }
.tgroup > summary .tname { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.tgroup.depth-0 > summary .tname { font-size: 1.2rem; }
.tmeta { margin-left: .25rem; }
.tstate { margin-left: auto; font-size: .88rem; }
.tchildren { margin-left: 6px; padding-left: 1.15rem; border-left: 1px dotted var(--line); }
.tgroup + .tgroup { margin-top: .35rem; }

.stiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px;
          margin: .15rem 0 .75rem calc(13px + 1.5rem); max-width: 1040px; }
.stile { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto auto;
         min-height: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
         text-decoration: none; color: var(--ink); overflow: hidden; }
.stile:hover { border-color: var(--accent); box-shadow: 0 1px 4px rgba(11, 21, 48, .12); }
.stile-flag { grid-row: 1 / 3; display: flex; align-items: flex-start; justify-content: center; padding-top: .3rem;
              color: #fff; font-weight: 700; font-size: .85rem; background: var(--st-none); }
.stile-up .stile-flag { background: var(--st-up); }
.stile-warn .stile-flag { background: var(--st-warn); }
.stile-down .stile-flag { background: var(--st-down); }
.stile-down { background: var(--st-down-soft); border-color: var(--st-down); }
.stile-warn { background: var(--st-warn-soft); }
.stile-pauze { opacity: .7; }
.stile.is-pending .stile-flag { background: repeating-linear-gradient(45deg, var(--st-warn) 0 4px, var(--st-up) 4px 8px); }
.stile-name { padding: .3rem .5rem 0; font-size: .86rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stile-val { padding: 0 .5rem .3rem; text-align: right; font-size: .8rem; color: var(--muted); align-self: end;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stile-down .stile-val { color: var(--st-down); font-weight: 500; }
.stile-add { border-style: dashed; color: var(--muted); }
.stile-add .stile-flag { background: transparent; color: var(--accent); font-size: 1.1rem; padding-top: .15rem; }
.stile-add .stile-name { align-self: center; grid-row: 1 / 3; padding-top: 0; }
@media (max-width: 860px) {
  .stiles { margin-left: 0; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
  .tchildren { padding-left: .6rem; }
  .tmeta { display: none; }
}

/* Meldingen */
table.rules td { vertical-align: top; }
table.rules .actions { white-space: nowrap; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
fieldset.checks { border: 0; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }
fieldset.checks legend { font-weight: 500; margin-bottom: .35rem; padding: 0; }
.test-mail { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1.25rem; padding-top: 1.25rem;
             border-top: 1px solid var(--line); }
.test-mail label { flex: 1 1 260px; }
details.howto { background: var(--bg); border-radius: 6px; padding: .6rem .9rem; }
details.howto summary { cursor: pointer; font-weight: 500; }
.maillog { grid-template-columns: 8.5rem 7rem minmax(0, 1fr) !important; }
[hidden] { display: none !important; }

/* Stil, onderhoud en bevestigen */
.mute-banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: 6px; padding: .55rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.mute-banner a { color: inherit; font-weight: 500; }
.mute-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.mute-row label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }
.mute-row label select, .mute-row label input { width: auto; min-width: 16rem; }
.pause-form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; margin-bottom: .5rem; }
.rule-mute { display: inline-block; }
.rule-mute summary { list-style: none; display: inline; }
.rule-mute summary::-webkit-details-marker { display: none; }
.rule-mute form { display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap; }
.rule-mute select { width: auto; }
.ack-panel { border-left: 4px solid var(--st-down); }
.ack-panel.is-acked { border-left-color: var(--accent); }
.ack-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.ack-form label { flex: 1 1 300px; display: flex; flex-direction: column; gap: .35rem; font-weight: 500; }
.ack-pill { background: var(--accent); color: #fff; border-color: transparent; }
.stile.is-acked .stile-flag { background: var(--accent); }
.stile.is-acked .stile-flag::after { content: ""; }

/* Instellingen */
.settings-head { margin-bottom: .75rem; }
.settings-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; }
.settings-tabs a { padding: .5rem .85rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tabs a:hover { color: var(--ink); }
.settings-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.sr-title { font-size: 1.1rem; }
.me-role { display: block; font-size: .75rem; opacity: .75; }
.role-pill { display: inline-block; font-size: .78rem; padding: 0 .5rem; border-radius: 999px; border: 1px solid currentColor; }
.role-admin { color: var(--accent); } .role-viewer { color: var(--muted); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .35rem .9rem; }
.pick-grid label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.pick-grid input { width: auto; }
.user-row { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 1.4fr) 10rem auto; gap: .5rem; align-items: center; }
@media (max-width: 860px) { .user-row { grid-template-columns: 1fr; } }
.inline-num { display: inline-flex; align-items: center; gap: .5rem; font-weight: 400; }
.inline-num input { width: 6rem; }
.delay-field { display: flex; flex-direction: column; gap: .35rem; }
.delay-field > label:first-child { font-weight: 500; }
.delay-field input[inputmode] { max-width: 8rem; }
.roles-explain { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .5rem 1rem; margin: 0 0 .75rem; }
.roles-explain dd { margin: 0; }
.cg-row { grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr) auto !important; align-items: baseline; }
.cg-actions { display: flex; gap: .75rem; }
fieldset.checks:has(.pick-grid) { display: block; }
fieldset.checks .pick-grid { margin-top: .2rem; }

/* Rechtensets */
.perm-chip { display: inline-block; font-size: .8rem; padding: .05rem .5rem; margin: .1rem .25rem .1rem 0; border-radius: 4px;
             background: var(--bg); border: 1px solid var(--line); }
.perm-chip.all { background: var(--accent); color: #fff; border-color: var(--accent); }
table.roles-table td { vertical-align: top; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0; }
.perm-group { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin: 0; }
.perm-group legend { font-family: var(--display); font-weight: 600; padding: 0 .35rem; }
.perm { display: flex !important; flex-direction: row !important; gap: .6rem; align-items: flex-start; padding: .4rem 0; font-weight: 400 !important; }
.perm input { width: auto; margin-top: .2rem; }
.perm > span { display: flex; flex-direction: column; }
.perm-list { margin: 0; padding-left: 1.1rem; columns: 2 220px; }

/* Probes */
.probe-card { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin-bottom: .75rem; }
.probe-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.probe-head .actions { display: flex; gap: .9rem; align-items: baseline; flex-wrap: wrap; }
.probe-card details { margin-top: .5rem; }
.probe-card summary { cursor: pointer; font-weight: 500; }
.probe-line { margin: -.75rem 0 1rem; font-size: .92rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.probe-pill { background: var(--cyan-soft, #e0f6fa); color: var(--ink); border-color: transparent; }
.probe-pill.is-off { background: var(--st-down-soft); color: var(--st-down); }
.spinner { display: inline-block; width: .9rem; height: .9rem; border: 2px solid var(--line); border-top-color: var(--accent);
           border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.cmd { padding-right: 6.5rem; }
