/* Leitwerk – Steuerzentrale. Nur System-Schriften und eigene Dateien (strenge CSP).
   Eine Schicht, keine Nachbesserungs-Blöcke: jede Klasse genau einmal.
   Maße: Abstände 4 · 8 · 12 · 16 · 24 · 32. Knopf 30 px, klein 26 px, Feld 32 px. */

:root {
  --bg: #f4f5f7;
  --bg-2: #eceef2;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --fg: #151821;
  --fg-2: #4a5061;
  --muted: #7d8394;
  --line: #e2e5eb;
  --line-2: #d3d7df;
  --accent: #4a5cf0;
  --accent-soft: #eceefe;
  --ok: #17915a;
  --ok-soft: #e3f5ec;
  --warn: #b7700f;
  --warn-soft: #fdf1dd;
  --bad: #cf3a2e;
  --bad-soft: #fce7e5;
  --info: #2b77c9;
  --info-soft: #e3effb;
  --bar: #e7e9ee;
  --shadow: 0 1px 2px rgba(20, 24, 33, .05), 0 4px 16px rgba(20, 24, 33, .04);
  --radius: 10px;
  --side: #10131b;
  --side-fg: #c9cedb;
  --side-muted: #7d8497;
  --side-hover: #1b2030;
  --side-active: #232a3e;
  --side-line: #1f2535;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --bg-2: #121621;
    --panel: #151a25;
    --panel-2: #1a2030;
    --fg: #e8ebf2;
    --fg-2: #b4bacb;
    --muted: #7f879b;
    --line: #242b3b;
    --line-2: #2f3749;
    --accent: #7b8aff;
    --accent-soft: #232a4a;
    --ok: #3ccf8a;
    --ok-soft: #14301f;
    --warn: #f0b451;
    --warn-soft: #33270f;
    --bad: #ff7b6e;
    --bad-soft: #3a1a17;
    --info: #6fb0f5;
    --info-soft: #152a40;
    --bar: #232a3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --side: #0a0c12;
    --side-hover: #141925;
    --side-active: #1c2335;
    --side-line: #171c29;
  }
}
html[data-theme="dark"] {
  --bg: #0d1017;
  --bg-2: #121621;
  --panel: #151a25;
  --panel-2: #1a2030;
  --fg: #e8ebf2;
  --fg-2: #b4bacb;
  --muted: #7f879b;
  --line: #242b3b;
  --line-2: #2f3749;
  --accent: #7b8aff;
  --accent-soft: #232a4a;
  --ok: #3ccf8a;
  --ok-soft: #14301f;
  --warn: #f0b451;
  --warn-soft: #33270f;
  --bad: #ff7b6e;
  --bad-soft: #3a1a17;
  --info: #6fb0f5;
  --info-soft: #152a40;
  --bar: #232a3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --side: #0a0c12;
  --side-hover: #141925;
  --side-active: #1c2335;
  --side-line: #171c29;
}
html[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #eceef2;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --fg: #151821;
  --fg-2: #4a5061;
  --muted: #7d8394;
  --line: #e2e5eb;
  --line-2: #d3d7df;
  --accent: #4a5cf0;
  --accent-soft: #eceefe;
  --ok: #17915a;
  --ok-soft: #e3f5ec;
  --warn: #b7700f;
  --warn-soft: #fdf1dd;
  --bad: #cf3a2e;
  --bad-soft: #fce7e5;
  --info: #2b77c9;
  --info-soft: #e3effb;
  --bar: #e7e9ee;
  --shadow: 0 1px 2px rgba(20, 24, 33, .05), 0 4px 16px rgba(20, 24, 33, .04);
  --side: #10131b;
  --side-hover: #1b2030;
  --side-active: #232a3e;
  --side-line: #1f2535;
}

/* ---------------------------------------------------------------- Grundlagen */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 13.5px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 14.5px; line-height: 20px; margin: var(--s5) 0 var(--s2); }
.card h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 var(--s2); font-weight: 600; }
.mono { font-family: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sub { color: var(--muted); font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
a.link, button.link { color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; font: inherit; }
a.link:hover, button.link:hover { text-decoration: underline; }
a.btn { text-decoration: none; }

/* ---------------------------------------------------------------- Rahmen: Seitenleiste + Inhalt */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-fg); padding: var(--s4) 10px var(--s3);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #6b7bff, #3e4fd8); display: grid; place-items: center; flex: none; }
.logo-name { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: .2px; line-height: 18px; }
.logo-sub { font-size: 11px; color: var(--side-muted); }
/* Nur die Navigation rollt, ohne sichtbare Leiste; der Verlauf am Rand zeigt, dass es weitergeht */
.side-nav {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding-bottom: var(--s3);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 24px), transparent 100%);
}
.side-nav::-webkit-scrollbar { display: none; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 12px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; border: 0; background: none;
  color: var(--side-fg); cursor: pointer; text-align: left; width: 100%; line-height: 18px;
}
.nav-item:hover { background: var(--side-hover); }
.nav-item.on { background: var(--side-active); color: #fff; }
.nav-item .count { margin-left: auto; font-size: 11px; line-height: 16px; background: #2d3550; color: #dfe3ff; padding: 0 6px; border-radius: 99px; }
.nav-item .count.alert { background: #6b2a24; color: #ffd9d4; }
.side-foot { border-top: 1px solid var(--side-line); padding: 10px 8px 0; display: grid; gap: 7px; }
.side-user { font-size: 12px; color: var(--side-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-state { display: flex; align-items: center; gap: 8px; font-size: 12px; }

main { padding: 0 var(--s5) 40px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3);
  height: 46px; margin: 0 calc(-1 * var(--s5)) var(--s4); padding: 0 var(--s5);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.crumbs b { color: var(--fg); font-weight: 600; }
.topbar .spacer { flex: 1; }
.env { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); font-weight: 600; letter-spacing: .02em; }
.live { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live .dot { width: 7px; height: 7px; }
.refresh-ctl { display: flex; align-items: center; gap: var(--s2); font-size: 12px; color: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin: 0 0 var(--s4); min-height: 36px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; line-height: 26px; letter-spacing: -.2px; }
.page-head p { color: var(--muted); line-height: 18px; margin-top: 1px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: var(--s5) 0 var(--s2); }
.section-head h2 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; margin-bottom: var(--s2); }
.back:hover { color: var(--fg); }

/* ---------------------------------------------------------------- Karten und Raster */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: clip; }
.card.pad, .padcard { padding: 14px 16px; }
/* Abstand nur zwischen frei gestapelten Karten; in Rastern regelt das gap */
.card + .card { margin-top: var(--s3); }
.grid > .card, .toolbar > .card, .kpis > .card, .stat-row > .card, .two > .card, .two > div > .card, .node-rows > .card, .chips > .card, .nodes > .card { margin-top: 0; }
.grid { display: grid; gap: var(--s3); }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--s3); align-items: stretch; }
.two > .card { height: 100%; }
.two > div { display: flex; flex-direction: column; min-width: 0; }
.two > div > .card { flex: 1; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.dashboard-alert { margin-bottom: var(--s3); }
@media (max-width: 1100px) { .two, .chart-grid { grid-template-columns: 1fr; } }

/* Kennzahlen: feste Spalten, gleiche Höhe, Hinweis darf zwei Zeilen haben */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.kpis + .kpis { margin-top: 10px; }
/* Abstand zwischen aufeinanderfolgenden Blöcken einer Seite. Es gab nur .card + .card und
   .kpis + .kpis – eine Karte direkt vor Kacheln (z. B. die Guthaben-Warnung über der
   Übersicht) klebte deshalb ohne Abstand an ihnen. */
.card + .kpis, .kpis + .card, .card + .two, .two + .card, .kpis + .two, .two + .kpis, .two + .two { margin-top: var(--s3); }
.kpis > .card { height: 100%; }
.kpi { display: grid; grid-template-rows: 16px 32px auto; row-gap: 4px; padding: 12px 14px; min-height: 92px; }
.kpi .label { font-size: 12px; line-height: 16px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 24px; line-height: 32px; font-weight: 650; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value.with-ring { display: flex; align-items: center; gap: 8px; }
.kpi .value.with-ring svg { flex: none; }
.kpi .hint { font-size: 11.5px; line-height: 15px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(min(var(--n, 4), 3), minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s2); }
.stat { padding: 10px 12px; }
.stat .v { font-size: 18px; font-weight: 650; line-height: 24px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- Nodes */
.node-rows { display: grid; gap: var(--s2); }
.node-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 240px 80px; gap: var(--s4); align-items: center; padding: 10px 14px; min-height: 60px; }
.node-row .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.node-row .who .name { font-weight: 650; font-size: 14px; line-height: 18px; }
.node-row .meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.node-row .m .top { display: flex; justify-content: space-between; font-size: 11.5px; line-height: 15px; margin-bottom: 4px; }
.node-row .m .top span:first-child { color: var(--muted); }
.node-row .m .top span:last-child { font-variant-numeric: tabular-nums; color: var(--fg-2); }
.node-row .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); font-size: 11.5px; }
.node-row .facts > div { min-width: 0; }
.node-row .facts b { display: block; font-size: 15px; line-height: 20px; font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; }
.node-row .facts b, .node-row .facts span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.node-row .facts span { color: var(--muted); }
.node-row .btn { justify-self: end; }
@media (max-width: 1150px) { .node-row { grid-template-columns: 1fr; gap: var(--s3); } }
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s3); }
.node { padding: 14px 16px; display: grid; gap: 10px; }
.node-head { display: flex; align-items: center; gap: 10px; }
.node-name { font-weight: 650; font-size: 14px; }
.node-meta { color: var(--muted); font-size: 12px; }
.action-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: var(--s3); }
.action-bar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
/* Dienst-Aktionen: Betrieb links als Gruppe, Sperre daneben, Löschen rechts */
.svc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.svc-actions .spacer { flex: 1; }
.btn-group { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--panel); }
.btn-group:empty { display: none; }
.btn-group .btn { border-radius: 0; border: 0; border-right: 1px solid var(--line-2); background: var(--panel); color: var(--fg); font-weight: 500; }
.btn-group .btn:last-child { border-right: 0; }
.btn-group .btn:hover { background: var(--panel-2); filter: none; }
.btn-group .btn svg { color: var(--muted); }
.atk-row { grid-template-columns: 200px minmax(0, 1fr) 240px 80px; }

