[data-theme="dark"] .customer-list li.active { background: #1e2a4a; }
[data-theme="dark"] tbody tr.selected { background: #1e2a4a; }
[data-theme="dark"] .search-results { box-shadow: 0 4px 16px rgba(0,0,0,.5); }
[data-theme="dark"] .group-chip { background: #22262e; }
[data-theme="dark"] .agent-box { background: #1f2329; }
[data-theme="dark"] .agent-box pre { background: #05070a; }
[data-theme="dark"] .ou-node.selected { background: #1e2a4a; }

* { box-sizing: border-box; }

input, select, textarea, button {
  font-family: inherit;
  color: var(--text);
  background-color: var(--panel);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app { display: flex; flex-direction: column; height: 100vh; }
.app-body { flex: 1; display: flex; overflow: hidden; }

.topbar {
  height: 52px; flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 0; background: var(--panel); border-bottom: 1px solid var(--border);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.session-timer { font-size: 12px; color: var(--muted); white-space: nowrap; }
.session-timer.warning { color: var(--danger); font-weight: 600; }

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.15s ease, min-width 0.15s ease;
}
.sidebar.collapsed { width: 0; min-width: 0; border-right: none; }

.sidebar-collapse-handle {
  width: 14px;
  flex-shrink: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.sidebar-collapse-handle:hover { background: var(--border); color: var(--text); }
.sidebar-collapse-handle.flipped { transform: scaleX(-1); }

.header-menu-wrapper { position: relative; }
.header-menu-button {
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 16px;
}
.header-menu-button:hover { background: var(--bg); }
.header-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 200px; padding: 6px 0; z-index: 200;
}
[data-theme="dark"] .header-menu { box-shadow: 0 4px 16px rgba(0,0,0,.5); }
.header-menu-item {
  display: block; width: 100%; text-align: left; padding: 9px 14px; border: none; background: none;
  color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.header-menu-item:hover { background: var(--bg); }
.header-menu-item.danger { color: var(--danger); }
.header-menu-divider { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

.customer-filter { padding: 8px 8px 0; }
.customer-filter input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.customer-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.customer-list li {
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 2px;
}
.customer-list li:hover { background: var(--bg); }
.customer-list li.active { background: #e8edfc; color: var(--primary-dark); font-weight: 600; }
.customer-list .status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; background: #9ca3af;
}
.customer-list .status-dot.ok { background: var(--status-ok); }
.customer-list .status-dot.failed { background: var(--danger); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.welcome { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }

.customer-view { display: flex; flex-direction: column; height: 100%; }
.hidden { display: none !important; }

.customer-header {
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.customer-header h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 12px; }

.customer-actions { display: flex; gap: 8px; align-items: center; }
.customer-actions input[type="search"] {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); width: 260px;
}

.btn {
  padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); cursor: pointer; font-size: 13px;
}
.btn:hover { background: var(--bg); }
.btn-small { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }

.search-results {
  position: absolute; top: 70px; right: 24px; width: 420px; max-height: 400px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 10; padding: 8px;
}
.search-results h4 { margin: 8px 4px 4px; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.search-results .result-item { padding: 6px 8px; border-radius: var(--radius); cursor: pointer; }
.search-results .result-item:hover { background: var(--bg); }

.tabs {
  display: flex; gap: 4px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.tab {
  padding: 10px 14px; border: none; background: none; cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent; color: var(--muted);
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.content-split { flex: 1; display: flex; overflow: hidden; position: relative; }
.list-panel { width: 45%; flex-shrink: 0; overflow-y: auto; border-right: none; background: var(--panel); display: flex; flex-direction: column; }
.ou-tree-container { border-bottom: 1px solid var(--border); max-height: 40%; overflow-y: auto; flex-shrink: 0; }
.table-container { flex: 1; overflow-y: auto; }
.ou-tree { padding: 6px 0; font-size: 13px; }
.ou-node { padding: 4px 8px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.ou-node:hover { background: var(--bg); }
.ou-node.selected { background: #e8edfc; color: var(--primary-dark); font-weight: 600; }
.ou-node-root { font-weight: 600; }
.ou-toggle { display: inline-block; width: 14px; text-align: center; color: var(--muted); cursor: pointer; user-select: none; }
.ou-label { flex: 1; }

.split-handle { width: 6px; flex-shrink: 0; cursor: col-resize; background: var(--border); }
.split-handle:hover, .split-handle.dragging { background: var(--primary); }

.detail-panel { flex: 1; overflow-y: auto; padding: 20px 24px; min-width: 180px; }

.detail-close {
  position: absolute; top: 12px; right: 16px; border: none; background: none;
  color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: var(--radius);
}
.detail-close:hover { background: var(--bg); color: var(--text); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; position: sticky; top: 0; background: var(--panel); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg); }
tbody tr.selected { background: #e8edfc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.badge.enabled { background: var(--status-ok-bg); color: var(--status-ok); }
.badge.disabled { background: var(--status-critical-bg); color: var(--status-critical); }

.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 16px 0; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 0; }

.group-chip {
  display: inline-block; background: var(--bg); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 12px; margin: 2px; font-size: 12px;
}

.change-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.change-item .change-type { font-weight: 600; margin-right: 6px; }
.change-item .change-time { color: var(--muted); font-size: 11px; }
.change-CREATED { color: var(--status-ok); }
.change-DELETED { color: var(--danger); }
.change-UPDATED { color: var(--primary-dark); }
.change-MEMBER_ADDED { color: var(--status-ok); }
.change-MEMBER_REMOVED { color: var(--danger); }
.change-MANUAL_EDIT { color: var(--status-warning); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: var(--panel); border-radius: 8px; padding: 24px; width: 480px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.modal label.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.modal input[type="text"], .modal input[type="number"], .modal input[type="password"], .modal input:not([type]) {
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px;
}
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }
.form-row label.small { flex: 0 0 90px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.test-result { font-size: 13px; padding: 4px 0; }
.test-result.ok { color: var(--status-ok); }
.test-result.error { color: var(--danger); }
.test-result.success { color: var(--status-ok); }

.toolbar { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.toolbar select { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); }

.agent-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 4px; }
.agent-box pre {
  background: #111827; color: #d1fae5; padding: 10px; border-radius: var(--radius);
  font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.agent-box .key-warning { color: var(--danger); font-size: 12px; margin: 6px 0; }

.empty-state { padding: 40px; text-align: center; color: var(--muted); }

.login-view {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); gap: 20px;
}
.login-form {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 14px;
}
.login-logo { display: block; height: 56px; margin: 0 auto 8px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.login-form input { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.login-form .test-result { min-height: 16px; }
.login-footer { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.6; }
.login-footer p { margin: 0; }

.modal-wide { width: 640px; max-width: 90vw; }
.modal-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header-row h3 { margin: 0; }
.user-mgmt-toolbar { margin-bottom: 10px; }
.user-form { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.role-pill.admin { background: var(--status-info-bg); color: var(--status-info); }
.role-pill.mitarbeiter { background: var(--bg); border: 1px solid var(--border); }
[data-theme="dark"] .role-pill.admin { background: #1e3a5f; color: #93c5fd; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.status-pill.active { background: var(--status-ok-bg); color: var(--status-ok); }
.status-pill.inactive { background: var(--danger-bg); color: var(--danger); }

.current-user-info { padding: 8px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.current-user-info .role-badge {
  display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; margin-left: 4px;
  background: var(--bg); border: 1px solid var(--border);
}

.readonly-field { padding: 7px 0; font-size: 13px; color: var(--text); }
.readonly-note { font-size: 12px; color: var(--muted); font-style: italic; }

.annotation-form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin-bottom: 8px; }
.annotation-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
/* Checkbox-Labels brauchen das Gegenteil der Spalten-Regel oben: Kästchen und Text sollen
   nebeneinander stehen, nicht übereinander - sonst wirkt das Kästchen wie ein eigenes,
   unbeschriftetes Element, getrennt von seinem Text (genau das gemeldete Problem). */
.annotation-form label.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.annotation-form input, .annotation-form textarea {
  padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit;
}
.annotation-actions { display: flex; align-items: center; gap: 10px; }

/* Zwei-Faktor-Authentifizierung */
.login-form-wide { width: 440px; max-width: calc(100vw - 32px); }
.login-form h3 { margin: 0; text-align: center; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; }
.stack-form input { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.two-factor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.two-factor-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin: 10px 0; background: var(--bg); }
.two-factor-card h4 { margin: 0 0 8px; }
.two-factor-card p { margin: 6px 0; }
.two-factor-qr { display: block; width: 220px; max-width: 100%; margin: 12px auto; border-radius: 6px; background: white; padding: 6px; }
.two-factor-secret { display: block; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); word-break: break-all; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel); }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.recovery-codes code { font-size: 13px; }
.two-factor-method-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.two-factor-method-row:last-child { border-bottom: none; }
.two-factor-method-meta { min-width: 0; }
.two-factor-method-meta strong { display: block; }
.two-factor-policy { padding: 10px 12px; border-radius: var(--radius); background: var(--bg); margin-bottom: 12px; }
.global-2fa-setting { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; }
.user-mgmt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge.two-factor-on { background: var(--status-ok-bg); color: var(--status-ok); }
.badge.two-factor-required { background: var(--status-warning-bg); color: var(--status-warning); }
.badge.two-factor-off { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
@media (max-width: 600px) {
  .recovery-codes { grid-template-columns: 1fr; }
  .global-2fa-setting { margin-left: 0; width: 100%; }
}
.modal-user-management { width: 900px; }
.modal-user-management table { min-width: 760px; }

/* ========================================================================== 
   GLPI-inspiriertes Verwaltungs-Layout
   ========================================================================== */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --border: #d8dee8;
  --text: #273142;
  --muted: #697386;
  --primary: #2f78bd;
  --primary-dark: #235f98;
  --danger: #c23b42;
  --danger-bg: #fff1f2;
  --radius: 4px;
  --nav-bg: #273b5e;
  --nav-bg-deep: #203250;
  --nav-hover: #314b75;
  --nav-active: #2d73b5;
  --nav-text: #dce6f4;
  --nav-muted: #9eb0c8;
  --sidebar-width: 238px;
  --topbar-height: 48px;

  --status-critical: #dc2626;
  --status-critical-bg: #fef2f2;
  --status-warning: #b45309;
  --status-warning-bg: #fef3c7;
  --status-ok: #166534;
  --status-ok-bg: #dcfce7;
  --status-info: #1d4ed8;
  --status-info-bg: #dbeafe;
  --status-paused: #6b7280;
  --status-paused-bg: #f1f2f4;

  /* Bisher an einigen Stellen referenziert, aber nie definiert - fiel dort still ins Leere
     (kein Schatten, keine Hintergrundfarbe). Jetzt echte Werte, angelehnt an die im Projekt
     bereits etablierten Schatten-/Flächenfarben. */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --surface: var(--panel);
  --surface-soft: var(--status-paused-bg);
}

[data-theme="dark"] {
  --bg: #111722;
  --panel: #19212e;
  --border: #303b4b;
  --text: #e7edf6;
  --muted: #9ba8bb;
  --primary: #5fa7e6;
  --primary-dark: #87bff0;
  --danger: #ff7b83;
  --danger-bg: #3b2027;
  --nav-bg: #17243a;
  --nav-bg-deep: #111c2e;
  --nav-hover: #233957;
  --nav-active: #285f91;
  --nav-text: #e3ebf7;
  --nav-muted: #96a8c0;

  --status-critical: #f87171;
  --status-critical-bg: #3a1d1d;
  --status-warning: #fbbf24;
  --status-warning-bg: #3f2f0d;
  --status-ok: #86efac;
  --status-ok-bg: #14532d;
  --status-info: #93c5fd;
  --status-info-bg: #1e3a5f;
  --status-paused: #9199a8;
  --status-paused-bg: #262a32;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html,
body {
  width: 100%;
  min-width: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  height: 100vh;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-columns 0.16s ease;
}

.app.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--nav-text);
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-deep) 100%);
  border: 0;
  box-shadow: 2px 0 6px rgba(13, 25, 43, 0.14);
  transition: transform 0.16s ease, width 0.16s ease, min-width 0.16s ease;
  z-index: 20;
}

.sidebar.collapsed {
  width: 0;
  min-width: 0;
  transform: translateX(-100%);
  border: 0;
}

.sidebar-brand {
  height: 124px;
  min-height: 124px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 4px;
  background: rgba(10, 22, 39, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 104px;
  object-fit: contain;
  object-position: left center;
  cursor: pointer;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.16));
}

.sidebar-nav {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 10px;
  scrollbar-width: thin;
}

.nav-heading {
  padding: 16px 18px 6px;
  color: var(--nav-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  color: var(--nav-text);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.nav-item:hover {
  color: #ffffff;
  background: var(--nav-hover);
}

.nav-item.active {
  color: #ffffff;
  background: var(--nav-active);
  border-left-color: #8bc4f2;
  font-weight: 600;
}

.nav-subitem {
  min-height: 33px;
  padding-left: 26px;
  font-size: 12px;
}

.nav-icon {
  width: 18px;
  flex: 0 0 18px;
  color: var(--nav-muted);
  text-align: center;
  font-size: 15px;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #ffffff;
}

.sidebar-customer-panel {
  min-height: 170px;
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 15, 29, 0.14);
  transition: background-color 0.3s ease;
}
.sidebar-customer-panel.customer-panel-highlight {
  background: rgba(59, 130, 246, 0.28);
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 4px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-count {
  min-width: 20px;
  padding: 1px 6px;
  color: #dcecff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  text-align: center;
  font-size: 10px;
}

.customer-filter {
  padding: 8px 12px;
}

.customer-filter input {
  width: 100%;
  height: 32px;
  padding: 6px 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  outline: none;
}

.customer-filter input::placeholder {
  color: #b6c3d5;
}

.customer-filter input:focus {
  background: rgba(255, 255, 255, 0.13);
  border-color: #83b9e9;
  box-shadow: 0 0 0 2px rgba(101, 172, 230, 0.16);
}

.customer-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 8px 10px;
  overflow-y: auto;
  list-style: none;
}

.customer-list li {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  margin: 1px 0;
  color: #d9e3f0;
  border-radius: 3px;
  cursor: pointer;
}

.customer-list li:hover {
  color: #ffffff;
  background: var(--nav-hover);
}

.customer-list li.active {
  color: #ffffff;
  background: var(--nav-active);
  font-weight: 600;
}

.customer-list li.muted {
  color: var(--nav-muted);
}

.customer-list .status-dot {
  flex: 0 0 8px;
}

.sidebar-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(8, 18, 33, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  color: #83bdf0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.current-user-info {
  min-width: 0;
  padding: 0;
  color: #dce6f3;
  border: 0;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.current-user-info .role-badge {
  display: block;
  width: fit-content;
  margin: 3px 0 0;
  padding: 1px 6px;
  color: #cfe5fb;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  z-index: 15;
}

.sidebar-collapse-handle {
  width: 32px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 16px;
}

.sidebar-collapse-handle:hover {
  color: var(--primary);
  background: var(--bg);
  border-color: var(--border);
}

.sidebar-collapse-handle.flipped {
  transform: none;
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.breadcrumbs > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-link {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  flex: 0 0 auto;
  color: #a6afbd;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-timer {
  padding: 4px 8px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.session-timer.warning {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.topbar-user {
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.topbar-user-email {
  max-width: 220px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-role {
  color: var(--muted);
  font-size: 10px;
}

.header-menu-button {
  width: 31px;
  height: 31px;
  border-radius: 3px;
}

.header-menu {
  top: calc(100% + 7px);
  min-width: 225px;
  border-radius: 4px;
}

/* Hauptbereich und Dashboard */
.main {
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: block;
  overflow: auto;
  padding: 14px;
  background: var(--bg);
}

.welcome {
  width: 100%;
  min-height: 100%;
  display: block;
  color: var(--text);
}

.page-heading,
.customer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.page-heading h1,
.customer-header h1 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  display: block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.dashboard-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.dashboard-card-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 11%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 4px;
  font-size: 22px;
}

.dashboard-card div {
  display: flex;
  flex-direction: column;
}

.dashboard-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dashboard-card div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-panel {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  margin: 0 0 3px;
  font-size: 14px;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.welcome-empty {
  min-height: 235px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.welcome-empty strong {
  color: var(--text);
  font-size: 14px;
}

.welcome-empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 25px;
}

/* Kundenansicht */
.customer-view {
  height: calc(100vh - var(--topbar-height) - 28px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

.customer-header {
  flex: 0 0 auto;
  border-radius: var(--radius) var(--radius) 0 0;
}

.customer-title-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.customer-title-block > div:last-child {
  min-width: 0;
}

.customer-header h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  color: #ffffff;
  background: var(--primary);
  border-radius: 4px;
  font-size: 22px;
}

.customer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-actions input[type="search"] {
  width: min(330px, 34vw);
  height: 32px;
  padding: 6px 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.customer-workbench {
  min-height: 0;
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.tabs {
  width: 174px;
  min-width: 174px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 62%, var(--panel));
  border: 0;
  border-right: 1px solid var(--border);
}

.tab {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  text-align: left;
}

.tab span {
  width: 18px;
  color: var(--muted);
  text-align: center;
}

.tab:hover {
  color: var(--text);
  background: var(--panel);
}

.tab.active {
  color: var(--primary-dark);
  background: var(--panel);
  border-left-color: var(--primary);
  border-bottom-color: var(--border);
  font-weight: 600;
}

.tab.active span {
  color: var(--primary);
}

.content-split {
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.list-panel {
  width: 48%;
  min-width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--panel);
}

.split-handle {
  width: 5px;
  background: var(--border);
  border-left: 1px solid color-mix(in srgb, var(--border) 85%, #0000);
  border-right: 1px solid color-mix(in srgb, var(--border) 85%, #0000);
}

.split-handle:hover,
.split-handle.dragging {
  background: var(--primary);
}

.detail-panel {
  min-width: 220px;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--bg) 38%, var(--panel));
}

.detail-placeholder {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.detail-placeholder span {
  font-size: 30px;
  opacity: 0.6;
}

.detail-placeholder p {
  margin: 8px 0 0;
}

.detail-close {
  top: 8px;
  right: 10px;
  z-index: 3;
}

.search-results {
  top: 105px;
  right: 26px;
  width: min(480px, calc(100vw - 52px));
  border-radius: 4px;
  z-index: 30;
}

/* Tabellen und Werkzeuge */
.toolbar {
  min-height: 45px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--bg) 45%, var(--panel));
}

.toolbar select,
.modal select,
.annotation-form select {
  min-height: 31px;
  padding: 5px 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
}

table {
  background: var(--panel);
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

th {
  height: 34px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 48%, var(--panel));
  font-size: 10px;
  letter-spacing: 0.035em;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

tbody tr.selected {
  background: color-mix(in srgb, var(--primary) 13%, var(--panel));
}

.btn {
  min-height: 31px;
  padding: 6px 11px;
  border-radius: 3px;
  box-shadow: none;
}

.btn-primary {
  color: #ffffff;
}

.btn-small {
  min-height: 27px;
  padding: 4px 8px;
}

/* Modale Dialoge */
.modal-overlay {
  padding: 18px;
  background: rgba(9, 17, 30, 0.54);
  backdrop-filter: blur(1px);
}

.modal {
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 18px 45px rgba(10, 20, 36, 0.28);
}

/* Login */
.login-view {
  position: relative;
  overflow: auto;
  background:
    linear-gradient(115deg, rgba(37, 61, 96, 0.96), rgba(30, 81, 126, 0.88)),
    var(--nav-bg);
}

.login-view::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
}

.login-form {
  position: relative;
  z-index: 1;
  width: 410px;
  max-width: calc(100vw - 30px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  box-shadow: 0 22px 55px rgba(5, 14, 28, 0.34);
}

.login-logo {
  display: block;
  width: min(100%, 292px);
  height: auto;
  max-height: none;
  margin: 0 auto 18px;
  object-fit: contain;
}

.login-footer {
  position: relative;
  z-index: 1;
  color: #d7e3f0;
}

/* Responsive */
@media (max-width: 1100px) {
  :root { --sidebar-width: 216px; }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-header { align-items: flex-start; }
  .customer-actions { max-width: 52%; }
  .customer-actions input[type="search"] { width: 100%; }
  .topbar-user { display: none; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app,
  .app.sidebar-collapsed {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(285px, 86vw);
    min-width: min(285px, 86vw);
  }
  .sidebar.collapsed {
    width: min(285px, 86vw);
    min-width: min(285px, 86vw);
  }
  .workspace { min-height: 100vh; }
  .main { overflow: visible; }
  .breadcrumbs { max-width: 42vw; }
  .session-timer { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-heading,
  .customer-header { align-items: stretch; flex-direction: column; }
  .customer-actions { max-width: none; justify-content: flex-start; }
  .customer-actions input[type="search"] { width: 100%; }
  .customer-view { height: auto; min-height: 720px; overflow: visible; }
  .customer-workbench { min-height: 620px; flex-direction: column; }
  .tabs {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .tab {
    width: auto;
    min-width: max-content;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }
  .tab.active { border-bottom-color: var(--primary); }
  .content-split { min-height: 560px; }
  .list-panel { width: 52%; min-width: 190px; }
}

/* ─────────────────────────────────────────────
   Asset Management: Computerbestand
   ───────────────────────────────────────────── */
.dashboard-card-warning .dashboard-card-icon {
  color: var(--status-warning);
  background: color-mix(in srgb, var(--status-warning) 14%, var(--panel));
}

.dashboard-card-danger .dashboard-card-icon {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
}

.asset-loading {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.asset-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  gap: 6px;
  padding: 10px;
  background: color-mix(in srgb, var(--bg) 45%, var(--panel));
  border-bottom: 1px solid var(--border);
}

.asset-summary-card {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 24px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  padding: 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
}

.asset-summary-card:hover,
.asset-summary-card.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

.asset-summary-card > span {
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.asset-summary-card strong {
  overflow: hidden;
  font-size: 17px;
  line-height: 1;
  text-overflow: ellipsis;
}

.asset-summary-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.asset-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.asset-toolbar input,
.asset-toolbar select {
  min-height: 31px;
  padding: 5px 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  font: inherit;
  font-size: 12px;
}

.asset-toolbar input {
  min-width: 190px;
  flex: 1 1 240px;
}

.asset-toolbar select {
  max-width: 190px;
}

.asset-ou-tree {
  max-height: 170px;
}

.asset-table-container {
  min-height: 260px;
  flex: 1;
  overflow: auto;
}

.asset-table {
  min-width: 940px;
}

.asset-table th:first-child,
.asset-table td:first-child {
  width: 126px;
}

.asset-table tbody tr {
  border-left: 3px solid transparent;
}

.asset-table tbody tr.asset-status-warning {
  border-left-color: #d69e2e;
}

.asset-table tbody tr.asset-status-critical {
  border-left-color: var(--danger);
}

.asset-table tbody tr.asset-status-disabled,
.asset-table tbody tr.asset-status-retired,
.asset-table tbody tr.asset-status-deleted {
  opacity: 0.72;
  border-left-color: var(--muted);
}

.table-sort {
  width: 100%;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.table-secondary {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.25;
}

.asset-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.asset-status-healthy {
  color: var(--status-ok);
  background: var(--status-ok-bg);
}

.asset-status-warning {
  color: var(--status-warning);
  background: var(--status-warning-bg);
}

.asset-status-critical {
  color: var(--status-critical);
  background: var(--status-critical-bg);
}

.asset-status-disabled,
.asset-status-retired,
.asset-status-deleted,
.asset-status-unknown {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, var(--panel));
}

.asset-pagination {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 45%, var(--panel));
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.asset-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.asset-pagination select {
  min-height: 27px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.asset-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 12px;
}

.asset-detail-header h3 {
  margin: 3px 0 9px;
  font-size: 20px;
}

.asset-detail-header .badge,
.asset-detail-header .asset-status-badge {
  margin-right: 5px;
}

.asset-warning-list,
.asset-ok-message {
  margin: 0 0 14px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--status-warning) 45%, var(--border));
  border-radius: 4px;
  color: var(--status-warning);
  background: color-mix(in srgb, var(--status-warning) 8%, var(--panel));
  font-size: 12px;
}

.asset-warning-list div + div {
  margin-top: 4px;
}

.asset-ok-message {
  color: var(--status-ok);
  border-color: color-mix(in srgb, var(--status-ok) 38%, var(--border));
  background: color-mix(in srgb, var(--status-ok) 7%, var(--panel));
}

.asset-detail-tabs {
  display: flex;
  gap: 2px;
  margin: 0 -20px 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.asset-detail-tabs button {
  padding: 9px 10px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.asset-detail-tabs button:hover,
.asset-detail-tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.asset-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.asset-metric-grid article {
  min-width: 0;
  padding: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.asset-metric-grid span,
.asset-metric-grid small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.asset-metric-grid strong {
  display: block;
  overflow: hidden;
  margin: 4px 0;
  font-size: 13px;
  text-overflow: ellipsis;
}

.asset-detail-grid {
  grid-template-columns: 165px minmax(0, 1fr);
}

.break-all {
  word-break: break-all;
}

@media (max-width: 1250px) {
  .asset-summary-strip { grid-template-columns: repeat(2, minmax(105px, 1fr)); }
  .asset-toolbar select { max-width: 155px; }
}

@media (max-width: 760px) {
  .asset-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-toolbar { align-items: stretch; }
  .asset-toolbar input,
  .asset-toolbar select,
  .asset-toolbar .btn { width: 100%; max-width: none; }
  .asset-pagination { flex-wrap: wrap; justify-content: center; }
  .asset-metric-grid { grid-template-columns: 1fr; }
  .asset-detail-grid { grid-template-columns: 1fr; }
  .asset-detail-grid dt { margin-top: 8px; }
}

/* ─────────────────────────────────────────────
   WBX Control 0.3.1 - einheitlicher Agent
   ───────────────────────────────────────────── */
.dashboard-card-success .dashboard-card-icon { color: var(--status-ok); background: var(--status-ok-bg); }

.agent-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.agent-status-installed { color: var(--status-ok); background: var(--status-ok-bg); border-color: color-mix(in srgb, var(--status-ok) 40%, transparent); }
.agent-status-missing { color: var(--muted); background: var(--status-paused-bg); border-color: var(--border); }

.asset-table td:nth-child(2) {
  min-width: 132px;
}
.asset-table td:nth-child(6) {
  min-width: 180px;
}

.inventory-metric-grid {
  margin-top: 14px;
}
.inventory-empty-state {
  margin: 16px 0;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.inventory-empty-state > span {
  display: block;
  margin-bottom: 8px;
  font-size: 30px;
  color: var(--primary);
}
.inventory-empty-state strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.inventory-empty-state p {
  max-width: 620px;
  margin: 7px auto 0;
  line-height: 1.55;
}
.inventory-empty-state code {
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
}
.inventory-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.inventory-section-heading h4,
.inventory-subheading {
  margin: 0;
  font-size: 14px;
}
.inventory-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.inventory-subheading {
  margin-top: 22px;
  margin-bottom: 9px;
}
.inventory-detail-grid {
  grid-template-columns: 165px minmax(0, 1fr);
}
.inventory-filter-row {
  display: flex;
  margin-bottom: 10px;
}
.inventory-filter-row input {
  width: min(520px, 100%);
  padding: 8px 10px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.inventory-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.inventory-software-table-wrap {
  max-height: 520px;
}
.inventory-table {
  min-width: 700px;
}
.inventory-table th {
  z-index: 1;
}
.inventory-table td,
.inventory-table th {
  vertical-align: top;
}
.network-adapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}
.network-adapter-card {
  min-width: 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.network-adapter-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.network-adapter-card header strong,
.network-adapter-card header small {
  display: block;
}
.network-adapter-card header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.network-adapter-card header > span {
  padding: 2px 7px;
  color: var(--primary-dark);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.network-adapter-card dl {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
}
.network-adapter-card dt {
  color: var(--muted);
  font-size: 11px;
}
.network-adapter-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .inventory-section-heading { flex-direction: column; }
  .inventory-detail-grid { grid-template-columns: 1fr; }
  .network-adapter-grid { grid-template-columns: 1fr; }
}
.asset-detail-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}
.asset-detail-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   Lizenz-Audit (CAL-Bedarfsübersicht)
   ───────────────────────────────────────────── */
.cal-summary { display: flex; gap: 12px; padding: 16px; flex-wrap: wrap; }
.cal-summary-card {
  flex: 1; min-width: 120px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px; text-align: center;
}
.cal-summary-card-muted { background: var(--bg); }
.cal-summary-value { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.cal-summary-card-muted .cal-summary-value { color: var(--text); }
.cal-summary-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.cal-note {
  margin: 0 16px 16px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.cal-note p { margin: 0 0 6px; }
.cal-note p:last-child { margin-bottom: 0; }
.cal-excluded-list { margin: 4px 0 0; padding-left: 18px; }
.cal-excluded-list li { margin-bottom: 2px; }

/* ─────────────────────────────────────────────
   Tabellen-Seitenweise-Darstellung
   ───────────────────────────────────────────── */
.sortable-table-wrapper { display: flex; flex-direction: column; }
.table-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px; border-top: 1px solid var(--border); font-size: 13px;
}

.cal-exclusion-modal-list { max-height: 60vh; overflow-y: auto; }
.cal-exclusion-modal-list .cal-excluded-list { padding-left: 18px; }
.cal-exclusion-modal-list .cal-excluded-list li { margin-bottom: 4px; font-size: 13px; }

/* ─────────────────────────────────────────────
   Compliance-Center
   ───────────────────────────────────────────── */
.compliance-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--bg) 45%, var(--panel));
  border-bottom: 1px solid var(--border);
}

.compliance-summary-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  text-align: left;
}

button.compliance-summary-card {
  cursor: pointer;
}

button.compliance-summary-card:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

.compliance-summary-card strong {
  font-size: 21px;
  line-height: 1;
}

.compliance-summary-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.compliance-summary-critical strong { color: var(--danger); }
.compliance-summary-warning strong { color: var(--status-warning); }
.compliance-summary-total { background: color-mix(in srgb, var(--primary) 6%, var(--panel)); }

.compliance-table-container {
  flex: 1;
  min-height: 280px;
  overflow: auto;
}

.compliance-row {
  border-left: 3px solid transparent;
}

.compliance-row.compliance-severity-critical { border-left-color: var(--danger); }
.compliance-row.compliance-severity-warning { border-left-color: var(--status-warning); }
.compliance-row.compliance-severity-info { border-left-color: var(--primary); }

.compliance-severity-badge,
.compliance-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 5px 6px 0;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.compliance-severity-badge.compliance-severity-critical {
  color: var(--status-critical);
  background: var(--status-critical-bg);
}

.compliance-severity-badge.compliance-severity-warning {
  color: var(--status-warning);
  background: var(--status-warning-bg);
}

.compliance-severity-badge.compliance-severity-info {
  color: var(--status-info);
  background: var(--status-info-bg);
}

.compliance-status-open {
  color: var(--status-critical);
  background: var(--status-critical-bg);
}

.compliance-status-acknowledged {
  color: var(--status-info);
  background: var(--status-info-bg);
}

.compliance-status-exception {
  color: #6b21a8;
  background: #f3e8ff;
}

.compliance-status-resolved {
  color: var(--status-ok);
  background: var(--status-ok-bg);
}

.compliance-detail-header h3 {
  margin: 2px 0 6px;
}

.compliance-detail-header p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.compliance-detail-grid code {
  overflow-wrap: anywhere;
}

.compliance-note,
.compliance-empty-note {
  margin: 12px 0;
  padding: 12px 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 5%, var(--panel));
  border: 1px solid var(--border);
  border-radius: 5px;
}

.compliance-empty-note {
  margin: 12px;
  color: var(--muted);
}

.compliance-note p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.compliance-form select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

[data-theme="dark"] .compliance-status-exception {
  color: #d8b4fe;
  background: #3b0764;
}

@media (max-width: 1000px) {
  .compliance-summary-strip { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
}

/* ── Asset-Lifecycle 0.6.0 ───────────────────────────── */
.device-lifecycle-toolbar select { min-width: 190px; }
.device-record-form { max-width: 640px; }
.device-form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: color-mix(in srgb, var(--primary) 3%, var(--panel));
  border: 1px solid var(--border);
  border-radius: 6px;
}
.device-form-section h4 { margin: 0 0 2px; }

.badge.lifecycle-ordered { color: var(--status-info); background: var(--status-info-bg); }
.badge.lifecycle-in-stock { color: var(--status-info); background: var(--status-info-bg); }
.badge.lifecycle-active { color: var(--status-ok); background: var(--status-ok-bg); }
.badge.lifecycle-repair { color: var(--status-warning); background: var(--status-warning-bg); }
.badge.lifecycle-returned { color: var(--status-paused); background: var(--status-paused-bg); }
.badge.lifecycle-retired { color: var(--status-paused); background: var(--status-paused-bg); }
.badge.lifecycle-lost { color: #fff; background: var(--status-critical); }

.lifecycle-timeline {
  position: relative;
  margin: 10px 0 18px;
  padding-left: 18px;
}
.lifecycle-timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 8px;
  left: 5px;
  width: 2px;
  background: var(--border);
}
.lifecycle-event {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.lifecycle-event-marker {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  margin-left: -17px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--border);
}
.lifecycle-event-content {
  margin-left: -12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
}
.lifecycle-event-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.lifecycle-event-head time,
.lifecycle-event-actor,
.lifecycle-event-field { color: var(--muted); font-size: 11px; }
.lifecycle-event-field { margin-top: 3px; font-weight: 700; }
.lifecycle-event-change {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 7px;
  font-size: 12px;
}
.lifecycle-event-change span {
  padding: 5px 7px;
  overflow-wrap: anywhere;
  border-radius: 4px;
  background: var(--bg);
}
.lifecycle-event-change b { color: var(--muted); }
.lifecycle-event-content p { margin: 8px 0 0; white-space: pre-wrap; }
.lifecycle-event-actor { margin-top: 7px; text-align: right; }

@media (max-width: 700px) {
  .device-record-form .form-row { flex-direction: column; }
  .lifecycle-event-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .lifecycle-event-change { grid-template-columns: 1fr; }
  .lifecycle-event-change b { transform: rotate(90deg); justify-self: center; }
}

.assigned-device-list { display: flex; flex-wrap: wrap; gap: 7px; }
.assigned-device-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
}
.assigned-device-chip:hover { border-color: var(--primary); }
.assigned-device-chip span { color: var(--muted); font-size: 11px; }

/* Suchbare AD-Benutzerzuweisung und direkte Compliance-Navigation */
.device-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.device-detail-heading h3 {
  margin: 0;
}

.entity-picker {
  position: relative;
}

.entity-picker > input[type="search"] {
  width: 100%;
  padding-right: 34px;
}

.entity-picker-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 22px;
}

.entity-picker-clear:hover {
  color: var(--text);
  background: var(--bg);
}

.entity-picker-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}

.entity-picker-result {
  display: flex;
  width: 100%;
  padding: 8px 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.entity-picker-result:hover,
.entity-picker-result:focus {
  background: var(--bg);
  outline: none;
}

.entity-picker-result strong {
  font-size: 13px;
}

.entity-picker-result span,
.entity-picker-empty,
.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.entity-picker-empty {
  padding: 10px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  line-height: 1.45;
}

.compliance-field-hint {
  margin: 4px 0 0;
  padding: 9px 10px;
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}


/* 0.6.3: Agent-Kontaktwarnungen in der Computerübersicht */
.asset-summary-card-warning {
  border-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 9%, var(--surface));
}
.asset-summary-card-danger {
  border-color: #dc2626;
  background: color-mix(in srgb, #dc2626 9%, var(--surface));
}
.asset-summary-card-warning > span { color: #a16207; }
.asset-summary-card-danger > span { color: #b91c1c; }
[data-theme="dark"] .asset-summary-card-warning { background: color-mix(in srgb, #f59e0b 13%, var(--surface)); }
[data-theme="dark"] .asset-summary-card-danger { background: color-mix(in srgb, #dc2626 13%, var(--surface)); }

/* Gerätearten und neu geordnete Geräteerfassung 0.6.5 */
.device-identification-section {
  border-left: 4px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

#deviceCategoryCustom {
  margin-top: 8px;
}

.device-lifecycle-toolbar #deviceCategoryFilter {
  min-width: 210px;
}

.device-lifecycle-toolbar #deviceAdLinkFilter {
  min-width: 180px;
}


/* Kundenspezifische Monitoring-Freischaltung */
.monitoring-customer-settings {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 4px 0 12px;
}
.monitoring-customer-settings legend {
  padding: 0 6px;
  font-weight: 700;
}
.monitoring-customer-settings .muted {
  margin: 8px 0 0;
  line-height: 1.45;
}


/* Infrastruktur-Monitoring */
.monitoring-page { display: grid; gap: 18px; padding: 18px; }
.monitoring-page-header, .monitoring-section-title, .monitoring-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.monitoring-page-header h3, .monitoring-section-title h3, .monitoring-editor h4 { margin: 0 0 4px; }
.monitoring-page-header p, .monitoring-section-title p { margin: 0; }
.monitoring-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.monitoring-disabled-banner { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--status-warning); border-radius: var(--radius); background: var(--status-warning-bg); }
.monitoring-target-table-wrap { overflow-x: auto; }
.monitoring-target-table { min-width: 1050px; }
.monitoring-target-table td { vertical-align: top; }
.monitoring-status { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.monitoring-status-unknown { background: var(--surface-soft); color: var(--muted); }
.monitoring-status-ok { background: var(--status-ok-bg); color: var(--status-ok); }
.monitoring-status-warning { background: var(--status-warning-bg); color: var(--status-warning); }
.monitoring-status-critical { background: var(--status-critical-bg); color: var(--status-critical); }
.monitoring-editor { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.monitoring-editor textarea { width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.45; }
.monitoring-editor code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.monitoring-template-section { display: grid; gap: 12px; }
.monitoring-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.monitoring-template-card { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.monitoring-template-card > div { display: grid; gap: 3px; }
.monitoring-template-card span, .monitoring-template-card p { color: var(--muted); font-size: 13px; margin: 0; }
.monitoring-template-card .btn { justify-self: start; }
@media (max-width: 800px) { .monitoring-page-header { flex-direction: column; } .monitoring-page { padding: 12px; } }

/* ─────────────────────────────────────────────
   Verwaiste Inventar-Geräte (kein AD-Computer, z.B. nicht domänengebundene PCs)
   ───────────────────────────────────────────── */
.orphan-devices-section {
  margin: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
}
.orphan-devices-section summary {
  cursor: pointer; font-weight: 600; color: var(--text); list-style: revert;
}

/* ─────────────────────────────────────────────
   Rack-Baukasten
   ───────────────────────────────────────────── */
.rack-list-header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px;
}
.rack-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 0 16px 16px;
}
.rack-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; cursor: pointer;
  background: var(--panel); transition: border-color 0.12s ease, transform 0.12s ease;
}
.rack-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.rack-card h4 { margin: 0 0 4px; }
.rack-card p { margin: 2px 0; font-size: 13px; }

.rack-detail-header {
  display: flex; align-items: center; gap: 14px; padding: 16px; flex-wrap: wrap;
}
.rack-detail-title { flex: 1; min-width: 200px; }
.rack-detail-title h3 { margin: 0 0 2px; }

.rack-columns {
  display: flex; gap: 32px; padding: 0 16px 32px; overflow-x: auto;
}
.rack-column-wrap { flex: 0 0 auto; }
.rack-column-heading {
  text-align: center; font-weight: 600; margin-bottom: 8px; color: var(--muted);
  text-transform: uppercase; font-size: 12px; letter-spacing: 0.04em;
}
.rack-column {
  position: relative; width: 280px; border: 2px solid var(--border); border-radius: 6px;
  background: var(--bg); overflow: hidden;
}
.rack-unit-row {
  position: absolute; left: 0; right: 0; border-bottom: 1px dashed var(--border); box-sizing: border-box;
}
.rack-unit-row:nth-child(odd) { background: rgba(127, 127, 127, 0.04); }
.rack-unit-number {
  position: absolute; left: 4px; top: 1px; font-size: 9px; color: var(--muted); user-select: none;
}
.rack-item-block {
  position: absolute; left: 24px; right: 4px; margin-top: 1px;
  border-radius: 3px; color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center;
  cursor: pointer; overflow: hidden; padding: 0 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  box-sizing: border-box;
}
.rack-item-block:hover { outline: 2px solid #fff; outline-offset: -2px; }
.rack-item-block span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rack-item-block-ports {
  display: block; padding: 0; background-image: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15));
}
.rack-item-block-label {
  position: absolute; left: 5px; top: 1px; font-size: 8px; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.85); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: calc(100% - 10px); pointer-events: none; z-index: 1;
}
.rack-port-strip {
  position: absolute; inset: 3px 4px 3px 4px; display: flex; align-items: stretch; gap: 1px;
}
.rack-port-dot {
  flex: 1 1 auto; min-width: 1px; background: rgba(255, 255, 255, 0.4); border-radius: 1px;
}

/* ─────────────────────────────────────────────
   Switch-/Patchpanel-Portkonfiguration (im Detailbereich)
   ───────────────────────────────────────────── */
.rack-port-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 4px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px; flex-wrap: wrap;
}
.rack-port-header h3 { margin: 0 0 2px; }
.rack-port-header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rack-port-legend { font-size: 11px; margin: 0 0 10px; }
.rack-port-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rack-port-table th {
  text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
}
.rack-port-table td { padding: 4px 8px; border: none; }
.rack-port-table tbody tr { transition: background-color 0.1s ease; }
.rack-port-table tbody tr:nth-child(odd) { background: rgba(127, 127, 127, 0.05); }
.rack-port-table tbody tr:nth-child(even) { background: transparent; }
.rack-port-table tbody tr:hover { background: rgba(59, 130, 246, 0.08); }
.rack-port-table .rack-port-number { font-weight: 600; width: 34px; }
.rack-port-table select, .rack-port-table input {
  width: 100%; font-size: 12px; padding: 3px 5px; box-sizing: border-box;
  border: 1px solid transparent; background: transparent;
}
.rack-port-table select:hover, .rack-port-table input:hover,
.rack-port-table select:focus, .rack-port-table input:focus {
  border-color: var(--border); background: var(--panel);
}
.rack-port-table select { min-width: 60px; }

/* ─────────────────────────────────────────────
   Switch-Faceplate (große Portübersicht, Cisco-Optik)
   ───────────────────────────────────────────── */
.faceplate {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start;
  padding: 10px; margin-bottom: 12px;
  background: #1f2225; border: 1px solid #34383d; border-radius: 5px;
}
.faceplate-group { display: flex; flex-direction: column; gap: 2px; }
.faceplate-group-xg { margin-left: 6px; padding-left: 10px; border-left: 1px dashed #4b5158; }
.faceplate-row { display: flex; gap: 2px; }
.faceplate-port {
  width: 22px; height: 18px; border-radius: 2px;
  background: #3a3f45; border: 1px solid #14161a;
  color: #c9ced4; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.faceplate-port:hover { background: #4d535a; }
.faceplate-port-active {
  background: #16a34a; color: #fff; border-color: #0d7a36;
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.55);
}
.faceplate-port-xg { background: #2b3a52; }
.faceplate-port-xg.faceplate-port-active { background: #16a34a; }
.faceplate-port-editing {
  outline: 2px solid #facc15; outline-offset: 1px; box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}
.faceplate-legend-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  background: #16a34a; vertical-align: middle; margin: 0 2px;
}
.rack-port-row-editing { background: rgba(250, 204, 21, 0.09) !important; }
.rack-port-strip-gap { flex: 0 0 4px; }
.rack-port-dot-xg { background: rgba(147, 197, 253, 0.65); }

/* ─────────────────────────────────────────────
   TLS-Zertifikatsüberwachung
   ───────────────────────────────────────────── */
.cert-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px; flex-wrap: wrap;
}
.cert-header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gdata-license-table { min-width: 1500px; }
.cert-table th {
  text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
}
.cert-table td { padding: 8px 10px; vertical-align: top; }
.cert-table tbody tr:nth-child(odd) { background: rgba(127, 127, 127, 0.05); }
.cert-table tbody tr:hover { background: rgba(59, 130, 246, 0.08); }
.license-row-warning {
  background: color-mix(in srgb, #f59e0b 16%, var(--panel)) !important;
  box-shadow: inset 4px 0 #f59e0b;
}
.license-row-critical {
  background: color-mix(in srgb, var(--danger) 15%, var(--panel)) !important;
  box-shadow: inset 4px 0 var(--danger);
}
.license-row-inactive {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 8%, var(--panel)) !important;
  opacity: 0.58;
  filter: grayscale(0.7);
}
.license-row-warning:hover { background: color-mix(in srgb, #f59e0b 23%, var(--panel)) !important; }
.license-row-critical:hover { background: color-mix(in srgb, var(--danger) 22%, var(--panel)) !important; }
.license-row-inactive:hover { opacity: 0.75; }
.cert-row-disabled { opacity: 0.55; }
.cert-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.cert-ok { background: var(--status-ok-bg); color: var(--status-ok); }
.cert-warn { background: var(--status-warning-bg); color: var(--status-warning); }
.cert-critical { background: var(--status-critical-bg); color: var(--status-critical); }
.cert-unreachable { background: var(--status-paused-bg); color: var(--muted); }
.cert-unknown { background: var(--bg); color: var(--muted); }

/* ─────────────────────────────────────────────
   Lizenzen - Kategorie-Reiter
   ───────────────────────────────────────────── */
.license-category-pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 16px 16px 0; }
.license-pill {
  padding: 5px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); font-size: 12px; cursor: pointer;
}
.license-pill:hover { border-color: var(--primary); }
.license-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.license-todo-cell { max-width: 220px; white-space: normal; }
.license-deactivation-reason { display: inline-block; max-width: 180px; margin-top: 4px; font-size: 11px; white-space: normal; }
.license-status-form {
  margin-bottom: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dashboard-panel-empty { margin: 0; padding: 16px; }
.dashboard-alert-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dashboard-alert-table th {
  padding: 8px 10px; text-align: left; color: var(--muted); border-bottom: 1px solid var(--border);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
}
.dashboard-alert-table td { padding: 9px 10px; vertical-align: top; border-bottom: 1px solid var(--border); }
.dashboard-license-alert-row { cursor: pointer; }
.dashboard-license-alert-row:last-child td { border-bottom: 0; }
#licenseAlertList, #monitoringAlertList { overflow-x: auto; }

/* ─────────────────────────────────────────────
   Verträge - Geräte-Verknüpfungsliste
   ───────────────────────────────────────────── */
.contract-asset-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.contract-asset-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.contract-asset-candidate { cursor: default; }
.contract-asset-candidate:hover { border-color: var(--primary); }

/* Hauptgerät-Kennzeichnung */
.assigned-device-chip-wrap { display: inline-flex; align-items: center; gap: 4px; }
.assigned-device-chip-primary { border-color: var(--primary); background: rgba(59, 130, 246, 0.08); }
.set-primary-device { padding: 2px 6px; font-size: 12px; }

/* Lizenz-Unter-Tab-Leiste - fasst sechs frueher getrennte Sidebar-Punkte zusammen */
.licensing-subtabs {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 62%, var(--panel));
}
.licensing-subtabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.licensing-subtabs-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.licensing-subtab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.licensing-subtab:hover { color: var(--text); border-color: var(--primary); }
.licensing-subtab.active {
  color: var(--primary-dark);
  background: color-mix(in srgb, var(--primary) 12%, var(--panel));
  border-color: var(--primary);
  font-weight: 600;
}

/* Produktkatalog */
.product-family-block { margin-bottom: 8px; }

/* Lizenzbestand-Formular in zwei klare Schritte gegliedert */
.stock-form-step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 4px 0 12px;
}
.stock-form-step legend {
  padding: 0 6px;
  font-weight: 700;
  color: var(--primary);
}

/* Kundenunabhängige Verwaltung: dezenter Hinweis in der Sidebar-Überschrift */
.nav-heading-hint { font-weight: 400; text-transform: none; letter-spacing: normal; opacity: 0.7; }

/* Mehrfachauswahl von Gruppen bei Bedarfsregeln (Chips + Entfernen-Knopf) */
.group-chips-container { display: flex; flex-wrap: wrap; gap: 2px; min-height: 0; }
.group-chips-container:empty { display: none; }
.group-chip-remove {
  border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: 13px; line-height: 1; padding: 0 0 0 4px;
}
.group-chip-remove:hover { color: var(--danger); }

/* Dokumentations-Ansicht (gerenderte Markdown-Inhalte) */
.doc-content { max-width: 860px; padding: 24px; line-height: 1.6; }
.doc-content h2 { margin-top: 28px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.doc-content h3 { margin-top: 22px; color: var(--primary-dark); }
.doc-content h4 { margin-top: 16px; }
.doc-content p { margin: 10px 0; }
.doc-content ul { margin: 8px 0; padding-left: 22px; }
.doc-content li { margin: 4px 0; }
.doc-content blockquote {
  margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--panel)); border-radius: 0 var(--radius) var(--radius) 0;
}
.doc-content code {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-size: 0.9em;
}
.doc-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.doc-table th, .doc-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.doc-table th { background: var(--panel); font-weight: 700; }

/* Donut-Charts für die Status-Übersicht auf der Startseite (PRTG-inspiriert) */
.donut-chart-row { display: flex; gap: 32px; flex-wrap: wrap; margin: 8px 0 24px; }
.donut-chart-card {
  display: flex; align-items: center; gap: 20px; padding: 18px 22px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  flex: 1 1 320px; min-width: 280px;
}
.donut-chart-card h3 { margin: 0 0 12px; font-size: 14px; }
.donut-chart-number { font-size: 30px; font-weight: 800; fill: var(--text); font-family: inherit; }
.donut-chart-label { font-size: 11px; fill: var(--muted); font-family: inherit; text-transform: uppercase; letter-spacing: 0.04em; }
.donut-chart-legend { display: flex; flex-direction: column; gap: 6px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.donut-legend-item strong { color: var(--text); margin-left: auto; padding-left: 12px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-chart circle { transition: stroke-dasharray 0.4s ease; }

/* Donut-Chart und zugehörige Detail-Tabelle als EINE zusammenhängende Einheit (PRTG-Stil) -
   vorher durch einen unabhängigen Statistik-Block voneinander getrennt, was den Eindruck
   erweckte, Donut und Tabelle gehörten nicht zusammen. */
.alert-panel-with-donut {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}
.alert-panel-donut {
  flex: 0 0 auto;
  min-width: 300px;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 18px 22px;
}
.alert-panel-detail {
  flex: 1 1 420px;
  min-width: 320px;
  padding: 18px 20px;
}
@media (max-width: 900px) {
  .alert-panel-donut { border-right: none; border-bottom: 1px solid var(--border); width: 100%; }
}

/* Donut-Legende klickbar - filtert die zugehörige Tabelle auf den jeweiligen Schweregrad */
.donut-legend-item.clickable { cursor: pointer; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.donut-legend-item.clickable:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.donut-legend-item.clickable.active { background: color-mix(in srgb, var(--primary) 14%, transparent); font-weight: 600; }

/* Textbasierter Header-Knopf für das Konfiguration-Menü (statt der runden Icon-Knöpfe) */
.header-menu-button-text {
  width: auto;
  height: auto;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
