/* Unverändert aus ai-gateway (apps/web/src/styles/tokens.css, tokens.md v1.1, adorsys-Styleguide). Einzige Stelle mit Hex-Werten. */
:root {
  /* Typografie */
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-size-base: 14px;
  --line-height-base: 1.45;

  /* Neutral */
  --bg-app: #f5f6f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-hover-row: #fafbfc;
  --bg-chip: #f0f2f5;
  --text-primary: #0f1a2a;
  --text-secondary: #556173;
  /* Styleguide Grau-80 (v1.1): AA auf bg-surface, bg-subtle, bg-hover-row */
  --text-muted: #6e7380;
  --border-strong: #d5dae1;
  --border: #e3e6eb;
  --border-subtle: #edf0f4;
  --underline: #c9d0da;
  /* Rand von Eingabefeldern, Auswahllisten, Checkboxen (Styleguide Grau-80, 3:1, v1.1) */
  --border-input: #6e7380;

  /* Primär */
  --primary: #2350d8;
  --primary-hover: #1a3ca6;
  --primary-subtle: #e8eefc;
  --primary-selected: #f2f6fe;
  --on-primary: var(--bg-surface);

  /* Status */
  --success-text: #1e6b44;
  --success-strong: #1e7b4c;
  --success-bg: #e6f4ec;
  --warning-text: #9a4508;
  --warning-strong: #b4530a;
  --warning-bg: #fdf0e4;
  --warning-bg-soft: #fdf6ee;
  --danger: #b42318;
  --danger-border: #f3c7b5;
  --over-budget: #c2410c;
  --neutral-badge-text: #4a5565;
  --neutral-badge-bg: #edf0f4;

  /* Sidebar (dunkel) */
  --nav-bg: #0e1726;
  --nav-text: #b8c3d6;
  --nav-text-muted: #8c9ab3;
  --nav-text-active: #ffffff;
  --nav-active-bg: #1c2940;
  --nav-hover-bg: #16223a;
  --nav-card-bg: #121d30;
  --nav-card-border: #24324a;
  --nav-divider: var(--nav-card-border);
  /* Fokus auf dunklem Grund: Styleguide Akzent-Hellblau (v1.1; primary hat dort nur 2,7:1) */
  --nav-focus: #25a8db;

  /* Diagramme (Reihenfolge der Serien; 2–5 unter 3:1 → immer mit Beschriftung oder Tabelle) */
  --chart-1: #1e3fae;
  --chart-2: #5b8def;
  --chart-3: #e07b26;
  --chart-4: #f2c14e;
  --chart-5: #c3cad5;
  --chart-single: var(--primary);
  --chart-highlight: var(--text-primary);

  /* Größen (tokens.md → Abstände, Größen, Formen) */
  --sidebar-width: 248px;
  --topbar-height: 70px;
  --content-max-width: 1440px;
  --control-lg: 44px;
  --control-md: 40px;
  --control-sm: 36px;

  /* Formen */
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-tile: 10px;
  --radius-chip: 6px;
  --radius-pill: 999px;
  --shadow-popover: 0 8px 24px rgba(15, 26, 42, 0.1);
  /* Overlay hinter Dialogen: text-primary mit Transparenz */
  --overlay: rgba(15, 26, 42, 0.4);
}

/*
 * Look & Feel des AI Gateway (tokens.md → Komponentenmuster), ohne Tailwind nachgebaut.
 * Nur Token-Variablen aus tokens.css, keine eigenen Hex-Werte.
 */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }

/* MARK: Basis */

*, ::before, ::after { box-sizing: border-box; border-color: var(--border); }
html {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
}
body { margin: 0; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }

/* Typostufen */
.text-display { font-size: 28px; letter-spacing: -0.02em; font-weight: 600; line-height: 1.2; }
.text-title { font-size: 18px; font-weight: 600; }
.text-heading { font-size: 16px; font-weight: 600; }
.text-small { font-size: 13px; }
.text-caption { font-size: 12px; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

/* MARK: App-Shell */

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--bg-surface); padding: 8px 16px; border-radius: var(--radius-control); box-shadow: var(--shadow-popover); }

