/* NetPulse – Oberfläche. Farben als Variablen; hell, dunkel oder automatisch (data-theme). */
:root {
  --bg: #f3f5f9;
  --bg-2: #eaeef5;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #eef1f7;
  --border: #e3e7ef;
  --border-strong: #cfd6e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-soft: #eef2ff;
  --accent-text: #ffffff;
  --up: #16a34a;
  --up-soft: #dcfce7;
  --down: #dc2626;
  --down-soft: #fee2e2;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --unknown: #64748b;
  --unknown-soft: #e2e8f0;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.05);
  --shadow-lg: 0 20px 50px rgb(15 23 42 / 0.18);
  --sidebar: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --bg-2: #0f1529; --surface: #121a2e; --surface-2: #172039; --surface-3: #1c2744;
    --border: #232f4b; --border-strong: #2f3d5f; --text: #e8edf7; --text-2: #c3cce0; --muted: #8b97b3;
    --accent: #818cf8; --accent-2: #22d3ee; --accent-soft: #1e2350; --accent-text: #0b1020;
    --up: #34d399; --up-soft: #0c3326; --down: #f87171; --down-soft: #3f1719; --warn: #fbbf24; --warn-soft: #3a2c0b;
    --unknown: #94a3b8; --unknown-soft: #1f2a40; --info: #60a5fa; --info-soft: #132a4f;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3); --shadow-lg: 0 20px 50px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --bg-2: #0f1529; --surface: #121a2e; --surface-2: #172039; --surface-3: #1c2744;
  --border: #232f4b; --border-strong: #2f3d5f; --text: #e8edf7; --text-2: #c3cce0; --muted: #8b97b3;
  --accent: #818cf8; --accent-2: #22d3ee; --accent-soft: #1e2350; --accent-text: #0b1020;
  --up: #34d399; --up-soft: #0c3326; --down: #f87171; --down-soft: #3f1719; --warn: #fbbf24; --warn-soft: #3a2c0b;
  --unknown: #94a3b8; --unknown-soft: #1f2a40; --info: #60a5fa; --info-soft: #132a4f;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3); --shadow-lg: 0 20px 50px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; margin: 0; font-weight: 600; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; color: var(--text-2); }
code, .mono { font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--down); }
.ok { color: var(--up); }
[hidden] { display: none !important; }

svg.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
svg.i-sm { width: 15px; height: 15px; }
svg.i-lg { width: 26px; height: 26px; }

/* ---------- Grundlayout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--text); font-size: 19px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
}
#nav a:hover { background: var(--surface-2); text-decoration: none; }
#nav a.active { background: var(--accent-soft); color: var(--accent); }
#nav a.active svg { color: var(--accent); }
.nav-badge { margin-left: auto; background: var(--down); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
body:not(.is-admin) .admin-only { display: none !important; }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 7px 9px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); border: 1px solid transparent; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); filter: none; }

.scan-mini { margin: 6px 4px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 12px; color: var(--text-2); }
.scan-mini strong { color: var(--accent); }

/* Herkunftszeichen „von BuscheHome“ (Logo ist Marke, siehe TRADEMARK.md) */
.maker { display: flex; align-items: center; gap: 8px; padding: 4px 9px; font-size: 12px; color: var(--muted); opacity: 0.85; user-select: none; }
.maker img { flex: none; border-radius: 50%; }
.maker b { font-weight: 600; color: var(--text-2); }
.maker-row { display: flex; align-items: center; gap: 4px; }
a.maker { flex: 1; min-width: 0; border-radius: var(--radius-sm); }
a.maker:hover { background: var(--surface-2); text-decoration: none; opacity: 1; }
.maker-src { font-size: 11px; color: var(--muted); padding: 4px 6px; border-radius: var(--radius-sm); }
.maker-src:hover { background: var(--surface-2); color: var(--text-2); text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { flex: 1; }
.menu-btn { display: none; }
.search { position: relative; width: min(380px, 40vw); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding-left: 36px; background: var(--surface); }
main#view { padding: 24px 28px 48px; max-width: 1500px; width: 100%; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 20; left: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform 0.2s; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .search { display: none; }
  main#view { padding: 16px; }
}

