/* ------------------------------------------------------------------
   Hosting Panel – Stylesheet
   Farben ausschließlich über Variablen, damit Hell/Dunkel greift.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-hover: #f3f5f8;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --divider: #eceef2;
  --text: #151b23;
  --text-2: #3b4552;
  --text-muted: #646f7d;
  --text-faint: #929ba7;

  --sidebar: #ffffff;
  --sidebar-border: #e3e6eb;

  --primary: #1f64d6;
  --primary-hover: #1853b5;
  --primary-soft: #ebf2fd;
  --primary-soft-border: #c9dbf7;
  --on-primary: #ffffff;
  --focus: rgba(31, 100, 214, .28);

  --green: #1f8a42;
  --green-soft: #e7f5ec;
  --red: #c93a2e;
  --red-hover: #ad2f24;
  --red-soft: #fcecea;
  --red-soft-border: #f2c7c2;
  --amber: #a86500;
  --amber-soft: #fdf4e3;
  --amber-soft-border: #f1dbad;
  --neutral-soft: #eef0f3;

  --chart-1: #1f64d6;
  --chart-2: #1f8a42;
  --chart-3: #d0701f;
  --chart-4: #7a4fc2;
  --chart-grid: #eceef2;

  --overlay: rgba(15, 20, 28, .45);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .06);

  --radius: 8px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262d38;
  --surface: #2e3643;
  --surface-2: #343d4b;
  --surface-hover: #3a4453;
  --border: #414b5a;
  --border-strong: #556072;
  --divider: #3b4452;
  --text: #e8ecf1;
  --text-2: #c9d0d9;
  --text-muted: #a3adba;
  --text-faint: #8691a0;

  --sidebar: #2a313d;
  --sidebar-border: #3b4452;

  --primary: #4d8ef7;
  --primary-hover: #6aa1fa;
  --primary-soft: rgba(77, 142, 247, .14);
  --primary-soft-border: rgba(77, 142, 247, .35);
  --on-primary: #ffffff;
  --focus: rgba(77, 142, 247, .4);

  --green: #4cc27a;
  --green-soft: rgba(76, 194, 122, .13);
  --red: #f0675b;
  --red-hover: #f48479;
  --red-soft: rgba(240, 103, 91, .13);
  --red-soft-border: rgba(240, 103, 91, .35);
  --amber: #e5a33c;
  --amber-soft: rgba(229, 163, 60, .13);
  --amber-soft-border: rgba(229, 163, 60, .35);
  --neutral-soft: #3b4452;

  --chart-1: #5b9bff;
  --chart-2: #4cc27a;
  --chart-3: #f08c3c;
  --chart-4: #a582f0;
  --chart-grid: #3b4452;

  --overlay: rgba(10, 14, 20, .55);
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .4), 0 0 0 1px var(--border);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--neutral-soft); padding: 1px 5px; border-radius: 4px; }
.code-block { background: var(--neutral-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; line-height: 1.55; }
[hidden] { display: none !important; }
::selection { background: var(--primary-soft-border); }

/* Shell ------------------------------------------------------------ */

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 20px;
  color: var(--text);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
