/* Server Admin – Oberfläche */
:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #121519;
  --surface-2: #181c21;
  --surface-3: #1f242a;
  --border: #232931;
  --border-strong: #2f363f;
  --text: #e8eaed;
  --muted: #9aa2ad;
  --faint: #6b737e;
  --accent: #5b8def;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 141, 239, .14);
  --ok: #34c17a;
  --ok-soft: rgba(52, 193, 122, .13);
  --warn: #e8a33d;
  --warn-soft: rgba(232, 163, 61, .14);
  --crit: #ef5b5b;
  --crit-soft: rgba(239, 91, 91, .13);
  --off: #5d6570;
  --chart-a: #5b8def;
  --chart-b: #a78bfa;
  --shadow: 0 1px 0 rgba(255,255,255,.02), 0 8px 24px rgba(0,0,0,.25);
  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #f6f7f9;
    --surface-3: #eceef1;
    --border: #e4e7eb;
    --border-strong: #d4d8de;
    --text: #15181c;
    --muted: #5c6470;
    --faint: #8c939d;
    --accent: #2f6fe4;
    --accent-soft: rgba(47, 111, 228, .1);
    --ok: #1e9e5a;
    --ok-soft: rgba(30, 158, 90, .1);
    --warn: #c47f12;
    --warn-soft: rgba(196, 127, 18, .12);
    --crit: #d93a3a;
    --crit-soft: rgba(217, 58, 58, .1);
    --off: #a3aab3;
    --chart-a: #2f6fe4;
    --chart-b: #8b5cf6;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .04);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0, "cv11" 1;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.012em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons & Formulare */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn-danger:hover { background: var(--crit); filter: brightness(1.08); }
.btn-danger-ghost { color: var(--crit); }
.btn.loading { pointer-events: none; opacity: .7; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.link { color: var(--accent); }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=url], select {
  height: 40px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font: 14px var(--font); padding: 0 12px; width: 100%; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=number] { width: 92px; text-align: right; }
.form-error { color: var(--crit); font-size: 13px; min-height: 18px; }

/* ---------- Login */
.login { min-height: 100%; display: grid; place-items: center; padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); }
.login-card {
  width: 100%; max-width: 360px; display: grid; gap: 14px; padding: 28px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.login-logo { border-radius: 14px; }
.login-card h1 { font-size: 21px; }
.login-card p { margin: -8px 0 4px; font-size: 13.5px; }

/* ---------- Layout */
.app { display: flex; min-height: 100%; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 22px; font-weight: 700; }
.topbar-sub { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted);
  padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.conn.live i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.err i { background: var(--crit); }
.views { padding: 4px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px); max-width: 1320px; width: 100%; margin: 0 auto; }
.view { display: grid; gap: 14px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--border);
}
.tab {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 4px 0;
  color: var(--faint); font: 500 10.5px var(--font); text-decoration: none; border: 0; background: none;
}
.tab:hover { text-decoration: none; }
.tab svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tab.on { color: var(--accent); }
.tab .badge { position: absolute; top: 0; left: calc(50% + 6px); }
.badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--crit); color: #fff;
  font: 600 10.5px/17px var(--font); text-align: center;
}

@media (min-width: 900px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; width: 232px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface);
  }
  .brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
  .brand img { border-radius: 8px; }
  .brand b { display: block; font-size: 14px; }
  .brand small { display: block; color: var(--faint); font-size: 12px; }
  .side-nav { display: grid; gap: 2px; }
  .side-nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    color: var(--muted); font-weight: 500; text-decoration: none;
  }
  .side-nav a:hover { background: var(--surface-2); color: var(--text); }
  .side-nav a.on { background: var(--accent-soft); color: var(--accent); }
  .side-nav .badge { margin-left: auto; }
  .side-foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--faint); line-height: 1.6; }
  .topbar { padding: 18px 28px 14px; }
  .views { padding: 4px 28px 40px; }
}

/* ---------- Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 14.5px; font-weight: 650; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: 1.4fr 1fr; } }

/* Status-Banner */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.banner .b-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.banner .b-ico svg { width: 22px; height: 22px; }
.banner.ok .b-ico { background: var(--ok-soft); color: var(--ok); }
.banner.crit { border-color: color-mix(in srgb, var(--crit) 40%, var(--border)); }
.banner.crit .b-ico { background: var(--crit-soft); color: var(--crit); }
.banner.warn .b-ico { background: var(--warn-soft); color: var(--warn); }
.banner b { display: block; font-size: 15px; }
.banner .b-sub { color: var(--muted); font-size: 13px; }
.banner .b-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.banner .b-list button { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 4px 9px; font: 500 12.5px var(--font); cursor: pointer; }

/* KPIs */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-sub { font-size: 12px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 5px; border-radius: 3px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--ok); transition: width .5s; }
.meter > i.warn { background: var(--warn); } .meter > i.crit { background: var(--crit); }
.spark { position: absolute; right: 0; bottom: 0; left: 0; height: 34px; opacity: .55; pointer-events: none; }
.spark svg { width: 100%; height: 100%; stroke-width: 1.4; }