/* ---------- Karten & Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card > header h2 { display: flex; align-items: center; gap: 8px; }
.card > header h2 svg { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-3 { grid-column: span 2; } }
@media (max-width: 720px) { .grid { grid-template-columns: minmax(0, 1fr); } .span-1, .span-2, .span-3 { grid-column: span 1; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack-v { display: flex; flex-direction: column; gap: 18px; }
.info-line { color: var(--muted); margin: -6px 0 18px; font-size: 13px; }

.grid.editing .widget { outline: 2px dashed var(--border-strong); outline-offset: 2px; cursor: grab; }
.grid.editing .widget.drag-over { outline-color: var(--accent); }
.widget-tools { display: flex; gap: 4px; }
.widget-tools button { padding: 3px 8px; font-size: 12px; }

/* ---------- Kennzahlen ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 12px; gap: 10px; } .kpi-icon { width: 36px; height: 36px; } .kpi-value { font-size: 22px; } }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.kpi-label { color: var(--muted); font-size: 12.5px; }

/* Farbtöne für Icons */
.tone-accent { background: var(--accent-soft); color: var(--accent); }
.tone-up { background: var(--up-soft); color: var(--up); }
.tone-down { background: var(--down-soft); color: var(--down); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-muted { background: var(--unknown-soft); color: var(--unknown); }

/* ---------- Status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.st-up, .badge.ev-up, .badge.sev-resolved { background: var(--up-soft); color: var(--up); }
.badge.st-down, .badge.ev-down, .badge.sev-critical { background: var(--down-soft); color: var(--down); }
.badge.st-unknown, .badge.plain { background: var(--unknown-soft); color: var(--unknown); }
.badge.ev-discovered, .badge.info { background: var(--info-soft); color: var(--info); }
.badge.ev-mac_changed, .badge.ev-ssh_key_changed, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ev-power_wake, .badge.ev-power_shutdown { background: var(--accent-soft); color: var(--accent); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); flex: none; }
.dot.up { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.chip { display: inline-block; padding: 1px 7px; margin: 1px 2px 1px 0; border-radius: 6px; background: var(--surface-3); font-size: 11.5px; white-space: nowrap; color: var(--text-2); }

/* ---------- Gerätekarten ---------- */
.dev-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; flex: none; }
.dev-icon svg { width: 21px; height: 21px; }
.dev-icon.lg { width: 64px; height: 64px; border-radius: 18px; }
.dev-icon.lg svg { width: 34px; height: 34px; }
.dev-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.dev-icon.sm svg { width: 16px; height: 16px; }
.t-network { background: #e0e7ff; color: #4338ca; } .t-server { background: #e0f2fe; color: #0369a1; }
.t-storage { background: #ede9fe; color: #6d28d9; } .t-client { background: #dcfce7; color: #15803d; }
.t-mobile { background: #fce7f3; color: #be185d; } .t-media { background: #ffedd5; color: #c2410c; }
.t-iot { background: #fef9c3; color: #a16207; } .t-power { background: #fee2e2; color: #b91c1c; }
.t-unknown { background: var(--unknown-soft); color: var(--unknown); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .t-network { background: #1e2455; color: #a5b4fc; }
  :root:not([data-theme="light"]) .t-server { background: #0c2a44; color: #7dd3fc; }
  :root:not([data-theme="light"]) .t-storage { background: #2a1d4f; color: #c4b5fd; }
  :root:not([data-theme="light"]) .t-client { background: #0f3323; color: #86efac; }
  :root:not([data-theme="light"]) .t-mobile { background: #3d1530; color: #f9a8d4; }
  :root:not([data-theme="light"]) .t-media { background: #3d2310; color: #fdba74; }
  :root:not([data-theme="light"]) .t-iot { background: #3a320b; color: #fde047; }
  :root:not([data-theme="light"]) .t-power { background: #3f1719; color: #fca5a5; }
}
:root[data-theme="dark"] .t-network { background: #1e2455; color: #a5b4fc; }
:root[data-theme="dark"] .t-server { background: #0c2a44; color: #7dd3fc; }
:root[data-theme="dark"] .t-storage { background: #2a1d4f; color: #c4b5fd; }
:root[data-theme="dark"] .t-client { background: #0f3323; color: #86efac; }
:root[data-theme="dark"] .t-mobile { background: #3d1530; color: #f9a8d4; }
:root[data-theme="dark"] .t-media { background: #3d2310; color: #fdba74; }
:root[data-theme="dark"] .t-iot { background: #3a320b; color: #fde047; }
:root[data-theme="dark"] .t-power { background: #3f1719; color: #fca5a5; }

.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.dev-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.dev-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.dev-card.off { opacity: 0.6; }
.dev-card .top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dev-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-card .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.dev-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dev-hero .title { flex: 1; min-width: 240px; }
.dev-hero h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dev-hero .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Reiter ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0; overflow-x: auto; }
.tabs button { background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 9px 14px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--text); filter: none; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Listen & Tabellen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.list .lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }
tr.unmonitored td { opacity: 0.55; }
.cell-dev { display: flex; align-items: center; gap: 10px; min-width: 0; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
.empty svg { width: 34px; height: 34px; opacity: 0.6; }

/* ---------- Balken & Messwerte ---------- */
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter.warn > span { background: var(--warn); }
.meter.crit > span { background: var(--down); }
.meter-row { display: grid; grid-template-columns: minmax(90px, 180px) 1fr auto; gap: 12px; align-items: center; padding: 6px 0; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.gauge { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.gauge .v { font-size: 22px; font-weight: 700; margin: 2px 0 8px; }
.gauge .l { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.stack { display: flex; height: 12px; border-radius: 7px; overflow: hidden; background: var(--surface-3); }
.stack > span { display: block; }
.bg-up { background: var(--up); } .bg-down { background: var(--down); } .bg-unknown { background: var(--unknown); } .bg-off { background: var(--border-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: 8px 12px; align-items: center; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); min-width: 3px; }
.progress { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 20%, transparent); overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }

/* ---------- Diagramme ---------- */
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .axis { stroke: var(--border); }
svg.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
svg.chart .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
svg.chart .area { opacity: 0.12; }
svg.chart .outage { fill: var(--down); }
svg.chart .lbl { fill: var(--muted); font-size: 11px; }
.c0 { stroke: var(--accent); fill: var(--accent); } .c1 { stroke: var(--accent-2); fill: var(--accent-2); }
.c2 { stroke: var(--warn); fill: var(--warn); } .c3 { stroke: var(--down); fill: var(--down); } .c4 { stroke: var(--up); fill: var(--up); }
.bgc0 { background: var(--accent); } .bgc1 { background: var(--accent-2); } .bgc2 { background: var(--warn); } .bgc3 { background: var(--down); } .bgc4 { background: var(--up); }

/* ---------- Formulare ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -1px; border-color: var(--accent); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
textarea { width: 100%; min-height: 90px; resize: vertical; }
textarea.mono { min-height: 140px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; font-size: 14px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row > label { flex: 1 1 170px; }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
legend { padding: 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: var(--accent-text);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 15px; cursor: pointer; font-weight: 550; white-space: nowrap;
}
button:hover { filter: brightness(1.07); }
button:disabled { opacity: 0.55; cursor: default; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn:hover { text-decoration: none; }
#q { min-width: min(320px, 100%); }
button.danger { background: var(--down); color: #fff; }
button.sm { padding: 4px 10px; font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border-radius: 0; background: var(--surface); color: var(--muted); padding: 7px 10px; border: 0; }
.seg button.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Login ---------- */
#login-view:empty { display: none; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 25%, transparent), transparent),
              radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent), var(--bg); }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.login .brand { justify-content: center; font-size: 24px; padding-bottom: 4px; }
.login p { margin: 0; text-align: center; }
.login-wrap:has(.maker-login) { align-content: center; gap: 18px; }
.maker-login { justify-content: center; font-size: 13px; padding: 0; margin: 0; flex-wrap: wrap; }
.maker-login > a:first-child { display: flex; align-items: center; gap: 8px; color: inherit; }
.maker-login > a:first-child:hover { text-decoration: none; color: var(--text-2); }

/* ---------- Hinweise, Dialog, Toast ---------- */
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.notice svg { color: var(--warn); margin-top: 1px; }
.notice.info { background: var(--info-soft); }
.notice.info svg { color: var(--info); }
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgb(8 12 24 / 0.55); backdrop-filter: blur(2px); }
dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
dialog .dlg-body { padding: 20px; overflow-y: auto; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: slide 0.2s; }
.toast.error { background: var(--down); color: #fff; }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Live-Ansicht & Animationen ---------- */
svg.flow { width: 100%; height: 12px; display: block; overflow: visible; }
svg.flow .flow-track { stroke: var(--border); stroke-width: 3; stroke-linecap: round; fill: none; }
svg.flow .flow-dash { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none;
  stroke-dasharray: 5 13; animation: flow 2s linear infinite; }
svg.flow.c1 .flow-dash, svg.flow.up .flow-dash { stroke: var(--accent-2); animation-direction: reverse; }
svg.flow.idle .flow-dash { opacity: 0.25; }
@keyframes flow { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) { svg.flow .flow-dash { animation: none; } }

svg.spark { width: 100%; height: 44px; display: block; }
svg.spark .line { fill: none; stroke-width: 1.6; }
svg.spark .spark-area { stroke: none; opacity: 0.12; }

.inet-path { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 4px 0 14px; }
.inet-node { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); max-width: 110px; }
.inet-node:hover { text-decoration: none; }
.inet-node > svg.i { width: 34px; height: 34px; color: var(--accent); }
.inet-node small { font-size: 11px; color: var(--muted); max-width: 110px; }
.inet-flows { display: flex; flex-direction: column; gap: 10px; }
.inet-values { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.inet-values strong { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inet-dir { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); font-weight: 600; }
.inet-dir.up { color: var(--accent-2); }

.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.live-pulse { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.live-pulse::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.if-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.if-card { padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.if-card.wan { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.if-card.down { opacity: 0.55; }
.if-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.if-card header .ellipsis { font-weight: 600; }
.if-rates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.if-rates strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.if-rates .inet-dir { font-size: 11.5px; }
.meter > span { transition: width 0.6s ease; }
.explorer-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.explorer-tools input[name="oid"] { flex: 1 1 320px; }
td.val { max-width: 520px; overflow-wrap: anywhere; }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
#a-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
#a-list td { padding: 7px 10px; }

/* ---------- Live-Stream: Verbindungsanzeige, Strom, Smart-Home-Kacheln ---------- */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border); }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--unknown); }
.live-dot.on { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.live-dot.on::before { background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }
.live-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--up); padding: 2px 7px; border-radius: 99px;
  background: var(--up-soft); }
.live-pulse.stale::before { background: var(--down); animation: none; }

.power-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.power-total { font-size: 34px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--warn), var(--down)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.power-total.big { font-size: 46px; margin: 6px 0 4px; }
svg.spark.tall { height: 56px; margin: 6px 0 12px; }
svg.spark .spark-area.c2 { opacity: 0.18; }
.bars .bar { transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bars .num { font-variant-numeric: tabular-nums; text-align: right; }

.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sh-tile, .ch-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; min-width: 0;
  transition: border-color 0.4s, box-shadow 0.4s, background 0.4s; }
.sh-tile:hover { border-color: var(--border-strong); }
.sh-tile.on, .ch-tile.on { border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--warn) 14%, var(--surface-2)), var(--surface-2) 70%);
  box-shadow: 0 0 18px -6px color-mix(in srgb, var(--warn) 70%, transparent); }
.sh-tile.off { opacity: 0.5; }
.sh-top { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.sh-tile.on .sh-top .i, .ch-tile.on .sh-top .i { color: var(--warn); }
.sh-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sh-chans { display: flex; gap: 4px; min-height: 6px; }
.sh-ch { width: 16px; height: 5px; border-radius: 3px; background: var(--border-strong); }
.sh-ch.on { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.sh-extra { font-size: 11.5px; color: var(--muted); min-height: 14px; }
.flash { animation: flash 0.7s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); } }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ch-tile strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.live-watt { font-weight: 600; color: var(--warn); font-variant-numeric: tabular-nums; }
.live-watt:empty { display: none; }
.warn-ic { color: var(--warn); vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .live-dot.on::before, .flash { animation: none; } }

/* ---------- Diagnose ---------- */
ol.diag { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
ol.diag li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; padding: 8px 10px;
  border-radius: var(--radius-sm); border-left: 3px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
ol.diag li.ok { border-left-color: var(--up); } ol.diag li.ok .i { color: var(--up); }
ol.diag li.err { border-left-color: var(--down); background: color-mix(in srgb, var(--down) 7%, var(--surface-2)); } ol.diag li.err .i { color: var(--down); }
ol.diag li.info .i { color: var(--muted); }

/* ---------- System-Log ---------- */
.log { font-size: 12.5px; max-height: calc(100vh - 290px); overflow: auto; }
.log-line { display: grid; grid-template-columns: 150px 52px 170px 1fr; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--border); align-items: baseline; }
.log-line .lvl { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--muted); }
.log-line.lvl-warn .lvl { color: var(--warn); } .log-line.lvl-error .lvl { color: var(--down); }
.log-line.lvl-error { background: color-mix(in srgb, var(--down) 6%, transparent); }
.log-line .msg { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 720px) { .log-line { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Alarm-Popups ---------- */
#alert-stack { position: fixed; top: 76px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.alert-pop { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 13px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); box-shadow: var(--shadow-lg);
  font-size: 13.5px; animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2); transition: opacity 0.25s, transform 0.25s; }
.alert-pop.out { opacity: 0; transform: translateX(20px); }
.alert-pop-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.alert-pop-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.alert-pop.sev-critical { border-left-color: var(--down); } .alert-pop.sev-critical > .i { color: var(--down); }
.alert-pop.sev-critical { animation: pop-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2), glow 1.6s 0.3s 3; }
.alert-pop.sev-warning { border-left-color: var(--warn); } .alert-pop.sev-warning > .i { color: var(--warn); }
.alert-pop.sev-resolved { border-left-color: var(--up); } .alert-pop.sev-resolved > .i { color: var(--up); }
.alert-pop.sev-info > .i { color: var(--info); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-12px) scale(0.97); } }
@keyframes glow { 50% { box-shadow: var(--shadow-lg), 0 0 0 4px color-mix(in srgb, var(--down) 35%, transparent); } }
@media (prefers-reduced-motion: reduce) { .alert-pop { animation: none; } }
#sched-area { margin-top: 18px; }
.gap-top { margin-top: 18px; }

/* ---------- Zwei-Faktor & App ---------- */
.qr { display: grid; place-items: center; background: #fff; border-radius: var(--radius-sm); padding: 10px; width: max-content; margin: 8px 0; }
.qr svg { width: 220px; height: 220px; display: block; }
ol.steps { margin: 0 0 6px; padding-left: 20px; color: var(--text-2); font-size: 13.5px; }
h3.sub { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- E-Mail-Vorschau ---------- */
.mail-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); position: relative; overflow: hidden; }
.mail-preview .mail-bar { position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--down); }
.mail-preview pre { white-space: pre-wrap; font: inherit; margin: 10px 0 0; color: var(--text-2); }

/* ---------- Geräte-Widget ---------- */
.dw-parts { display: grid; gap: 14px; margin-top: 10px; }
.span-2 .dw-parts, .span-3 .dw-parts { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.dw-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.dw-head strong { margin-left: auto; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.dev-live .bars { grid-template-columns: minmax(0, 1fr) max-content max-content; }

/* ---------- Dienste ---------- */
.check-list { display: flex; flex-direction: column; }
.check-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 70px 80px; gap: 14px; align-items: center; padding: 12px 6px;
  border-bottom: 1px solid var(--border); cursor: pointer; border-radius: var(--radius-sm); }
.check-row:hover { background: var(--surface-2); }
.check-row.off { opacity: 0.55; }
.check-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.check-msg { color: var(--text-2); margin-top: 2px; }
.check-row.st-down .check-msg { color: var(--down); }
.check-nums { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.check-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--unknown); display: inline-block; flex: none; }
.st-up .check-dot, .check-dot.st-up { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); }
.st-down .check-dot, .check-dot.st-down { background: var(--down); animation: blink 1.2s infinite; }
.st-warn .check-dot, .check-dot.st-warn { background: var(--warn); }
.beats { display: flex; gap: 2px; align-items: flex-end; height: 22px; }
.beats i { width: 5px; height: 100%; border-radius: 2px; background: var(--border); }
.beats i.ok { background: var(--up); }
.beats i.bad { background: var(--down); }
.wbeats { display: flex; align-items: center; gap: 10px; }
.wbeats .beats i { width: 4px; }
.kpis.compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.check-detail .beats { margin: 10px 0; }
@media (max-width: 900px) {
  .check-row { grid-template-columns: 12px minmax(0, 1fr) 70px; }
  .check-row .beats, .check-row .check-nums:last-child { display: none; }
}
.page-head > .kpis { flex: 1 1 520px; }

.pick-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px;
  display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.pick-list label { min-width: 0; }

/* ---------- Netzwerkkarte ---------- */
.map-scroll { overflow: auto; max-height: calc(100vh - 230px); min-height: 300px; }
svg.map { display: block; }
svg.map .edge { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
svg.map .edge.guess { stroke-dasharray: 4 4; opacity: 0.7; }
svg.map .edge.down { stroke: var(--down); }
svg.map .node circle { fill: var(--surface-2); stroke: var(--unknown); stroke-width: 2; }
svg.map .node use { color: var(--text-2); }
svg.map .node.st-up circle { stroke: var(--up); }
svg.map .node.st-down circle { stroke: var(--down); fill: var(--down-soft); }
svg.map .node.st-off circle { stroke-dasharray: 3 3; }
svg.map .node text { font-size: 12px; fill: var(--text); }
svg.map .node text.ip { font-size: 10px; fill: var(--muted); font-family: ui-monospace, monospace; }
svg.map .node.hit circle { stroke: var(--accent); stroke-width: 4; }
svg.map a:hover text { fill: var(--accent); }
/* ---------- Statusseite ---------- */
.pick-list.tall { max-height: 460px; }
.sp-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 8px; align-items: center; }
.sp-label { padding: 4px 8px; font-size: 12.5px; }
body.status-page { background: var(--bg); color: var(--text); }
.status-wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px; }
.status-head h1 { margin: 0 0 6px; font-size: 26px; }
.status-overall { margin: 16px 0; padding: 14px 18px; border-radius: var(--radius); font-weight: 600; background: var(--up-soft); color: var(--up); }
.status-overall.degraded { background: var(--warn-soft); color: var(--warn); }
.status-overall.down { background: var(--down-soft); color: var(--down); }
.status-overall.unknown { background: var(--surface-2); color: var(--muted); }
.status-item { padding: 12px 4px; border-bottom: 1px solid var(--border); }
.status-item:last-child { border-bottom: 0; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.status-label { font-size: 12.5px; }
.status-label.ok { color: var(--up); } .status-label.degraded { color: var(--warn); } .status-label.down { color: var(--down); }
.status-uptime { margin-left: auto; }
.beats.days { height: 28px; gap: 3px; }
.beats.days i { flex: 1; width: auto; }
.beats i.warn { background: var(--warn); }
.status-foot { text-align: center; margin-top: 18px; }

/* ---------- Protokolle ---------- */
.log-table td { vertical-align: top; }
.log-table .log-msg { white-space: pre-wrap; word-break: break-word; min-width: 280px; }
.nowrap { white-space: nowrap; }
.badge.sev-error { background: var(--down-soft); color: var(--down); }
.badge.sev-info { background: var(--surface-3); color: var(--text-2); }
tr.sev-row-bad td:first-child { box-shadow: inset 3px 0 0 var(--down); }
tr.sev-row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.badge.sev-warn { background: var(--warn-soft); color: var(--warn); }

.install-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.install-btn { white-space: nowrap; }

/* ---------- Live CPU/RAM ---------- */
.dw-head.is-live strong::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--up);
  margin-left: 6px; vertical-align: middle; animation: blink 1.4s infinite; }
.dw-live svg.spark { height: 36px; margin: 2px 0 6px; }
.sys-live { display: grid; grid-template-columns: repeat(3, minmax(120px, 180px)) 1fr; gap: 18px; align-items: end; margin-bottom: 16px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.sys-live strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.sys-live .meter span { transition: width 0.8s; }
@media (max-width: 720px) { .sys-live { grid-template-columns: 1fr 1fr; } }

/* ---------- Statusseite (öffentlich) ---------- */
.status-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg)), color-mix(in srgb, var(--accent-2) 18%, var(--bg)));
  border-bottom: 1px solid var(--border); padding: 34px 0 26px; }
.status-hero .status-wrap { padding-top: 0; padding-bottom: 0; }
.status-brand { display: flex; align-items: center; gap: 14px; }
.status-brand h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.status-brand p { margin: 2px 0 0; color: var(--text-2); }
.status-wrap { max-width: 900px; margin: 0 auto; padding: 24px 16px; }
.status-overall { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 16px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.status-overall .i { width: 30px; height: 30px; flex: none; }
.status-overall strong { font-size: 17px; }
.status-overall.ok { border-color: color-mix(in srgb, var(--up) 45%, transparent); } .status-overall.ok .i { color: var(--up); }
.status-overall.degraded { border-color: color-mix(in srgb, var(--warn) 45%, transparent); } .status-overall.degraded .i { color: var(--warn); }
.status-overall.down { border-color: color-mix(in srgb, var(--down) 55%, transparent); background: color-mix(in srgb, var(--down) 8%, var(--surface)); }
.status-overall.down .i { color: var(--down); }
.status-group { margin-bottom: 22px; }
.status-group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px 4px; }
.status-item { padding: 16px 4px; border-bottom: 1px solid var(--border); }
.status-item:last-child { border-bottom: 0; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.status-name { font-size: 15.5px; }
.status-label { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); }
.status-label.ok { color: var(--up); background: var(--up-soft); } .status-label.degraded { color: var(--warn); background: var(--warn-soft); }
.status-label.down { color: var(--down); background: var(--down-soft); }
.status-uptime { margin-left: auto; font-variant-numeric: tabular-nums; }
.days-legend { display: flex; justify-content: space-between; margin-top: 4px; }
.st-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.st-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.st-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.st-panel-head strong { color: var(--text); font-variant-numeric: tabular-nums; }
svg.st-chart { width: 100%; height: 90px; display: block; }
svg.st-chart .line { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
svg.st-chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.st-axis { display: flex; justify-content: space-between; margin-top: 2px; }
/* ---------- Statusseite-Editor ---------- */
.sp-list { display: flex; flex-direction: column; gap: 10px; }
.sp-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.sp-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: end; margin-top: 6px; }
@media (max-width: 900px) { .sp-fields { grid-template-columns: 1fr 1fr; } }

/* ---------- Verbrauch / Erzeugung ---------- */
.en-figs { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.en-fig { display: flex; flex-direction: column; }
.en-fig .power-total { font-size: 26px; }
.power-total.prod { background: linear-gradient(90deg, var(--up), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.en-balance { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.6; }
.en-balance.plus { color: var(--up); }
.bar.prod { background: linear-gradient(90deg, var(--up), var(--accent-2)); }
.role-producer { color: var(--up); }
.i.role-producer { color: var(--up); } .i.role-consumer { color: var(--warn); } .i.role-grid { color: var(--info); }
.sh-tile.prod { border-color: color-mix(in srgb, var(--up) 55%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--up) 14%, var(--surface-2)), var(--surface-2) 70%);
  box-shadow: 0 0 18px -6px color-mix(in srgb, var(--up) 70%, transparent); }
.sh-tile.prod .sh-top .i, .sh-tile.prod .sh-val { color: var(--up); }

.power-head .actions { display: flex; align-items: center; gap: 6px; }
.ghost.icon-only { padding: 4px 6px; }

/* Suchfeld über langen Auswahllisten */
.select-search { margin-bottom: 6px; }
select[size]:not([size="0"]):not([size="1"]) { padding: 4px; }

.st-live { display: inline-flex; align-items: center; gap: 6px; color: var(--up); font-weight: 600; }
.st-live.off { color: var(--warn); }
.st-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 6px; animation: blink 1.4s infinite; }
.st-live.off .st-live-dot { background: var(--warn); animation: none; }

/* 2FA-Pflicht noch nicht erfüllt: Navigation ausblenden, nur „Mein Konto“ */
body.totp-lock #nav, body.totp-lock #global-search { display: none !important; }

/* ---------- Energie-Auswertung ---------- */
:root { --en-grid: #4f46e5; --en-pv: #0891b2; --en-export: #b45309; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --en-grid: #6366f1; --en-pv: #0891b2; --en-export: #b45309; } }
:root[data-theme="dark"] { --en-grid: #6366f1; --en-pv: #0891b2; --en-export: #b45309; }
.en-c-grid { fill: var(--en-grid); background: var(--en-grid); }
.en-c-pv { fill: var(--en-pv); background: var(--en-pv); }
.en-c-export { fill: var(--en-export); background: var(--en-export); }
.legend i.sw, .en-tip i.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.en-period { min-width: 120px; text-align: center; font-size: 15px; }
.seg-links a { padding: 7px 12px; color: var(--muted); text-decoration: none; background: var(--surface); }
.seg-links a.active { background: var(--accent-soft); color: var(--accent); }
.en-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.en-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.en-tile strong { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--text); }
.en-tile.prod strong { color: var(--up); }
.en-chart { position: relative; }
.en-chart svg { width: 100%; height: auto; display: block; }
.en-grid-line { stroke: var(--border); stroke-width: 1; }
.en-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.en-hit { fill: transparent; cursor: default; }
.en-hit:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.en-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; min-width: 190px; z-index: 5; }
.en-tip strong { display: block; margin-bottom: 4px; }
.en-tip div { display: flex; align-items: center; gap: 2px; color: var(--text-2); }
.en-tip div b { margin-left: auto; padding-left: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.en-bar-cell { width: 30%; min-width: 80px; }
.en-bar-cell .bar { display: block; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.notice.ok { background: var(--up-soft); }
.notice.ok svg { color: var(--up); }
.notice.warn { background: var(--warn-soft); }
.notice.warn svg { color: var(--warn); }

/* Protokolle: Empfangs-Zustand */
.sl-receiver { margin-bottom: 14px; padding: 12px 16px; }
.sl-recv-lines { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 13.5px; }
.sl-recv-lines #sl-test { margin-left: auto; }
.sl-receiver .notice { margin: 10px 0 0; }

/* WLAN-Signal: Balken + dBm (Qualität zusätzlich als Text im title/Label) */
.sig { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sig-bars i { display: block; width: 3px; border-radius: 1px; background: var(--border-strong); }
.sig-bars i:nth-child(1) { height: 4px; } .sig-bars i:nth-child(2) { height: 6px; } .sig-bars i:nth-child(3) { height: 9px; } .sig-bars i:nth-child(4) { height: 12px; }
.sig-up .sig-bars i.on { background: var(--up); } .sig-warn .sig-bars i.on { background: var(--warn); } .sig-down .sig-bars i.on { background: var(--down); }
/* UniFi-Clients */
.uc-tools { margin: 14px 0 8px; }
.uc-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.uc-table th.sorted { color: var(--accent); }
.uc-table td { vertical-align: top; }
td.uc-meter { min-width: 90px; }
td.uc-meter .meter { margin-bottom: 3px; }
.kpi-value.small-val { font-size: 15px; line-height: 1.3; }
.uc-overview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.uc-overview header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.uc-overview h2 { font-size: 14px; display: flex; gap: 8px; align-items: center; margin: 0; }
.wrap-any { word-break: break-all; }

/* Geräteliste: Verbindung laut UniFi */
.dev-card .conn { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); margin: 6px 0 2px; min-width: 0; flex-wrap: wrap; }
.dev-card .conn .ellipsis { max-width: 45%; }
.dev-card .conn .conn-rate { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.conn-cell { display: flex; gap: 6px; align-items: flex-start; }
.conn-cell .i { margin-top: 2px; }
.nowrap { white-space: nowrap; }
#unifi-hint .notice { display: flex; align-items: center; gap: 12px; }
#unifi-hint .notice > span { flex: 1; }

/* Übernehmen / Aufräumen */
#unifi-hint .notice { margin-bottom: 10px; }
.imp-tools { display: flex; gap: 6px; }
.imp-list { max-height: 55vh; overflow: auto; }
.imp-list td { vertical-align: top; }

/* Zustellstatus */
.ch-error { color: var(--down); display: block; }
.ch-error .i { vertical-align: -2px; }
.ch-warn { color: var(--warn); margin-top: 2px; }
.ch-warn .i { vertical-align: -2px; }

/* Alarmtöne */
.sound-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 18px; }
.sound-row { display: flex; align-items: flex-end; gap: 8px; }
.sound-row label { flex: 1; }

/* Verbundene Programme */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips .chip { display: inline-flex; align-items: center; gap: 4px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
pre.code { background: var(--surface-3); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
details.sub > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.card.sub { margin-top: 16px; }
.badge.paused { background: var(--info-soft); color: var(--info); }

/* =====================================================================================
   Leitstand-Design (NOC): technischer Look – Raster, leuchtende LEDs, Monospace-Messwerte,
   Mini-Verläufe. Steht am Ende, damit es die Grundgestaltung überschreibt.
   ===================================================================================== */
:root {
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, monospace;
  --accent: #0e7490; --accent-2: #7c3aed; --accent-soft: #e0f7fb;
  --grid-line: rgb(14 116 144 / 0.06);
  --glow: 0 0 0 transparent;
  --radius: 10px; --radius-sm: 7px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #05090f; --bg-2: #08101b; --surface: #0a121f; --surface-2: #0e1828; --surface-3: #132036;
    --border: #16253b; --border-strong: #22385a; --text: #e4ecf7; --text-2: #b4c3da; --muted: #6f84a3;
    --accent: #22d3ee; --accent-2: #a78bfa; --accent-soft: #072a33; --accent-text: #031216;
    --up: #2ee59d; --up-soft: #062b1f; --down: #ff4d6a; --down-soft: #330c15; --warn: #ffb224; --warn-soft: #33240a;
    --info: #4ea8ff; --info-soft: #0b2440; --unknown: #7d8da6; --unknown-soft: #141f31;
    --grid-line: rgb(34 211 238 / 0.045);
    --glow: 0 0 18px rgb(34 211 238 / 0.08);
  }
}
:root[data-theme="dark"] {
  --bg: #05090f; --bg-2: #08101b; --surface: #0a121f; --surface-2: #0e1828; --surface-3: #132036;
  --border: #16253b; --border-strong: #22385a; --text: #e4ecf7; --text-2: #b4c3da; --muted: #6f84a3;
  --accent: #22d3ee; --accent-2: #a78bfa; --accent-soft: #072a33; --accent-text: #031216;
  --up: #2ee59d; --up-soft: #062b1f; --down: #ff4d6a; --down-soft: #330c15; --warn: #ffb224; --warn-soft: #33240a;
  --info: #4ea8ff; --info-soft: #0b2440; --unknown: #7d8da6; --unknown-soft: #141f31;
  --grid-line: rgb(34 211 238 / 0.045);
  --glow: 0 0 18px rgb(34 211 238 / 0.08);
}

/* Hintergrund: feines Messraster + Lichtschein oben */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 70% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  background-attachment: fixed;
}
code, .mono, .kpi-value, .dc-stats b, .fact b, .sys-strip, th { font-family: var(--mono); }
.mono, td.mono { font-variant-numeric: tabular-nums; }

/* Seitenleiste */
.sidebar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); }
.brand span { font-weight: 700; letter-spacing: 0.01em; }
.nav-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: color-mix(in srgb, var(--accent) 55%, var(--muted)); }
.nav-label::before { content: "// "; opacity: 0.6; }
#nav a { position: relative; border: 1px solid transparent; }
#nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
#nav a.active::before { content: ""; position: absolute; left: -15px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-badge { font-family: var(--mono); box-shadow: 0 0 10px color-mix(in srgb, var(--down) 60%, transparent); }

/* Kopfzeile mit Statusleiste */
.topbar { background: color-mix(in srgb, var(--bg) 78%, transparent); }
.topbar h1 { font-size: 17px; letter-spacing: 0.02em; display: flex; align-items: center; gap: 10px; }
.topbar h1::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sys-strip { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sys-led { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); }
.sys-led:hover { text-decoration: none; border-color: var(--border-strong); }
.sys-led i { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); }
.sys-led b { color: var(--text); font-weight: 700; }
.sys-led span { color: var(--muted); }
.sys-led.up i { background: var(--up); box-shadow: 0 0 8px var(--up); }
.sys-led.down i { background: var(--down); box-shadow: 0 0 8px var(--down); animation: led-blink 1.2s steps(2, start) infinite; }
.sys-led.warn i { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.sys-led.zero i { background: var(--unknown); box-shadow: none; animation: none; }
.sys-clock { margin-left: 4px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border); color: var(--accent);
  background: var(--surface); letter-spacing: 0.06em; min-width: 76px; text-align: center; }
@keyframes led-blink { to { opacity: 0.25; } }
@media (max-width: 1250px) { .sys-led span { display: none; } }
@media (max-width: 960px) { .sys-clock { display: none; } }
@media (max-width: 560px) { .sys-strip { display: none; } }

/* Karten: Akzentlinie oben, Ecken-Markierung, Titel als Kennung */
.card { position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, var(--surface)), var(--surface));
  box-shadow: var(--shadow), var(--glow); }