/* Logo und Panel-Name bleiben oben stehen, wenn die Seitenleiste scrollt */
.sidebar > .brand { position: sticky; top: 0; z-index: 2; background: var(--sidebar); }
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 7px;
  flex-shrink: 0;
}
.sidebar nav { padding: 6px 12px 16px; flex: 1; }
.nav-section {
  padding: 18px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-faint);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 1px 0;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
}
.nav-link svg { color: var(--text-muted); flex-shrink: 0; }
.nav-link:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.nav-link.active svg { color: var(--primary); }
.nav-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--neutral-soft);
  border-radius: 10px;
  padding: 0 7px;
  line-height: 18px;
}
.nav-link.active .nav-count { background: var(--surface); color: var(--primary); }
.sidebar-foot {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Erreichbarkeit bleibt unten stehen, wenn die Seitenleiste scrollt */
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--sidebar);
}
.health-line { display: flex; align-items: center; gap: 8px; color: inherit; }
.health-line:hover { text-decoration: none; }
.health-line.bad { color: var(--red); font-weight: 500; }
.health-line.bad:hover span:last-child { text-decoration: underline; }
.rdns-log details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 8px; }
.rdns-log details.bad { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.rdns-log summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rdns-log pre { max-height: 320px; overflow: auto; margin: 4px 0 8px; white-space: pre-wrap; word-break: break-all; }
.health-version { color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.health-version:hover { color: var(--text-muted); text-decoration: none; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.conn-dot.ok { background: var(--green); }
.conn-dot.bad { background: var(--red); }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .spacer { flex: 1; }
.topbar-title { font-size: 13px; color: var(--text-muted); }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px 4px 4px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.user-btn:hover { background: var(--surface-hover); border-color: var(--border); }
.user-btn .who { text-align: left; line-height: 1.2; }
.user-btn .who b { display: block; font-size: 13px; font-weight: 600; }
.user-btn .who small { font-size: 11.5px; color: var(--text-muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.menu-toggle { display: none; }

.main { padding: 26px 28px 56px; flex: 1; }
.page { max-width: 1260px; margin: 0 auto; }
.nav-backdrop { display: none; }

/* Seitenkopf ------------------------------------------------------- */

.breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span.sep { margin: 0 6px; color: var(--text-faint); }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Karten ----------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card.overflow-visible { overflow: visible; }
.card.overflow-visible > .card-head:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
}
.card-head h2 { font-size: 14.5px; }
.card-head .hint { font-size: 12.5px; color: var(--text-muted); font-weight: normal; margin-left: 6px; }
.card-body { padding: 18px; }
.card-foot {
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-muted);
}
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }

.section-title { font-size: 14.5px; margin-bottom: 4px; }
.section-desc { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.settings-row {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--divider);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .field:last-child { margin-bottom: 0; }

/* Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-hover); }
.btn:focus-visible, .input:focus, select:focus, textarea:focus, .icon-btn:focus-visible, .user-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
  border-color: var(--primary);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.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); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-ghost-danger { color: var(--red); }
.btn-ghost-danger:hover { background: var(--red-soft); border-color: var(--red-soft-border); }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.btn svg { flex-shrink: 0; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn .spinner { width: 13px; height: 13px; }

/* Formulare -------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field label, .label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-2);
}
.help, .field .help { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.input, select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { height: auto; padding: 8px 11px; resize: vertical; }
select { padding-right: 28px; }
.input:disabled { background: var(--surface-2); color: var(--text-muted); }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.field label.check { display: flex; font-weight: normal; font-size: 13.5px; color: var(--text); margin-bottom: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 180px; margin-bottom: 0; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; height: 36px; box-shadow: none; }
/* Feste Vorsilbe vor einem Eingabefeld (z. B. /htdocs/) und Auswahl hinter einem Feld (z. B. .example.com) */
.input-group .input-addon {
  display: flex; align-items: center; padding: 0 10px; font-size: 13px; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); white-space: nowrap;
}
.input-group .input-addon + .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .input + select { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search .input { padding-left: 34px; }

/* Tabellen --------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table .actions-cell .btn + .btn { margin-left: 6px; }
.table .break { overflow-wrap: anywhere; }
/* Freigeben bzw. Zuweisen gleich breit, damit die Buttons in jeder Zeile an derselben Stelle stehen */
.ip-main-action { min-width: 92px; justify-content: center; }
.ip-section + .ip-section { margin-top: 22px; }
.ip-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; }
.ip-section-head h3 { margin: 0; font-size: 15px; }
.ip-group { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.ip-group > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  padding: 10px 14px; background: var(--surface-2); user-select: none; }
.ip-group > summary::-webkit-details-marker { display: none; }
.ip-group > summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg); transition: transform .15s; flex-shrink: 0; margin-right: 2px; }
.ip-group[open] > summary::before { transform: rotate(45deg); }
.ip-group[open] > summary { border-bottom: 1px solid var(--border); }
.ip-group-title { font-weight: 600; }
.ip-group-counts { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ip-group-meta { margin-left: auto; }
.node-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0 2px; }
.ip-group .table-wrap { margin: 0; border: 0; border-radius: 0; }
@media (min-width: 1100px) {
  .ip-table { table-layout: fixed; }
  .ip-table th:nth-child(1) { width: 34%; }
  .ip-table th:nth-child(2) { width: 16%; }
  .ip-table th:nth-child(3) { width: 14%; }
  .ip-table th:nth-child(5) { width: 250px; }
}
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.server-cell { display: flex; align-items: center; gap: 12px; min-width: 170px; }
.server-cell .os-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--neutral-soft);
  color: var(--text-muted);
}

dl.specs { display: grid; grid-template-columns: 150px 1fr; margin: 0; }
dl.specs dt, dl.specs dd { padding: 9px 0; border-bottom: 1px solid var(--divider); margin: 0; }
dl.specs dt { color: var(--text-muted); font-size: 13px; }
dl.specs dd { font-weight: 500; overflow-wrap: anywhere; }
dl.specs > :nth-last-child(-n+2) { border-bottom: 0; }