/* Leisten, Punkte, Pillen */
.bar { height: 6px; background: var(--bar); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.hot i { background: var(--warn); }
.bar.full i { background: var(--bad); }
.meter { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: var(--s2); font-size: 12px; }
.meter .k { color: var(--muted); }
.meter .v { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.minis { display: grid; gap: 3px; min-width: 170px; }
.mini { display: grid; grid-template-columns: 34px minmax(60px, 1fr) 44px; gap: var(--s2); align-items: center; font-size: 11.5px; }
.mini .mk { color: var(--muted); }
.mini .mv, .mini .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.mini .bar { height: 5px; }
.minis .meter { grid-template-columns: 34px 1fr 40px; font-size: 11.5px; gap: var(--s2); }
.minis .meter .bar { height: 5px; }
.stackbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bar); }
.stackbar i { display: block; height: 100%; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 20px; border-radius: 99px; font-size: 11.5px; line-height: 20px; background: var(--bg-2); color: var(--fg-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.kind i { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); display: inline-block; }
.cc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.cc b { display: inline-grid; place-items: center; width: 24px; height: 17px; border-radius: 3px; background: var(--bg-2); border: 1px solid var(--line); font-size: 10px; letter-spacing: .02em; }
.owner { display: flex; align-items: center; gap: 8px; }
.owner .avatar { width: 22px; height: 22px; font-size: 10.5px; }

/* ---------------------------------------------------------------- Listen und Tabellen */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); align-items: start; }
.feed-item:first-child { border-top: 0; }
.feed-item .t { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.feed-item .dot { margin-top: 6px; }
.empty { padding: 20px 14px; color: var(--muted); text-align: center; }
.empty-state { display: grid; justify-items: center; gap: 4px; padding: 28px 14px; color: var(--muted); text-align: center; }
.empty-state svg { opacity: .5; }
.empty-state b { color: var(--fg); font-weight: 600; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); vertical-align: middle; position: sticky; top: 0; z-index: 1; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--fg); }
th .arrow { opacity: .5; margin-left: 4px; }
td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 18px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--s2);
  padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel);
}
.pager .small:first-child { margin-right: auto; }
.pager select.sm { width: auto; min-width: 92px; height: 26px; padding: 0 24px 0 8px; font-size: 12px; }
.svc-name { font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
dl.facts { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.share-list { display: grid; padding: 10px 14px; gap: 8px; }
.share-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(0, 2fr) 140px; gap: var(--s3); align-items: center; font-size: 12px; }
.share-row .k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-row .v { text-align: right; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.flow { display: grid; grid-template-columns: minmax(120px, 1fr) 92px; gap: var(--s3); align-items: center; }
.flow .v { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.type-rows { display: grid; gap: var(--s3); }
.type-row { display: grid; gap: 5px; }

.test-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.test-action { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 12px; display: grid; gap: 8px; align-content: start; }
.test-action .btn { justify-self: start; }
.test-result { grid-column: 1 / -1; min-width: 0; }
.api-result { display: grid; gap: var(--s3); margin-top: var(--s3); }
.api-summary { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(220px, 1.4fr); gap: var(--s2); }
.api-summary-card { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); padding: 10px 12px; display: grid; gap: 4px; min-width: 0; }
.api-summary-card span { color: var(--muted); font-size: 11.5px; }
.api-summary-card b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.api-visual { display: grid; gap: var(--s3); }
.api-object { display: grid; gap: var(--s3); min-width: 0; }
.api-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s2); margin: 0; }
.api-facts dt { color: var(--muted); font-size: 11.5px; line-height: 16px; }
.api-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.api-section { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); padding: 10px; display: grid; gap: var(--s2); min-width: 0; }
.api-section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.api-section-title b { font-size: 13px; }
.api-table { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.api-list { display: grid; gap: 6px; }
.api-list-row { display: grid; grid-template-columns: 42px 1fr; gap: var(--s2); align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.api-empty { color: var(--muted); padding: 14px; border: 1px dashed var(--line-2); border-radius: 8px; text-align: center; }
.api-more { padding: 8px 10px; border-top: 1px solid var(--line); }
.api-raw { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 9px 11px; }
.api-raw summary { cursor: pointer; color: var(--fg-2); font-weight: 600; }
.api-mini-json { max-height: 220px; overflow: auto; word-break: normal; }
@media (max-width: 900px) { .api-summary { grid-template-columns: 1fr 1fr; } .api-summary-card.wide { grid-column: 1 / -1; } }
@media (max-width: 620px) { .api-summary, .api-facts { grid-template-columns: 1fr; } }
/* ---------------------------------------------------------------- Bedienelemente */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 7px; border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer; font-weight: 550; white-space: nowrap; line-height: 1;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--panel); border-color: var(--line-2); color: var(--fg); font-weight: 500; }
.btn.ghost:hover { background: var(--panel-2); filter: none; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
td .btn.sm, .row-actions .btn.sm, .action-bar .btn.sm, .feed-item .btn.sm, .set-edit .btn.sm, .share-row .btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.danger-text { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line-2)); }
.btn.danger-text:hover { background: var(--bad-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: none; padding: 3px; border-radius: 6px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--bg-2); color: var(--fg); }