.card::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 70%, transparent), transparent); opacity: 0.7; }
.card::after { content: ""; position: absolute; right: 7px; top: 7px; width: 9px; height: 9px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-right: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  pointer-events: none; }
.card > header h2 { font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-2); }
.card > header h2 svg { color: var(--accent); width: 16px; height: 16px; padding: 4px; box-sizing: content-box; border-radius: 6px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }

/* Kennzahlen mit Verlauf */
.kpis-noc { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.kpis-noc .kpi { display: block; }
.kpis-noc .kpi-icon { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 8px; }
.kpis-noc .kpi-icon svg { width: 16px; height: 16px; }
.kpis-noc .kpi-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; margin-top: 2px; }
.kpi { position: relative; overflow: hidden; align-items: flex-start; background: var(--surface-2); padding: 14px 14px 12px; min-height: 104px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 9px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; z-index: 1; }
.kpi-label { order: -1; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub b { color: var(--text-2); font-family: var(--mono); }
.kpi-spark:empty { display: none; }
.kpi-spark { position: absolute; left: 0; right: 0; bottom: 0; height: 28px; opacity: 0.9; pointer-events: none; }
.kpi.has-spark { padding-bottom: 36px; }
.tone-up-k .kpi-value { color: var(--up); text-shadow: 0 0 18px color-mix(in srgb, var(--up) 35%, transparent); }
.tone-down-k .kpi-value { color: var(--down); text-shadow: 0 0 18px color-mix(in srgb, var(--down) 35%, transparent); }
.tone-warn-k .kpi-value { color: var(--warn); }

/* Mini-Verlauf */
svg.spark { display: block; width: 100%; height: 100%; overflow: visible; color: var(--accent); }
svg.spark .spark-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
svg.spark .spark-area { fill: currentColor; opacity: 0.12; stroke: none; }
svg.spark .spark-end { fill: currentColor; stroke: none; }
svg.spark.t-up { color: var(--up); } svg.spark.t-down { color: var(--down); } svg.spark.t-warn { color: var(--warn); }
svg.spark.t-info { color: var(--info); } svg.spark.t-muted { color: var(--unknown); }

/* Ring-Anzeige */
.ring { position: relative; display: inline-grid; place-items: center; width: 54px; height: 54px; color: var(--up); }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.ring-fg { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 3px currentColor); }
.ring-val { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); }
.ring-val small { font-size: 9px; color: var(--muted); }
.ring.t-warn { color: var(--warn); } .ring.t-down { color: var(--down); } .ring.t-muted { color: var(--unknown); }