.shell { min-height: 100svh; background: var(--bg-app); }
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
}

.sidebar-col { display: none; background: var(--nav-bg); }
@media (min-width: 1024px) {
  .sidebar-col { display: block; }
  .sidebar-col > .sidebar { position: sticky; top: 0; height: 100svh; overflow-y: auto; }
}
/* Unter 1024 px: Menü als Seitenblatt, ohne Skript über eine Checkbox */
.nav-overlay { display: none; position: fixed; inset: 0; z-index: 40; background: var(--overlay); }
@media (max-width: 1023px) {
  #nav-toggle:checked ~ .sidebar-col { display: block; position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-width); max-width: 85vw; overflow-y: auto; }
  #nav-toggle:checked ~ .nav-overlay { display: block; }
  #nav-toggle:focus-visible ~ .content-col .menu-button,
  #nav-toggle:focus-visible ~ .sidebar-col .menu-close { outline: 2px solid var(--primary); outline-offset: 2px; }
}
@media (min-width: 1024px) { #nav-toggle { display: none; } }

.sidebar { display: flex; flex-direction: column; min-height: 100%; padding: 24px 14px 20px; background: var(--nav-bg); color: var(--nav-text); }
.sidebar-brand { padding: 0 10px 24px; }
.sidebar-brand img { height: 28px; width: auto; display: block; }
.sidebar-brand p { margin-top: 20px; font-size: 13px; font-weight: 500; color: var(--nav-text-muted); }
.nav-section { display: flex; flex-direction: column; }
.nav-section + .nav-section { margin-top: 16px; }
.nav-section.divider::before { content: ''; display: block; margin: 0 12px 12px; border-top: 1px solid var(--nav-divider); }
.nav-label { padding: 4px 12px 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-text-muted); }
.nav-section ul { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: var(--control-lg); padding: 0 12px;
  border-radius: var(--radius-control); color: var(--nav-text); font-size: 14px;
}
.nav-link:hover { background: var(--nav-hover-bg); color: var(--nav-text-active); }
.nav-link:focus-visible { outline: 2px solid var(--nav-focus); outline-offset: -2px; }
.nav-link.active { background: var(--nav-active-bg); color: var(--nav-text-active); font-weight: 500; }
.nav-count { margin-left: auto; font-size: 12px; color: var(--nav-text-muted); font-variant-numeric: tabular-nums; }

.content-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  height: var(--topbar-height); padding: 0 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) { .topbar { padding: 0 32px; } }
.menu-button {
  display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: var(--control-lg); height: var(--control-lg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--bg-surface); color: var(--text-primary); cursor: pointer;
}
.menu-button:hover { background: var(--bg-subtle); }
.menu-close { width: auto; height: auto; min-height: var(--control-lg); margin-bottom: 16px; padding: 0 12px; }
#nav-toggle:focus-visible ~ .sidebar-col .menu-close { outline-color: var(--nav-focus); }
@media (min-width: 1024px) { .menu-button { display: none; } }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-meta { display: flex; flex-direction: column; gap: 4px; min-width: 126px; font-size: 13px; color: var(--text-secondary); }
.meter { height: 6px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.meter > span.danger { background: var(--danger); }
.avatar {
  display: flex; align-items: center; justify-content: center; width: var(--control-lg); height: var(--control-lg);
  border-radius: var(--radius-pill); background: var(--primary-subtle); color: var(--primary); font-weight: 600; font-size: 13px;
}
@media (max-width: 420px) {
  .topbar-meta { min-width: 0; }
  .avatar { display: none; }
}

main { width: 100%; max-width: var(--content-max-width); margin: 0 auto; padding: 28px 16px 48px; outline: none; }
@media (min-width: 640px) { main { padding: 28px 32px 48px; } }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* MARK: Seitenkopf */

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-header > div:first-child { min-width: 0; }
.page-header h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-header p { margin-top: 4px; color: var(--text-secondary); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.crumb a { color: var(--text-secondary); }

/* MARK: Kacheln, Karten */

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-tile {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 20px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-card); color: var(--text-primary);
}
a.stat-tile:hover { border-color: var(--border-strong); color: var(--text-primary); }
a.stat-tile.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.stat-tile .label { font-size: 13px; color: var(--text-secondary); }
.stat-tile .value { font-size: 28px; letter-spacing: -0.02em; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-tile .value.danger { color: var(--danger); }
.stat-tile .value.warning { color: var(--warning-text); }
.stat-tile .value.success { color: var(--success-text); }
.stat-tile .meta { font-size: 13px; color: var(--text-secondary); }

.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-card); min-width: 0; }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.card-head + .card-body { padding-top: 12px; }
.card-head + .table-wrap { margin-top: 12px; }
.card-foot { padding: 12px 20px 16px; font-size: 13px; color: var(--text-secondary); border-top: 1px solid var(--border-subtle); }
.card.danger-zone { border-color: var(--danger-border); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.statistics-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); align-items: start; }
.grid-policy { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); align-items: start; }
@media (max-width: 1100px) { .grid-policy { grid-template-columns: 1fr; } }

