/* LiPATCH – Design-System (RMM-Konsole: dunkle Navigation, dichte Datenansichten) */

:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef1f5;
  --hover: #f3f6fa;
  --border: #dde2e9;
  --border-strong: #c9d0da;
  --text: #17202c;
  --text-2: #354152;
  --muted: #66738a;
  --faint: #98a2b3;
  --accent: #1f6feb;
  --accent-hover: #175ccc;
  --accent-soft: #e8f0fe;
  --accent-text: #1559c7;
  --ok: #19a463;
  --ok-soft: #e6f6ee;
  --ok-text: #11804b;
  --warn: #e8890c;
  --warn-soft: #fff4e5;
  --warn-text: #b4650a;
  --crit: #dc3545;
  --crit-soft: #fdecee;
  --crit-text: #b42232;
  --info: #0b8bd9;
  --info-soft: #e7f4fc;
  --info-text: #076aa6;
  --console-bg: #0d1117;
  --console-text: #d1d7e0;
  /* Navigation – in beiden Modi dunkel */
  --nav-bg: #111b2b;
  --nav-bg-2: #0c1522;
  --nav-text: #a9b6ca;
  --nav-text-hi: #ffffff;
  --nav-hover: rgba(255, 255, 255, .06);
  --nav-active: rgba(61, 139, 255, .16);
  --nav-accent: #3d8bff;
  --nav-border: rgba(255, 255, 255, .07);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 40px -10px rgba(16, 24, 40, .28), 0 4px 10px rgba(16, 24, 40, .08);
  --ring: 0 0 0 3px rgba(31, 111, 235, .2);
  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 232px;
  --sidebar-rail: 64px;
  --topbar-h: 56px;
  --font: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1119; --surface: #121a25; --surface-2: #151e2a; --surface-3: #1b2533; --hover: #18212e;
    --border: #243042; --border-strong: #314056; --text: #e6ebf2; --text-2: #c3ccd9; --muted: #8b97aa; --faint: #5f6b7e;
    --accent: #3d8bff; --accent-hover: #67a3ff; --accent-soft: rgba(61, 139, 255, .15); --accent-text: #8cbcff;
    --ok: #2fbf7a; --ok-soft: rgba(47, 191, 122, .14); --ok-text: #5fd69b;
    --warn: #f59f2a; --warn-soft: rgba(245, 159, 42, .14); --warn-text: #ffbe5c;
    --crit: #f05462; --crit-soft: rgba(240, 84, 98, .15); --crit-text: #ff8a94;
    --info: #2aa7f0; --info-soft: rgba(42, 167, 240, .15); --info-text: #7fcbf7;
    --console-bg: #070b10; --nav-bg: #0a111b; --nav-bg-2: #070c14;
    --shadow-sm: none; --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .75);
    --ring: 0 0 0 3px rgba(61, 139, 255, .32);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1119; --surface: #121a25; --surface-2: #151e2a; --surface-3: #1b2533; --hover: #18212e;
  --border: #243042; --border-strong: #314056; --text: #e6ebf2; --text-2: #c3ccd9; --muted: #8b97aa; --faint: #5f6b7e;
  --accent: #3d8bff; --accent-hover: #67a3ff; --accent-soft: rgba(61, 139, 255, .15); --accent-text: #8cbcff;
  --ok: #2fbf7a; --ok-soft: rgba(47, 191, 122, .14); --ok-text: #5fd69b;
  --warn: #f59f2a; --warn-soft: rgba(245, 159, 42, .14); --warn-text: #ffbe5c;
  --crit: #f05462; --crit-soft: rgba(240, 84, 98, .15); --crit-text: #ff8a94;
  --info: #2aa7f0; --info-soft: rgba(42, 167, 240, .15); --info-text: #7fcbf7;
  --console-bg: #070b10; --nav-bg: #0a111b; --nav-bg-2: #070c14;
  --shadow-sm: none; --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .75);
  --ring: 0 0 0 3px rgba(61, 139, 255, .32);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- Basis */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 13.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text); }