/* Chart */
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg-a::before { background: var(--chart-a); } .lg-b::before { background: var(--chart-b); }
.chart { position: relative; height: 190px; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; display: block; stroke-width: 1.6; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis text { fill: var(--faint); stroke: none; font: 10.5px var(--font); }
.chart .tip {
  position: absolute; top: 0; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 9px; font-size: 12px; white-space: nowrap; transform: translateX(-50%); box-shadow: var(--shadow);
}
.chart .tip b { font-weight: 600; }
.chart .cursor { stroke: var(--border-strong); stroke-width: 1; }
.empty-chart { height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 13px; text-align: center; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; color: var(--muted); font: 500 12px var(--font); padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* Listen */
.list { display: grid; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); min-width: 0; }
.row:first-child { border-top: 0; padding-top: 2px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .val { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.clickable { cursor: pointer; }
.bar { height: 4px; border-radius: 2px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--chart-a); border-radius: 2px; }
.empty { color: var(--faint); font-size: 13px; padding: 18px 0; text-align: center; }

/* Statuspunkt */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--off); flex: none; display: inline-block; }
.dot.running, .dot.up { background: var(--ok); }
.dot.starting, .dot.paused, .dot.created, .dot.slow, .dot.stopped-by-user { background: var(--warn); }
.dot.unhealthy, .dot.exited, .dot.dead, .dot.restarting, .dot.down { background: var(--crit); }
.dot.stopped-by-user { background: var(--off); }
.dot.pulse { box-shadow: 0 0 0 0 var(--crit-soft); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,91,91,.45); } 70% { box-shadow: 0 0 0 7px rgba(239,91,91,0); } 100% { box-shadow: 0 0 0 0 rgba(239,91,91,0); } }

