:root {
  --bg: #0f0d12;
  --panel: #17141c;
  --panel-2: #1f1b26;
  --line: #2e2836;
  --line-2: #3d3547;
  --text: #ece6f0;
  --muted: #9a90a6;
  --dim: #6f667a;
  --accent: #e8a33d;
  --accent-ink: #1a1206;
  --track: #2a2531;
  --fill: #8f86a0;
  --good: #5cc28a;
  --warn: #e6b450;
  --bad: #e5645a;
  --info: #6ea8e8;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 19px; }
h2 { font-size: 16px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabnum { font-variant-numeric: tabular-nums; }

/* Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth form { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; gap: 14px; }
.auth p { margin: 0; color: var(--muted); }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
input, button { font: inherit; color: inherit; }
input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus { outline: 2px solid rgba(232,163,61,.5); border-color: var(--accent); }
button, .btn { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.ghost { background: none; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--panel-2); }
button.sm { padding: 3px 8px; font-size: 12px; }
.err { color: var(--bad); min-height: 1em; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: rgba(15,13,18,.93); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; }
.logo { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(var(--good) 0 30%, transparent 30% 40%, var(--accent) 40% 70%, transparent 70% 80%, var(--fill) 80%); flex: none; }
.top nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
.top nav a { color: var(--muted); padding: 5px 9px; border-radius: 6px; white-space: nowrap; font-size: 13px; }
.top nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.top .right { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.live.paused { background: var(--dim); }
.live.loading { background: var(--accent); }
main { max-width: 1320px; margin: 0 auto; padding: 20px; display: grid; gap: 28px; }
section { display: grid; gap: 12px; scroll-margin-top: 64px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec-head .muted { font-size: 12px; }

/* Gesamtzustand */
.overall { border-radius: var(--radius); border: 1px solid; padding: 12px 16px; display: grid; gap: 6px; }
.overall.good { border-color: rgba(92,194,138,.35); background: rgba(92,194,138,.06); }
.overall.warn { border-color: rgba(230,180,80,.45); background: rgba(230,180,80,.07); }
.overall.bad { border-color: rgba(229,100,90,.5); background: rgba(229,100,90,.08); }
.overall b { font-size: 15px; }
.overall ul { margin: 0; padding-left: 20px; color: var(--text); }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.tile .label { color: var(--muted); font-size: 12px; }
.tile .value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .value small { font-size: 13px; color: var(--muted); font-weight: 400; }
.tile .sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.meter { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--fill); min-width: 2px; }
.meter.warn > i { background: var(--warn); }
.meter.bad > i { background: var(--bad); }
.meter.thin { height: 5px; }

/* Zustand: immer Symbol + Text */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap; }
.st::before { font-size: 11px; }
.st.good { color: var(--good); } .st.good::before { content: "●"; }
.st.warn { color: var(--warn); } .st.warn::before { content: "▲"; }
.st.bad { color: var(--bad); } .st.bad::before { content: "✕"; }
.st.off { color: var(--dim); } .st.off::before { content: "○"; }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
th.num { text-align: right; }

/* Container */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.card.down { border-color: rgba(229,100,90,.5); }
.card-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card-head h2 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mini-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-meters .label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.mini-meters .label b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.health-msg { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 6px 8px; max-height: 60px; overflow: auto; white-space: pre-wrap; }
.group-title { color: var(--dim); font-size: 12px; margin: 6px 0 -4px; }

/* Minecraft */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.list { display: grid; gap: 0; }
.list .row { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.list .row:last-child { border-bottom: 0; }
.list .row .t { color: var(--dim); font-family: var(--mono); font-size: 11.5px; flex: none; }
.names { display: flex; gap: 6px; flex-wrap: wrap; }

/* Logs */
.modal-bg { position: fixed; inset: 0; background: rgba(5,4,7,.75); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; width: 100%; max-width: 1100px; height: min(820px, calc(100vh - 32px)); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal header { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal header h2 { flex: 1; min-width: 160px; }
.modal header input { width: 220px; }
.modal header label { display: flex; flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
.logbox { flex: 1; overflow: auto; padding: 10px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.logbox .l.err { color: #f0948c; }
.logbox .l.warn { color: var(--warn); }
.logbox .l .ts { color: var(--dim); }
.empty { color: var(--dim); padding: 12px 0; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .top nav { order: 3; flex-basis: 100%; }
  main { padding: 16px; }
  .modal header input { width: 100%; }
}
.stack { display: grid; gap: 12px; align-content: start; }
select { font: inherit; color: inherit; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 8px; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