h1 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 14px; font-weight: 600; }
h3 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
svg.i { width: 16px; height: 16px; flex: none; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.lg { width: 20px; height: 20px; }
svg.i.xl { width: 28px; height: 28px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.nowrap-row { display: flex; align-items: center; }
.gap-xs { gap: 4px; } .gap-s { gap: 8px; } .gap { gap: 12px; } .gap-l { gap: 20px; }
.stack { display: grid; gap: 4px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-ok { color: var(--ok-text); } .t-warn { color: var(--warn-text); } .t-crit { color: var(--crit-text); } .t-info { color: var(--info-text); }
::selection { background: rgba(31, 111, 235, .22); }

/* ---------------------------------------------------------------- Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 460px) 1fr; background: var(--bg); }
.login-side {
  background: radial-gradient(700px 400px at 0% 0%, rgba(61, 139, 255, .28), transparent 60%), linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2));
  color: var(--nav-text); padding: 36px 40px; display: flex; flex-direction: column; gap: 40px;
}
.login-side .brand-name { color: #fff; }
.login-claim { margin-top: auto; display: grid; gap: 22px; }
.login-claim h2 { color: #fff; font-size: 24px; line-height: 1.3; font-weight: 650; letter-spacing: -.015em; }
.login-claim ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.login-claim li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.login-claim li svg { color: var(--nav-accent); margin-top: 2px; }
.login-foot { margin-top: auto; font-size: 12px; color: #6f7f96; }
.login-main { display: grid; place-items: center; padding: 24px 16px; }
.login-box {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-lg); display: grid; gap: 16px;
}
.login-box p { margin-top: 4px; }

/* ---------------------------------------------------------------- Shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2)); color: var(--nav-text);
  display: flex; flex-direction: column; z-index: 30; overflow: hidden;
}
.side-top { height: var(--topbar-h); display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--nav-border); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.sidebar .brand-name { color: #fff; }
.logo {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none;
  background: linear-gradient(135deg, #3d8bff, #1f5fd6); box-shadow: 0 2px 8px rgba(31, 111, 235, .45); letter-spacing: -.02em;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; scrollbar-width: thin; }
.nav-group { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: #66768e; padding: 16px 10px 6px; white-space: nowrap; }
#nav a {
  position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 6px; color: var(--nav-text);
  font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
#nav a svg { width: 18px; height: 18px; color: #8597b1; }
#nav a:hover { background: var(--nav-hover); color: var(--nav-text-hi); text-decoration: none; }
#nav a:hover svg { color: var(--nav-text-hi); }
#nav a.active { background: var(--nav-active); color: var(--nav-text-hi); }
#nav a.active svg { color: var(--nav-accent); }
#nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-accent); }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 650; min-width: 20px; height: 18px; line-height: 18px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--crit); color: #fff; }
.nav-count.info { background: var(--nav-accent); }
.side-foot { border-top: 1px solid var(--nav-border); padding: 8px 10px 12px; display: grid; gap: 4px; flex: none; }
.side-collapse {
  display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px; border-radius: 6px; border: none; background: none;
  color: var(--nav-text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; width: 100%;
}
.side-collapse:hover { background: var(--nav-hover); color: #fff; }
.side-version { display: flex; align-items: center; gap: 12px; padding: 4px 16px; font-size: 11.5px; color: #66768e; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 191, 122, .2); flex: none; }

/* eingeklappte Navigation */
.app.collapsed { grid-template-columns: var(--sidebar-rail) minmax(0, 1fr); }
.app.collapsed .lbl, .app.collapsed .nav-group, .app.collapsed .brand-name { display: none; }
.app.collapsed .side-top { padding: 0; justify-content: center; }
.app.collapsed #nav a, .app.collapsed .side-collapse { justify-content: center; padding: 0; }
.app.collapsed .side-collapse svg { transform: scaleX(-1); }
.app.collapsed .side-version { justify-content: center; padding: 4px 0; }
.app.collapsed .nav-count { position: absolute; top: 3px; right: 5px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
.app.collapsed #nav .nav-group + a { margin-top: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.global-search {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; height: 36px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--faint); font: inherit; font-size: 13.5px; cursor: text; text-align: left;
}
.global-search:hover { border-color: var(--border-strong); }
.global-search .ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { margin-left: auto; font-size: 11px; font-family: var(--font); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--surface); white-space: nowrap; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.icon-btn .badge-dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--crit); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
#btn-menu { display: none; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; }
.user-btn:hover { background: var(--hover); }
.user-btn svg { color: var(--muted); width: 14px; height: 14px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 650; font-size: 12px; color: #fff; flex: none;
  background: linear-gradient(135deg, #5b6cff, #1f6feb); letter-spacing: .02em;
}
.menu-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; animation: rise .12s ease-out;
}
.dropdown.left { right: auto; left: 0; }
.dropdown .head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown > button, .dropdown > a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: none; background: none; color: var(--text-2);
  font: inherit; font-size: 13.5px; border-radius: var(--radius-sm); cursor: pointer; text-align: left; white-space: nowrap;
}
.dropdown > button svg, .dropdown > a svg { color: var(--muted); }
.dropdown > button:hover, .dropdown > a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.dropdown > button:disabled { opacity: .45; cursor: not-allowed; background: none; }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown .danger, .dropdown .danger svg { color: var(--crit-text); }
.dropdown .dd-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 6px 10px 4px; }
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--radius-sm); margin: 4px 0; }
.theme-switch button { display: flex; justify-content: center; padding: 5px; font: inherit; font-size: 12px; color: var(--muted); border: none; background: none; border-radius: 4px; cursor: pointer; }
.theme-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Benachrichtigungen */
.dropdown.notif { width: 380px; padding: 0; max-width: calc(100vw - 24px); }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:hover { background: var(--hover); text-decoration: none; }
.notif-item .title { font-weight: 550; font-size: 13px; }
.notif-item .meta { color: var(--muted); font-size: 12px; }
.notif-foot { display: block; text-align: center; padding: 10px; font-size: 13px; font-weight: 550; }