/* ---------- Dienste */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; display: block; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--faint); width: 17px; height: 17px; }
.search input { padding-left: 36px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips button {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 6px 12px; font: 500 12.5px var(--font); cursor: pointer; white-space: nowrap;
}
.chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chips button .cnt { opacity: .7; margin-left: 4px; }

.projects { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.proj { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-width: 0; align-self: start; }
.proj.problem { border-color: color-mix(in srgb, var(--crit) 45%, var(--border)); }
.proj-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 12px 12px 16px; }
.proj-head .grow { flex: 1; min-width: 0; }
.proj-name { display: flex; align-items: center; gap: 8px; }
.proj-name h2 { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font: 600 11px/18px var(--font); padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.proj-meta { font-size: 12px; color: var(--faint); margin-top: 3px; font-variant-numeric: tabular-nums; }
.proj-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: 12.5px; text-decoration: none;
}
.chip-link:hover { text-decoration: none; border-color: var(--border-strong); }
.chip-link svg { width: 13px; height: 13px; color: var(--faint); }
.chip-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-link .dot { width: 7px; height: 7px; }
.ct-list { border-top: 1px solid var(--border); }
.ct {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 18px; gap: 10px; align-items: center;
  padding: 10px 12px 10px 16px; border-top: 1px solid var(--border); cursor: pointer; min-height: 54px;
}
.ct:first-child { border-top: 0; }
.ct:hover { background: var(--surface-2); }
.ct .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct .meta { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct .meta .bad { color: var(--crit); }
.ct .meta .warn { color: var(--warn); }
.ct .res { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.35; }
.ct .res .hot { color: var(--warn); font-weight: 600; }
.ct > svg { color: var(--faint); width: 16px; height: 16px; }

/* ---------- Websites */
.summary-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.summary-row .kpi-value { font-size: 22px; }
.sites { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .sites { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.site { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.site.down { border-color: color-mix(in srgb, var(--crit) 45%, var(--border)); }
.site-top { display: flex; align-items: center; gap: 10px; }
.site-top .grow { flex: 1; min-width: 0; }
.site-top a { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.site-top a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-top a svg { width: 14px; height: 14px; color: var(--faint); }
.site-err { color: var(--crit); font-size: 12.5px; margin-top: 6px; }
.site-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.site-stats div { min-width: 0; }
.site-stats span { display: block; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.site-stats b { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-stats b.warn { color: var(--warn); } .site-stats b.crit { color: var(--crit); }
.uptime-bar { display: flex; gap: 2px; height: 22px; margin-top: 12px; }
.uptime-bar i { flex: 1; border-radius: 2px; background: var(--ok); opacity: .85; min-width: 2px; }
.uptime-bar i.d { background: var(--crit); opacity: 1; }
.uptime-bar i.p { background: var(--warn); }
.uptime-bar i.n { background: var(--surface-3); }
.uptime-legend { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; margin-top: 4px; }

/* ---------- Ereignisse */
.events { padding: 4px 16px; }
.day { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 14px 0 4px; }
.ev { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); align-items: start; }
.day + .ev { border-top: 0; }
.ev-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.ev-ico svg { width: 16px; height: 16px; }
.ev-ico.crit { background: var(--crit-soft); color: var(--crit); }
.ev-ico.warn { background: var(--warn-soft); color: var(--warn); }
.ev-ico.ok { background: var(--ok-soft); color: var(--ok); }
.ev-ico.info { background: var(--surface-3); color: var(--muted); }
.ev-title { font-weight: 550; }
.ev-body { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ev-time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }

/* ---------- Einstellungen */
.settings { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.rules { display: grid; }
.rule { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.rule:first-child { border-top: 0; padding-top: 0; }
.rule .grow { flex: 1; min-width: 0; }
.rule b { font-weight: 550; display: block; }
.rule small { color: var(--faint); font-size: 12px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + i { background: var(--ok); border-color: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.thresholds { display: grid; }
.thr { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.thr:first-child { border-top: 0; padding-top: 0; }
.thr .grow { flex: 1; min-width: 0; }
.thr small { color: var(--faint); font-size: 12px; display: block; }
.thr .unit { color: var(--faint); font-size: 12.5px; width: 34px; }
.repos { display: grid; gap: 10px; }
.repo { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: center; }
.repo label { font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .repo { grid-template-columns: 1fr; gap: 4px; } }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.push-state { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; }
.push-state .p-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.push-state.on .p-ico { background: var(--ok-soft); color: var(--ok); }
.push-state b { display: block; }
.push-state small { color: var(--muted); font-size: 12.5px; }
.howto { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.howto svg { width: 15px; height: 15px; vertical-align: -3px; }
.devices { margin-top: 14px; }
.devices h4 { margin: 0 0 4px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.df-grid { display: grid; gap: 0; }
.df-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.df-row:first-child { border-top: 0; padding-top: 0; }
.df-row .grow { flex: 1; min-width: 160px; }
.df-row b { display: block; font-weight: 550; }
.df-row small { color: var(--faint); font-size: 12px; }

/* ---------- Sheet */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--safe-top) - 24px); height: calc(100% - var(--safe-top) - 24px);
  background: var(--surface); border-radius: 18px 18px 0 0; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -10px 40px rgba(0,0,0,.35);
}
.sheet.open { transform: none; }
.sheet.compact { height: auto; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px 18px; border-bottom: 1px solid var(--border); flex: none; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h3 { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px 18px calc(18px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet.compact .sheet-body { flex: none; }
@media (min-width: 900px) {
  .sheet { left: auto; top: 0; bottom: 0; width: min(860px, 92vw); height: 100%; max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--border); transform: translateX(105%); }
  .sheet.compact { width: 420px; height: 100%; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 16px; }
}
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.act {
  display: grid; justify-items: center; gap: 5px; padding: 11px 4px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 500 12px var(--font); cursor: pointer;
}
.act svg { width: 20px; height: 20px; }
.act:hover { background: var(--surface-3); }
.act:disabled { opacity: .35; cursor: not-allowed; }
.act.danger { color: var(--crit); }
.act.loading { opacity: .6; pointer-events: none; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (min-width: 640px) { .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.info-grid div { min-width: 0; }
.info-grid > div > span { display: block; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.info-grid b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.info-grid .full { grid-column: 1 / -1; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
.note.crit { background: var(--crit-soft); }
.logs-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-height: 320px; flex: 1; }
.logs-tools { display: flex; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.logs-tools select { width: auto; height: 32px; font-size: 12.5px; padding: 0 8px; }
.logs-tools input { height: 32px; font-size: 12.5px; flex: 1 1 140px; width: auto; }
.logs-tools .btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
pre.logs {
  margin: 0; flex: 1; overflow: auto; padding: 10px 12px; font: 11.5px/1.55 var(--mono); background: var(--bg);
  white-space: pre-wrap; word-break: break-word; max-height: 60vh; min-height: 260px; -webkit-overflow-scrolling: touch;
}
pre.logs .ts { color: var(--faint); }
pre.logs .e { color: var(--crit); }
pre.logs .w { color: var(--warn); }
pre.logs mark { background: var(--warn-soft); color: inherit; border-radius: 2px; }
.menu-list { display: grid; gap: 6px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 500 14px var(--font); cursor: pointer; text-align: left; text-decoration: none;
}
.menu-item:hover { background: var(--surface-3); text-decoration: none; }
.menu-item small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }
.menu-item .grow { flex: 1; min-width: 0; }
.menu-item.danger { color: var(--crit); }
.menu-item.danger small { color: var(--faint); }
.section-label { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 -6px; }

/* ---------- Dialog & Toasts */
.dialog { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.5); animation: fade .15s; }
.dialog-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.dialog-card h3 { font-size: 17px; }
.dialog-card p { margin: 8px 0 18px; font-size: 14px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toasts { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text); box-shadow: 0 10px 30px rgba(0,0,0,.3);
  font-size: 13.5px; animation: toast .22s ease; pointer-events: auto;
}
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--crit); }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border: 1px solid var(--border); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 420px) {
  .kpi-value { font-size: 23px; }
  .site-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .act { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Diagramm-Farben */
.s-a { stroke: var(--chart-a); }
.s-b { stroke: var(--chart-b); }
.stop-a { stop-color: var(--chart-a); }
.ev.clickable, .row.clickable { cursor: pointer; }
.ev.clickable:hover .ev-title { color: var(--accent); }