/* Fakten (Label/Wert) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; align-items: baseline; }
.facts dt { color: var(--text-secondary); font-size: 13px; }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.facts-wide { grid-template-columns: max-content 1fr max-content 1fr; }
@media (max-width: 900px) { .facts-wide { grid-template-columns: max-content 1fr; } }

/* MARK: Tabs, Filter */

.tabs { display: flex; gap: 4px; padding: 0 8px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 14px 12px 12px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab:focus-visible { outline-offset: -2px; }
.tab.active { color: var(--text-primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab .count { color: var(--text-secondary); font-weight: 400; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 20px 12px; }
.toolbar select { width: auto; max-width: 100%; }
.search { flex: 1; min-width: min(100%, 220px); }

/* MARK: Formulare, Buttons */

input[type=text], input[type=search], input[type=password], input[type=number], textarea, select {
  width: 100%; min-height: var(--control-md); padding: 8px 12px; font: inherit; font-size: 14px; font-weight: 400; color: var(--text-primary);
  background: var(--bg-surface); border: 1px solid var(--border-input); border-radius: var(--radius-control);
}
textarea { font-family: var(--font-mono); font-size: 13px; line-height: 1.5; resize: vertical; }
input[type=text], input[type=search], input[type=password], input[type=number], select { height: var(--control-md); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, label.field { font-size: 13px; font-weight: 500; }
.field-hint { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.field input[type=file] { width: 100%; min-width: 0; font: inherit; color: var(--text-primary); }
.field input[type=file]::file-selector-button {
  min-height: var(--control-md); margin-inline-end: 8px; padding-inline: 12px;
  font: inherit; color: inherit; background: var(--bg-subtle);
  border: 1px solid var(--border-input); border-radius: var(--radius-control); cursor: pointer;
}
/* Formularraster: kurze Werte bekommen keine volle Kartenbreite */
.form-grid { display: grid; gap: 16px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; max-width: 960px; }
.form-grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
/* Eine Auswahl mit Knopf daneben, Knopf auf Höhe des Feldes */
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.inline-form .field { flex: 1 1 320px; max-width: 640px; }
.inline-form .btn { min-height: var(--control-md); }
/* Brotkrumen direkt über dem Seitenkopf, nicht im Abstand der Seitenspalte */
.stack > .crumb { margin-bottom: -16px; }
.form-grid .field-wide { grid-column: 1 / -1; max-width: 640px; }
.form-grid-wide { max-width: none; }
.form-section { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Einstellungsliste: Bezeichnung | Auswahl | Speichern, alle Zeilen auf denselben Fluchtlinien */
.setting-list { display: flex; flex-direction: column; }
.setting-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto; align-items: center; gap: 12px 16px;
  padding: 12px 20px; border-top: 1px solid var(--border-subtle);
}
.setting-row:first-child { border-top: none; }
.setting-row label { font-size: 14px; font-weight: 500; }
@media (max-width: 640px) { .setting-row { grid-template-columns: 1fr auto; } .setting-row label { grid-column: 1 / -1; } }
/* Softwarekatalog */
.software-offer-details { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .software-offer-details { grid-column: 1 / -1; }
  .software-offer .checkbox { grid-column: auto; }
}
/* Sprungmarken innerhalb einer Seite */
.jump-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.jump-nav a {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--bg-surface); color: var(--text-secondary); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.jump-nav a:hover { border-color: var(--border-strong); color: var(--text-primary); }
.policy-process + .policy-process { border-top: 1px solid var(--border-subtle); }
.checkbox { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 14px; font-weight: 400; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-sm); padding: 0 14px;
  font: inherit; font-size: 13px; font-weight: 600; border-radius: var(--radius-control); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary);
}
.btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { color: var(--danger); background: var(--bg-subtle); }
.btn-lg { min-height: var(--control-lg); width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-secondary); }

/* MARK: Tabellen */

.table-wrap { overflow-x: auto; }
.wifi-name { white-space: pre-wrap; }
.version-chart { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.version-chart .table-wrap { flex: 1 1 16rem; }
.statistics-grid .version-pie { width: 4.5rem; flex-shrink: 0; }
.statistics-grid .card { container-type: inline-size; }
.statistics-grid .version-chart { gap: 1rem; flex-wrap: nowrap; align-items: center; }
.statistics-grid .version-chart .table-wrap { flex: 1 1 auto; min-width: 0; }
.version-chart th, .version-chart td { padding-left: 6px; padding-right: 6px; }
.version-chart th:first-child, .version-chart td:first-child { padding-left: 0; }
.version-chart th:last-child, .version-chart td:last-child { padding-right: 0; }
.version-chart .name-link { display: inline-flex; align-items: flex-start; }
.version-chart .pie-dot { flex-shrink: 0; margin-top: .35em; }
#geraete, #betriebssysteme, #macos-statistik, #windows-statistik,
#checks, #netbird, #restart, #macos-update-reminders, #windows-update-reminders,
#thresholds, #maintenance, #processes, #windows-processes { scroll-margin-top: 5.5rem; }
@media (max-width: 600px) {
  .statistics-grid .version-chart { flex-wrap: wrap; justify-content: center; }
  .statistics-grid .version-chart .table-wrap { flex-basis: 100%; }
}
.activity-table td { width: 75%; }
.activity-value { display: grid; grid-template-columns: minmax(0, 1fr) 4ch; align-items: center; gap: 1rem; text-align: right; }
.version-pie { width: 11rem; max-width: 100%; height: auto; }
.version-pie a { fill: var(--pie-color); }
.version-pie a:hover { stroke: var(--chart-highlight); stroke-width: 1.5px; }
.pie-dot { display: inline-block; width: .75rem; height: .75rem; margin-inline-end: .5rem; border-radius: 50%; background: var(--pie-color); }
.pie-color-1 { --pie-color: var(--chart-1); }
.pie-color-2 { --pie-color: var(--chart-2); }
.pie-color-3 { --pie-color: var(--chart-3); }
.pie-color-4 { --pie-color: var(--chart-4); }
.pie-color-5 { --pie-color: var(--chart-5); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { padding: 10px 8px; text-align: left; font-size: 13px; font-weight: 500; color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover-row); }
th.num, td.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
table.compact td { padding-top: 8px; padding-bottom: 8px; }
.name-link { color: var(--text-primary); font-weight: 500; text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 3px; }
.name-link:hover { color: var(--primary); text-decoration-color: currentColor; }
.cell-sub { font-size: 13px; color: var(--text-secondary); }
.chip { display: inline-block; white-space: nowrap; padding: 1px 8px; border-radius: var(--radius-chip); background: var(--bg-chip); font-size: 13px; }
.os-cell { min-width: 0; max-width: 18rem; overflow-wrap: anywhere; }
.os-cell .chip { max-width: 100%; white-space: normal; }
.os-update { margin-top: 5px; }

/* MARK: Badges, Hinweise */

.badge {
  display: inline-flex; align-items: center; width: fit-content; padding: 2px 8px; border-radius: var(--radius-pill);
  border: 1px solid transparent; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--bg-surface); color: var(--danger); border-color: var(--danger-border); }
.badge-neutral { background: var(--neutral-badge-bg); color: var(--neutral-badge-text); }
.badge-info { background: var(--primary-subtle); color: var(--primary); }

.info-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-tile); background: var(--primary-subtle); color: var(--primary); font-size: 13px; }
.alert { padding: 12px 14px; border-radius: var(--radius-tile); font-size: 13px; }
.alert-danger { color: var(--danger); background: var(--bg-surface); border: 1px solid var(--danger-border); }
.alert-success { color: var(--success-text); background: var(--success-bg); }

