/* Server Dashboard: schwarz-weiß. Zustände werden über Form unterscheidbar gemacht (gefüllt, hohl, gestreift, invertiert). */
:root {
  --bg: #000; --fg: #fff; --muted: #8f8f8f; --dim: #5c5c5c; --line: #262626; --soft: #141414; --edge: #444;
  --display: "Bahnschrift", "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, Menlo, monospace;
  --hatch: repeating-linear-gradient(135deg, #fff 0 2px, transparent 2px 5px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); scrollbar-color: #444 #000; font-variant-numeric: tabular-nums; }
::selection { background: #fff; color: #000; }
h1 { font: 600 28px/1.1 var(--display); margin: 0; letter-spacing: -.01em; }
h2 { font: 600 15px/1.2 var(--display); margin: 0 0 12px; letter-spacing: .01em; }
small, .muted { color: var(--muted); }
a { color: var(--fg); }
code { font-family: var(--mono); font-size: 12.5px; background: var(--soft); padding: 1px 5px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Gerüst */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; padding: 22px 0 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 20px 26px; font: 600 18px/1 var(--display); letter-spacing: .01em; }
.brand img { width: 28px; height: 28px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: var(--muted); text-decoration: none; font: 500 15px/1.2 var(--display); letter-spacing: .01em; }
.nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { color: #fff; background: var(--soft); }
.nav a.on { background: #fff; color: #000; }
.nav .spacer { flex: 1; }
main { padding: 30px 40px 80px; min-width: 0; max-width: 1320px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
[data-page="overview"] .head { display: none; }
section { margin-bottom: 38px; }
section > h2 { padding-top: 10px; border-top: 1px solid #fff; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 44px; }
.panel { min-width: 0; }
.cols > .panel { border-top: 1px solid #fff; padding-top: 10px; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 12px; }
.p-head h2 { margin: 0; }
.p-head b { font: 600 34px/1 var(--display); letter-spacing: -.01em; }
canvas { width: 100%; height: 160px; display: block; }

/* Kopfzeile der Übersicht: sagt in einem Satz, wie es dem Server geht */
.hero-t { font: 600 clamp(46px, 8.5vw, 104px)/.94 var(--display); font-variation-settings: "wdth" 80; letter-spacing: -.025em; margin: 0 0 16px; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; }

/* Erreichbarkeit: Verlaufsstreifen */
.mon { display: grid; grid-template-columns: 16px minmax(120px, 1.1fr) minmax(160px, 2.4fr) minmax(100px, .8fr); gap: 16px; align-items: center; padding: 15px 14px; border-bottom: 1px solid var(--line); }
.mon-name { min-width: 0; }
.mon-name b, .mon-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-name b { font: 600 16px/1.25 var(--display); }
.mon-meta { text-align: right; }
.mon-meta b, .mon-meta small { display: block; }
.mon-meta b { font: 600 18px/1.2 var(--display); }
.strip { display: flex; align-items: flex-end; gap: 2px; height: 32px; }
.strip i { flex: 1; min-width: 2px; background: #1f1f1f; height: 12%; }
.strip i.ok { background: #fff; }
.strip i.fail { background: var(--hatch); height: 100%; outline: 1px solid #fff; outline-offset: -1px; }
.mon-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--dim); display: inline-block; flex: none; border-style: dotted; }
.dot.up { background: #fff; border: 2px solid #fff; }
.dot.down { background: transparent; border: 2px solid #fff; }

/* Balken */
.row { display: grid; grid-template-columns: 74px 1fr 130px; gap: 14px; align-items: center; padding: 8px 0; }
.row span:first-child { font: 600 15px var(--display); }
.row span:last-child { text-align: right; color: var(--muted); }
.bar { height: 6px; background: #1f1f1f; }
.bar i { display: block; height: 100%; background: #fff; }
.bar.warn i { background: repeating-linear-gradient(135deg, #fff 0 4px, #777 4px 8px); }
.bar.crit i { background: var(--hatch); outline: 1px solid #fff; }
.net { display: flex; gap: 40px; } .net b { font: 600 30px/1.1 var(--display); display: block; letter-spacing: -.01em; }

/* Bedienelemente */
.btn { background: transparent; border: 1px solid var(--edge); border-radius: 4px; padding: 6px 14px; cursor: pointer; color: #fff; }
.btn:hover { border-color: #fff; }
.btn.primary { background: #fff; border-color: #fff; color: #000; font-weight: 600; }
.btn.primary:hover { background: #d6d6d6; border-color: #d6d6d6; }
.btn.danger { border-style: dashed; }
.btn.sm { padding: 3px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: default; }
input, select { background: #000; border: 1px solid var(--edge); border-radius: 4px; padding: 8px 11px; min-width: 0; }
input:focus, select:focus { border-color: #fff; outline: none; }
input[type=checkbox] { accent-color: #fff; }
.form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; } .field label { font-size: 12.5px; color: var(--muted); }
.field.grow { flex: 1; min-width: 200px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.tabs { display: inline-flex; border: 1px solid var(--edge); border-radius: 4px; overflow: hidden; }
.tabs button { background: none; border: 0; padding: 7px 16px; color: var(--muted); cursor: pointer; font: 500 14px var(--display); }
.tabs button:hover { color: #fff; }
.tabs button.on { background: #fff; color: #000; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; max-width: 78ch; }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font: 600 13px var(--display); color: var(--muted); padding: 8px 10px; border-bottom: 1px solid #fff; white-space: nowrap; }
.tbl th.sort { cursor: pointer; } .tbl th.sort:hover { color: #fff; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--soft); }
.tbl td.num { text-align: right; } .tbl td.act { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.pin { background: none; border: 0; cursor: pointer; color: var(--dim); font-size: 17px; padding: 0 4px; }
.pin.on, .pin:hover { color: #fff; } .pin:disabled { cursor: default; }
.empty { padding: 34px 8px; color: var(--muted); border-bottom: 1px solid var(--line); }

/* Logs: Fehlerzeilen sind invertiert */
.logview { background: #000; border: 1px solid #333; padding: 14px 16px; font: 12.5px/1.6 var(--mono); height: 56vh; min-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0; color: #bdbdbd; }
.logview .err { background: #fff; color: #000; display: inline-block; width: 100%; }
.logview .warn { color: #fff; text-decoration: underline dotted; }

/* Anmeldung */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .panel { width: min(430px, 100%); }
.gate h1 { font: 600 56px/.95 var(--display); font-variation-settings: "wdth" 80; letter-spacing: -.02em; margin-bottom: 14px; }
.gate p { color: var(--muted); margin: 0 0 26px; }
.gate .field { margin-bottom: 16px; } .gate input { width: 100%; padding: 11px 13px; }
.err-msg { min-height: 20px; font-size: 13px; margin: 0 0 8px; text-decoration: underline dotted; }
.copybox { display: flex; gap: 8px; } .copybox input { flex: 1; font-family: var(--mono); }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); background: #fff; color: #000; padding: 11px 18px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #000; color: #fff; outline: 1px dashed #fff; }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; overflow-x: auto; padding: 0 0 env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid #fff; background: #000; z-index: 20; }
  .brand, .nav .spacer { display: none; }
  .nav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 9px 14px; }
  main { padding: 20px 16px 100px; }
  .mon { grid-template-columns: 16px 1fr auto; } .mon .strip { grid-column: 1 / -1; }
  .row { grid-template-columns: 56px 1fr; } .row span:last-child { grid-column: 1 / -1; text-align: left; }
  .cols { gap: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }


/* ===== Hintergrund (FluxLines) ===== */
.flux { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.flux-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.flux-fallback { background: repeating-linear-gradient(112deg, rgba(255,255,255,.075) 0 1px, transparent 1px 16px); -webkit-mask-image: linear-gradient(100deg, #000, transparent 85%); mask-image: linear-gradient(100deg, #000, transparent 85%); }
.gate-flux { position: fixed; }

/* Seitenkopf mit Hintergrund */
.head { position: relative; height: 126px; border: 1px solid var(--line); align-items: flex-end; padding: 0 26px 18px; overflow: hidden; margin-bottom: 32px; }
.head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.7), rgba(0,0,0,0) 70%); z-index: 1; pointer-events: none; }
.head h1 { position: relative; z-index: 2; font-size: 48px; font-variation-settings: "wdth" 85; letter-spacing: -.02em; }

/* Kopfbereich der Übersicht */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line); margin-bottom: 40px; min-height: 340px; display: flex; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.62) 0, rgba(0,0,0,.2) 55%, rgba(0,0,0,0) 100%), linear-gradient(0deg, rgba(0,0,0,.7) 0, rgba(0,0,0,0) 60%); z-index: 1; pointer-events: none; }
.hero-in { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; width: 100%; padding: 34px 34px 30px; flex-wrap: wrap; }
.hero-main { min-width: 0; flex: 1 1 520px; }
.hero-t { margin: 0 0 18px; }
.hero p { color: #c4c4c4; text-shadow: 0 0 14px #000; }
.hero.bad .hero-t { color: transparent; -webkit-text-stroke: 2px #fff; }
.hero-stats { display: flex; gap: 38px; }
.hero-stats small { display: block; margin-bottom: 6px; color: #c4c4c4; }
.hero-stats b { display: block; font: 600 42px/1 var(--display); letter-spacing: -.01em; min-width: 3ch; }
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 11px; vertical-align: middle; animation: pulse 1.6s ease-in-out infinite; }

/* Kerne */
.cores { display: flex; align-items: flex-end; gap: 5px; height: 44px; margin-top: 14px; }
.cores i { flex: 0 0 9px; background: #fff; height: 4%; transition: height .7s cubic-bezier(.2,.8,.2,1); }

/* ===== Bewegung ===== */
.w { display: inline-block; animation: word .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 80ms); }
.enter > * { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.enter > *:nth-child(2) { animation-delay: .07s; } .enter > *:nth-child(3) { animation-delay: .14s; }
.enter > *:nth-child(4) { animation-delay: .21s; } .enter > *:nth-child(5) { animation-delay: .28s; } .enter > *:nth-child(n+6) { animation-delay: .35s; }
.strip i { transform-origin: bottom; }
.anim .strip i.ok, .anim .strip i.fail { animation: grow .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--k) * 9ms); }
.mon .dot.up { position: relative; }
.mon .dot.up::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid #fff; animation: ping 2.6s ease-out infinite; }
.mon .dot.down { animation: blink 1.2s steps(2, start) infinite; }
.mon { transition: background .2s; } .mon:hover { background: #0b0b0b; }
.mon.down { box-shadow: inset 4px 0 0 #fff; }
.nav a { transition: background .15s, color .15s, padding-left .2s; } .nav a:hover { padding-left: 26px; } .nav a.on:hover { padding-left: 20px; }
.btn { transition: border-color .15s, background .15s, transform .08s; } .btn:active { transform: scale(.96); }
.tbl td { transition: background .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes word { from { opacity: 0; transform: translateY(55%) skewY(4deg); } to { opacity: 1; transform: none; } }
@keyframes grow { from { opacity: 0; transform: scaleY(.04); } to { opacity: 1; transform: none; } }
@keyframes ping { from { transform: scale(1); opacity: .8; } to { transform: scale(2.8); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes blink { 50% { opacity: .25; } }

.gate .panel { position: relative; z-index: 1; background: rgba(0,0,0,.74); border: 1px solid #333; padding: 36px; }
@media (max-width: 800px) { .head { height: 100px; } .head h1 { font-size: 34px; } .hero { min-height: 300px; } .hero-stats { gap: 24px; } .hero-stats b { font-size: 30px; } }

.cores::before { content: "Kerne"; color: var(--muted); font-size: 12.5px; align-self: center; margin-right: 10px; }


/* ===== Etwas Farbe: Grundton bleibt schwarz-weiß ===== */
:root { --up: #34d27b; --down: #ff5a4f; --warn: #ffb340; --accent: #5cc8ff; --accent2: #a78bfa; }
:focus-visible { outline-color: var(--accent); }
input:focus, select:focus { border-color: var(--accent); }
.dot { border-color: var(--warn); }
.dot.up { background: var(--up); border-color: var(--up); box-shadow: 0 0 10px rgba(52,210,123,.55); }
.dot.down { background: transparent; border-color: var(--down); box-shadow: 0 0 10px rgba(255,90,79,.45); }
.mon .dot.up::after { border-color: var(--up); }
.strip i.ok { background: var(--up); }
.strip i.fail { background: repeating-linear-gradient(135deg, var(--down) 0 2px, transparent 2px 5px); outline-color: var(--down); }
.mon.down { box-shadow: inset 4px 0 0 var(--down); }
.mon.down .mon-meta b { color: var(--down); }
.hero.bad .hero-t { -webkit-text-stroke-color: var(--down); }
.live { background: var(--up); box-shadow: 0 0 10px var(--up); }
.hero.bad .live { background: var(--down); box-shadow: 0 0 10px var(--down); }
.bar i { background: var(--accent); }
.bar.warn i { background: repeating-linear-gradient(135deg, var(--warn) 0 4px, #8a5f12 4px 8px); }
.bar.crit i { background: repeating-linear-gradient(135deg, var(--down) 0 2px, transparent 2px 5px); outline-color: var(--down); }
.cores i { background: var(--accent); }
.btn.danger { color: #ff8a80; border-color: #7a2a25; } .btn.danger:hover { border-color: var(--down); }
.pin.on, .pin:hover { color: var(--warn); }
.logview .err { background: rgba(255,90,79,.15); color: #ff9d94; box-shadow: inset 3px 0 0 var(--down); }
.logview .warn { color: var(--warn); text-decoration: none; }
.err-msg { color: #ff8a80; }
#toast.bad { background: #2a0d0b; color: #ff9d94; outline: 1px solid var(--down); }
.hero-stats b, .p-head b { text-shadow: 0 0 24px rgba(92,200,255,.25); }


/* ===== Neue Seiten und Funktionen ===== */
a.btn { text-decoration: none; display: inline-block; }
.ping-g { color: var(--up); } .ping-a { color: var(--warn); } .ping-r { color: var(--down); }
.btn.danger:disabled { opacity: .35; }
.fv-stats { display: flex; gap: 48px; flex-wrap: wrap; margin-bottom: 28px; }
.fv-stats small { display: block; margin-bottom: 6px; }
.fv-stats b { display: block; font: 600 38px/1.05 var(--display); letter-spacing: -.01em; max-width: 520px; }
.fv-stats b.small-b { font: 500 16px/1.4 var(--font); letter-spacing: 0; padding-top: 14px; color: var(--muted); }
.al-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.al-row input[type=number] { width: 80px; }
.al-row label { display: flex; align-items: center; gap: 9px; }

/* Mitteilungen, Wartung */
.badge-m { margin-left: 8px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn); border-radius: 99px; padding: 1px 7px; vertical-align: middle; }
.sm-sel { background: #000; color: #fff; border: 1px solid #444; border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.dot.unknown { background: #777; }