input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); min-width: 0;
}
input:not([type=checkbox]):not([type=radio]), select { height: 32px; padding: 0 10px; }
textarea { padding: 8px 10px; resize: vertical; min-height: 84px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
/* Ein Feld: Beschriftung, Eingabe, Hinweis – immer gestapelt, egal ob <label> oder <div>.
   (Galt früher nur für label.field, deshalb klebte alles in einem div.field aneinander.) */
.field { display: grid; gap: 5px; font-size: 12px; color: var(--fg-2); align-content: start; }
.field > input:not([type=checkbox]):not([type=radio]), .field > select, .field > textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3) var(--s4); align-items: start; }
/* Nebeneinander stehende Felder auf gemeinsame Linien legen: alle Beschriftungen auf einer
   Höhe, alle Eingaben auf einer Höhe, alle Hinweise auf einer Höhe – auch bei unterschiedlich
   langen Texten. */
@supports (grid-template-rows: subgrid) {
  .form-grid { grid-template-rows: auto auto auto; }
  .form-grid > .field { grid-row: span 3; grid-template-rows: subgrid; }
}
.form-grid.resize { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.resize .btn { grid-column: 1 / -1; justify-self: start; }
.toolbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: var(--s2); }
.seg { display: inline-flex; height: 32px; align-items: center; background: var(--bg-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 26px; padding: 0 11px; border-radius: 6px; cursor: pointer; color: var(--fg-2); }
.seg button.on { background: var(--panel); color: var(--fg); box-shadow: var(--shadow); font-weight: 550; }
.search { position: relative; }
.search input { padding-left: 30px; width: 240px; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: var(--s1) 0 var(--s3); }
.tabs button { border: 0; background: none; padding: 7px 11px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
pre.cmd { background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; font-size: 12px; }
.inline-form { border: 1px solid var(--line-2); border-radius: var(--radius); padding: var(--s3); background: var(--panel-2); display: grid; gap: 10px; margin-top: 10px; }

/* Checkboxen und Schalter */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--muted); background: var(--panel);
  display: inline-grid; place-content: center; cursor: pointer; vertical-align: middle;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
  border-color: var(--accent);
}
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg); cursor: pointer; user-select: none; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.check:hover { border-color: var(--line-2); }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.toggle-row { display: flex; align-items: center; gap: var(--s3); padding: 10px 14px; border-top: 1px solid var(--line); }
.toggle-row:first-child { border-top: 0; }
.toggle-row .txt { flex: 1; }
.toggle-row .txt div:first-child { font-weight: 550; }

/* Meldungszeile */
.msgbar { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--radius); margin-bottom: var(--s3); border: 1px solid var(--line); background: var(--panel); }
.msgbar.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-soft); }
.msgbar.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); }
.msgbar.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); }
.msgbar .txt { flex: 1; }
.msgbar .txt form input { background: var(--panel); }
.msgbar button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }

