/* =====================================================================
   DVFlow – aanvullingen op app.css/lists.css (DVPortaal-stijl)
   Statuskleuren zoals PRTG: groen up, geel waarschuwing, rood down, oranje ongebruikelijk, blauw gepauzeerd, grijs onbekend.
   ===================================================================== */
:root {
    /* één bron van waarheid, gelijk aan DVFlow.Core.Model.StatusColors (mails, Teams, PDF, maps): altijd samen wijzigen */
    --st-up: #2e9e4f;
    --st-up-50: #e9f6ee;
    --st-up-ink: #1f7a3a;
    --st-warning: #f2b705;
    --st-warning-50: #fff6d6;
    --st-warning-ink: #8a6500;
    --st-down: #d71920;
    --st-down-50: #fdecec;
    --st-down-ink: #b3141a;
    --st-downack: #e0656b;
    --st-downack-50: #fbeaeb;
    --st-downack-ink: #a8323a;
    --st-unusual: #f57c00;
    --st-unusual-50: #fff0e0;
    --st-unusual-ink: #a85500;
    --st-paused: #4f8fd6;
    --st-paused-50: #e8f1fb;
    --st-paused-ink: #2f6fb5;
    --st-unknown: #9aa5ad;
    --st-unknown-50: #f0f2f4;
    --st-unknown-ink: #657782;
}

/* ---------- statuspillen (bovenbalk, boom, wallboard) */
.statuspills { display: inline-flex; gap: 4px; align-items: center; margin-right: 8px; text-decoration: none !important; }
.spill { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 4px;
         font-size: 12px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.spill.st-up { background: var(--st-up); }
.spill.st-warning { background: var(--st-warning); color: #3d2e00; }
.spill.st-down { background: var(--st-down); }
.spill.st-downack { background: var(--st-downack); }
.spill.st-unusual { background: var(--st-unusual); }
.spill.st-paused { background: var(--st-paused); }
.spill.st-unknown { background: var(--st-unknown); }
.spill--sm { min-width: 20px; height: 18px; font-size: 11px; padding: 0 5px; }

.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; text-align: center; }
.nav-badge--down { background: var(--st-down); }
.nav-badge--warn { background: var(--st-warning); color: #3d2e00; }

/* ---------- statusbadge (tekst met bolletje) */
.stbadge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.stbadge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stbadge.st-up { background: var(--st-up-50); color: var(--st-up-ink); }
.stbadge.st-warning { background: var(--st-warning-50); color: var(--st-warning-ink); }
.stbadge.st-down { background: var(--st-down-50); color: var(--st-down-ink); }
.stbadge.st-downack { background: var(--st-downack-50); color: var(--st-downack-ink); }
.stbadge.st-unusual { background: var(--st-unusual-50); color: var(--st-unusual-ink); }
.stbadge.st-paused { background: var(--st-paused-50); color: var(--st-paused-ink); }
.stbadge.st-unknown { background: var(--st-unknown-50); color: var(--slate-500); }
.stbadge--lg { font-size: 14px; padding: 4px 14px 4px 12px; }

/* ---------- cellen in DataList (CellCss) */
.cell-st-up { background: var(--st-up-50) !important; color: var(--st-up-ink); font-weight: 600; }
.cell-st-warning { background: var(--st-warning-50) !important; color: var(--st-warning-ink); font-weight: 600; }
.cell-st-down { background: var(--st-down-50) !important; color: var(--st-down-ink); font-weight: 600; }
.cell-st-downack { background: var(--st-downack-50) !important; color: var(--st-downack-ink); font-weight: 600; }
.cell-st-unusual { background: var(--st-unusual-50) !important; color: var(--st-unusual-ink); font-weight: 600; }
.cell-st-paused { background: var(--st-paused-50) !important; color: var(--st-paused-ink); }
.cell-st-unknown { background: var(--st-unknown-50) !important; color: var(--slate-500); }
.cell-link { color: var(--brand); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(223, 36, 73, .35); }

/* ---------- boom (Apparaten) */
.tree-layout { display: flex; gap: 16px; flex: 1; min-height: 0; }
.tree-panel { width: 360px; flex: none; background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm);
              display: flex; flex-direction: column; min-height: 0; }
.tree-panel__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--slate-100); }
.tree-panel__body { overflow: auto; padding: 6px 4px 12px; flex: 1; }
.tree-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.tnode { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; cursor: pointer; user-select: none; font-size: 13px; }
.tnode:hover { background: var(--slate-50); }
.tnode.is-selected { background: var(--brand-50); outline: 1px solid #f3c3cd; }
.tnode__toggle { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--slate-500); flex: none; }
.tnode__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tnode__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnode__name small { color: var(--text-muted); margin-left: 6px; }
.tnode__counts { display: inline-flex; gap: 3px; flex: none; }
.tchildren { margin-left: 16px; border-left: 1px dashed var(--slate-200); padding-left: 2px; }
.dot-st-up { background: var(--st-up); } .dot-st-warning { background: var(--st-warning); } .dot-st-down { background: var(--st-down); }
.dot-st-downack { background: var(--st-downack); } .dot-st-unusual { background: var(--st-unusual); } .dot-st-paused { background: var(--st-paused); }
.dot-st-unknown { background: var(--st-unknown); }