/* Status ----------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--neutral-soft);
  color: var(--text-muted);
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.running { background: var(--green-soft); color: var(--green); }
.status.stopped { background: var(--red-soft); color: var(--red); }
.status.paused, .status.busy { background: var(--amber-soft); color: var(--amber); }
.status.busy::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--neutral-soft);
  color: var(--text-2);
  white-space: nowrap;
}
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }

.meter { min-width: 110px; }
.meter-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.meter-head strong { color: var(--text); font-weight: 600; }
.meter-bar { height: 6px; background: var(--neutral-soft); border-radius: 3px; overflow: hidden; }
.meter-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s; }
.meter-bar.warn > span { background: var(--amber); }
.meter-bar.crit > span { background: var(--red); }

.usage-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.usage-tile { padding: 18px; border-right: 1px solid var(--border); }
.usage-tile:last-child { border-right: 0; }
.usage-tile .label { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-weight: 500; font-size: 12.5px; margin-bottom: 6px; }
.usage-tile .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.usage-tile .value small { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.usage-tile .meter-bar { margin-top: 12px; }

/* Server-Kopf ------------------------------------------------------ */

.server-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.server-head-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
}
.server-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.server-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-soft);
  display: grid; place-items: center;
  color: var(--primary);
}
.server-title h1 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.server-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.server-meta b { color: var(--text); font-weight: 500; }
.power-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  padding: 12px 10px 11px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Dropdown --------------------------------------------------------- */

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 5px;
  z-index: 30;
}
.dropdown-menu button, .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 5px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--surface-hover); text-decoration: none; }
.dropdown-menu button:disabled { color: var(--text-faint); cursor: not-allowed; background: none; }
.dropdown-menu .item-text { display: block; }
.dropdown-menu small { display: block; color: var(--text-muted); font-size: 11.5px; }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.dropdown-menu .menu-head { padding: 8px 10px 6px; font-size: 12px; color: var(--text-muted); }
.dropdown-menu .menu-head b { display: block; color: var(--text); font-size: 13px; }

/* Charts ----------------------------------------------------------- */

.chart { position: relative; height: 210px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-faint); font-size: 10.5px; font-family: var(--font); }
.chart .hover-line { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 5;
  transform: translate(-50%, 0);
}
.chart-tip .t { color: var(--text-muted); margin-bottom: 3px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--neutral-soft);
  border-radius: var(--radius-sm);
}
.segmented button {
  background: none; border: 0;
  padding: 4px 11px;
  font: inherit; font-size: 12.5px; font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Hinweise / Leerzustände ------------------------------------------ */

.notice {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13px;
  margin-bottom: 16px;
}
.notice.info { background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--text-2); }
.notice.info svg { color: var(--primary); }
.notice.warn { background: var(--amber-soft); border-color: var(--amber-soft-border); color: var(--text-2); }
.notice.warn svg { color: var(--amber); }
.notice.error { background: var(--red-soft); border-color: var(--red-soft-border); color: var(--text-2); }
.notice.error svg { color: var(--red); }
/* Lange Werte wie Fingerprints oder Tokens im Hinweis umbrechen statt überstehen */
.notice code { word-break: break-all; }
.notice.success { background: var(--green-soft); border-color: transparent; color: var(--text-2); }
.notice.success svg { color: var(--green); }
.notice svg { flex-shrink: 0; margin-top: 2px; }
.notice a { font-weight: 600; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-muted); }
.empty strong { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.empty .empty-icon {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--neutral-soft);
  color: var(--text-muted);
}
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0 !important; }

.loading { padding: 40px; text-align: center; color: var(--text-muted); }
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
.btn .spinner { border-color: var(--border-strong); border-top-color: currentColor; margin-right: 2px; }
.btn-primary .spinner, .btn-danger .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal ------------------------------------------------------------ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: fade-in .12s ease-out;
}
.modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  animation: modal-in .16s ease-out;
}
.modal.wide { max-width: 640px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 15.5px; }
.modal-close { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px; line-height: 0; border-radius: 4px; }
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-body { padding: 20px; }
.modal-body p { margin: 0 0 12px; color: var(--text-2); }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; justify-content: flex-end; gap: 8px;
  border-radius: 0 0 10px 10px;
}
.modal .error-text { color: var(--red); font-size: 13px; margin-top: 4px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.checklist {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.checklist label {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--divider);
  font-weight: normal;
  margin: 0;
  cursor: pointer;
}
.checklist label:last-child { border-bottom: 0; }
.checklist label:hover { background: var(--surface-hover); }

/* Toasts ----------------------------------------------------------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 11px 14px 11px 12px;
  font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast::before { content: ""; width: 3px; align-self: stretch; border-radius: 2px; background: var(--primary); flex-shrink: 0; }
.toast.success::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.warning::before { background: var(--amber); }
.toast .toast-title { font-weight: 600; }
.toast .toast-msg { color: var(--text-muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* Login ------------------------------------------------------------ */

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.login-page .brand { height: auto; padding: 0; margin-bottom: 24px; font-size: 18px; }
.login-box {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  padding: 28px;
}
.login-box h2 { font-size: 18px; margin-bottom: 4px; }
.login-box .sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }
.login-foot { margin-top: 18px; font-size: 12.5px; color: var(--text-muted); }