.page { padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; width: 100%; max-width: 1680px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .subtitle { color: var(--muted); margin-top: 2px; font-size: 13px; }
.page-head > .grow { flex: 1 1 340px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; margin-bottom: 4px; }
.crumbs:empty { display: none; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-text); text-decoration: none; }
.crumbs svg { width: 13px; height: 13px; color: var(--faint); }
#view { display: grid; gap: 16px; min-width: 0; }
#view > *, .grid > *, [data-tab] > * { min-width: 0; }

/* ---------------------------------------------------------------- Karten / Widgets */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 48px; }
.card-head h2 { font-size: 13.5px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .link { margin-left: auto; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.card-head .link svg { width: 14px; height: 14px; }
.card-body { padding: 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Statusleiste (Kacheln mit Kennzahlen) */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-right: 1px solid var(--border); color: var(--text); min-width: 0; position: relative; }
.tile:last-child { border-right: none; }
a.tile:hover { background: var(--hover); text-decoration: none; }
.tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.tile.ok::after { background: var(--ok); } .tile.warn::after { background: var(--warn); } .tile.crit::after { background: var(--crit); } .tile.info::after { background: var(--accent); }
.tile:first-child::after { border-bottom-left-radius: var(--radius); }
.tile:last-child::after { border-bottom-right-radius: var(--radius); }
.tile-icon { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.tile.ok .tile-icon { background: var(--ok-soft); color: var(--ok-text); }
.tile.warn .tile-icon { background: var(--warn-soft); color: var(--warn-text); }
.tile.crit .tile-icon { background: var(--crit-soft); color: var(--crit-text); }
.tile.info .tile-icon { background: var(--accent-soft); color: var(--accent-text); }
.tile-value { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-value small { font-size: 13px; color: var(--muted); font-weight: 550; margin-left: 2px; }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* KPI (Updates-Seite etc.) */
.kpi { padding: 16px; display: grid; gap: 8px; color: var(--text); position: relative; }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi-icon { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.kpi-icon.ok { background: var(--ok-soft); color: var(--ok-text); }
.kpi-icon.warn { background: var(--warn-soft); color: var(--warn-text); }
.kpi-icon.crit { background: var(--crit-soft); color: var(--crit-text); }
.kpi-icon.info { background: var(--accent-soft); color: var(--accent-text); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 550; margin-left: 2px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: flex; }
.kpi-bar span { height: 100%; }

/* Listen */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); min-width: 0; }
.list-item:last-child { border-bottom: none; }
a.list-item:hover { background: var(--hover); text-decoration: none; }
.list-item .title { font-weight: 550; font-size: 13px; }
.list-item .meta { color: var(--muted); font-size: 12px; }
.list-item > svg:last-child { color: var(--faint); }
.list-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.list-icon.ok { background: var(--ok-soft); color: var(--ok-text); }
.list-icon.warn { background: var(--warn-soft); color: var(--warn-text); }
.list-icon.crit { background: var(--crit-soft); color: var(--crit-text); }
.list-icon.info { background: var(--accent-soft); color: var(--accent-text); }

/* Aktivitäts-Zeitleiste */
.timeline { display: flex; flex-direction: column; padding: 6px 0; }
.tl-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 8px 16px; color: var(--text); position: relative; }
a.tl-item:hover { background: var(--hover); text-decoration: none; }
.tl-item::before { content: ""; position: absolute; left: 29px; top: 36px; bottom: -8px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); position: relative; z-index: 1; border: 2px solid var(--surface); }
.tl-dot svg { width: 14px; height: 14px; }
.tl-dot.ok { background: var(--ok-soft); color: var(--ok-text); }
.tl-dot.crit { background: var(--crit-soft); color: var(--crit-text); }
.tl-dot.warn { background: var(--warn-soft); color: var(--warn-text); }
.tl-dot.info { background: var(--accent-soft); color: var(--accent-text); }
.tl-item .title { font-weight: 550; font-size: 13px; }
.tl-item .meta { color: var(--muted); font-size: 12px; }
.tl-item .when { color: var(--faint); font-size: 12px; white-space: nowrap; padding-top: 2px; }

/* Donut / Legende / Balken */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 124px; height: 124px; flex: none; }
.donut .track { stroke: var(--surface-3); }
.donut-center { font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-label { font-size: 10px; fill: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.legend { display: grid; gap: 6px; flex: 1; min-width: 150px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 2px 4px; margin: 0 -4px; }
.legend-row .val { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
a.legend-row { color: var(--text); border-radius: var(--radius-sm); }
a.legend-row:hover { text-decoration: none; background: var(--hover); }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.c-ok { background: var(--ok); stroke: var(--ok); }
.c-warn { background: var(--warn); stroke: var(--warn); }
.c-crit { background: var(--crit); stroke: var(--crit); }
.c-info { background: var(--info); stroke: var(--info); }
.c-unk { background: var(--border-strong); stroke: var(--border-strong); }
.c-accent { background: var(--accent); stroke: var(--accent); }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
a.hbar:hover { text-decoration: none; color: var(--accent-text); }
.hbar .track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 999px; }
.hbar .val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th, td { text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2);
  white-space: nowrap; position: sticky; top: 0; z-index: 1; height: 36px;
}
thead th:first-child { border-top-left-radius: var(--radius); }
thead th:last-child { border-top-right-radius: var(--radius); }
.card-head + .table-wrap th, .toolbar + .table-wrap th, .card-head + div .table-wrap th, .toolbar + div th { border-radius: 0 !important; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--hover); }
tr.clickable { cursor: pointer; }
tr.selected td { background: var(--accent-soft) !important; }
td.check, th.check { width: 36px; padding-right: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.st, th.st { width: 28px; padding-right: 0; }
.cell-main { font-weight: 550; color: var(--text); }
a.cell-main:hover { color: var(--accent-text); }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.host-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.host-avatar { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); position: relative; }
.host-avatar .st { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--faint); }
.host-avatar .st.on { background: var(--ok); }
.host-avatar .st.off { background: var(--crit); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.issue-icons { display: inline-flex; gap: 4px; align-items: center; }
.issue { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; }
.issue svg { width: 13px; height: 13px; }
.issue.crit { background: var(--crit-soft); color: var(--crit-text); }
.issue.warn { background: var(--warn-soft); color: var(--warn-text); }
.issue.info { background: var(--accent-soft); color: var(--accent-text); }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .count { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.search-box { position: relative; flex: 0 1 320px; min-width: 180px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box input { padding-left: 32px; height: 34px; }
.toolbar select { width: auto; min-width: 140px; height: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.chip .n { font-size: 11px; font-weight: 650; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.chip.on .n { background: var(--accent); color: #fff; }
.chip .x { display: inline-grid; place-items: center; margin-right: -4px; }
.chip .x svg { width: 12px; height: 12px; }

/* Filter-Spalte (Host-Liste) */
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.facets { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto; }
.facet { padding: 10px 0; border-bottom: 1px solid var(--border); }
.facet:last-child { border-bottom: none; }
.facet h3 { padding: 2px 14px 6px; }
.facet-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 14px; border: none; background: none; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; text-align: left; }
.facet-opt:hover { background: var(--hover); color: var(--text); }
.facet-opt.on { color: var(--accent-text); font-weight: 600; background: var(--accent-soft); }
.facet-opt .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.facet-opt.on .n { color: var(--accent-text); }
.facet-opt .dot { width: 8px; height: 8px; box-shadow: none; }
.facet-opt svg { color: var(--muted); width: 14px; height: 14px; }
.facets-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.facets-toggle { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: default; }
.facets-toggle svg { color: var(--muted); }
.facets-toggle svg:last-child { display: none; }
.linkbtn { border: none; background: none; color: var(--accent-text); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; font-weight: 550; }
.linkbtn:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- Formulare */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); cursor: pointer; }
input, select, textarea {
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 11px; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { padding-right: 28px; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; flex: none; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 280px; tab-size: 4; background: var(--surface-2); line-height: 1.55; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.section-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 6px; }
.field-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; background: var(--surface-2); }
.field-group > .legend-title { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 6px; gap: 2px; flex-wrap: wrap; }
.seg label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 4px; cursor: pointer; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: inline-grid; place-items: center; width: 42px; height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; color: var(--muted); }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.option-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.option-card { display: grid; gap: 2px; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; font-weight: 400; position: relative; }
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-card strong { font-size: 13px; color: var(--text); font-weight: 600; }
.option-card span { font-size: 12px; color: var(--muted); }
.option-card:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); background: var(--accent-soft); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(31, 111, 235, .35); }
.btn.primary svg { color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--crit-text); }
.btn.danger svg { color: var(--crit-text); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.danger.solid svg { color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 550;
  white-space: nowrap; background: var(--surface-3); color: var(--text-2); border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.badge svg { width: 12px; height: 12px; }
.badge.ok { background: var(--ok-soft); color: var(--ok-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.crit { background: var(--crit-soft); color: var(--crit-text); }
.badge.info { background: var(--accent-soft); color: var(--accent-text); }
.badge.outline { background: transparent; border-color: var(--border-strong); color: var(--muted); }
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live .d { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 500; margin: 1px 4px 1px 0; border: 1px solid var(--border); }
a.tag:hover { text-decoration: none; border-color: var(--border-strong); }

/* Meter */
.meter { display: grid; grid-template-columns: 34px minmax(36px, 1fr); align-items: center; gap: 6px; font-size: 12px; min-width: 84px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.bar { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; width: 0; }
.bar.warn > span { background: var(--warn); }
.bar.crit > span { background: var(--crit); }
.bar.accent > span { background: var(--accent); }

/* ---------------------------------------------------------------- Host-Detail */
.device { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.device-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 16px; }
.device-id { padding: 18px 16px 14px; display: grid; gap: 12px; justify-items: start; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border-radius: var(--radius) var(--radius) 0 0; }
.device-id .row1 { display: flex; gap: 12px; align-items: center; width: 100%; }
.device-icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; position: relative; }
.device-icon .st { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); background: var(--faint); }
.device-icon .st.on { background: var(--ok); }
.device-icon .st.off { background: var(--crit); }
.device-id h1 { font-size: 17px; overflow-wrap: anywhere; }
.device-id .sub { color: var(--muted); font-size: 12.5px; }
.device-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.device-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.device-actions .dropdown { left: 0; right: auto; }
.props { display: grid; padding: 6px 0; }
.prop { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 10px; padding: 7px 16px; font-size: 13px; }
.prop svg { color: var(--faint); margin-top: 2px; }
.prop .k { font-size: 11.5px; color: var(--muted); }
.prop .v { color: var(--text); overflow-wrap: anywhere; }
.device-main { display: grid; gap: 16px; min-width: 0; }
.device-main > * { min-width: 0; }

.gauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauge { padding: 14px 16px; border-right: 1px solid var(--border); display: grid; gap: 8px; min-width: 0; }
.gauge:last-child { border-right: none; }
.gauge .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 550; }
.gauge .label svg { width: 14px; height: 14px; }
.gauge .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.gauge .value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.gauge .bar { height: 5px; }

/* Kennzahlen-Leiste (Job-Detail) */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { padding: 12px 16px; border-right: 1px solid var(--border); display: grid; gap: 4px; min-width: 0; }
.stat:last-child { border-right: none; }
.stat .label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .value { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .value.small { font-size: 13px; font-weight: 550; }

/* Tabs */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 8px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; font-size: 13px; }
.tabs a svg { width: 15px; height: 15px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-weight: 650; }
.tabs .n.crit { background: var(--crit-soft); color: var(--crit-text); }

/* Definitionslisten */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 9px 20px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }

/* Konsole & Code */
.console {
  background: var(--console-bg); color: var(--console-text); border-radius: var(--radius); padding: 14px 16px; max-height: 620px; overflow: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border);
}
.code-block { position: relative; background: var(--console-bg); color: #e6edf3; border-radius: var(--radius); padding: 14px 52px 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.6; word-break: break-all; border: 1px solid var(--border); }
.code-block .prompt { color: #7ee787; user-select: none; margin-right: 8px; }
.code-block .copy { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #e6edf3; box-shadow: none; }
.code-block .copy:hover { background: rgba(255, 255, 255, .16); }
.code-block .copy svg { color: #e6edf3; }

/* Diagramme */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.chart { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 8px; background: var(--surface); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.chart-head span { font-size: 12px; color: var(--muted); font-weight: 550; }
.chart-head strong { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: 90px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart .area { opacity: .12; }
.chart .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.s-cpu { stroke: #1f6feb; fill: #1f6feb; } .s-mem { stroke: #7c4dff; fill: #7c4dff; } .s-disk { stroke: #e8890c; fill: #e8890c; } .s-load { stroke: #0f9f8f; fill: #0f9f8f; }

/* Leere Zustände */
.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty .empty-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }
.empty .empty-icon.ok { background: var(--ok-soft); color: var(--ok-text); }
.empty h2 { color: var(--text); }
.empty p { max-width: 420px; font-size: 13px; }
.empty.compact { padding: 26px 18px; }
.card > .empty { border-radius: var(--radius); }

/* Onboarding */
.onboard { padding: 28px; display: grid; gap: 18px; background: linear-gradient(120deg, var(--accent-soft), transparent 65%), var(--surface); }
.hero-icon { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.step p { color: var(--muted); font-size: 13px; }

/* Hinweise */
.callout { display: flex; gap: 12px; padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.callout svg { margin-top: 2px; color: var(--muted); }
.callout.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok-text); }
.callout.ok svg { color: var(--ok-text); }
.callout.info { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.callout.info svg { color: var(--accent-text); }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-text); }
.callout.warn svg { color: var(--warn-text); }
.callout.crit { background: var(--crit-soft); border-color: transparent; color: var(--crit-text); }
.callout.crit svg { color: var(--crit-text); }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 550; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary svg { transform: rotate(90deg); }
details.more > div { margin-top: 12px; }
details.card > summary { list-style: none; cursor: pointer; border-bottom: none; }
details.card[open] > summary { border-bottom: 1px solid var(--border); }
details.card > summary svg { transition: transform .15s; }
details.card[open] > summary svg { transform: rotate(90deg); }

/* Einstellungen */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.subnav { display: grid; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 16px); padding: 6px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; }
.subnav a:hover { background: var(--hover); text-decoration: none; }
.subnav a.active { background: var(--accent-soft); color: var(--accent-text); }
.subnav a svg { color: var(--muted); }
.subnav a.active svg { color: var(--accent-text); }

/* Schweregrad-Leiste */
.sev-row td:first-child { box-shadow: inset 3px 0 0 var(--border-strong); }
.sev-row.critical td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.sev-row.warning td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.sev-row.info td:first-child { box-shadow: inset 3px 0 0 var(--info); }

/* Fortschritt (Batch) */
.progress { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.progress span { height: 100%; }

/* ---------------------------------------------------------------- Modal & Palette */
.overlay { position: fixed; inset: 0; background: rgba(10, 17, 27, .5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.modal { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); width: 100%; max-width: 580px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: rise .16s ease-out; }
.modal.wide { max-width: 880px; }
.modal-head { padding: 16px 20px 14px; display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.modal-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 0 20px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.form-error { color: var(--crit-text); background: var(--crit-soft); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 14px; }
.host-picker { max-height: 230px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.host-picker label { display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--border); font-weight: 400; color: var(--text); cursor: pointer; }
.host-picker label:hover { background: var(--hover); }
.host-picker label:last-child { border-bottom: none; }

.palette { align-items: start; padding-top: 10vh; }
.palette-box { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .14s ease-out; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-input input { border: none; box-shadow: none !important; padding: 0; font-size: 15px; background: transparent; }
.palette-list { max-height: 400px; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); }
.palette-item svg { color: var(--muted); }
.palette-item .meta { margin-left: auto; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.palette-item.on { background: var(--accent-soft); color: var(--accent-text); }
.palette-item.on svg { color: var(--accent-text); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11.5px; background: var(--surface-2); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 70; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 11px 14px; box-shadow: var(--shadow-lg); max-width: 400px; font-size: 13px; animation: rise .16s ease-out; }
.toast svg { margin-top: 2px; color: var(--accent); }
.toast.err { border-left-color: var(--crit); }
.toast.err svg { color: var(--crit); }
.toast.ok { border-left-color: var(--ok); }
.toast.ok svg { color: var(--ok); }

/* Rollen */
body[data-role="viewer"] .op { display: none !important; }
body:not([data-role="admin"]) .adm { display: none !important; }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1400px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:nth-child(3) { border-right: none; }
  .tile:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .device { grid-template-columns: 1fr; }
  .device-side { position: static; }
  .split { grid-template-columns: 1fr; }
  .facets { position: static; max-height: none; display: flex; flex-wrap: wrap; overflow: visible; }
  .facets-head { width: 100%; }
  .facet { flex: 1 1 200px; border-bottom: none; border-right: 1px solid var(--border); }
  .facet:last-child { border-right: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-right: none; }
  .stat:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .app.collapsed .lbl, .app.collapsed .nav-group, .app.collapsed .brand-name { display: revert; }
  .side-collapse { display: none; }
  #btn-menu { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 6px; }
  .global-search .kbd { display: none; }
  .page { padding: 16px 16px 60px; }
  .grid-2, .grid-3, .steps, .settings { grid-template-columns: 1fr; }
  .subnav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .search-box { flex: 1 1 100%; }
  .page-actions { margin-left: 0; }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge:nth-child(2) { border-right: none; }
  .gauge:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .facets-toggle { cursor: pointer; }
  .facets-toggle svg:last-child { display: inline; }
  .facets.m-closed .facet { display: none; }
  .facets.m-closed .facets-head { border-bottom: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { border-right: none !important; border-bottom: 1px solid var(--border); padding: 12px; }
  .tile:nth-child(odd) { border-right: 1px solid var(--border) !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-right: none !important; border-bottom: 1px solid var(--border); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .hide-sm { display: none; }
  .global-search { width: 40px; flex: none; padding: 0; justify-content: center; }
  .global-search .ph { display: none; }
  .facet { flex-basis: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .hbar { grid-template-columns: 90px minmax(0, 1fr) 30px; }
}

.page-head:empty { display: none; }
.page-head.compact h1, .page-head.compact .subtitle { display: none; }
.page-head.compact .crumbs { margin-bottom: 0; }
p.muted.small svg { vertical-align: -3px; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--text); }
th.sort svg { width: 12px; height: 12px; vertical-align: -2px; margin-left: 4px; color: var(--accent-text); }
.device-actions .menu-wrap .btn { width: 100%; }
.device-actions .menu-wrap .btn svg:last-child { margin-left: auto; }
.page-actions .muted svg { vertical-align: -2px; }
.facets-head h2 svg { vertical-align: -2px; color: var(--muted); }
.cell-sub.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 640px; white-space: normal; }
.console.script-view { max-height: 460px; }
select optgroup { font-weight: 600; }