/* ---------- donuts (dashboard) */
.donut-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.donut-card { display: flex; align-items: center; gap: 22px; padding: 18px 22px; background: var(--slate-700); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.donut-card h3 { color: #fff; font-weight: 500; margin-top: 8px; text-align: center; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut__center { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; font-weight: 600; }
.donut-legend { display: grid; gap: 4px; font-size: 13px; }
.donut-legend a { color: #fff; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.donut-legend a:hover { text-decoration: underline; }
.donut-legend .muted { color: rgba(255, 255, 255, .6); }

/* ---------- sensordetail */
.sensor-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; background: var(--white); border: 1px solid var(--slate-200);
               border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.sensor-head__value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sensor-head__meta { display: grid; gap: 2px; font-size: 13px; color: var(--text-muted); }
.sensor-head__msg { flex: 1 1 100%; font-size: 13px; padding: 8px 12px; border-radius: 6px; background: var(--slate-50); }
.sensor-head__msg.st-down { background: var(--st-down-50); color: var(--st-down); }
.sensor-head__msg.st-warning { background: var(--st-warning-50); color: #8a6500; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }

.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gauge { padding: 12px 14px; background: var(--white); border: 1px solid var(--slate-200); border-left: 4px solid var(--st-unknown); border-radius: var(--radius-sm); }
.gauge.st-up { border-left-color: var(--st-up); } .gauge.st-warning { border-left-color: var(--st-warning); } .gauge.st-down { border-left-color: var(--st-down); }
.gauge.st-downack { border-left-color: var(--st-downack); } .gauge.st-unusual { border-left-color: var(--st-unusual); } .gauge.st-paused { border-left-color: var(--st-paused); }
.gauge__name { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge__value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.gauge__limits { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---------- grafiek (SVG) */
.chartcard { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px 14px; }
.chartcard__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.chartcard__head h3 { flex: 1; }
.linechart { width: 100%; height: 260px; display: block; }
.linechart .grid { stroke: var(--slate-100); stroke-width: 1; }
.linechart .axis { fill: var(--text-muted); font-size: 11px; }
.linechart .series { fill: none; stroke-width: 1.6; }
.linechart .band { opacity: .12; }
.linechart .limit-err { stroke: var(--st-down); stroke-dasharray: 4 3; stroke-width: 1; }
.linechart .limit-warn { stroke: var(--st-warning); stroke-dasharray: 4 3; stroke-width: 1; }
.linechart .down-zone { fill: var(--st-down); opacity: .08; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chart-legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend .is-off { opacity: .4; text-decoration: line-through; }
.chart-tip { font-size: 12px; color: var(--text); margin-top: 4px; min-height: 18px; }

/* ---------- wallboard */
.wall { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wall-tile { border-radius: var(--radius); padding: 14px 16px; color: #fff; min-height: 110px; display: flex; flex-direction: column; gap: 6px; background: var(--st-up); }
.wall-tile.st-warning { background: var(--st-warning); color: #3d2e00; }
.wall-tile.st-down { background: var(--st-down); animation: wallpulse 2s infinite; }
.wall-tile.st-downack { background: var(--st-downack); }
.wall-tile.st-unusual { background: var(--st-unusual); }
.wall-tile.st-paused { background: var(--st-paused); }
.wall-tile.st-unknown { background: var(--st-unknown); }
.wall-tile h3 { color: inherit; font-size: 17px; }
.wall-tile__list { font-size: 12px; opacity: .95; display: grid; gap: 2px; }
@keyframes wallpulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.15); } }
.wall-header { display: flex; align-items: center; gap: 16px; padding: 12px 16px 0; }
.wall-header h1 { flex: 1; }

/* ---------- algemeen */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.form-grid .field { display: flex; flex-direction: column; gap: 4px; }
.form-grid .field > label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.form-grid .field--wide { grid-column: 1 / -1; }
.form-help { font-size: 11.5px; color: var(--text-muted); }
.card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.card + .card { margin-top: 12px; }
.card h3 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; font-size: 13px; }
.kv > dt { color: var(--text-muted); }
.kv > dd { margin: 0; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
.secret-box { font-family: Consolas, monospace; font-size: 18px; letter-spacing: 1px; padding: 12px 16px; background: var(--slate-50); border: 1px dashed var(--slate-300); border-radius: 6px; user-select: all; word-break: break-all; }
.sevtext-0, .sevtext-1, .sevtext-2, .sevtext-3 { color: var(--st-down); font-weight: 600; }
.sevtext-4 { color: #8a6500; font-weight: 600; }

/* D1 – monitoringschermen ============================================== */
.lc { display: flex; flex-direction: column; gap: 6px; }
.lc-wrap { position: relative; }
.lc-svg { width: 100%; height: auto; display: block; }
.lc-svg .grid { stroke: var(--slate-100); stroke-width: 1; }
.lc-svg .axis { fill: var(--text-muted); font-size: 13px; }
.lc-svg .series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.lc-svg .band { opacity: .14; stroke: none; }
.lc-svg .limit-err { stroke: var(--st-down); stroke-dasharray: 6 4; stroke-width: 1.2; }
.lc-svg .limit-warn { stroke: var(--st-warning); stroke-dasharray: 6 4; stroke-width: 1.2; }
.lc-svg .down-zone { fill: var(--st-down); opacity: .09; }
.lc-overlay { position: absolute; inset: 0; cursor: crosshair; }

.dash-kpis-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sd-pane { padding: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.sensor-tabs { margin-top: 12px; }
.sd-table { width: 100%; }
.sd-table td, .sd-table th { vertical-align: middle; }
.tree-search { flex: 1; }
.tree-layout { min-height: calc(100vh - var(--topbar-h) - 120px); }
.tree-panel { max-height: calc(100vh - var(--topbar-h) - 110px); }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 18px; }
.type-card { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; background: var(--white);
             border: 1px solid var(--slate-200); border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: inherit; }
.type-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); background: var(--brand-50); }
.type-card strong { font-size: 14px; }
.type-card span { font-size: 12.5px; color: var(--text-muted); }

.wallboard--kiosk { background: var(--slate-900); min-height: 100vh; }
.wallboard--kiosk .wall-header h1 { color: #fff; }
.wallboard--kiosk .dash-link { color: #fff; }
.wall-header .spill { min-width: 34px; height: 26px; font-size: 14px; }

/* D2 – beheerschermen (triggers, inloggegevens, probes, schema's, import) */
.d2-trig, .d2-cred { display: flex; flex-direction: column; gap: 10px; }
.d2-trig__bar { display: flex; align-items: center; gap: 12px; }
.d2-trig__bar h3 { flex: 1; margin: 0; }
.d2-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--white); }
.d2-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--slate-200); white-space: nowrap; }
.d2-table td { padding: 6px 8px; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.d2-table th.center, .d2-table td.center { text-align: center; }
.d2-inherited td { color: var(--text-muted); background: var(--slate-50); }
.d2-actions { white-space: nowrap; text-align: right; width: 1%; }
.d2-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--slate-200);
              border-radius: 6px; background: var(--white); color: var(--slate-600); cursor: pointer; margin-left: 4px; }
.d2-iconbtn:hover { border-color: var(--slate-300); background: var(--slate-50); }
.d2-iconbtn--danger:hover { color: var(--st-down); border-color: #f3c3cd; background: var(--st-down-50); }
.d2-error { margin-top: 10px; padding: 8px 12px; border-radius: 6px; background: var(--st-down-50); color: var(--st-down); font-size: 13px; }
.d2-credcard { padding: 12px 14px; }
.d2-credcard__head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.d2-credcard__head h4 { flex: 1; margin: 0; font-size: 14px; }
.d2-cred__foot { display: flex; justify-content: flex-end; gap: 8px; }
.d2-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.d2-grow { flex: 1; min-width: 220px; }
.d2-steps { margin: 12px 0 0; padding-left: 20px; font-size: 13px; display: grid; gap: 4px; }
.d2-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.d2-ranges { margin-top: 10px; }
.d2-time { width: 92px; }
.d2-subhead { margin: 16px 0 4px; font-size: 14px; }
.d2-help { margin: -6px 0 10px; }
.d2-report { margin-top: 12px; max-height: 30vh; overflow: auto; font-size: 13px; }
.d2-report ul { margin: 0; padding-left: 18px; }
.d2-mt { margin-top: 12px; }
.d2-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.d2-cards .card + .card { margin-top: 0; }

/* Schermvullende lijst binnen de detailkolom van Apparaten (niet direct onder .page--full, dus zelf de hoogte geven) */
.page--full > .tree-layout { flex: 1 1 0; min-height: 480px; }
.tree-detail > .datalist--fill { flex: 1 1 0; min-height: 320px; display: flex; flex-direction: column; margin-bottom: 0; }

/* ---------- grafieken (LineChart op echte pixels) */
.lc { position: relative; }
.lc-wrap { position: relative; width: 100%; }
.lc-svg, .lc-hover { position: absolute; inset: 0; display: block; overflow: visible; }
.lc-hover { pointer-events: none; }
.lc-svg text { font-family: var(--font); }
.lc-svg .axis { fill: var(--slate-500); font-size: 11px; font-variant-numeric: tabular-nums; }
.lc-svg .grid { stroke: var(--slate-100); stroke-width: 1; stroke-dasharray: 3 4; }
.lc-svg .grid--base { stroke: var(--slate-200); stroke-dasharray: none; }
.lc-svg .tick { stroke: var(--slate-200); }
.lc-svg .series { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.lc-svg .band { opacity: .12; stroke: none; }
.lc-svg .limit-err { stroke: var(--st-down); stroke-dasharray: 6 4; stroke-width: 1.2; opacity: .8; }
.lc-svg .limit-warn { stroke: var(--st-warning); stroke-dasharray: 6 4; stroke-width: 1.2; opacity: .9; }
.lc-svg .limit-label { font-size: 10.5px; font-weight: 600; }
.lc-svg .limit-label--err { fill: var(--st-down); }
.lc-svg .limit-label--warn { fill: var(--st-warning-ink); }
.lc-svg .down-zone { fill: var(--st-down); opacity: .1; }
.lc-svg .lc-empty { fill: var(--slate-300); font-size: 13px; }
.lc-cross { stroke: var(--slate-500); stroke-width: 1; stroke-dasharray: 3 3; }
.lc-overlay { position: absolute; inset: 0; cursor: crosshair; }
.lc-tip { position: absolute; z-index: 2; min-width: 170px; max-width: 260px; padding: 8px 10px; background: rgba(23, 32, 38, .92); color: #fff;
          border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.lc-tip__time { font-weight: 600; margin-bottom: 4px; color: rgba(255, 255, 255, .8); }
.lc-tip__row { display: flex; align-items: center; gap: 6px; }
.lc-tip__row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lc-tip__row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .85); }
.lc-tip__row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lc-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--slate-100); font-size: 12px; color: var(--text-muted); }
.lc-stats b { color: var(--text); font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chart-legend { margin-bottom: 6px; }

/* ---------- tab Grafieken: vier periodes, klik = groot */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1200px) { .chart-grid { grid-template-columns: 1fr; } }
.chartcard--click { cursor: zoom-in; transition: border-color .15s, box-shadow .15s; }
.chartcard--click:hover { border-color: var(--slate-300); box-shadow: var(--shadow); }
.chartcard__zoom { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); opacity: 0; transition: opacity .15s; }
.chartcard--click:hover .chartcard__zoom { opacity: 1; }
.chartcard__head h3 { font-size: 14px; }
.chart-popup .dxbl-modal-body { padding: 12px 18px 18px; }

/* ---------- Boomoverzicht (zoals PRTG: apparaten met sensortegels) */
.st-counter { display: flex; align-items: center; gap: 4px; min-height: 32px; }
.st-counter a.spill { text-decoration: none; }
.stree { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px 14px 18px; }
.stree__head { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.stree__toggle { border: 0; background: none; padding: 0; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--slate-500); cursor: pointer; }
.stree__name { color: var(--text); font-weight: 600; }
.stree__name:hover { color: var(--brand); }
.stree__node--probe > .stree__head .stree__name { font-size: 15px; }
.stree__node--device > .stree__head .stree__name { font-weight: 500; }
.stree__host { font-size: 12px; color: var(--text-muted); }
.stree__children { margin-left: 9px; padding-left: 14px; border-left: 1px dashed var(--slate-200); }
.stree__tiles { display: flex; flex-wrap: wrap; gap: 3px; margin: 1px 0 6px 40px; }
/* tegel zoals PRTG: smal, laag, klein lettertype; gekleurd statusstrookje links */
.stile { --tile-w: 94px; display: grid; grid-template-columns: 13px 1fr; grid-template-rows: auto auto; width: var(--tile-w); height: 30px;
         background: var(--white); border: 1px solid var(--slate-200); border-radius: 2px; overflow: hidden; text-decoration: none !important;
         color: var(--text); font-size: 10px; line-height: 12px; transition: box-shadow .12s; }
.stile:hover { box-shadow: 0 1px 4px rgba(16, 24, 32, .18); border-color: var(--slate-300); }
.stile__icon { grid-row: 1 / 3; display: flex; align-items: flex-start; justify-content: center; padding-top: 1px; color: #fff; font-weight: 700; font-size: 9.5px; background: var(--st-unknown); }
.stile__name { padding: 1px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stile__value { padding: 0 4px 1px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stile.st-up .stile__icon { background: var(--st-up); }
.stile.st-warning .stile__icon { background: var(--st-warning); color: #3d2e00; }
.stile.st-warning { background: var(--st-warning-50); }
.stile.st-down .stile__icon { background: rgba(0, 0, 0, .18); }
.stile.st-down { background: var(--st-down); color: #fff; border-color: var(--st-down); }
.stile.st-downack .stile__icon { background: var(--st-downack); }
.stile.st-downack { background: var(--st-downack-50); }
.stile.st-unusual .stile__icon { background: var(--st-unusual); }
.stile.st-unusual { background: var(--st-unusual-50); }
.stile.st-paused .stile__icon { background: var(--st-paused); }
.stile.st-paused { background: var(--st-paused-50); }
.stile--add { border-style: dashed; color: var(--text-muted); }
.stile--add .stile__icon { background: transparent; color: var(--brand); font-size: 12px; padding-top: 7px; }
.stile--add .stile__name { grid-row: 1 / 3; align-self: center; }
.stree--s .stile { --tile-w: 80px; height: 26px; font-size: 9px; line-height: 11.5px; grid-template-columns: 11px 1fr; }
.stree--s .stile__icon { font-size: 8.5px; }
.stree--s .stile__name, .stree--s .stile__value { padding-left: 3px; padding-right: 3px; }
.stree--l .stile { --tile-w: 124px; height: 36px; font-size: 11.5px; line-height: 16px; }
.stree--xl .stile { --tile-w: 170px; height: 46px; font-size: 13px; line-height: 21px; }
.stree--xl .stile__value { font-size: 14px; }
/* boom zelf ook compacter */
.stree { padding: 8px 12px 14px; }
.stree__head { padding: 2px 0; font-size: 12.5px; }
.stree__head .stree__name { font-size: 12.5px; }
.stree__host { font-size: 11px; }
.stree__node--probe > .stree__head .stree__name { font-size: 13.5px; }
.stree__children { margin-left: 8px; padding-left: 12px; }

/* grenzen in de grafiek: fijn en rustig */
.lc-svg .limit-err { stroke: var(--st-down); stroke-dasharray: 3 3; stroke-width: .75; opacity: .6; }
.lc-svg .limit-warn { stroke: var(--st-warning); stroke-dasharray: 3 3; stroke-width: .75; opacity: .7; }
.lc-svg .limit-label { font-size: 9.5px; font-weight: 500; opacity: .85; }
.lc-svg .series { stroke-width: 1.6; }

/* Sensor Tree: toevoegen en slepen */
.stree__head[draggable="true"] { cursor: grab; }
.stree__head.is-dragging { opacity: .45; }
.stree__head.is-drop { background: var(--brand-50); outline: 1px dashed var(--brand); border-radius: 4px; }
.stree__actions { display: inline-flex; gap: 4px; margin-left: 10px; opacity: 0; transition: opacity .12s; }
.stree__head:hover .stree__actions { opacity: 1; }
.stree__act { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border: 1px solid var(--slate-200); border-radius: 4px;
              background: var(--white); color: var(--text-muted); font-size: 11px; cursor: pointer; text-decoration: none !important; }
.stree__act:hover { border-color: var(--brand); color: var(--brand); }
.stree__empty { margin: 2px 0 8px 22px; font-size: 11.5px; color: var(--text-muted); font-style: italic; }

/* ---------- Sensor Tree in PRTG-stijl: rustig, recht, dunne lijnen */
.stree { padding: 10px 14px 16px; border-radius: 6px; }
.stree__head { gap: 5px; padding: 1px 0; min-height: 22px; font-size: 12.5px; }
.stree__toggle { width: 11px; height: 11px; border: 1px solid #9aa5ad; border-radius: 0; background: #fff; color: #5f6b73;
                 font-size: 10px; line-height: 9px; font-weight: 600; padding: 0; flex: none; }
.stree__toggle:hover { border-color: var(--slate-700); color: var(--slate-700); }
.stree__icon { display: inline-flex; color: #7a858c; }
.stree__name { font-weight: 500; color: #3c4449; }
.stree__node--probe > .stree__head .stree__name { font-size: 13.5px; font-weight: 600; }
.stree__node--group > .stree__head .stree__name { font-weight: 600; }
.stree__node--device > .stree__head .stree__name { font-weight: 400; }
.stree__host { color: #9aa5ad; font-size: 11px; }
.stree__children { margin-left: 5px; padding-left: 13px; border-left: 1px solid #dfe4e7; }
.stree__tiles { gap: 2px; margin: 1px 0 6px 34px; }
.stree .tnode__counts .spill--sm { height: 15px; min-width: 16px; font-size: 10px; border-radius: 2px; }

/* tegels: recht, dunne rand, groen/rood strookje met wit vinkje (zoals PRTG) */
.stile { border-radius: 0; border-color: #d3d9dd; color: #4a5358; }
.stile:hover { transform: none; box-shadow: 0 0 0 1px #9aa5ad; }
.stile__icon { font-size: 10px; padding-top: 2px; }
.stile__name { color: #4a5358; }
.stile__value { font-weight: 400; color: #2f363a; }
.stile.st-up { background: #fff; }
.stile.st-up .stile__icon { background: var(--st-up); }
.stile.st-warning { background: #fff; }
.stile.st-warning .stile__icon { background: var(--st-warning); color: #3d2e00; }
.stile.st-unusual .stile__icon { background: var(--st-unusual); }
.stile.st-paused { background: #fff; }
.stile.st-paused .stile__icon { background: var(--st-paused); }
.stile.st-unknown .stile__icon { background: var(--st-unknown); }
.stile.st-down { background: var(--st-down); border-color: var(--st-down-ink); color: #fff; }
.stile.st-down .stile__name, .stile.st-down .stile__value { color: #fff; }
.stile.st-down .stile__icon { background: var(--st-down-ink); }
.stile.st-downack { background: var(--st-downack-50); border-color: var(--st-downack); }
.stile.st-downack .stile__icon { background: var(--st-downack); }
.stile--add { border-style: solid; background: #fafbfc; }
.stile--add .stile__icon { color: #1f6fb2; font-size: 13px; font-weight: 700; }
.stile--add .stile__name { color: #5f6b73; }
.stree--s .stile { --tile-w: 94px; height: 28px; }
.stree--s .stile__icon { font-size: 9px; }

/* rechtermuisknop-menu */
.ctx-backdrop { position: fixed; inset: 0; z-index: 1999; }
.ctx-menu { position: fixed; z-index: 2000; min-width: 210px; padding: 4px 0; background: #fff; border: 1px solid var(--slate-200);
            border-radius: 6px; box-shadow: 0 6px 24px rgba(16, 24, 32, .18); font-size: 12.5px; }
.ctx-menu__title { display: flex; align-items: center; gap: 6px; padding: 6px 12px 7px; font-weight: 600; color: var(--slate-700);
                   border-bottom: 1px solid var(--slate-100); margin-bottom: 3px; max-width: 280px; }
.ctx-menu__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 12px; border: 0; background: none;
            text-align: left; color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.ctx-item:hover { background: var(--slate-50); color: var(--brand); }
.ctx-item .icon { color: var(--slate-500); }
.ctx-item:hover .icon { color: var(--brand); }
.ctx-item--danger { color: var(--danger); }
.ctx-item__more { margin-left: auto; }
.ctx-sep { height: 1px; margin: 3px 0; background: var(--slate-100); }
.ctx-sub { display: none; position: absolute; left: 100%; top: -5px; min-width: 190px; padding: 4px 0; background: #fff;
           border: 1px solid var(--slate-200); border-radius: 6px; box-shadow: 0 6px 24px rgba(16, 24, 32, .18); }
.ctx-item--sub:hover > .ctx-sub { display: block; }

/* ---------------------------------------------------------------- panelen: tekst blijft binnen het paneel (Settings, rechterpaneel Devices) */
.d2-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.d2-cards > *, .card, .sd-pane, .tree-detail > * { min-width: 0; }
.card { overflow-wrap: anywhere; }
.card h3 { overflow-wrap: anywhere; }
.form-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.form-grid .field { min-width: 0; }
.form-grid .field > * { max-width: 100%; }
.form-help { display: block; overflow-wrap: anywhere; line-height: 1.4; }
.kv { grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); }
.kv > dt { white-space: nowrap; }
.kv > dd { min-width: 0; overflow-wrap: anywhere; }
.d2-table td { overflow-wrap: anywhere; }
.d2-table--fixed { table-layout: fixed; }
.d2-table--fixed td.mono { word-break: break-all; }
.d2-table .nowrap, .d2-table td.nowrap { white-space: nowrap; overflow-wrap: normal; }
.tree-detail .dxbl-tabs, .tree-detail .dxbl-tabs-content, .tree-detail .dxbl-tabs-content > * { min-width: 0; max-width: 100%; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; } .kv > dd { margin-bottom: 6px; } }

/* ---------------------------------------------------------------- audit */
.audit-changes { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.audit-changes th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--text-muted); padding: 5px 8px; border-bottom: 1px solid var(--slate-200); }
.audit-changes td { padding: 5px 8px; border-bottom: 1px solid var(--slate-100); vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; }
.audit-changes td.old { color: #a12a2a; background: #fdf3f3; }
.audit-changes td.new { color: #1e6b2d; background: #f2faf3; }
.audit-changes col.f { width: 28%; }
.audit-detail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.audit-detail pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: var(--slate-50, #f6f8fa); padding: 8px; border-radius: 6px; max-height: 260px; overflow: auto; }
.audit-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.audit-who small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- alerting: keuzelijst met vinkjes, review-markering */
.d2-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 8px; }
.d2-trig__bar .d2-trig__block { margin-left: auto; margin-right: 12px; font-size: 13px; }
.d2-inherited a { color: inherit; text-decoration: underline dotted; }
.audit-layout { align-items: stretch; }
.audit-side { flex: 0 0 420px; width: 420px; max-width: 42%; overflow: auto; align-self: stretch; }
.audit-side h3 { margin-bottom: 8px; }
@media (max-width: 1100px) { .audit-layout { flex-direction: column; } .audit-side { flex: none; width: auto; max-width: none; } }
.audit-history { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .audit-history { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- bulk-edit en templates */
.bulk-grid { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); gap: 8px 14px; align-items: center; margin-bottom: 12px; }
.bulk-grid > * { min-width: 0; }
.bulk-grid .form-help { display: block; }
.bulk-grow { flex: 1 1 auto; min-width: 0; }
@media (max-width: 700px) { .bulk-grid { grid-template-columns: 1fr; } }
.tpl-sensors { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tpl-sensors th, .tpl-sensors td { padding: 4px 8px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; overflow-wrap: anywhere; }
.tpl-sensors th { font-weight: 600; font-size: 12px; }
.tpl-json textarea { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }

/* ---------------------------------------------------------------- rapporten: tabbladen + geplande rapporten */
.page-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #e5e7eb); margin: 0 0 12px; flex-wrap: wrap; }
.page-tabs__tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; color: var(--muted, #6b7280); text-decoration: none;
                  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.page-tabs__tab:hover { color: var(--text, #1f2a37); }
.page-tabs__tab.is-active { color: var(--accent, #1f6feb); border-bottom-color: currentColor; }
.rep-sections { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.rep-sections label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.rep-logo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rep-logo img { max-height: 48px; max-width: 220px; object-fit: contain; background: #fff; border: 1px solid var(--border, #e5e7eb); padding: 4px; border-radius: 4px; }
.rep-runs { margin-top: 12px; min-width: 0; }
.rep-picklist { max-height: 220px; overflow: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; padding: 6px 10px; margin-top: 6px;
                display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2px 16px; }
.rep-picklist label { display: flex; align-items: center; gap: 6px; font-weight: 400; min-width: 0; overflow-wrap: anywhere; }

/* ---------- vestigingskiezer (bovenbalk) en vestigingschip op overzichten */
.branchpick { position: relative; margin-right: 8px; }
.branchpick__btn { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: 999px;
    border: 1px solid var(--slate-200); background: var(--white, #fff); font: inherit; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.branchpick__btn:hover { background: var(--slate-50, #f6f8fa); }
.branchpick__btn--active { border-color: #1f6fb2; box-shadow: 0 0 0 1px #1f6fb2 inset; font-weight: 600; }
.branchpick__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.branchpick__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.branchpick__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 31; min-width: 210px; padding: 6px;
    background: var(--white, #fff); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.branchpick__item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 7px;
    background: none; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.branchpick__item small { margin-left: auto; color: var(--text-muted); font-size: 11px; }
.branchpick__item:hover { background: var(--slate-100); }
.branchpick__item--on { background: var(--slate-100); font-weight: 600; }
.branchpick__item--muted { color: var(--text-muted); border-top: 1px solid var(--slate-100); border-radius: 0 0 7px 7px; margin-top: 4px; }
.branchchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 9px; border-radius: 999px; background: #e8f1fa;
    color: #1b4f7a; font-size: 12px; font-weight: 600; white-space: nowrap; }
.branchchip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.branchchip button:hover { background: rgba(0, 0, 0, .08); }
@media (max-width: 720px) { .branchpick__name { display: none; } }
