:root {
  --navy: #0e4466;
  --navy-dark: #082c44;
  --navy-deep: #06283f;
  --cyan: #00a3d7;
  --green: #7fa82e;
  --bg: #eef2f5;
  --card: #ffffff;
  --line: #dde4ea;
  --text: #1c2b36;
  --muted: #677885;
  --ok: #4f7d12;
  --ok-bg: #e9f3d6;
  --warn: #8a5a00;
  --warn-bg: #fdefc8;
  --crit: #b3261e;
  --crit-bg: #fbdcda;
  --info: #00648a;
  --info-bg: #d8f1fa;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(14, 68, 102, .08), 0 2px 8px rgba(14, 68, 102, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 15px; }
h2 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 12px; }
code { font: 12.5px Consolas, "Cascadia Mono", monospace; background: var(--bg); padding: 2px 5px; border-radius: 4px; word-break: break-all; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Seitenleiste ---------- */
.sidebar {
  width: 232px; flex: none; background: var(--navy-deep); color: #c5d6e2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 20px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { font-size: 12px; line-height: 1.25; color: #9fc3d8; }
.brand b { display: block; font-size: 16px; color: #fff; font-weight: 600; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.sidebar nav a, .nav-logout {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 6px;
  color: #c5d6e2; margin-bottom: 2px;
}
.sidebar nav a:hover, .nav-logout:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--cyan); color: #fff; font-weight: 600; }
.nav-sep { padding: 18px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f93aa; }
.nav-logout { margin: 10px; }

/* ---------- Hauptbereich ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: none; }
.tenant-switch { display: flex; align-items: center; gap: 8px; }
.tenant-switch label { color: var(--muted); font-size: 12px; margin: 0; }
.tenant-name { color: var(--muted); }
.user-chip { background: var(--bg); border-radius: 20px; padding: 5px 13px; font-weight: 600; }
.content { padding: 24px 28px 48px; max-width: 1500px; width: 100%; }

/* ---------- Karten und Raster ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card > h2 { margin-bottom: 14px; }
.card-flush { padding: 0; overflow: hidden; }
.card-pad { padding: 16px 20px 0; }
p.card-pad { padding-bottom: 14px; margin: 0; }
h2.card-pad { margin-bottom: 12px; }
.card-link { display: inline-block; margin-top: 12px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid .card { margin-bottom: 0; }
.grid + .card, .grid + form, .card + .grid { margin-top: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-wide { grid-column: 1 / -1; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px;
  color: var(--text); border-left: 4px solid var(--cyan); display: block;
}
.kpi:hover { text-decoration: none; box-shadow: 0 2px 12px rgba(14, 68, 102, .16); }
.kpi-warn { border-left-color: #e8a317; }
.kpi-num { display: block; font-size: 30px; font-weight: 600; line-height: 1.15; color: var(--navy); }
.kpi-lbl { color: var(--muted); }

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .icon { width: 56px; height: 56px; color: var(--cyan); }
.empty-state h2 { font-size: 19px; margin: 12px 0 8px; }
.empty-state p { max-width: 520px; margin: 0 auto 20px; color: var(--muted); }

/* ---------- Diagramme ---------- */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { width: 132px; height: 132px; flex: none; }
.donut-num { font-size: 9px; font-weight: 600; text-anchor: middle; fill: var(--navy); }
.donut-lbl { font-size: 3.2px; text-anchor: middle; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.legend li b { margin-left: auto; padding-left: 10px; }
.legend a { color: var(--text); }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 28px; align-items: center; gap: 10px; padding: 5px 0; }
.bars li b { text-align: right; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label small { color: var(--muted); }
.bar-track { height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--cyan); border-radius: 5px; min-width: 3px; }
.bar-warn { background: #e8a317; }
.bar-crit { background: #d64545; }
.bars-volumes li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); }
.bar-value { color: var(--muted); text-align: right; white-space: nowrap; }

.attention { list-style: none; margin: 0; padding: 0; }
.attention li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child { border-bottom: 0; }
.attention a { font-weight: 600; display: block; }
.attention span { color: var(--muted); font-size: 12.5px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
.table-scroll { max-height: 330px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #f7f9fb; white-space: nowrap; position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #f5f9fc; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.check { width: 36px; }
td.links a { display: inline-block; margin-right: 10px; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form { display: inline; }
.dev-link { font-weight: 600; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.dot-ok { background: #7fa82e; box-shadow: 0 0 0 3px rgba(127, 168, 46, .2); }
.dot-off { background: #b3bec7; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-crit { background: var(--crit-bg); color: var(--crit); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #e6ebef; color: #51616d; }

.progress { display: inline-block; width: 90px; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-left: 6px; }
.progress span { display: block; height: 100%; background: var(--cyan); }

/* ---------- Formulare und Schaltflaechen ---------- */
input[type=text], input[type=email], input[type=password], input[type=search], select {
  font: inherit; color: var(--text); padding: 7px 10px; border: 1px solid #c3ced7; border-radius: 6px; background: #fff; min-width: 0;
}
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--cyan); vertical-align: middle; margin: 0; }
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
label input[type=text], label input[type=email], label input[type=password], label select { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
label.checkline { font-weight: 400; display: flex; align-items: center; gap: 8px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
label.inline select { display: inline-block; width: auto; margin: 0; }
.form-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.form-row label { flex: 1; max-width: 380px; margin: 0; }
.form-stack { max-width: 420px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600;
  padding: 7px 14px; border-radius: 6px; border: 1px solid #c3ced7; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f1f5f8; text-decoration: none; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn-primary:hover { background: #008fbd; }
.btn-danger { color: var(--crit); border-color: #e6b4b0; }
.btn-danger:hover { background: var(--crit-bg); }
dialog .btn-danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; padding: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; flex: 1; max-width: 520px; }
.search input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { padding: 4px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.chip:hover { text-decoration: none; border-color: var(--cyan); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulkbar h2 { margin: 0; }
.bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; border-left: 4px solid; }
.flash-ok { background: var(--ok-bg); border-color: var(--green); }
.flash-crit { background: var(--crit-bg); border-color: #d64545; }
.flash-warn { background: var(--warn-bg); border-color: #e8a317; }
.flash-info { background: var(--info-bg); border-color: var(--cyan); }

dialog { border: 0; border-radius: 10px; padding: 24px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 12px 48px rgba(6, 40, 63, .35); color: var(--text); text-align: left; white-space: normal; }
dialog::backdrop { background: rgba(6, 40, 63, .55); }
dialog h2 { font-size: 17px; margin-bottom: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- Computer-Detailseite ---------- */
.dev-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.backlink { display: inline-block; margin-bottom: 8px; font-size: 13px; }
.dev-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.dev-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--cyan); }
.count { background: #e6ebef; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }

.props { margin: 0; }
.props + .props { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.props > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 4px 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }
.props-row { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.props-row > div { display: block; }
.props-row dt { font-size: 12px; }

.patchbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; position: sticky; bottom: 12px; border: 1px solid var(--line); }
.patchbar label { margin-bottom: 6px; }
.patchbar select { display: inline-block; width: auto; margin: 0 0 0 8px; }
.patchbar-actions { display: flex; align-items: center; gap: 12px; }

.task { border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task summary { display: flex; align-items: center; gap: 12px; padding: 12px 20px; cursor: pointer; flex-wrap: wrap; }
.task summary:hover { background: #f5f9fc; }
.task-name { font-weight: 600; min-width: 190px; }
.task-name small { font-weight: 400; color: var(--muted); }
.task-msg { flex: 1; min-width: 120px; }
.task-meta { font-size: 12.5px; white-space: nowrap; }
.task-body { padding: 0 20px 16px; }
.log { background: var(--navy-deep); color: #d7e6ef; padding: 12px 14px; border-radius: 6px; font: 12.5px/1.5 Consolas, "Cascadia Mono", monospace; max-height: 380px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 8px; }
.proxy-choice { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.proxy-choice input { flex: 1; min-width: 240px; max-width: 360px; }
.copybox { display: flex; align-items: flex-start; gap: 10px; background: var(--bg); border-radius: 6px; padding: 10px 12px; margin-top: 6px; }
.copybox code { flex: 1; background: none; padding: 0; }
.more summary { cursor: pointer; color: var(--info); font-weight: 600; margin-bottom: 10px; }

/* ---------- Anmeldung ---------- */
.login-body { min-height: 100vh; background: #fff; }
.login-hero {
  flex: 1.35; background: linear-gradient(150deg, #0e4466 0%, #06283f 62%, #041c2d 100%); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; min-width: 0;
}
.hero-art { width: min(560px, 100%); height: auto; }
.login-hero-text { text-align: center; max-width: 480px; margin-top: 8px; }
.login-hero-text h2 { font-size: 26px; font-weight: 600; margin-bottom: 10px; }
.login-hero-text p { color: #a9c8da; font-size: 15px; margin: 0; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 32px; min-width: 340px; }
.login-box { width: 100%; max-width: 340px; }
.login-logo { width: 234px; max-width: 100%; height: auto; display: block; }
.login-product { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; margin: 6px 0 34px 2px; }
.login-box h1 { font-size: 23px; margin-bottom: 18px; color: var(--navy); }
.login-hint { color: var(--muted); }
.login-box input { padding: 9px 11px; }
.login-box .btn { margin-top: 8px; }
.login-foot { margin-top: 36px; color: var(--muted); font-size: 12px; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 1150px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  body { display: block; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar nav { display: flex; flex-wrap: wrap; padding: 0 8px 8px; order: 3; width: 100%; }
  .nav-sep { display: none; }
  .nav-logout { margin-left: auto; }
  .topbar { padding: 12px 16px; position: static; flex-wrap: wrap; }
  .content { padding: 16px; }
  .grid, .grid-2, .kpis { grid-template-columns: minmax(0, 1fr); }
  .props > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .login-body { display: block; }
  .login-hero { padding: 24px; }
  .hero-art { width: min(300px, 100%); }
  .login-panel { min-width: 0; }
}