/* Status-Punkte und Plaketten */
.dot.up { box-shadow: 0 0 0 3px var(--up-soft), 0 0 8px var(--up); }
.dot.down { box-shadow: 0 0 0 3px var(--down-soft), 0 0 8px var(--down); }
.badge { border-radius: 5px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent); padding: 1px 7px; }
.chip { font-family: var(--mono); border-radius: 4px; border: 1px solid var(--border); }

/* Gerätekarten: Kennwerte, Verlauf, Status-LED */
.dev-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.dev-card { position: relative; gap: 9px; padding: 14px 14px 12px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 75%, var(--surface)), var(--surface)); }
.dev-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--unknown); opacity: 0.8; }
.dev-card.st-up::before { background: var(--up); box-shadow: 0 0 12px var(--up); }
.dev-card.st-down::before { background: var(--down); box-shadow: 0 0 12px var(--down); }
.dev-card.st-paused::before { background: var(--info); }
.dev-card.st-off { opacity: 0.55; }
.dev-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: var(--shadow), 0 0 22px color-mix(in srgb, var(--accent) 12%, transparent); }
.dev-card .top .ellipsis { flex: 1; }
.led { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--unknown); border: 1px solid rgb(0 0 0 / 0.3); }
.led.up { background: var(--up); box-shadow: 0 0 6px var(--up), 0 0 14px color-mix(in srgb, var(--up) 50%, transparent); }
.led.down { background: var(--down); box-shadow: 0 0 6px var(--down); animation: led-blink 1s steps(2, start) infinite; }
.led.paused { background: var(--info); box-shadow: 0 0 6px var(--info); }
.dc-facts { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); }
.dc-facts > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dc-facts > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-facts svg { color: color-mix(in srgb, var(--accent) 70%, var(--muted)); }
.dc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.dc-stats > div { background: var(--surface-2); padding: 5px 8px; min-width: 0; }
.dc-stats label { display: block; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.dc-stats b { font-size: 12.5px; color: var(--text); white-space: nowrap; }
.av-up { color: var(--up) !important; } .av-warn { color: var(--warn) !important; } .av-down { color: var(--down) !important; }
.dc-spark { height: 26px; margin: 0 -2px; }
.dev-card .meta { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.dc-spark:empty { display: none; }

/* Gerätekopf: Kennzahlenleiste */
.dev-hero h1 { font-size: 22px; letter-spacing: 0; }
.dev-icon.lg { box-shadow: 0 0 24px color-mix(in srgb, currentColor 25%, transparent); border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.fact-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin-top: 16px;
  background: var(--border); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.fact { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-2); min-width: 0; }
.fact > svg { color: var(--accent); flex: none; }
.fact > span { min-width: 0; }
.fact label { display: block; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.fact b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reiter, Tabellen, Listen */
.tabs button { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.tabs button.active { text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
th { font-size: 10.5px; letter-spacing: 0.12em; background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
tbody tr.clickable:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.list li { border-bottom-style: dashed; }

/* Hinweise und Leerzustände */
.notice { border-left: 3px solid var(--accent); }
.empty svg { color: color-mix(in srgb, var(--accent) 60%, var(--muted)); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 40%, transparent)); }

@media (prefers-reduced-motion: reduce) { .led.down, .sys-led.down i { animation: none; } }

/* ---------------------------------------------------------------------------
   Leitstand, Sektoren, Rechte
   --------------------------------------------------------------------------- */
.link-btn { background: none; border: 0; color: var(--accent); padding: 4px 0; font-size: 13px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { filter: none; background: none; }
.filter-row { margin-bottom: 12px; }
.muted-row td { opacity: 0.6; }
tr.acked td { opacity: 0.75; }
tr.acked td:first-child, tr.sev-critical td:first-child, tr.sev-warning td:first-child { box-shadow: inset 3px 0 0 var(--info); }
tr.sev-critical td:first-child { box-shadow: inset 3px 0 0 var(--down); }
tr.sev-warning td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.dc-tags { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; }
.assign-row { align-items: flex-end; margin-bottom: 6px; }
.assign-row > button { margin-bottom: 4px; }
.perm-row { align-items: flex-start; margin: 6px 0; }
.move-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.token-show { display: block; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-3); word-break: break-all; user-select: all; }
.audit-filter { margin-bottom: 14px; padding: 14px; }
.audit-filter > button { margin-bottom: 2px; }

.ls-head { margin-bottom: 14px; }
.ls-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); }
.ls-kpis { margin-bottom: 16px; }
.ls-kpis .kpi.k-up .kpi-icon { background: var(--up-soft); color: var(--up); }
.ls-kpis .kpi.k-down { border-color: var(--down); }
.ls-kpis .kpi.k-down .kpi-icon { background: var(--down-soft); color: var(--down); }
.ls-kpis .kpi.k-down .kpi-value { color: var(--down); }
.ls-kpis .kpi.k-warn .kpi-icon { background: var(--warn-soft); color: var(--warn); }
.ls-kpis .kpi.k-info .kpi-icon { background: var(--info-soft); color: var(--info); }
.ls-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ls-tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "light name" "light state" "nums nums" "alerts alerts";
  gap: 4px 12px; align-items: center; text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.ls-tile:hover { border-color: var(--border-strong); filter: none; }
.ls-tile:disabled { cursor: default; opacity: 1; }
.ls-light { grid-area: light; width: 22px; height: 22px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 5px var(--up-soft); }
.ls-name { grid-area: name; font-weight: 700; font-size: 16px; }
.ls-state { grid-area: state; color: var(--muted); font-size: 12.5px; }
.ls-nums { grid-area: nums; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.ls-nums .down { color: var(--down); }
.ls-alerts { grid-area: alerts; display: flex; flex-wrap: wrap; gap: 4px; }
.ls-tile.st-red { border-color: var(--down); background: color-mix(in srgb, var(--down-soft) 45%, var(--surface)); }
.ls-tile.st-red .ls-light { background: var(--down); box-shadow: 0 0 0 5px var(--down-soft); animation: blink 1.2s infinite; }
.ls-tile.st-yellow { border-color: var(--warn); }
.ls-tile.st-yellow .ls-light { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
.ls-tile.st-maintenance .ls-light { background: var(--info); box-shadow: 0 0 0 5px var(--info-soft); }
.ls-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--up); }
.ls-dot.st-red { background: var(--down); } .ls-dot.st-yellow { background: var(--warn); } .ls-dot.st-maintenance { background: var(--info); }
.ls-tiles:empty { display: none; }
/* Elemente in frei wählbarer Reihenfolge: Abstand über das Gerüst statt über die Elemente */
#ls-body { display: flex; flex-direction: column; gap: 16px; }
#ls-body .ls-kpis, #ls-body .ls-tiles { margin-bottom: 0; }
#ls-body > #ls-kpis:empty { display: none; }
/* Dialog „Leitstand anpassen“ */
.ls-cfg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ls-cfg-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.ls-cfg-list li:first-child [data-up], .ls-cfg-list li:last-child [data-down] { visibility: hidden; }
.ls-cfg-move { display: flex; gap: 2px; flex-shrink: 0; }
.ls-cfg-list input[type="checkbox"] { flex-shrink: 0; }

/* Leitstand-Bildschirm (Kiosk) und Vollbild: ohne Menü, größere Schrift */
body.kiosk .sidebar, body.kiosk .menu-btn, body.kiosk .search, body.kiosk #logout { display: none !important; }
body.kiosk .shell { grid-template-columns: 1fr; }
body.kiosk .ls-name { font-size: 20px; }
body.kiosk .ls-table { font-size: 15px; }
:fullscreen .sidebar, :fullscreen .topbar { display: none; }
:fullscreen .shell { grid-template-columns: 1fr; }

/* Einrichtungs-Assistent */
.wizard > header { margin-bottom: 8px; }
.wz-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; counter-reset: wz; }
.wz-steps li { flex: 1 1 120px; }
.wz-steps a { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  color: var(--muted); text-decoration: none; font-size: 13px; background: var(--surface-2); }
.wz-steps li.current a { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.wz-steps li.done a { color: var(--up); }
#wz-body > p:first-child { margin-top: 0; }
#wz-body .table-wrap, #wz-body > .actions, .wz-manual { margin: 12px 0; }
.wz-manual { align-items: end; }
.wz-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.wz-router { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 12px 0; background: var(--surface-2); }
.wz-router > header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: start; }
.wz-router p { margin: 8px 0 0; }
.wz-router .notice { margin: 10px 0 0; }
.wz-family { min-width: 220px; font-size: 13px; }
.wz-methods { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.wz-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-2); background: var(--surface-2); }
.wz-tile b { font-size: 24px; color: var(--text); }
.wz-types { display: flex; gap: 6px; flex-wrap: wrap; }
.wz-types a { text-decoration: none; }

/* Eigene Abfragen */
.form-row > label.narrow { flex: 0 0 9rem; }
pre.pre-wrap { white-space: pre-wrap; word-break: break-word; max-height: 18rem; overflow: auto; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.cq-value { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Drucker: Tonerfarben im Füllstandsbalken */
.meter.toner-black > span { background: #3b3f4a; }
.meter.toner-cyan > span { background: #06b6d4; }
.meter.toner-magenta > span { background: #d946ef; }
.meter.toner-yellow > span { background: #eab308; }
.meter.warn.toner-black > span, .meter.warn.toner-cyan > span, .meter.warn.toner-magenta > span, .meter.warn.toner-yellow > span { opacity: 0.75; }
.meter.crit[class*="toner-"] > span { background: var(--down); opacity: 1; }
