/* Systeemstatus (tab-system) en Home-tegel. */
.dash-sys .sys-age { font-size: .74rem; color: var(--muted); }
.dash-sys .card-header { display: flex; align-items: center; justify-content: space-between; }
.sys-mini { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); font-size: .76rem; color: var(--muted); }
.sys-spark { display: block; width: 100%; height: 34px; margin-top: 4px; }
.sys-live { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #16a34a; vertical-align: 1px; animation: sys-live 2s ease-out infinite; }
@keyframes sys-live { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.55); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.sys-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 0 8px; }
.sys-score-n { font-size: 2.3rem; font-weight: 800; line-height: 1; color: var(--text, #0f172a); font-variant-numeric: tabular-nums; }
.sys-score-n small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.sys-score-l { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); }
.sys-score-h { padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; color: #166534; background: #dcfce7; }
.sys-score-h.is-warn { color: #9a3412; background: #ffedd5; }
.sys-score-h.is-bad { color: #991b1b; background: #fee2e2; }
.sys-dist { display: flex; gap: 2px; height: 6px; margin-bottom: 10px; border-radius: 999px; overflow: hidden; background: #e2e8f0; }
.sys-dist i { display: block; height: 100%; transform-origin: left; animation: sys-grow .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sys-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.sys-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.sys-chip { padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.sys-chip.is-warn { color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
.sys-chip.is-bad { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.sys-kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.sys-kv { padding: 6px 8px; border-radius: 8px; background: var(--bg, #f8fafc); border-left: 3px solid #16a34a; min-width: 0; }
.sys-kv.is-warn { border-left-color: #ea580c; }
.sys-kv.is-bad { border-left-color: #dc2626; }
.sys-kv small { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sys-kv b { display: block; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#tab-system .sys-root { max-width: 1400px; margin: 0 auto; }
.sys-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.sys-head h1 { margin: 0; font-size: 1.5rem; color: var(--primary); }
.sys-head p { margin: 4px 0 0; }
.sys-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sys-pill { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .84rem; color: #fff; background: var(--c, #16a34a); }
.sys-pill.is-bad { animation: sa-pulse 1.6s ease-in-out infinite; }
.sys-auto { font-size: .8rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.sys-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.sys-tabs button { padding: 10px 16px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sys-tabs button.is-on { color: var(--primary); border-bottom-color: #0ea5e9; }
.sys-body { animation: ui-reveal .35s ease both; }
.sys-error { padding: 14px; border-radius: 10px; background: #fef2f2; color: #991b1b; }
.sys-card { padding: 16px 18px; margin-bottom: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.sys-card h3 { margin: 0 0 12px; font-size: 1rem; color: var(--primary); }
.sys-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 16px; }
.sys-grid2 > .sys-card { margin-bottom: 0; }
.sys-grid2 + * { margin-top: 16px; }

/* Meters */
.sys-gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sys-gauge { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); text-align: center; }
.sys-gauge svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.sys-gauge .g-bg { fill: none; stroke: var(--card-elev); stroke-width: 8; }
.sys-gauge .g-fg { fill: none; stroke: var(--c); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); animation: g-in 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes g-in { from { stroke-dasharray: 0 999; } }
.sys-gauge .g-val { position: absolute; top: 38px; left: 0; right: 0; font-size: 1.15rem; font-weight: 800; color: var(--c); }
.sys-gauge .g-val small { font-size: .7rem; font-weight: 600; }
.sys-gauge b { margin-top: 4px; font-size: .84rem; }
.sys-gauge > small { font-size: .7rem; color: var(--muted); }

/* Controles per groep */
.sys-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; margin-bottom: 16px; }
.sys-group { position: relative; overflow: hidden; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.sys-group::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #16a34a; }
.sys-group.is-warn::before { background: #ea580c; }
.sys-group.is-bad::before { background: #dc2626; animation: stripe-breathe 2.2s ease-in-out infinite; }
.sys-group h3 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: .95rem; }
.sys-group h3 span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.sys-check { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--card-elev); }
.sys-check:last-child { border-bottom: 0; }
.sys-check > i { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #16a34a; }
.sys-check.is-warn > i { background: #ea580c; }
.sys-check.is-bad > i { background: #dc2626; animation: sa-pulse 1.4s ease-in-out infinite; }
.sys-check b { font-size: .86rem; }
.sys-check small { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; word-break: break-word; }
.sys-check > span { font-size: .82rem; font-weight: 700; text-align: right; white-space: nowrap; }
.sys-check.is-warn > span { color: #c2410c; }
.sys-check.is-bad > span { color: #dc2626; }
.sys-check-card { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }

/* Netwerkschema */
.nw-wrap { overflow-x: auto; }
.nw-svg { display: block; width: 100%; min-width: 900px; height: auto; font-family: inherit; }
.nw-vpc { fill: #f0f9ff; stroke: #7dd3fc; stroke-dasharray: 6 4; }
.nw-subnet { fill: #ecfeff; stroke: #67e8f9; stroke-dasharray: 4 4; }
.nw-ec2 { fill: #fff; stroke: #94a3b8; }
.nw-zone { font-size: 11px; font-weight: 700; fill: #0369a1; }
.nw-node rect { fill: #fff; stroke: var(--c); stroke-width: 1.6; filter: drop-shadow(0 2px 4px rgba(15, 23, 42, .08)); }
.nw-node.is-warn rect { fill: #fff7ed; }
.nw-node.is-bad rect { fill: #fef2f2; animation: nw-blink 1.4s ease-in-out infinite; }
.nw-alert { animation: sa-pulse 1.4s ease-in-out infinite; }
@keyframes nw-blink { 50% { stroke-width: 3.5; } }
.nw-t { font-size: 12.5px; font-weight: 700; fill: #0f172a; text-anchor: middle; }
.nw-s { font-size: 10.5px; fill: #64748b; text-anchor: middle; }
.nw-lat { font-size: 10px; font-weight: 700; text-anchor: middle; }
.nw-link path { fill: none; stroke-width: 2.2; opacity: .55; }
.nw-link.is-ok path { opacity: .45; }
.nw-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.nw-legend .is-ok { color: #16a34a; } .nw-legend .is-warn { color: #ea580c; } .nw-legend .is-bad { color: #dc2626; }
.sys-pings { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.sys-ping { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card-elev); font-size: .82rem; }
.sys-ping i { width: 10px; height: 10px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: ping-ok 2s ease-out infinite; }
.sys-ping.is-warn i { background: #ea580c; animation: none; }
.sys-ping.is-bad i { background: #dc2626; animation: sa-pulse 1.2s ease-in-out infinite; }
.sys-ping span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes ping-ok { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); } 100% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } }

/* Tabellen */
.sys-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.sys-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.sys-table td { padding: 7px 8px; border-bottom: 1px solid var(--card-elev); vertical-align: top; }
.sys-table tr.is-warn td { background: #fff7ed; }
.sys-table td.is-warn { color: #c2410c; font-weight: 700; }
.sys-table .mono, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; }
.sys-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: #e0f2fe; color: #0369a1; }
.sys-tag.k-beheer { background: #ede9fe; color: #6d28d9; } .sys-tag.k-opdracht { background: #dcfce7; color: #15803d; } .sys-tag.k-voorraad { background: #fef3c7; color: #92400e; }
.sys-src { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: .72rem; font-weight: 600; background: #f1f5f9; color: #475569; }
.sys-src.is-web { background: #dbeafe; color: #1d4ed8; } .sys-src.is-app { background: #dcfce7; color: #15803d; }
.sys-m { font-size: .7rem; font-weight: 800; color: #475569; }
.sys-bar { display: inline-block; width: 90px; height: 7px; margin-right: 8px; border-radius: 4px; background: var(--card-elev); overflow: hidden; vertical-align: middle; }
.sys-bar span { display: block; height: 100%; background: #2563eb; border-radius: 4px; animation: barx .7s ease both; transform-origin: left; }
@keyframes barx { from { transform: scaleX(0); } }
.sys-split { display: flex; width: 90px; height: 7px; border-radius: 4px; overflow: hidden; background: var(--card-elev); }
.sys-split .w { background: #2563eb; } .sys-split .a { background: #16a34a; } .sys-split .o { background: #cbd5e1; }
.sys-feed td { white-space: nowrap; }
.sys-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sys-kpis > div { padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.sys-kpis b { display: block; font-size: 1.4rem; color: var(--primary); }
.sys-kpis small { color: var(--muted); font-size: .76rem; }
.sys-kpis .is-warn b { color: #ea580c; }
.cost-svg { width: 100%; height: auto; display: block; }
.cost-bar { transform-box: fill-box; transform-origin: bottom; animation: cost-rise .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes cost-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.cost-grid { stroke: var(--border, #e2e8f0); stroke-dasharray: 3 4; }
.cost-ax { font-size: 11px; fill: var(--muted, #64748b); }
.cost-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.cost-share { display: inline-block; width: 90px; height: 6px; margin-right: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; vertical-align: middle; }
.cost-share span { display: block; height: 100%; }
.cost-note { margin: 12px 0 0; font-size: .8rem; line-height: 1.5; }

/* Grafieken */
.sys-ranges { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; }
.sys-ranges button { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; }
.sys-ranges button.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.sys-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 16px; }
.sys-chart { position: relative; margin-bottom: 0; }
.sys-legend { display: flex; gap: 12px; flex-wrap: wrap; margin: -6px 0 6px; font-size: .74rem; color: var(--muted); }
.sys-legend i, .sys-tip i { display: inline-block; width: 10px; height: 3px; margin-right: 5px; border-radius: 2px; vertical-align: middle; }
.ch-svg { display: block; width: 100%; height: auto; cursor: crosshair; }
.ch-grid { stroke: var(--card-elev); }
.ch-ax { font-size: 10px; fill: #94a3b8; }
.ch-x { stroke: #0f172a; stroke-dasharray: 2 3; }
.ch-line { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: ch-draw 1.2s ease forwards; }
@keyframes ch-draw { to { stroke-dashoffset: 0; } }
.sys-tip { position: absolute; top: 46px; z-index: 5; min-width: 160px; padding: 8px 10px; border-radius: 10px; background: #0f172a; color: #fff; font-size: .76rem; pointer-events: none; box-shadow: 0 10px 24px rgba(15, 23, 42, .3); }
.sys-tip small { color: #94a3b8; }

/* Beveiliging */
.sys-jails { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sys-jail { padding: 12px; border-radius: 12px; background: var(--card-elev); border: 1px solid var(--border); }
.sys-jail.is-warn { border-color: #fdba74; background: #fff7ed; }
.sys-jail-n { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.sys-jail-n span { font-size: .72rem; color: var(--muted); }
.sys-jail-n b { display: block; font-size: 1.1rem; color: var(--text); }
.sys-jail ul { margin: 0; padding-left: 16px; max-height: 140px; overflow: auto; font-size: .78rem; }

/* Audittrail */
.audit-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.audit-filters input, .audit-filters select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font: inherit; font-size: .84rem; }
.audit-filters input#au-q { flex: 1; min-width: 220px; }
.audit-row { cursor: pointer; }
.audit-row:hover td { background: var(--card-elev); }
.audit-d { max-width: 380px; word-break: break-word; }
.audit-more td { background: #f8fafc; }
.audit-more pre { max-height: 300px; overflow: auto; margin: 6px 0 0; padding: 10px; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: .76rem; }

[data-theme="dark"] .nw-vpc { fill: rgba(14, 165, 233, .06); } [data-theme="dark"] .nw-subnet { fill: rgba(6, 182, 212, .06); }
[data-theme="dark"] .nw-ec2, [data-theme="dark"] .nw-node rect { fill: #12263f; } [data-theme="dark"] .nw-t { fill: #e2e8f0; }
[data-theme="dark"] .sys-table tr.is-warn td, [data-theme="dark"] .sys-jail.is-warn { background: rgba(234, 88, 12, .1); }
[data-theme="dark"] .audit-more td { background: #0b1a2e; }
@media (prefers-reduced-motion: reduce) {
    .nw-svg circle, .sys-ping i, .sys-check.is-bad > i, .nw-node.is-bad rect, .ch-line, .sys-gauge .g-fg { animation: none !important; }
    .nw-svg animateMotion { display: none; }
}