/* Responsiv -------------------------------------------------------- */

@media (max-width: 1250px) {
  .hide-md { display: none; }
}
@media (max-width: 1050px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .settings-row { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px;
    z-index: 40; transform: translateX(-100%); transition: transform .2s;
    box-shadow: var(--shadow-pop);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 35; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 12px; }
  .main { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .user-btn .who { display: none; }
  .usage-tiles { grid-template-columns: 1fr; }
  .usage-tile { border-right: 0; border-bottom: 1px solid var(--border); }
  .usage-tile:last-child { border-bottom: 0; }
  dl.specs { grid-template-columns: 120px 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 1050px) {
  /* Ohne Beschriftung, nur Symbol (der Titel des Buttons erklärt ihn) */
  .label-lg { display: none; }
}
@media (max-width: 860px) {
  /* Schmalere Bildschirme: weniger Innenabstand in Tabellen, damit sie ohne seitliches Scrollen passen */
  .table th, .table td { padding-left: 12px; padding-right: 12px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
}
@media (max-width: 560px) {
  /* Handy: noch weniger Innenabstand und umbrechende Überschriften und Datumsangaben */
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
  .table th, .table td.nowrap { white-space: normal; }
  .hide-xs { display: none; }
  .segmented { max-width: 100%; }
  /* Dateiliste: Aktionen (bei ZIP-Archiven vier) dürfen umbrechen statt die Tabelle zu verbreitern */
  .files-table .actions-cell { white-space: normal; }
  .files-table .actions-cell .btn { margin: 2px 0 2px 4px; }
  .segmented button { padding-left: 8px; padding-right: 8px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
}

/* Standorte -------------------------------------------------------- */

.cc {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 17px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--neutral-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  font-family: var(--mono);
}
.loc { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.group-head .muted { font-weight: normal; }
.checklist .group-label {
  padding: 7px 11px; background: var(--surface-2); border-bottom: 1px solid var(--divider);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
}
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv-list dt { color: var(--text-muted); }
.kv-list dd { margin: 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 13px; }
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.stat-row b { color: var(--text); font-weight: 600; }

/* Systemprüfung ---------------------------------------------------- */

.check-list { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.check-item:first-child { border-top: 0; }
.check-icon {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.check-item.ok .check-icon { background: var(--green-soft); color: var(--green); }
.check-item.warn .check-icon { background: var(--amber-soft); color: var(--amber); }
.check-item.error .check-icon { background: var(--red-soft); color: var(--red); }
.check-item.off .check-icon { background: var(--surface-2); color: var(--text-faint); }
.check-body { min-width: 0; flex: 1; }
.check-name { font-weight: 600; font-size: 13.5px; }
.check-item.off .check-name { color: var(--text-muted); font-weight: 500; }
.check-detail { font-size: 13px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.check-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.check-cmd { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.check-cmd code {
  font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; overflow-x: auto; white-space: nowrap; min-width: 0;
}

/* Vorgänge --------------------------------------------------------- */

.job { display: grid; gap: 12px; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.job-steps li { display: flex; align-items: center; gap: 9px; color: var(--text-faint); }
.job-steps li::before {
  content: ""; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--border-strong); box-sizing: border-box;
}
.job-steps li.ok { color: var(--text-2); }
.job-steps li.ok::before { background: var(--green); border-color: var(--green);
  -webkit-mask: none; box-shadow: inset 0 0 0 3px var(--surface); }
.job-steps li.now { color: var(--text); font-weight: 600; }
.job-steps li.now::before { border-color: var(--primary); border-top-color: transparent; animation: spin .8s linear infinite; }
.job-steps li.err { color: var(--red); font-weight: 600; }
.job-steps li.err::before { background: var(--red); border-color: var(--red); box-shadow: inset 0 0 0 3px var(--surface); }

/* Auswahlkarten (Templates) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.choice {
  position: relative; display: flex; gap: 11px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-weight: normal !important; margin: 0 !important;
}
.choice:hover { border-color: var(--primary); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-soft); }
.choice .os-badge {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--neutral-soft);
  font-size: 11px; font-weight: 700; color: var(--text-2); font-family: var(--mono);
}
.choice b { display: block; font-size: 13.5px; color: var(--text); }
.choice small { color: var(--text-muted); font-size: 12px; }
.danger-zone { border-color: var(--red-soft-border); }
.danger-zone .card-head { border-bottom-color: var(--red-soft-border); }
.danger-zone .card-head h2 { color: var(--red); }

/* Anmeldung & Sicherheit ------------------------------------------- */

.divider-text {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0; font-size: 12px; color: var(--text-faint);
}
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-box img { width: 180px; height: 180px; border-radius: var(--radius); background: #fff; padding: 6px; border: 1px solid var(--border); }
.secret-text { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; word-break: break-all; background: var(--neutral-soft); padding: 6px 9px; border-radius: 5px; }
.codes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-family: var(--mono); font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.method-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
.method-row:last-child { border-bottom: 0; }
.method-row .method-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--text-muted); flex-shrink: 0; }
.method-row .method-icon.on { background: var(--green-soft); color: var(--green); }
.method-row .grow { flex: 1; min-width: 200px; }
.lang-btn { width: auto; padding: 0 9px; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.dropdown-menu .lang-code { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-muted); width: 22px; }
.dropdown-menu button.current { font-weight: 600; }
/* Häkchen hinter der gewählten Sprache – nur im Sprachmenü, nicht bei Abmelden & Co. */
.dropdown-menu button[data-lang] svg { margin-left: auto; color: var(--primary); }
.lang-switch { display: flex; gap: 14px; justify-content: center; margin-top: 10px; }

/* Code-Beispiele (API) ----------------------------------------------- */

.code-block {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre;
}

/* Gesperrte Server --------------------------------------------------- */

.status.locked { background: var(--red-soft); color: var(--red); }
.status.locked::before { display: none; }
.status.locked svg { margin-right: 4px; vertical-align: -2px; }

/* Gespeicherte SSH-Schlüssel zum Ankreuzen */
.key-list { display: flex; flex-direction: column; gap: 8px; }
.key-list .check { align-items: flex-start; }
.key-list .check small { display: block; margin-top: 1px; color: var(--text-muted); font-size: 11.5px; word-break: break-all; }
.key-list .badge { margin-left: 4px; }

/* Kundenansicht durch einen Admin */
.impersonate-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 24px; background: var(--amber-soft); border-bottom: 1px solid var(--amber-soft-border);
  color: var(--text-2); font-size: 13.5px;
}
.impersonate-bar svg { color: var(--amber); flex: 0 0 auto; }
.impersonate-bar span { flex: 1; min-width: 200px; }

/* Branding: Logo und rechtliche Links */
.brand-logo { display: block; max-height: 32px; max-width: 180px; object-fit: contain; }
.login-page .brand-logo { max-height: 48px; max-width: 240px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.legal-links a { color: var(--text-muted); }
.legal-links a:hover { color: var(--text); }
.sidebar-legal { padding: 10px 20px 12px; margin-top: auto; }
.login-foot .legal-links { justify-content: center; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-preview { max-height: 40px; max-width: 200px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.color-pick { width: 44px; min-width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface); cursor: pointer; }
/* Logo mit Panel-Namen daneben: Logo als Bildzeichen, etwas kleiner */
.brand-logo.with-name { max-height: 28px; max-width: 96px; }
.login-page .brand-logo.with-name { max-height: 40px; max-width: 140px; }
.login-page .brand { gap: 12px; }

/* Reiter der Einstellungsseite */
.settings-tabs { margin: -4px 0 16px; border-top: 0; border-bottom: 1px solid var(--border); padding: 0; }

/* Öffentliche Statusseite */
.status-page { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; min-height: 100vh; }
.status-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.status-head .brand { height: auto; padding: 0; font-size: 18px; }
.status-banner { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.status-banner b { font-size: 16px; }
.status-banner.ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
.status-banner.degraded, .status-banner.maintenance { background: var(--amber-soft); border-color: var(--amber-soft-border); color: var(--amber); }
.status-banner.outage { background: var(--red-soft); border-color: var(--red-soft-border); color: var(--red); }
.status-banner .small { color: var(--text-muted); margin-top: 2px; }
.status-incident.major { border-left: 3px solid var(--red); }
.status-incident.minor { border-left: 3px solid var(--amber); }
.status-incident.info { border-left: 3px solid var(--primary); }
.status-incident-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-incident p { margin: 8px 0; }
.status-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; font-size: 12.5px; }
.status-foot > a { color: var(--text-muted); }
.legal-row { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.status-link { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }

/* Betriebssystem-Logos (Simple Icons als Maske, damit Farbe und Dunkelmodus steuerbar sind) */
.os-logo { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.os-logo svg { display: block; width: 100%; height: 100%; }
.os-logo.masked {
  background: var(--logo-color, var(--text));
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}
:root[data-theme="dark"] .os-logo.masked { background: color-mix(in srgb, var(--logo-color, var(--text)) 70%, #fff); }
.os-icon .os-logo, .os-badge .os-logo, .server-head-icon .os-logo { margin: auto; }

/* Seitenleiste einklappen (nur am Desktop; mobil bleibt das Ausklappmenü) */
.nav-collapse {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; margin-top: 10px; border: 0; background: none; cursor: pointer;
  color: var(--text-muted); font: inherit; font-size: 13px; border-radius: var(--radius-sm);
}
.nav-collapse:hover { background: var(--surface-hover); color: var(--text); }
.nav-collapse svg { transform: rotate(90deg); transition: transform .15s; flex-shrink: 0; }
@media (min-width: 861px) {
  .shell { transition: grid-template-columns .15s; }
  .shell.nav-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
  .nav-collapsed .sidebar { overflow-x: hidden; }
  .nav-collapsed .brand { padding: 0; justify-content: center; }
  .nav-collapsed .brand [data-panel-name] { display: none; }
  .nav-collapsed .brand-logo { max-width: 40px; max-height: 32px; }
  .nav-collapsed .sidebar nav { padding: 6px 10px 16px; }
  .nav-collapsed .nav-section { font-size: 0; padding: 0; margin: 12px 6px 8px; border-top: 1px solid var(--sidebar-border); }
  .nav-collapsed .nav-link { justify-content: center; padding: 9px 0; position: relative; }
  .nav-collapsed .nav-link span { display: none; }
  .nav-collapsed .nav-link .nav-count {
    display: block; position: absolute; top: 3px; right: 4px; padding: 0 4px; font-size: 9.5px; line-height: 14px;
  }
  .nav-collapsed .nav-collapse { justify-content: center; padding: 9px 0; }
  .nav-collapsed .nav-collapse span { display: none; }
  .nav-collapsed .nav-collapse svg { transform: rotate(-90deg); }
  .nav-collapsed .sidebar-legal { display: none; }
  .nav-collapsed .sidebar-foot { align-items: center; padding: 12px 0; font-size: 0; }
  .nav-collapsed .sidebar-foot a { font-size: 0; }
}
@media (max-width: 860px) { .nav-collapse { display: none; } }

/* Bootreihenfolge */
.boot-list { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.boot-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.boot-item + .boot-item { border-top: 1px solid var(--border); }
.boot-item.off { background: var(--surface-2); }
.boot-item.off .check > span:last-child, .boot-item.off svg { opacity: .55; }
.boot-item .check { display: flex; align-items: center; gap: 8px; margin: 0; }
.boot-pos { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--neutral-soft); font-size: 11px; font-weight: 700; color: var(--text-2); }
.boot-item:not(.off) .boot-pos { background: var(--primary-soft); color: var(--primary); }
.boot-move { display: flex; gap: 4px; flex-shrink: 0; }
.boot-move [data-boot-up] svg { transform: rotate(180deg); }
.server-icon:has(.os-logo) { background: var(--neutral-soft); }

/* Tickets */
.nav-count.accent { background: var(--primary); color: var(--on-primary); }
.nav-link.active .nav-count.accent { background: var(--primary); color: var(--on-primary); }
.seg-count { font-weight: 700; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 7px; vertical-align: middle; }
.ticket-unread .cell-title { font-weight: 700; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1050px) { .ticket-layout { grid-template-columns: 1fr; } }
.ticket-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ticket-msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm, none); }
.ticket-msg.from-staff { border-left: 3px solid var(--primary); }
.ticket-msg.is-note { background: color-mix(in srgb, var(--amber, #d97706) 8%, var(--surface)); border-color: color-mix(in srgb, var(--amber, #d97706) 35%, var(--border)); border-left-width: 3px; }
.ticket-msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ticket-msg-head .avatar { width: 26px; height: 26px; font-size: 11px; }
.ticket-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.ticket-event { text-align: center; font-size: 12.5px; color: var(--text-muted); padding: 2px 0; }
.ticket-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ticket-images img { max-width: 220px; max-height: 160px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; object-fit: cover; }
.ticket-files { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--text); background: var(--surface-2); }
.file-chip:hover { text-decoration: none; border-color: var(--border-strong); }
.file-chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text-muted); display: inline-grid; }
form.is-note { border-color: color-mix(in srgb, var(--amber, #d97706) 45%, var(--border)); }
form.is-note textarea { background: color-mix(in srgb, var(--amber, #d97706) 6%, var(--surface)); }
.ticket-reply-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-servers { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.ticket-servers .badge:hover { text-decoration: none; filter: brightness(.95); }

/* Laufende Aufgabe (Backup, Snapshot …) über den Server-Tabs */
.task-bar { align-items: flex-start; }
.task-bar > .spinner { margin-top: 2px; flex-shrink: 0; }
.task-bar-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.task-bar-pct { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Cookie-Hinweis */
.cookie-notice {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60;
  width: min(760px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-pop); font-size: 13px; line-height: 1.5; color: var(--text-2);
}
.cookie-notice .cookie-text { flex: 1; }
.cookie-notice .btn { flex-shrink: 0; }
@media (max-width: 560px) { .cookie-notice { flex-direction: column; align-items: stretch; } }

/* Eigenes Logo für den Dunkelmodus */
:root[data-theme="dark"] .logo-for-light, :root:not([data-theme="dark"]) .logo-for-dark { display: none; }
.logo-preview.dark-bg { background: #2a313d; border-color: #3b4452; }

/* Lange Listen: nur die Tabelle scrollt, Kopfzeile bleibt stehen (am Desktop).
   Lange Formulare: Reiter bleiben oben, die Speichern-Leiste unten sichtbar. */
@media (min-width: 861px) {
  /* Fester Seitenkopf (app.js setzt die Klasse und den Abstand nach oben). Abstände darunter als Innenabstand, damit
     zwischen den gestapelten Teilen kein Inhalt durchscheint. */
  .sticky-part { position: sticky; z-index: 15; background: var(--bg); }
  .breadcrumb.sticky-part { margin-bottom: 0; padding-bottom: 6px; }
  .page-head.sticky-part { margin-bottom: 0; padding-bottom: 20px; }
  .server-head.sticky-part { background: var(--surface); }
  .sticky-foot {
    position: sticky; bottom: 0; z-index: 6;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 -6px 12px -10px rgba(16, 24, 40, .25);
  }
  /* Die Tabelle scrollt selbst und füllt das Fenster, ohne dass die Seite scrollt: Höhe = Fenster minus alles andere
     (Kopfzeile, Seitentitel, Filterzeile …). Fußzeile unter der Tabelle und Tabs über der Karte kommen dazu. */
  .scroll-table {
    --scroll-rest: 330px; --scroll-foot: 0px; --scroll-tabs: 0px;
    max-height: max(320px, calc(100vh - var(--scroll-rest) - var(--scroll-foot) - var(--scroll-tabs))); overflow-y: auto;
  }
  /* Tabelle direkt in der Karte, ohne Filterzeile darüber: entsprechend höher */
  .card > .scroll-table:first-child { --scroll-rest: 270px; }
  .scroll-table:has(+ .card-foot) { --scroll-foot: 42px; }
  .page:has(> .ws-tabs) .scroll-table { --scroll-tabs: 52px; }
  .scroll-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border); }
}
.nav-count.danger, .nav-link.active .nav-count.danger { background: var(--red); color: #fff; }

/* Knopf, der wie ein Link aussieht */
.btn.btn-link { border: 0; background: none; padding: 0; height: auto; color: var(--primary); font-weight: 500; }
.btn.btn-link:hover { text-decoration: underline; background: none; }

/* ==== Webspaces ==================================================================================== */

/* Logs eines Webspaces */
.log-view { max-height: 460px; overflow: auto; margin: 0; font-size: 12px; white-space: pre; }

/* Wiederherstellen: Stand durchsuchen */
.restore-path { margin-bottom: 6px; }
.restore-list { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.restore-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.restore-row:last-child { border-bottom: 0; }
.restore-row > a, .restore-row > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.restore-row svg { vertical-align: -2px; color: var(--text-muted); }
[data-dbs] .restore-row { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; }

/* Webspace-Seite: Kennzahlen, Reiter und eine ruhigere, sachlichere Darstellung -------------------- */

.ws-detail .card { border-radius: 6px; box-shadow: none; }
.ws-detail .card-head { padding-top: 12px; padding-bottom: 12px; }
.ws-detail .card-head h2 { font-size: 14px; font-weight: 600; }
/* Aktionen in den Kartenköpfen schlicht statt in Vollfarbe */
.ws-detail .card-head .btn-primary { background: var(--surface); color: var(--text); border-color: var(--border-strong, var(--border)); }
.ws-detail .card-head .btn-primary:hover:not(:disabled) { background: var(--neutral-soft); }
.ws-detail .table th { font-size: 11px; letter-spacing: .04em; }
.ws-detail .table td { padding-top: 9px; padding-bottom: 9px; }
.ws-detail .empty { padding: 28px 18px; }
.ws-detail .empty-icon { display: none; }
.ws-detail .danger-zone .card-head h2 { font-size: 13.5px; }
.ws-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ws-zone > .muted { max-width: 640px; }

.ws-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 18px;
}
.ws-kpi { padding: 14px 16px; border-left: 1px solid var(--border); min-width: 0; }
.ws-kpi:first-child { border-left: 0; }
.ws-kpi-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted); }
.ws-kpi-value { font-size: 20px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-kpi .meter-bar { margin-top: 8px; height: 4px; }
.ws-kpi-action { border: 0; background: none; padding: 0; color: var(--text-muted); cursor: pointer; display: inline-flex; }
.ws-kpi-action:hover:not(:disabled) { color: var(--text); }
.ws-kpi-action:disabled { opacity: .4; cursor: default; }

.ws-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tabs button, .ws-tabs a {
  border: 0; background: none; padding: 9px 14px; font: inherit; font-size: 13.5px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.ws-tabs button:hover, .ws-tabs a:hover { color: var(--text); }
.ws-tabs button.active, .ws-tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.ws-tab-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 11px;
  font-weight: 600; line-height: 17px; text-align: center; background: var(--neutral-soft); color: var(--text-muted); }

.kv-2col { grid-template-columns: auto 1fr auto 1fr; column-gap: 24px; }
.ws-detail dl.kv-list { margin: 0; }
@media (max-width: 900px) {
  .ws-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ws-kpi:nth-child(4) { border-left: 0; }
  .ws-kpi:nth-child(n+4) { border-top: 1px solid var(--border); }
  .kv-2col { grid-template-columns: auto 1fr; }
}
@media (max-width: 560px) {
  .ws-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-kpi:nth-child(odd) { border-left: 0; }
  .ws-kpi:nth-child(4) { border-left: 1px solid var(--border); }
  .ws-kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
}

/* SSL-Hinweise gesammelt */
.ssl-issues ul { margin: 6px 0 0; padding-left: 18px; }
.ssl-issues li { margin: 2px 0; }
.ssl-issues li .btn-link { margin-left: 6px; }
.verify-box ul { margin: 8px 0 0; padding: 0; list-style: none; }
.verify-box li { padding: 8px 0; border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
.verify-record { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; font-size: 12.5px; }
.verify-record code { word-break: break-all; }
.verify-actions { display: flex; gap: 6px; align-items: center; }

/* WordPress-Staging unter der Live-Installation */
.app-staging td:first-child { padding-left: 34px; }

/* Dateimanager */
.files-head { gap: 10px; }
.files-crumbs a { color: var(--text); }
.files-crumbs svg { vertical-align: -2px; }
.files-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.files-selection { display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: var(--primary-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.files-selection span { margin-right: auto; }
.files-table .files-name a, .files-table .files-name span { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.files-table .files-name svg { color: var(--text-muted); flex: none; }
.files-table td { padding-top: 7px; padding-bottom: 7px; }
.files-drop .card { outline: 2px dashed var(--primary); outline-offset: -4px; }
.files-editor { width: 100%; min-height: 55vh; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre; tab-size: 2; resize: vertical; }
.files-editor-wrap { position: relative; padding-left: 4.5em; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.files-editor-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.files-editor-wrap .files-editor { display: block; padding: 8px 12px; border: 0; border-left: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.files-gutter { position: absolute; top: 0; left: 0; width: 4.5em; box-sizing: border-box; margin: 0; padding: 8px 8px 8px 0; overflow: hidden;
  text-align: right; user-select: none; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--text-faint); }
.modal.files-editor-modal { max-width: min(1100px, 96vw); }

/* PHP-Einstellungen */
.php-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.php-grid .field { min-width: 0; margin-bottom: 16px; }
@media (max-width: 760px) { .php-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .php-grid { grid-template-columns: 1fr; } }

/* Statistik ----------------------------------------------------------------------------- */
.stat-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.stat-filters select { width: auto; min-width: 200px; max-width: 100%; }
.ws-kpis.stat-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-kpi { background: none; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit; text-align: left;
  cursor: pointer; position: relative; }
.stat-kpi:hover { background: var(--surface-2); }
.stat-kpi.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.stat-chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 220px auto; column-gap: 10px; }
.stat-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--text-muted);
  text-align: right; font-variant-numeric: tabular-nums; margin: -6px 0; }
.stat-plot { position: relative; border-bottom: 1px solid var(--border); }
.stat-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); opacity: .7; }
.stat-bar-hit { position: absolute; top: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; }
.stat-bar { width: 100%; max-width: 18px; min-height: 0; background: var(--primary); border-radius: 4px 4px 0 0; }
.stat-bar-hit:hover .stat-bar { filter: brightness(1.15); }
.stat-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--text); color: var(--surface);
  font-size: 12px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 2; }
.stat-xlabels { grid-column: 2; position: relative; height: 18px; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.stat-xlabels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.stat-tops { margin-top: 0; }
.stat-top .table td { padding-top: 7px; padding-bottom: 7px; }
.stat-name { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) {
  .ws-kpis.stat-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-kpis .ws-kpi:nth-child(3) { border-left: 0; }
  .stat-kpis .ws-kpi:nth-child(4) { border-left: 1px solid var(--border); }
  .stat-kpis .ws-kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 560px) { .stat-x-minor { display: none; } }

/* Team: Abschnitte je Produkt im Einladungsdialog, Zugriff je Produkt in der Tabelle */
.team-section { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 0 0 14px; }
.team-section legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.team-access + .team-access { margin-top: 4px; }