/* ---------------------------------------------------------------- Einstellungen, Konten, Rechte, 2FA */
.set-list { display: grid; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s3); align-items: center; padding: 9px 16px; border-top: 1px solid var(--line); min-height: 50px; }
.set-list .set-row:first-child { border-top: 0; }
.set-label { font-weight: 600; line-height: 18px; }
.set-edit { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); }
.set-value { font-variant-numeric: tabular-nums; min-width: 110px; text-align: right; }
.set-unit { color: var(--muted); font-size: 12px; min-width: 52px; }
.steps { margin: 0; padding-left: 18px; display: grid; gap: var(--s3); }
.steps li { line-height: 20px; }
.keybox { margin-top: var(--s2); padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); display: grid; gap: 6px; }
.keybox .key { font-size: 15px; letter-spacing: .08em; }
.keybox pre.cmd { display: flex; align-items: center; gap: 8px; justify-content: space-between; white-space: pre-wrap; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); }
.codes span { padding: 7px; border: 1px solid var(--line); border-radius: 7px; text-align: center; background: var(--panel-2); }
.rights { display: grid; gap: 10px; }
.rights select { max-width: 520px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); cursor: pointer; }
.perm input { margin-top: 2px; }
.perm:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.perm-name { font-weight: 600; font-size: 13px; }
.perm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-top: 1px solid var(--line); }
.perm-row .pill { min-width: 40px; justify-content: center; }
.setup-steps { display: grid; margin-top: 10px; border-top: 1px solid var(--line); }
.setup-step { display: grid; grid-template-columns: 90px minmax(0, 1fr) 100px; gap: 10px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.setup-step .pill { justify-self: start; }
.setup-step > span:last-child { text-align: right; }
@media (max-width: 900px) { .set-row { grid-template-columns: 1fr; } .set-edit { justify-content: flex-start; } .codes { grid-template-columns: repeat(2, 1fr); } .perm-grid, .perm-list { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Diagramme */
.chart-wrap { display: grid; gap: 4px; }
.chart-readout { font-size: 11.5px; line-height: 16px; min-height: 16px; color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart { width: 100%; height: 150px; display: block; cursor: crosshair; overflow: hidden; }
.chart.bars { cursor: default; }
.chart line, .chart polyline { vector-effect: non-scaling-stroke; }
.chart rect { shape-rendering: geometricPrecision; }
.chart .grid line { stroke: var(--line); stroke-opacity: .7; }
.chart .grid line.base { stroke: var(--line-2); stroke-opacity: 1; }
.chart .grid text { font-variant-numeric: tabular-nums; }
.chart text { fill: var(--muted); font-size: 10px; }
.chart text.peak { fill: var(--fg-2); font-size: 10px; font-weight: 600; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; gap: var(--s3); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.dash { background: none; border-top: 2px dashed var(--muted); height: 0; width: 14px; }

/* ---------------------------------------------------------------- Notfall-Konsole */
.console { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); border-radius: var(--radius); padding: 10px; background: var(--panel-2); }
.console-out { margin: 8px 0 0; height: 300px; overflow: auto; background: #0b0e14; color: #d7dbe6; border-radius: 7px; padding: 8px 10px; font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

/* ---------------------------------------------------------------- Anmeldung */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: radial-gradient(1200px 600px at 10% 10%, #2b3ba8 0%, #111525 55%, #0a0c12 100%); color: #e6e9ff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand h2 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.4px; }
.login-brand p { color: #aeb6e8; max-width: 440px; }
.login-brand ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: #cfd5ff; }
.login-brand li::before { content: "·"; margin-right: 10px; color: #7b8aff; font-weight: 700; }
.login-side, .login-wrap { display: grid; place-items: center; padding: var(--s5); min-height: 100vh; }
.login { width: min(380px, 100%); padding: var(--s5); display: grid; gap: 10px; }
.login h1 { margin: 4px 0 2px; font-size: 19px; }
@media (max-width: 900px) { .login-split { grid-template-columns: 1fr; } .login-brand { display: none; } }

/* ---------------------------------------------------------------- Dialoge */
body.has-modal { overflow: hidden; }
#modal-root .overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 16, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: var(--s5); animation: fade .12s ease-out; }
#modal-root .dialog { width: min(520px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--panel); color: var(--fg); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); animation: rise .14s ease-out; }
#modal-root .dialog.wide { width: min(760px, 100%); }
#modal-root .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 14px 18px 0; }
#modal-root .dialog-head h2 { margin: 0; font-size: 15.5px; }
#modal-root .dialog-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 7px; display: grid; place-items: center; }
#modal-root .dialog-x:hover { background: var(--bg-2); color: var(--fg); }
#modal-root .dialog-body { padding: var(--s3) 18px 18px; display: grid; gap: 10px; }
#modal-root .dialog-body form { display: grid; gap: 10px; }
#modal-root .dialog-body .form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
#modal-root .dialog-body input:not([type=checkbox]), #modal-root .dialog-body select, #modal-root .dialog-body textarea { width: 100%; }
#modal-root .dialog-question { font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
#modal-root .dialog-error { margin: 10px 18px 0; padding: 8px 10px; border-radius: 7px; background: var(--bad-soft); color: var(--bad); font-size: 12.5px; }
/* Knopfzeile: über die volle Dialogbreite, bündig mit den Feldern darüber –
   Abbrechen links an der Kante, die eigentliche Aktion rechts an der Kante. */
#modal-root .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
#modal-root .dialog-actions > .btn:only-child { margin-left: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- Schmale Fenster */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .side-nav { flex-basis: 100%; mask-image: none; -webkit-mask-image: none; overflow: visible; }
  .nav-label, .side-foot .ap-state { display: none; }
  .side-foot { margin: 0; border: 0; padding: 0; }
  main { padding: 0 var(--s4) 40px; }
  .topbar { margin: 0 calc(-1 * var(--s4)) var(--s3); padding: 0 var(--s4); }
  .search input { width: 100%; }
}


/* Abstand unter der Reiterleiste einer Sammelseite */
.tab-body { margin-top: var(--s4); }

/* ---------------------------------------------------------------- Bestätigungs-Dialog (heikle Aktion) */
#modal-root .stepup { gap: var(--s3); }
#modal-root .stepup-top { display: flex; align-items: flex-start; gap: 12px; padding: 12px 13px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); }
#modal-root .stepup-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--accent-soft, var(--panel)); color: var(--accent); }
#modal-root .stepup-top b { display: block; margin-bottom: 2px; }
#modal-root .stepup-field { display: grid; gap: 5px; }
#modal-root .stepup-field > span { color: var(--fg-2); font-size: 12.5px; }
#modal-root .stepup-field .code-input { font-family: var(--mono, ui-monospace, monospace); font-size: 21px; letter-spacing: 7px; text-align: center; height: 46px; }
#modal-root .stepup-hint { display: flex; align-items: center; gap: 6px; }

/* Diagramm ohne Werte: ruhige Fläche statt leerem Gitter über die volle Breite */
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 9px; background: var(--bg-2); }
.chart-empty svg { opacity: .55; }

/* Platzhalter in einem Feld, das keine Eingabe hat – hält die Zeile auf gleicher Höhe */
.field-static { display: flex; align-items: center; height: 32px; padding: 0 10px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: var(--bg-2); }

/* Knöpfe und Volltext-Elemente in einem Feldraster: eigene Zeile über die ganze Breite,
   nicht in eine Feldspalte quetschen (sonst sitzt der Knopf auf Höhe der Beschriftungen). */
.form-grid > .btn, .form-grid > button, .form-grid > .toolbar, .form-grid > p, .form-grid > .msgbar { grid-column: 1 / -1; }
.form-grid > .btn, .form-grid > button { justify-self: start; }
@supports (grid-template-rows: subgrid) {
  .form-grid > .btn, .form-grid > button, .form-grid > .toolbar, .form-grid > p, .form-grid > .msgbar { grid-row: auto; }
}

/* In einem Feld oder Feldraster gibt die Spalte die Breite vor. Viele Eingaben tragen eine
   inline gesetzte Pixelbreite (für Werkzeugleisten gedacht) – die darf hier nicht gewinnen,
   sonst stehen die Felder unterschiedlich breit nebeneinander. */
.field > input:not([type=checkbox]):not([type=radio]), .field > select, .field > textarea,
.form-grid > input:not([type=checkbox]):not([type=radio]), .form-grid > select, .form-grid > textarea { width: 100% !important; }

/* Testlauf */
.tl-check { display: inline-flex; align-items: center; gap: 8px; height: 32px; font-size: 13px; color: var(--fg); white-space: nowrap; cursor: pointer; }
.tl-check input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--accent); }
.tl-options { display: flex; flex-wrap: wrap; gap: 8px 14px; max-width: 760px; }
.tl-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; flex: 1 1 100%; }
.tl-preset { display: grid; gap: 3px; text-align: left; min-height: 78px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); cursor: pointer; }
.tl-preset:hover:not(:disabled), .tl-preset.active { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.tl-preset:disabled { opacity: .55; cursor: not-allowed; }
.tl-preset.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.tl-preset-main { font-weight: 700; }
.tl-preset-desc, .tl-preset-status { color: var(--muted); font-size: 12px; line-height: 1.25; }
.tl-preset-status { color: var(--fg); font-weight: 650; }
.tl-preset.bad .tl-preset-status { color: var(--bad); }
.tl-steps { display: grid; }
.tl-step { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); }
.tl-step:first-child { border-top: 0; }
.tl-step .n { color: var(--muted); font-size: 12px; }
.tl-step .label { font-weight: 550; }
.tl-step .sub { font-size: 12px; color: var(--fg-2); margin-top: 2px; word-break: break-word; }
.tl-step .sub.bad { color: var(--bad); }
.tl-step.tl-now { background: color-mix(in srgb, var(--info) 8%, transparent); }
.tl-log { margin-top: 10px; max-height: 520px; overflow: auto; background: #0b0e14; color: #d7dbe6; border-radius: 7px; padding: 8px 10px; font-size: 12px; line-height: 1.5; }
.tl-line { display: grid; grid-template-columns: 64px 50px 1fr; gap: 8px; align-items: baseline; }
.tl-line .ts { color: #7d8597; }
.tl-line .lv { color: #7d8597; text-transform: uppercase; font-size: 10.5px; }
.tl-line.ok .msg, .tl-line.ok summary { color: #7ee2a8; }
.tl-line.warn .msg, .tl-line.warn summary { color: #f5c46b; }
.tl-line.bad .msg, .tl-line.bad summary { color: #ff8a8a; }
.tl-line.info .msg, .tl-line.info summary { color: #8fb8ff; }
.tl-line details summary { cursor: pointer; }
.tl-line pre { margin: 4px 0 6px; padding: 6px 8px; background: #151a24; border-radius: 5px; white-space: pre-wrap; word-break: break-word; color: #c3c9d6; }
@media (max-width: 640px) { .tl-step { grid-template-columns: 26px 1fr; } .tl-step .dur, .tl-step .pill { grid-column: 2; justify-self: start; } .tl-line { grid-template-columns: 58px 1fr; } .tl-line .lv { display: none; } }

/* ---------------------------------------------------------------- 2FA-Code: sechs Ziffernfelder */
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp-box {
  width: 100%; min-width: 0; height: 52px; text-align: center; font-size: 22px; font-weight: 600;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; padding: 0; caret-color: var(--accent);
}
.otp-box:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
@media (max-width: 420px) { .otp { gap: 5px; } .otp-box { height: 46px; font-size: 19px; } }

/* Fehlerzeile der Anmeldung: sichtbar nur mit Text, sonst entstünde dauerhaft eine Lücke */
.login-err { color: var(--bad); font-size: 12.5px; line-height: 1.45; }
.login-err:empty { display: none; }

/* ---------------------------------------------------------------- Mail-Design */
.mail-preview { display: block; width: 100%; height: 600px; margin: var(--s3) 0; border: 1px solid var(--line); border-radius: 10px; background: #f4f5f9; }
.color-value { display: inline-flex; align-items: center; gap: 8px; }
.color-dot { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); }
.field input.color-input { height: 34px; padding: 3px; cursor: pointer; }
/* ---------------------------------------------------------------- Profil-Menue oben rechts */
.profil { position: relative; flex: none; }
button.avatar { border: 0; padding: 0; cursor: pointer; font-family: inherit; }
button.avatar:hover, button.avatar[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar.gross { width: 36px; height: 36px; font-size: 13px; }
.profil-menu {
  position: absolute; right: 0; top: calc(100% + 9px); z-index: 60; width: 256px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, .3);
}
.profil-menu[hidden] { display: none; }
.profil-kopf { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.profil-wer { min-width: 0; }
.profil-wer b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--fg); cursor: pointer; text-align: left; font: inherit; font-size: 13px;
}
.profil-item:hover { background: var(--bg-2); }
.profil-item.gefahr { color: var(--bad); }
.profil-item.gefahr:hover { background: var(--bad-soft); }
.profil-label { padding: 9px 10px 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.profil-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 0 6px 9px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.profil-theme {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px; border: 1px solid var(--line);
  border-radius: 8px; background: none; color: var(--fg-2); cursor: pointer; font: inherit; font-size: 11.5px;
}
.profil-theme:hover { background: var(--bg-2); }
.profil-theme.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#modal-root .dialog-body .form-grid.one, .form-grid.one { grid-template-columns: 1fr; }
.field textarea.vorlage-text { min-height: 230px; resize: vertical; font: inherit; line-height: 1.5; }
.vorlage-vars { display: grid; gap: 4px; margin-top: var(--s3); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.vorlage-gruppe { margin: var(--s3) 0 var(--s1); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ================================================================ Neues Erscheinungsbild
   Helle Seitenleiste im hellen Design, ruhigere Flächen, klarere Hierarchie. */
:root {
  --bg: #f5f6f9; --bg-2: #eceef3; --panel: #ffffff; --panel-2: #f8f9fc; --line: #e5e8ef; --line-2: #d5d9e3;
  --accent: #2f6bff; --accent-soft: #e8efff; --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 33, .04), 0 6px 20px rgba(20, 24, 33, .04);
  --side: #ffffff; --side-fg: #414858; --side-muted: #8b91a1; --side-hover: #f1f3f8; --side-active: #e8efff; --side-line: #e5e8ef; --side-on: #1f55e0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12; --bg-2: #12151d; --panel: #12151d; --panel-2: #181c26; --line: #1f2430; --line-2: #2b3141;
    --accent: #6d9bff; --accent-soft: #16233f; --shadow: none;
    --side: #0e1016; --side-fg: #b9bfce; --side-muted: #6f7688; --side-hover: #171b25; --side-active: #16233f; --side-line: #1a1e29; --side-on: #a9c4ff;
  }
}
html[data-theme="dark"] {
  --bg: #0b0d12; --bg-2: #12151d; --panel: #12151d; --panel-2: #181c26; --line: #1f2430; --line-2: #2b3141;
  --accent: #6d9bff; --accent-soft: #16233f; --shadow: none;
  --side: #0e1016; --side-fg: #b9bfce; --side-muted: #6f7688; --side-hover: #171b25; --side-active: #16233f; --side-line: #1a1e29; --side-on: #a9c4ff;
}
html[data-theme="light"] {
  --bg: #f5f6f9; --bg-2: #eceef3; --panel: #ffffff; --panel-2: #f8f9fc; --line: #e5e8ef; --line-2: #d5d9e3;
  --accent: #2f6bff; --accent-soft: #e8efff;
  --shadow: 0 1px 2px rgba(20, 24, 33, .04), 0 6px 20px rgba(20, 24, 33, .04);
  --side: #ffffff; --side-fg: #414858; --side-muted: #8b91a1; --side-hover: #f1f3f8; --side-active: #e8efff; --side-line: #e5e8ef; --side-on: #1f55e0;
}

/* Rollbalken: schmal, in den Farben des Designs */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); border: 2px solid transparent; background-clip: padding-box; }

/* Rahmen */
.shell { grid-template-columns: 240px 1fr; }
.side { border-right: 1px solid var(--side-line); padding: 14px 10px 12px; }
.logo { padding: 2px 8px 14px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #5b8cff, #2f5be0); }
.logo-name { color: var(--fg); }
.nav-group { display: grid; gap: 4px; }
.nav-group + .nav-group { margin-top: 16px; }
button.nav-label {
  display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; cursor: pointer;
  padding: 4px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: .07em; color: var(--side-muted); text-transform: uppercase;
}
button.nav-label:hover { color: var(--side-fg); }
.nav-label svg { transform: rotate(90deg); transition: transform .15s; opacity: .7; }
.nav-group.zu .nav-label svg { transform: none; }
.nav-group.zu .nav-item { display: none; }
.nav-group.zu.alarm .nav-label { color: var(--bad); }
.nav-item { padding: 8px 10px; border-radius: 8px; }
.nav-item svg { opacity: .7; }
.nav-item.on { background: var(--side-active); color: var(--side-on); font-weight: 600; }
.nav-item.on svg { opacity: 1; }
.nav-item .count { background: var(--bg-2); color: var(--fg-2); font-weight: 600; min-width: 20px; text-align: center; }
.nav-item .count.alert { background: var(--bad-soft); color: var(--bad); }

main { padding: 0 28px 48px; }
.topbar { height: 56px; margin: 0 -28px 24px; padding: 0 28px; }
.crumbs { font-size: 13px; }
.env { text-transform: none; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; }
.suche {
  display: flex; align-items: center; gap: 8px; width: 260px; height: 34px; padding: 0 8px 0 11px; border: 1px solid var(--line-2);
  border-radius: 9px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px;
}
.suche:hover { border-color: var(--accent); color: var(--fg-2); }
.suche span { flex: 1; text-align: left; }
kbd { font: 600 10.5px/18px inherit; font-family: inherit; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--muted); background: var(--bg-2); white-space: nowrap; }

.page-head { margin-bottom: 20px; min-height: 44px; }
.page-head h1 { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.4px; }
.page-head p { font-size: 13.5px; margin-top: 2px; }
h2 { font-size: 15px; line-height: 22px; margin: 28px 0 10px; }
.section-head { margin: 28px 0 10px; }

/* Profil-Knopf */
.profil-knopf {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 9px 0 4px; border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--panel); color: var(--fg); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
}
.profil-knopf:hover, .profil-knopf[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.profil-knopf .avatar { background: linear-gradient(135deg, #5b8cff, #2f5be0); color: #fff; }
.profil-knopf svg { transform: rotate(90deg); color: var(--muted); transition: transform .15s; }
.profil-knopf[aria-expanded="true"] svg { transform: rotate(-90deg); }
.profil-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Schnellsuche */
.palette-wrap { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; background: rgba(8, 10, 16, .5); backdrop-filter: blur(3px); }
.palette { width: min(620px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .4); overflow: hidden; }
.palette-kopf { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
input.palette-in, input.palette-in:focus { flex: 1; height: 100%; padding: 0; border: 0; outline: 0; background: none; font-size: 15px; box-shadow: none; }
.palette-list { max-height: 380px; overflow-y: auto; padding: 6px; display: grid; gap: 1px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--fg); cursor: pointer; text-align: left; font-size: 13.5px; }
.palette-item.on, .palette-item:hover { background: var(--accent-soft); }
.palette-item svg { color: var(--muted); flex: none; }
.palette-titel { font-weight: 600; white-space: nowrap; }
.palette-sub { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-art { flex: none; font-size: 11px; color: var(--muted); }
.palette-leer { padding: 22px; text-align: center; color: var(--muted); }

/* Übersicht: Handlungsbedarf */
.tun-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.tun-kopf h2 { margin: 0; }
.tun-zeile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--fg); cursor: pointer; text-align: left; font: inherit; }
.tun-zeile:hover { background: var(--panel-2); }
.tun-zeile > svg { color: var(--muted); flex: none; }
.tun-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.tun-leer { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ok); }

/* Schritte untereinander (2FA einrichten) */
.stufen { display: grid; }
.stufe { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 16px; border-top: 1px solid var(--line); }
.stufe:first-child { border-top: 0; }
.stufe-nr { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; background: var(--accent); color: #fff; }
.stufe.wartet .stufe-nr { background: var(--bg-2); color: var(--muted); }
.stufe.fertig .stufe-nr { background: var(--ok-soft); color: var(--ok); }
.stufe.wartet .stufe-body { opacity: .55; }
.stufe-titel { font-weight: 600; line-height: 28px; }
.stufe-text { color: var(--fg-2); }
.stufe-aktion { margin-top: 12px; }
.stufe-aktion .keybox { margin-top: 0; }

/* Produktarten: je Art eine Zeile, Einstellung rechts daneben */
.art-row { align-items: start; padding: 14px 16px; }
.art-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.art-fehlt { margin-top: 4px; font-size: 12.5px; color: var(--bad); }
.art-feld { display: grid; gap: 10px; }
.art-feld .field { width: 100%; }
.art-fuss { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }

/* Webhooks */
.hook-row { align-items: start; padding: 14px 16px; }
.hook-row .set-edit { flex-wrap: wrap; }
.hook-themen { margin: var(--s4) 0; display: grid; gap: 8px; }
.hook-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; }
.leer { display: grid; gap: 4px; padding: 10px 0; text-align: center; }

/* Text und darauf folgende Eingabezeile in einer Karte brauchen Luft dazwischen */
.card p + .toolbar, .card p + form, .card .sub + .toolbar, .card .small + form.toolbar { margin-top: 12px; }

/* Dauerhafte Warnung oben auf jeder Seite */
.msgbar.dauer { align-items: center; }
.msgbar button.msgbar-link { color: var(--fg); font-weight: 600; text-decoration: underline; white-space: nowrap; }

/* Dienst-Seite: Steuerleiste oben, Rest in Reitern */
.svc-bar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 12px 16px; }
.svc-bar .svc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.svc-bar .svc-actions .spacer { display: none; }
.svc-bar .svc-weg { flex: 1; }
.svc-pdf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 16px; border-left: 1px solid var(--line); }
.svc-tabs { margin: var(--s4) 0; }
.card.pad > div > h3:first-child { margin-top: 0 !important; }

.pill.gross { height: 26px; padding: 0 12px; font-size: 13px; line-height: 26px; font-weight: 600; }

/* Leistung ändern: Regler mit sichtbarer Grenze */
.regler-form { display: grid; gap: 18px; }
.regler-row { display: grid; gap: 8px; }
.regler-kopf { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.regler-wert { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--accent); }
.regler-kopf .muted { margin-left: auto; }
.regler-zeile { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 16px; align-items: center; }
.regler-eingabe { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
input.regler-zahl { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range].regler {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; padding: 0; border: 0; border-radius: 99px; cursor: pointer; outline: none;
  background: linear-gradient(to right, var(--accent) 0, var(--accent) var(--pos, 0%), var(--bar) var(--pos, 0%), var(--bar) var(--limit, 100%), color-mix(in srgb, var(--bad) 45%, var(--bar)) var(--limit, 100%), color-mix(in srgb, var(--bad) 45%, var(--bar)) 100%);
}
input[type=range].regler::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
input[type=range].regler::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
input[type=range].regler:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.regler-info { color: var(--muted); }
.regler-row.ueber .regler-wert, .regler-row.ueber .regler-info { color: var(--bad); }
.regler-row.ueber input.regler-zahl { border-color: var(--bad); }
.regler-row.ueber input[type=range].regler {
  background: linear-gradient(to right, var(--accent) 0, var(--accent) var(--limit, 100%), var(--bad) var(--limit, 100%), var(--bad) var(--pos, 0%), color-mix(in srgb, var(--bad) 45%, var(--bar)) var(--pos, 0%), color-mix(in srgb, var(--bad) 45%, var(--bar)) 100%);
}
.regler-row.ueber input[type=range].regler::-webkit-slider-thumb { border-color: var(--bad); }
.regler-fuss { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.regler-summe { flex: 1; color: var(--fg-2); }
.regler-summe.schlecht { color: var(--bad); }
@media (max-width: 700px) { .regler-zeile { grid-template-columns: 1fr; } }

/* Discord-Bot */
pre.bot-log { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.5; }

/* Bot-Panel: Einstellungen mit Bereichsliste links */
.bot-einst { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.bot-nav { display: grid; gap: 2px; position: sticky; top: 72px; }
.bot-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--fg-2); cursor: pointer; text-align: left; font: inherit; }
.bot-nav-item:hover { background: var(--bg-2); }
.bot-nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.bot-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); padding: 18px; align-items: start; }
.bot-felder .breit { grid-column: 1 / -1; }
.bot-felder .field { display: grid; gap: 5px; font-size: 12.5px; color: var(--fg-2); align-content: start; }
.bot-felder .field input:not([type=checkbox]):not([type=radio]), .bot-felder .field select, .bot-felder .field textarea { width: 100%; }
.bot-kopf h3 { margin: 0 0 2px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.bot-schalter { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.bot-rollen { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; max-height: 220px; overflow: auto; }
.bot-liste { display: grid; gap: 6px; }
.bot-zeile { display: grid; gap: 6px; align-items: center; }
.bot-zeile.types { grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1.4fr) 110px 90px 34px; }
.bot-zeile.rules { grid-template-columns: 220px minmax(0, 1fr) 34px; }
.bot-save { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 8px; margin-top: var(--s4); padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 34px rgba(0, 0, 0, .3); }
.bot-save[hidden] { display: none; }
.bot-save span { flex: 1; font-weight: 600; }
.bot-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) { .bot-einst, .bot-felder { grid-template-columns: 1fr; } .bot-nav { position: static; } .bot-zeile.types, .bot-zeile.rules { grid-template-columns: 1fr; } }

/* Kopfzeilen-Prüfung */
.kopf-ergebnis { display: grid; gap: 10px; margin-top: var(--s4); }
.kopf-ergebnis:empty { display: none; }
.kopf-liste { gap: 8px; }
.kopf-zeile { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; align-items: start; }
.kopf-zeile .pill { justify-self: start; white-space: normal; height: auto; min-height: 20px; }
.kopf-schritte { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Sicherheitsprüfung unter dem Anmelde-Knopf */
.captcha-hint { font-size: 11px; color: var(--muted, #8b93a7); text-align: center; margin-top: 6px; }
.captcha-hint[data-state="fehler"] { color: var(--bad, #e5484d); }

/* Checkboxen: überall gleich groß, egal in welchem Feld oder Dialog sie stehen */
input[type="checkbox"] { width: 17px !important; height: 17px !important; min-width: 17px; padding: 0 !important; box-sizing: border-box; background-size: 13px 13px; }
input[type="checkbox"]:checked { background-size: 13px 13px; }
.check { min-height: 32px; line-height: 18px; }
.check input[type="checkbox"] { margin: 0; }
.hook-checks .check, .bot-rollen .check { width: 100%; }

/* ================================================================ Anmeldung, neu */
.login-split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.login-brand {
  position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; color: #eaf0ff;
  background: radial-gradient(900px 520px at 0% 0%, rgba(91, 140, 255, .55), transparent 62%), radial-gradient(700px 520px at 100% 100%, rgba(47, 91, 224, .35), transparent 60%), #0b1020;
}
.login-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 44px 44px;
  mask-image: radial-gradient(700px 500px at 20% 30%, #000, transparent 75%); -webkit-mask-image: radial-gradient(700px 500px at 20% 30%, #000, transparent 75%); }
.login-brand > * { position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo .logo-mark { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 10px 30px rgba(47, 107, 255, .45); }
.login-logo .logo-name { color: #fff; font-size: 18px; line-height: 22px; }
.login-logo .logo-sub { color: #9fb0e6; font-size: 12px; }
.login-text h2 { font-size: 36px; line-height: 1.15; letter-spacing: -.8px; margin: 0 0 12px; max-width: 520px; }
.login-text p { color: #b6c3ee; font-size: 15.5px; max-width: 460px; margin: 0; }
.login-text ul { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; color: #dbe4ff; font-size: 14.5px; }
.login-text li { display: flex; align-items: center; gap: 12px; }
.login-text li::before { content: none; }
.login-haken { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(109, 155, 255, .18); color: #9dbcff; }
.login-hinweis { font-size: 12.5px; color: #8fa0d6; }
.login-side { padding: 32px; }
.login { width: min(400px, 100%); padding: 34px 32px 28px; gap: 16px; border-radius: 18px; box-shadow: 0 24px 70px rgba(10, 14, 30, .18); }
.login-kopf { display: grid; gap: 4px; margin-bottom: 6px; }
.login-kopf h1 { margin: 0; font-size: 24px; line-height: 30px; letter-spacing: -.4px; }
.login-kopf p { margin: 0; color: var(--muted); font-size: 13.5px; }
.login-feld { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.login input:not([type=checkbox]) { height: 42px; font-size: 14px; border-radius: 10px; width: 100%; }
.login .otp-box { height: 50px; }
.login-pw { position: relative; display: grid; }
.login-pw input { padding-right: 44px; }
.login-auge { position: absolute; right: 5px; top: 5px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.login-auge:hover { color: var(--fg); background: var(--bg-2); }
.login .btn { height: 42px; justify-content: center; border-radius: 10px; font-size: 14px; }
.login-knopf { margin-top: 4px; box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); }
.login-fuss { display: flex; align-items: flex-start; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.45; color: var(--muted); }
.login-fuss svg { flex: none; margin-top: 2px; }
@media (max-width: 900px) { .login-split { grid-template-columns: 1fr; } .login-brand { display: none; } }

/* Zahlenfelder mit eigenen Knöpfen für mehr und weniger */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* nur der Rahmen um Zahlenfelder, nicht die rechtsbündigen Tabellenzellen gleichen Namens */
.num:not(td):not(th) { position: relative; display: inline-grid; vertical-align: middle; min-width: 84px; }
.num > input[type=number] { width: 100% !important; padding-right: 30px; }
.num > button {
  position: absolute; right: 1px; width: 26px; height: calc(50% - 1px); display: grid; place-items: center; padding: 0;
  border: 0; border-left: 1px solid var(--line-2); background: var(--panel-2); color: var(--muted); cursor: pointer;
}
.num > .num-auf { top: 1px; border-radius: 0 7px 0 0; border-bottom: 1px solid var(--line-2); }
.num > .num-ab { bottom: 1px; border-radius: 0 0 7px 0; }
.num > button:hover { background: var(--accent-soft); color: var(--accent); }
.num > button:active { background: var(--accent); color: #fff; }
.num:has(input:disabled) > button { opacity: .45; cursor: not-allowed; }
.field > .num, .form-grid > .num, .bot-felder .field .num, #modal-root .dialog-body .num, .regler-eingabe .num { width: 100%; }
.login .num > input { height: 42px; }
/* Rollen-Auswahl im Bot-Panel: Namen vollständig lesbar */
.bot-rollen .check { min-width: 0; }
.bot-rollen .check { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Anmeldung: Feinschliff */
.login-side { position: relative; overflow: hidden; }
.login-side::before { content: ""; position: absolute; width: 620px; height: 620px; right: -180px; top: -220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
.login { position: relative; backdrop-filter: blur(6px); border-color: var(--line-2); }
.login-knopf { position: relative; gap: 10px; }
.login-dreher { display: none; width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: login-dreh .7s linear infinite; }
.login-knopf.laedt .login-dreher { display: inline-block; }
.login-knopf.laedt { opacity: .85; cursor: progress; }
@keyframes login-dreh { to { transform: rotate(360deg); } }
.login.wackelt { animation: login-wackel .32s ease; }
@keyframes login-wackel { 0%, 100% { transform: none; } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.login-gross { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--warn); }
.login-gross[hidden] { display: none; }
.login-hinweis { display: flex; align-items: center; gap: 9px; }
.login-puls { width: 8px; height: 8px; border-radius: 50%; background: #3ccf8a; box-shadow: 0 0 0 0 rgba(60, 207, 138, .6); animation: login-puls 2.2s ease-out infinite; flex: none; }
.login-puls.aus { background: #e5484d; animation: none; }
@keyframes login-puls { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 138, .55); } 100% { box-shadow: 0 0 0 9px rgba(60, 207, 138, 0); } }
.login input:not([type=checkbox]):focus { box-shadow: 0 0 0 3px var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .login.wackelt, .login-puls, .login-dreher { animation: none; } }

/* ================================================================ Anmeldung: links Hintergrund, rechts das Formular */
.login-split { grid-template-columns: minmax(0, 1fr) minmax(440px, 520px); }
.login-brand { padding: 44px 52px; background: #070a14; isolation: isolate; }
.login-brand::after { content: none; }
.login-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.login-bg .orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .85; will-change: transform; }
.login-bg .orb.a { width: 620px; height: 620px; left: -160px; top: -200px; background: #2f6bff; animation: orb-a 22s ease-in-out infinite alternate; }
.login-bg .orb.b { width: 520px; height: 520px; right: -140px; bottom: -180px; background: #6d3bff; opacity: .6; animation: orb-b 26s ease-in-out infinite alternate; }
.login-bg .orb.c { width: 380px; height: 380px; left: 38%; top: 42%; background: #00b3ff; opacity: .35; animation: orb-c 30s ease-in-out infinite alternate; }
@keyframes orb-a { to { transform: translate(120px, 90px) scale(1.12); } }
@keyframes orb-b { to { transform: translate(-110px, -70px) scale(1.08); } }
@keyframes orb-c { to { transform: translate(-90px, 80px) scale(.9); } }
.login-bg .raster { position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse 85% 75% at 35% 45%, #000 20%, transparent 78%); -webkit-mask-image: radial-gradient(ellipse 85% 75% at 35% 45%, #000 20%, transparent 78%); }
.login-bg .strahl { position: absolute; inset: -20% -10%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .07) 50%, transparent 58%); animation: strahl 9s ease-in-out infinite; }
@keyframes strahl { 0%, 100% { transform: translateX(-18%); opacity: 0; } 50% { transform: translateX(18%); opacity: 1; } }
.login-brand > *:not(.login-bg) { position: relative; z-index: 1; }
.login-text { margin-top: auto; padding-bottom: 28px; }
.login-text h2 { font-size: 44px; line-height: 1.08; letter-spacing: -1.2px; max-width: 560px; text-shadow: 0 2px 30px rgba(0, 0, 0, .35); }
.login-text p { font-size: 16px; color: #c9d5ff; }
.login-text ul { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.login-text li { padding: 7px 14px 7px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); font-size: 13px; }
.login-haken { background: rgba(255, 255, 255, .14); color: #fff; width: 22px; height: 22px; border-radius: 50%; }
.login-hinweis { color: #b9c6f5; }
/* rechte Seite: ruhige Fläche über die volle Höhe, kein schwebender Kasten */
.login-side { background: var(--panel); border-left: 1px solid var(--line); padding: 48px 56px; place-items: center stretch; }
.login-side::before { content: none; }
.login-side .login { width: 100%; max-width: 380px; margin: 0 auto; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; border-radius: 0; gap: 18px; }
.login-kopf { margin-bottom: 10px; }
.login-kopf h1 { font-size: 30px; line-height: 36px; letter-spacing: -.6px; }
.login-kopf p { font-size: 14.5px; }
.login input:not([type=checkbox]) { height: 46px; background: var(--bg); }
.login .btn { height: 46px; }
.login .login-auge { top: 7px; }
@media (max-width: 900px) { .login-side { border-left: 0; padding: 32px 24px; } }
@media (prefers-reduced-motion: reduce) { .login-bg .orb, .login-bg .strahl { animation: none; } }

/* Anmeldung: Text links mittig, Hintergrund ohne Raster (weicher Farbverlauf) */
.login-bg .raster { display: none; }
.login-brand { background: #060914; justify-content: flex-start; }
.login-bg .orb { filter: blur(110px); }
.login-bg .orb.a { width: 760px; height: 760px; left: -220px; top: -260px; background: #2f6bff; opacity: .8; }
.login-bg .orb.b { width: 680px; height: 680px; right: -220px; bottom: -260px; background: #7a3cff; opacity: .55; }
.login-bg .orb.c { width: 460px; height: 460px; left: 34%; top: 36%; background: #19c2ff; opacity: .28; }
.login-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 35%, rgba(4, 6, 14, .55) 100%); }
.login-text { margin: auto; padding: 0; text-align: center; display: grid; justify-items: center; }
.login-text h2 { max-width: 620px; margin-bottom: 14px; }
.login-text p { max-width: 520px; }
.login-text ul { justify-content: center; }
.login-hinweis { justify-content: center; }

/* Anmeldung: Text links bündig mit dem Logo, senkrecht mittig */
.login-text { margin: auto 0; text-align: left; justify-items: start; }
.login-text ul { justify-content: flex-start; }
.login-hinweis { justify-content: flex-start; }

/* ================================================================ Panel im Stil der Anmeldung
   Weicher Farbschein im Hintergrund, gläserne Kopfzeile, leuchtende Akzente. Nur Aussehen, keine Maße der Raster. */
body { background: var(--bg); }
.shell { position: relative; isolation: isolate; }
.shell::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 18% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(760px 520px at 100% 0%, color-mix(in srgb, #7a3cff 11%, transparent), transparent 70%),
    radial-gradient(700px 600px at 70% 110%, color-mix(in srgb, #19c2ff 7%, transparent), transparent 70%); }

/* Seitenleiste */
.side { background: color-mix(in srgb, var(--side) 86%, transparent); backdrop-filter: blur(18px); }
.logo-mark { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
.nav-item { position: relative; transition: background .15s, color .15s; }
.nav-item.on { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent) 6%, transparent)); color: var(--side-on); }
.nav-item.on::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-item:hover:not(.on) { background: var(--side-hover); }
.nav-item:hover svg { opacity: 1; }

/* Kopfzeile */
.topbar { background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(16px) saturate(1.3); }
.suche { background: color-mix(in srgb, var(--panel) 70%, transparent); transition: border-color .15s, box-shadow .15s; }
.suche:hover { box-shadow: 0 0 0 3px var(--accent-soft); }

/* Seitenkopf */
.page-head h1 { font-size: 28px; line-height: 34px; letter-spacing: -.6px; }
.page-head p { font-size: 14px; }

/* Karten */
.card { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(10px); transition: border-color .18s, box-shadow .18s, transform .18s; }
.kpis > .card { position: relative; }
.kpis > .card::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; border-radius: 0 0 2px 2px; opacity: 0; transition: opacity .18s;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.kpis > .card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 12%, transparent); transform: translateY(-1px); }
.kpis > .card:hover::before { opacity: 1; }
.kpi { grid-template-rows: 26px 34px auto; row-gap: 6px; padding: 14px 16px; min-height: 108px; }
.kpi .label { line-height: 26px; gap: 9px; font-size: 12.5px; }
.kpi .label svg { box-sizing: content-box; width: 14px; height: 14px; padding: 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi .value { font-size: 26px; line-height: 34px; letter-spacing: -.5px; }

/* Knöpfe */
.btn { transition: filter .15s, box-shadow .15s, background .15s, border-color .15s; border-radius: 8px; }
.btn:not(.ghost):not(.danger):not(.danger-text) { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn:not(.ghost):not(.danger):not(.danger-text):hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.ghost:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }

/* Reiter und Umschalter */
.tabs button { transition: color .15s, border-color .15s; }
.tabs button.on { border-bottom-color: var(--accent); box-shadow: 0 8px 12px -10px var(--accent); }

/* Tabellen: Zeilen heben sich beim Überfahren ab */
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* Handlungsbedarf und Meldungen */
.tun-zeile { transition: background .12s, padding-left .12s; }
.tun-zeile:hover { padding-left: 20px; }
.msgbar { backdrop-filter: blur(10px); }

/* Profil */
.profil-knopf { background: color-mix(in srgb, var(--panel) 70%, transparent); }

/* Dialoge */
#modal-root .dialog, #modal-root .modal { box-shadow: 0 30px 90px rgba(0, 0, 0, .5), 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }

@media (prefers-reduced-motion: reduce) { .card, .btn, .nav-item, .tun-zeile { transition: none; } .kpis > .card:hover { transform: none; } }

/* Farbfelder: runde Farbfläche und Wert zum Eintippen */
.farbe { display: inline-flex; align-items: center; gap: 0; height: 34px; min-width: 150px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); overflow: hidden; vertical-align: middle; }
.farbe:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.farbe.falsch { border-color: var(--bad); }
.farbe-flaeche { position: relative; flex: none; width: 22px; height: 22px; margin: 0 8px 0 6px; border-radius: 50%; background: var(--farbe, #888); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 0 0 1px rgba(0, 0, 0, .25), 0 2px 8px color-mix(in srgb, var(--farbe, #888) 55%, transparent); cursor: pointer; }
.farbe-flaeche input.farbe-wahl { position: absolute; inset: 0; width: 100% !important; height: 100% !important; padding: 0 !important; border: 0; opacity: 0; cursor: pointer; }
.farbe input.farbe-text { flex: 1; min-width: 0; width: auto !important; height: 100%; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: none; padding: 0 10px 0 0; font-size: 13px; text-transform: lowercase; }
.field > .farbe, .form-grid > .farbe, .bot-felder .field .farbe, #modal-root .dialog-body .farbe { width: 100%; }

/* Werkzeugzeilen: Knöpfe und Felder exakt gleich hoch */
.toolbar { align-items: center; }
.toolbar .btn, .toolbar .btn.sm, .toolbar input:not([type=checkbox]):not([type=range]), .toolbar select, .toolbar .num, .toolbar .farbe, .toolbar .seg { height: 32px; min-height: 32px; box-sizing: border-box; }
.toolbar .btn, .toolbar .btn.sm { padding: 0 12px; font-size: 13px; line-height: 1; }
.toolbar form.toolbar { margin: 0; }
.toolbar .num > input[type=number] { height: 100%; }

/* Guthaben-Vorschau */
.vorschau-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0; }
@media (max-width: 900px) { .vorschau-kpis { grid-template-columns: 1fr; } }

/* Seitenleiste: der Verlauf oben darf den ersten Eintrag nicht verdecken, deshalb liegt er über freiem Platz */
.side-nav { padding-top: 10px; }
.logo { padding-bottom: 4px; }
@media (max-width: 900px) { .side-nav { padding-top: 0; } }

/* TeamSpeak: Instanzen mit ihren Kunden-Servern */
.ts-instanz { margin-bottom: 14px; overflow: hidden; }
.ts-instanz-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ts-instanz > .card { border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* Datenschutz-Register */
.ds-liste { display: grid; gap: 10px; }
.ds-karte { overflow: hidden; border-left: 3px solid var(--line-2); }
.ds-karte.warn { border-left-color: var(--warn); }
.ds-karte.bad { border-left-color: var(--bad); }
.ds-karte.ok { border-left-color: var(--ok); }
.ds-kopf { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ds-kopf:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ds-body { padding: 4px 16px 16px; display: grid; gap: 14px; border-top: 1px solid var(--line); }
.ds-offen { margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 12%, transparent); font-size: 13px; }
.ds-offen ul { margin: 6px 0 0; padding-left: 18px; }
.ds-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13.5px; }
.ds-dl dt { color: var(--muted); }
.ds-dl dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 700px) { .ds-dl { grid-template-columns: 1fr; gap: 2px 0; } .ds-dl dd { margin-bottom: 8px; } }

/* Datums- und Zeitfelder wie alle anderen Felder, auch der Kalender folgt dem Design */
input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=search], input[type=tel] { border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); color: var(--fg); min-width: 0; font: inherit; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input[type=date], :root:not([data-theme="light"]) input[type=datetime-local], :root:not([data-theme="light"]) input[type=time] { color-scheme: dark; } }
html[data-theme="dark"] input[type=date], html[data-theme="dark"] input[type=datetime-local], html[data-theme="dark"] input[type=time] { color-scheme: dark; }
#modal-root .dialog-body .form-grid.zwei, .form-grid.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { #modal-root .dialog-body .form-grid.zwei, .form-grid.zwei { grid-template-columns: 1fr; } }

.ds-dl.avv { grid-template-columns: 90px minmax(0, 1fr); }
.ds-dl.avv dt { font-variant-numeric: tabular-nums; white-space: nowrap; }