/* Hinweis-Kachel: Icon links, Titel 14/600, Meta 13/secondary, Hintergrund in Statusfarbe */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-tile); background: var(--bg-subtle); }
.notice > div { min-width: 0; overflow-wrap: anywhere; }
.notice .icon { margin-top: 1px; }
.notice-critical { background: var(--warning-bg-soft); border: 1px solid var(--danger-border); }
.notice-critical .icon { color: var(--danger); }
.notice-warning { background: var(--warning-bg); }
.notice-warning .icon { color: var(--warning-strong); }
.notice-info { background: var(--primary-selected); }
.notice-info .icon { color: var(--primary); }
.notice-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice-meta { margin-top: 2px; font-size: 13px; color: var(--text-secondary); white-space: pre-line; }
.notice-items { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.report-items { margin-top: 6px; padding-inline-start: 20px; list-style: disc; }
.report-items li + li { margin-top: 6px; }

.state-ok { color: var(--success-text); font-weight: 500; }
.state-bad { color: var(--danger); font-weight: 600; }
.state-unknown { color: var(--text-muted); }

/* Verlauf: ein Balken je Report, älteste links */
#verlauf { scroll-margin-top: calc(var(--topbar-height) + 16px); }
.strip { display: flex; gap: 3px; padding: 4px; margin: -4px; overflow-x: auto; }
.strip a { flex: 1 0 14px; max-width: 14px; height: 28px; border-radius: 3px; }
.strip a:hover { opacity: 0.75; }
.strip a:focus-visible { outline-offset: 0; }
.strip-ok { background: var(--success-strong); }
.strip-attention { background: var(--warning-strong); }
.strip-critical { background: var(--danger); }
.strip-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 12px; color: var(--text-secondary); }
.strip-legend span { white-space: nowrap; }
.strip-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.strip-legend .l-ok::before { background: var(--success-strong); }
.strip-legend .l-attention::before { background: var(--warning-strong); }
.strip-legend .l-critical::before { background: var(--danger); }

details > summary { cursor: pointer; list-style: none; }
.card > details > summary.card-head { padding-bottom: 20px; }
.card > details[open] > summary.card-head { padding-bottom: 0; }
.card > details > summary.card-head > :last-child { display: inline-flex; align-items: center; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chevron { transition: transform 0.15s; color: var(--text-secondary); }
details[open] > summary .chevron { transform: rotate(90deg); }

.empty { padding: 48px 20px; text-align: center; color: var(--text-secondary); }
.empty h2 { color: var(--text-primary); margin-bottom: 6px; }

.field-list dt { font-family: var(--font-mono); font-size: 12px; margin-top: 10px; }
.field-list dd { font-size: 13px; color: var(--text-secondary); }

/* MARK: Anmeldung (AuthLayout) */

.auth { display: flex; flex-direction: column; min-height: 100svh; background: var(--bg-app); }
.auth-header {
  display: flex; align-items: center; gap: 16px; height: var(--topbar-height); padding: 0 16px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) { .auth-header { padding: 0 32px; } }
.auth-header img { height: 28px; width: auto; }
.auth-header .sep { height: 24px; border-left: 1px solid var(--border-strong); }
.auth-main { display: flex; flex: 1; justify-content: center; align-items: flex-start; padding: 64px 16px 48px; }
.auth-card { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 420px; padding: 32px 28px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }

/* MARK: Vorgänge (Befehlsausgabe) */

pre.output {
  margin: 0; padding: 12px 14px; max-height: 420px; overflow: auto;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--bg-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-control);
}
.output-label { margin: 10px 0 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
details.command { border: 1px solid var(--border); border-radius: var(--radius-tile); padding: 10px 12px; }
details.command > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
details.command > summary code { overflow-wrap: anywhere; }
details.command[open] > summary { margin-bottom: 6px; }
ul.notes { list-style: disc; padding-left: 18px; }
textarea[readonly] { background: var(--bg-subtle); }

/* Sehr schmale Statistik-Karten: Torte über die Tabelle */
@container (max-width: 340px) {
  .statistics-grid .version-chart { flex-wrap: wrap; justify-content: center; }
  .statistics-grid .version-chart .table-wrap { flex-basis: 100%; }
}

/* MARK: Ressourcenauslastung */
.resource-meter { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.resource-meter .meter { flex: 1 0 48px; }
.resource-meter .num { min-width: 6ch; text-align: right; }

.resource-cell-label { display: none; }
.resource-table [scope=row] { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .resource-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-toolbar .search { grid-column: 1 / -1; }
  .resource-toolbar .btn { justify-self: start; }

  .resource-table, .resource-table tbody { display: block; }
  .resource-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .resource-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
  }
  .resource-table tbody :is(th, td) { border: 0; padding: 0; text-align: left; }
  .resource-table [scope=row], .resource-table td:last-child { grid-column: 1 / -1; }
  .resource-cell-label { display: block; color: var(--text-secondary); font-size: 13px; }
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 12px;
  margin-block: 12px;
}

.resource-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.resource-values,
.resource-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.resource-scale { justify-content: space-between; }
.resource-values { margin-bottom: 10px; }

.resource-plot {
  display: flex;
  gap: 2px;
  height: 64px;
  margin-block: auto 4px;
  border-block: 1px solid var(--border);
}

.resource-column {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: end;
  justify-content: center;
}

.resource-bar,
.resource-key { background: var(--chart-1); }

.resource-bar[data-series="1"],
.resource-key[data-series="1"] { background: var(--chart-3); }

.resource-bar {
  flex: 1;
  max-width: 32px;
}

.resource-bar[data-zero="true"] { min-height: 1px; }

.resource-key {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

[data-w="0"]{width:0%}[data-w="5"]{width:5%}[data-w="10"]{width:10%}[data-w="15"]{width:15%}[data-w="20"]{width:20%}[data-w="25"]{width:25%}[data-w="30"]{width:30%}[data-w="35"]{width:35%}[data-w="40"]{width:40%}[data-w="45"]{width:45%}[data-w="50"]{width:50%}[data-w="55"]{width:55%}[data-w="60"]{width:60%}[data-w="65"]{width:65%}[data-w="70"]{width:70%}[data-w="75"]{width:75%}[data-w="80"]{width:80%}[data-w="85"]{width:85%}[data-w="90"]{width:90%}[data-w="95"]{width:95%}[data-w="100"]{width:100%}
.resource-bar[data-h="0"]{height:0%}.resource-bar[data-h="1"]{height:1%}.resource-bar[data-h="2"]{height:2%}.resource-bar[data-h="3"]{height:3%}.resource-bar[data-h="4"]{height:4%}.resource-bar[data-h="5"]{height:5%}.resource-bar[data-h="6"]{height:6%}.resource-bar[data-h="7"]{height:7%}.resource-bar[data-h="8"]{height:8%}.resource-bar[data-h="9"]{height:9%}.resource-bar[data-h="10"]{height:10%}.resource-bar[data-h="11"]{height:11%}.resource-bar[data-h="12"]{height:12%}.resource-bar[data-h="13"]{height:13%}.resource-bar[data-h="14"]{height:14%}.resource-bar[data-h="15"]{height:15%}.resource-bar[data-h="16"]{height:16%}.resource-bar[data-h="17"]{height:17%}.resource-bar[data-h="18"]{height:18%}.resource-bar[data-h="19"]{height:19%}.resource-bar[data-h="20"]{height:20%}.resource-bar[data-h="21"]{height:21%}.resource-bar[data-h="22"]{height:22%}.resource-bar[data-h="23"]{height:23%}.resource-bar[data-h="24"]{height:24%}.resource-bar[data-h="25"]{height:25%}.resource-bar[data-h="26"]{height:26%}.resource-bar[data-h="27"]{height:27%}.resource-bar[data-h="28"]{height:28%}.resource-bar[data-h="29"]{height:29%}.resource-bar[data-h="30"]{height:30%}.resource-bar[data-h="31"]{height:31%}.resource-bar[data-h="32"]{height:32%}.resource-bar[data-h="33"]{height:33%}.resource-bar[data-h="34"]{height:34%}.resource-bar[data-h="35"]{height:35%}.resource-bar[data-h="36"]{height:36%}.resource-bar[data-h="37"]{height:37%}.resource-bar[data-h="38"]{height:38%}.resource-bar[data-h="39"]{height:39%}.resource-bar[data-h="40"]{height:40%}.resource-bar[data-h="41"]{height:41%}.resource-bar[data-h="42"]{height:42%}.resource-bar[data-h="43"]{height:43%}.resource-bar[data-h="44"]{height:44%}.resource-bar[data-h="45"]{height:45%}.resource-bar[data-h="46"]{height:46%}.resource-bar[data-h="47"]{height:47%}.resource-bar[data-h="48"]{height:48%}.resource-bar[data-h="49"]{height:49%}.resource-bar[data-h="50"]{height:50%}.resource-bar[data-h="51"]{height:51%}.resource-bar[data-h="52"]{height:52%}.resource-bar[data-h="53"]{height:53%}.resource-bar[data-h="54"]{height:54%}.resource-bar[data-h="55"]{height:55%}.resource-bar[data-h="56"]{height:56%}.resource-bar[data-h="57"]{height:57%}.resource-bar[data-h="58"]{height:58%}.resource-bar[data-h="59"]{height:59%}.resource-bar[data-h="60"]{height:60%}.resource-bar[data-h="61"]{height:61%}.resource-bar[data-h="62"]{height:62%}.resource-bar[data-h="63"]{height:63%}.resource-bar[data-h="64"]{height:64%}.resource-bar[data-h="65"]{height:65%}.resource-bar[data-h="66"]{height:66%}.resource-bar[data-h="67"]{height:67%}.resource-bar[data-h="68"]{height:68%}.resource-bar[data-h="69"]{height:69%}.resource-bar[data-h="70"]{height:70%}.resource-bar[data-h="71"]{height:71%}.resource-bar[data-h="72"]{height:72%}.resource-bar[data-h="73"]{height:73%}.resource-bar[data-h="74"]{height:74%}.resource-bar[data-h="75"]{height:75%}.resource-bar[data-h="76"]{height:76%}.resource-bar[data-h="77"]{height:77%}.resource-bar[data-h="78"]{height:78%}.resource-bar[data-h="79"]{height:79%}.resource-bar[data-h="80"]{height:80%}.resource-bar[data-h="81"]{height:81%}.resource-bar[data-h="82"]{height:82%}.resource-bar[data-h="83"]{height:83%}.resource-bar[data-h="84"]{height:84%}.resource-bar[data-h="85"]{height:85%}.resource-bar[data-h="86"]{height:86%}.resource-bar[data-h="87"]{height:87%}.resource-bar[data-h="88"]{height:88%}.resource-bar[data-h="89"]{height:89%}.resource-bar[data-h="90"]{height:90%}.resource-bar[data-h="91"]{height:91%}.resource-bar[data-h="92"]{height:92%}.resource-bar[data-h="93"]{height:93%}.resource-bar[data-h="94"]{height:94%}.resource-bar[data-h="95"]{height:95%}.resource-bar[data-h="96"]{height:96%}.resource-bar[data-h="97"]{height:97%}.resource-bar[data-h="98"]{height:98%}.resource-bar[data-h="99"]{height:99%}.resource-bar[data-h="100"]{height:100%}