/* SimplyPanel – Grundgestaltung.
   Farben, Radius und Abstände kommen aus /theme.css (im Panel unter Verwaltung → Design änderbar).
   Eigene Regeln: <Datenordner>/web/custom.css anlegen. */

:root {
  --bg: #141a2b; --bg-side: #10162480; --surface: #1c2438; --surface-2: #232d45; --border: #33405e;
  --text: #e6eaf2; --text-dim: #8e9ab5; --accent: #f2b544; --accent-text: #1a1405;
  --ok: #3cc4a4; --warn: #f2b544; --err: #f0605a; --info: #7aa7f7;
  --console-bg: #0f1422; --console-text: #d5dbe8;
  --load-low: #3cc4a4; --load-mid: #f2b544; --load-high: #f0605a;
  --gap: 16px; --radius: 10px; --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --side-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
small, .dim { color: var(--text-dim); }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.ico { width: 16px; height: 16px; flex: none; }

/* ---------- Gerüst ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--bg-side); border-right: 1px solid var(--border); padding: 18px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand img { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: .78rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button.link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 500; width: 100%; text-align: left;
}
.nav a:hover, .nav button.link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active .ico { color: var(--accent); }
.nav .ico { width: 18px; height: 18px; flex: none; }
.nav-head { margin: 18px 10px 6px; font-size: .8rem; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; }
.nav .srv { gap: 9px; }
.nav .srv .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .srv .cpu { font-size: .75rem; color: var(--text-dim); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.side-foot .who { padding: 4px 10px 8px; font-size: .85rem; color: var(--text-dim); }
.side-foot .who b { color: var(--text); font-weight: 600; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .title { flex: 1; min-width: 220px; }
.page-head .title p { margin: 4px 0 0; color: var(--text-dim); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(86vw, 300px); transform: translateX(-100%); transition: transform .2s ease; background: var(--bg); }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 30; }
  .main { padding-top: 18px; }
}

/* Maschine kompakt in der Seitenleiste: Ringe (außen verplant, innen genutzt) */
.sh { display: block; margin: 14px 2px 0; padding: 10px 6px 9px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-dim); font-size: .75rem; }
.sh:hover { text-decoration: none; background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); }
.sh.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.sh-head { display: flex; justify-content: space-between; padding: 0 6px 6px; font-size: .78rem; }
.sh-temp { font-weight: 600; color: var(--text); }
.sh-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.sh-item { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.sh-gauge { position: relative; width: 62px; height: 62px; }
.sh-ring { width: 100%; height: 100%; display: block; }
.sh-ring circle { fill: none; transition: stroke-dasharray .6s ease, stroke .6s; }
.sh-track { stroke: var(--surface-2); }
.sh-alloc { stroke: color-mix(in srgb, var(--text-dim) 75%, transparent); stroke-linecap: round; }
.sh-alloc.over { stroke: var(--err); }
.sh-track.over { stroke: color-mix(in srgb, var(--err) 30%, transparent); }
.sh-alloc.over { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--err) 55%, transparent)); }
.sh-used { stroke: var(--load-low); stroke-linecap: round; }
.sh-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: .95rem; font-weight: 700; color: var(--text); }
.sh-num small { font-size: .6rem; font-weight: 600; color: var(--text-dim); margin-left: 1px; }
.sh-label { color: var(--text); font-weight: 600; font-size: .76rem; margin-top: 2px; }
.sh-sub { display: flex; flex-direction: column; align-items: center; line-height: 1.25; font-size: .68rem; max-width: 100%; }
.sh-sub b { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sh-sub span { font-size: .62rem; }
.sh-sub.over, .sh-sub.over b { color: var(--err); }
.sh-legend { display: flex; justify-content: center; gap: 12px; margin-top: 7px; font-size: .68rem; }
.sh-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: 2px; }
.sh-dot-used { background: var(--load-low); height: 5px !important; vertical-align: 1px !important; }
.sh-dot-alloc { background: color-mix(in srgb, var(--text-dim) 75%, transparent); }

/* ---------- Flächen ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel > .ph { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel > .ph h2, .panel > .ph h3 { flex: 1; }
.panel > .pb { padding: 18px; }
.panel + .panel { margin-top: var(--gap); }
.grid > .panel + .panel, .host-head > .panel + .panel { margin-top: 0; }
.grid { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.callout { border-left: 3px solid var(--info); background: color-mix(in srgb, var(--info) 10%, var(--surface)); padding: 12px 14px; border-radius: var(--radius-sm); }
.callout.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.callout.err { border-color: var(--err); background: color-mix(in srgb, var(--err) 10%, var(--surface)); }

/* ---------- Bedienelemente ---------- */
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-weight: 550; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--border)); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ok { color: var(--ok); }
.btn.danger { color: var(--err); }
.btn.danger.solid { background: var(--err); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: .88rem; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn .ico { width: 16px; height: 16px; }

label.field { display: block; }
label.field > span { display: block; font-size: .88rem; font-weight: 550; margin-bottom: 5px; }
label.field > small { display: block; margin-top: 4px; font-size: .8rem; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { height: auto; min-height: 120px; padding: 10px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: -3px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check small { display: block; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.code-input { font-family: var(--mono); letter-spacing: .3em; font-size: 1.4rem !important; text-align: center; height: 52px !important; }

/* Status-Lampe */
.lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-dim) 18%, transparent); }
.lamp.running { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.lamp.starting, .lamp.stopping, .lamp.installing { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent); animation: pulse 1.2s ease-in-out infinite; }
.lamp.failed { background: var(--err); }
@keyframes pulse { 50% { opacity: .35; } }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-dim); white-space: nowrap; }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.badge.err { color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent); }
.badge.accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Balken */
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--load-low); transition: width .4s ease, background .4s; }

/* Tabs */
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--border); margin-bottom: var(--gap); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 14px; color: var(--text-dim); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Zähler an Reitern */
.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; font-size: .72rem; font-weight: 700; background: var(--warn); color: #1a1405; vertical-align: 1px; }
.tab-badge.crit { background: var(--err); color: #fff; }
.finding h3 { font-size: 1.02rem; }
.code-copy { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.code-copy pre { margin: 0; width: 100%; max-height: 120px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: .78rem; background: var(--console-bg); color: var(--console-text); padding: 10px; border-radius: var(--radius-sm); }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 550; color: var(--text-dim); font-size: .82rem; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* ---------- Server-Übersicht ---------- */
.srv-list { display: flex; flex-direction: column; }
.srv-row {
  display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(120px, 1fr)) auto; gap: 18px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text);
}
.srv-row:last-child { border-bottom: 0; }
.srv-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); text-decoration: none; }
.srv-row .nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
.srv-row .nm b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-row .nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-row .stat { font-size: .85rem; }
.srv-row .stat .v { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 8px; margin-bottom: 5px; color: var(--text-dim); }
.srv-row .stat .v b { white-space: nowrap; }
.srv-row .stat .v b { color: var(--text); font-weight: 600; }
@media (max-width: 860px) { .ph > small.dim { display: none; } .srv-row { grid-template-columns: 1fr 1fr; } .srv-row .nm { grid-column: 1 / -1; } .srv-row .act { display: none; } }

.empty { padding: 40px 20px; text-align: center; color: var(--text-dim); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- Maschine / Threads ---------- */
.host-head { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: var(--gap); margin-bottom: var(--gap); }
@media (max-width: 1000px) { .host-head { grid-template-columns: 1fr; } }
.bigstat { display: flex; align-items: baseline; gap: 10px; }
.bigstat .n { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.bigstat .u { color: var(--text-dim); font-size: 1rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; text-align: right; font-weight: 550; }
.kv.left dd { text-align: left; }
.chart { width: 100%; height: 150px; display: block; }
.chart.sm { height: 64px; }

.cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--core-w, 150px), 1fr)); gap: 8px; }
.core { display: flex; gap: 3px; padding: 3px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--border) 45%, transparent); }
.core .ct { display: none; }
.thr {
  position: relative; flex: 1; min-width: 0; height: 104px; border-radius: 4px; background: var(--surface-2); overflow: hidden;
  padding: 7px 8px; display: flex; flex-direction: column; text-align: left; color: var(--text);
}
.thr .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--load-low); opacity: .5; transition: height .45s ease, background .45s; }
.thr .fill::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: inherit; filter: brightness(1.5); opacity: 1; }
.thr > * { position: relative; }
.thr .id { font-size: .72rem; color: var(--text-dim); display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.thr .id span:first-child { font-weight: 600; }
.thr .pct { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; }
.thr .who { margin-top: auto; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.thr .who b { color: var(--text); font-weight: 600; }
.thr .who .more { color: var(--text-dim); font-weight: 600; }
.thr .who .free { opacity: .7; }
.thr.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.thr:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--border)); }
.cores.compact { --core-w: 64px; }
.cores.compact .thr { height: 54px; padding: 4px 6px; }
.cores.compact .thr .pct { font-size: .95rem; }
.cores.compact .thr .who, .cores.compact .thr .id span + span { display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--text-dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.thread-detail { min-height: 120px; }
.consumer { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.consumer:last-child { border-bottom: 0; }
.consumer .meter { grid-column: 1 / -1; }

.temps { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.temp { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.temp small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.temp b { font-size: 1.1rem; }

/* ---------- Konsole ---------- */
.server-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.server-head .title { flex: 1; min-width: 240px; }
.server-head h1 { display: flex; align-items: center; gap: 12px; }
.addr { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .88rem; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); padding: 3px 9px; border-radius: var(--radius-sm); }
.addr:hover { color: var(--text); }
.addr .ico { width: 14px; height: 14px; }
.ph > .row { flex: 1; }
.power { display: flex; gap: 8px; }
.console-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--gap); }
@media (max-width: 1100px) { .console-layout { grid-template-columns: 1fr; } }
.console {
  background: var(--console-bg); color: var(--console-text); border-radius: var(--radius); border: 1px solid var(--border);
  display: flex; flex-direction: column; height: min(68vh, 720px); min-height: 360px; overflow: hidden;
}
.console pre {
  flex: 1; margin: 0; padding: 14px 16px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  font: 13px/1.5 var(--mono); tab-size: 4;
}
.console form { display: flex; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.console form .prompt { padding: 0 4px 0 16px; display: flex; align-items: center; color: var(--accent); font-family: var(--mono); }
.console input { flex: 1; border: 0; border-radius: 0; background: transparent; color: var(--console-text); font-family: var(--mono); height: 44px; box-shadow: none !important; }
.console .jump { position: absolute; right: 16px; bottom: 56px; }
.console-wrap { position: relative; }
.stat-col .panel .pb { padding: 14px 16px; }
.stat-line { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 6px; }
.stat-line b { font-weight: 600; }

/* ANSI-Farben */
.a-b { font-weight: 700; } .a-i { font-style: italic; } .a-u { text-decoration: underline; } .a-d { opacity: .7; }

/* ---------- Dateien ---------- */
.crumbs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: .92rem; }
.crumbs a { padding: 2px 6px; border-radius: 4px; }
.crumbs span { color: var(--text-dim); }
.file-row td:first-child { width: 28px; }
.file-row .fname { display: flex; align-items: center; gap: 8px; }
.file-row .ico { width: 17px; height: 17px; color: var(--text-dim); }
.file-row.dir .ico { color: var(--accent); }
.dropzone.drag { outline: 2px dashed var(--accent); outline-offset: -6px; }
.editor { width: 100%; min-height: 60vh; font: 13px/1.5 var(--mono); background: var(--console-bg); color: var(--console-text); border-radius: var(--radius-sm); tab-size: 4; white-space: pre; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: min(420px, 100%); }
.auth .brand { justify-content: center; padding-bottom: 22px; font-size: 1.25rem; }
.auth .panel > .pb { padding: 26px; }
.auth h1 { font-size: 1.3rem; margin-bottom: 6px; }
.auth p { color: var(--text-dim); }
.qr { background: #fff; padding: 12px; border-radius: var(--radius-sm); width: fit-content; margin: 8px auto 14px; }
.qr img, .qr svg { display: block; width: 196px; height: 196px; image-rendering: pixelated; }
.secret { font-family: var(--mono); letter-spacing: .08em; word-break: break-all; text-align: center; font-size: .9rem; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; font-family: var(--mono); font-size: 1rem; background: var(--surface-2); padding: 14px; border-radius: var(--radius-sm); }

/* ---------- Toasts & Dialoge ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--info); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: tin .18s ease-out; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(5, 8, 15, .6); display: grid; place-items: center; z-index: 90; padding: 18px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; }
.modal.wide { width: min(980px, 100%); }
.modal .pf { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); }

/* Theme-Editor */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatch { border: 2px solid transparent; border-radius: var(--radius); overflow: hidden; text-align: left; background: var(--surface-2); }
.swatch.active { border-color: var(--accent); }
.swatch .pv { height: 58px; display: grid; grid-template-columns: 30% 1fr; }
.swatch .pv i { display: block; }
.swatch .pv div { display: flex; flex-direction: column; gap: 5px; padding: 9px; }
.swatch .pv b { display: block; height: 6px; border-radius: 3px; }
.swatch span { display: block; padding: 7px 10px; font-weight: 600; font-size: .88rem; }
.var-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.var-row { display: flex; align-items: center; gap: 10px; }
.var-row label { flex: 1; font-size: .88rem; }
.var-row input[type=text] { width: 110px; height: 34px; font-family: var(--mono); font-size: .82rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
details.notes { font-size: .88rem; }
details.notes summary { cursor: pointer; color: var(--text-dim); }
details.notes ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.finding pre.mono { white-space: pre-wrap; max-height: 260px; overflow-y: auto; }
.finding pre.cmd span { white-space: nowrap; }
details.content-list { padding: 0 var(--pad, 16px) 14px; }
details.content-list summary { cursor: pointer; color: var(--text-dim); padding: 4px 0 10px; }
details.content-list .table-wrap { max-height: 360px; overflow: auto; }
.mem-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.mem-stack i { display: block; height: 100%; transition: width .45s ease; }
.mem-stack i.game, .mem-legend i.game { background: var(--accent); }
.mem-stack i.sys, .mem-legend i.sys { background: color-mix(in srgb, var(--text-dim) 70%, transparent); }
.mem-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--text-dim); }
.mem-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mem-legend i.free { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.mem-legend b { color: var(--text); font-weight: 600; margin-left: 2px; }
.bigstat { flex-wrap: wrap; row-gap: 2px; }
.bigstat .n { white-space: nowrap; }

/* Server-Formular */
.sf { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); align-items: start; }
.sf-side { position: sticky; top: 16px; }
@media (max-width: 1100px) { .sf { grid-template-columns: 1fr; } .sf-side { position: static; order: -1; } }
.res { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.res:last-of-type { border-bottom: 0; }
.res-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.res-val { color: var(--accent); }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font: inherit; font-size: .82rem; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.res-ctl { display: grid; grid-template-columns: 1fr 110px auto; gap: 10px; align-items: center; }
.res-num { width: 110px; }
input.range { width: 100%; accent-color: var(--accent); }
details.more summary, details.fold > summary { cursor: pointer; color: var(--text-dim); }
details.fold > summary { list-style: none; color: var(--text); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2::before { content: "▸ "; color: var(--text-dim); }
details.fold[open] > summary h2::before { content: "▾ "; }
.thrmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.thrpick { position: relative; overflow: hidden; height: 64px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.thrpick .fill { position: absolute; left: 0; right: 0; bottom: 0; opacity: .35; transition: height .45s ease; }
.thrpick > b, .thrpick > .who { position: relative; }
.thrpick > b { font-size: 1.05rem; }
.thrpick .who { font-size: .68rem; color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thrpick.on { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.thrpick.on > b { color: var(--accent); }
.sum-row { display: grid; gap: 5px; }
.sum-head { display: flex; justify-content: space-between; font-size: .88rem; }
.sum-head b { font-weight: 600; }
.sum-bar { position: relative; display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.sum-bar i { display: block; height: 100%; }
.sum-bar i.o { background: color-mix(in srgb, var(--text-dim) 60%, transparent); }
.sum-bar i.t { background: var(--accent); }
.sum-row.over .sum-bar i.t { background: var(--err); }
.sum-row.over .sum-head b, .sum-row.over small { color: var(--err); }
.err-text { color: var(--err); }
.ok-text { color: var(--ok); }

/* Spieler */
.pl-table tr.click { cursor: pointer; }
.pl-table tr.click:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.pl-avatar { border-radius: 5px; image-rendering: pixelated; flex: none; background: var(--surface-2); }
.pl-modal { width: min(1060px, 100%); }
.pl-content { min-height: 320px; }
.pl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-content: start; }
.pl-stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 2px; }
.pl-stat b { font-size: 1.05rem; }
.panel.inset { background: var(--surface-2); box-shadow: none; }
.row .lbl { min-width: 96px; color: var(--text-dim); font-size: .88rem; }
.inv-wrap { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.inv-armor { display: grid; gap: 6px; }
.inv-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.slot { position: relative; aspect-ratio: 1; min-width: 0; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.inv-armor .slot { width: 66px; }
.slot:hover { border-color: var(--accent); }
.slot.empty { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.slot .nm { font-size: .66rem; line-height: 1.15; word-break: break-word; }
.slot .cnt { position: absolute; right: 4px; bottom: 2px; font-size: .75rem; font-weight: 700; }
.slot .box { position: absolute; left: 4px; top: 2px; font-size: .6rem; color: var(--info); }
.slot .lbl { font-size: .62rem; color: var(--text-dim); min-width: 0; }
.slot.ench { box-shadow: inset 0 0 0 1px #a78bfa, 0 0 8px -2px #a78bfa; }
.hist-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.hist-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hchip { padding: 2px 8px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.hchip small { font-weight: 400; opacity: .8; }
.hchip.plus { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.hchip.minus { color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent); }
.cp-out { white-space: pre-wrap; max-height: 420px; overflow: auto; background: var(--console-bg, var(--surface-2)); padding: 12px; border-radius: var(--radius-sm); font-size: .8rem; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mod-card { display: grid; gap: 6px; align-content: start; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.mod-card .btn { justify-self: start; }
@media (max-width: 760px) { .pl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .inv-wrap { grid-template-columns: 1fr; } .inv-armor { grid-template-columns: repeat(5, 1fr); } .inv-armor .slot { width: auto; } }
.pl-modal .row select, .pl-modal .row input { width: auto; }
.pl-modal .row input[type=text] { min-width: 160px; }
.inv-armor .slot .nm { font-size: .6rem; }

/* Item-Bilder und Item-Suche im Spieler-Reiter */
.slot.has-ico { padding: 2px; }
.item-ico { width: min(64px, 78%); height: auto; pointer-events: none; user-select: none; }
.slot.has-ico .cnt { color: #fff; text-shadow: 1px 1px 0 #3f3f3f, 2px 2px 0 rgba(0,0,0,.35); font-size: .82rem; right: 5px; bottom: 3px; }
.slot.has-ico.ench::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  background: linear-gradient(115deg, transparent 30%, rgba(167,139,250,.55) 45%, transparent 60%) 0 0 / 250% 250%; animation: glint 3.2s linear infinite; }
@keyframes glint { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .slot.has-ico.ench::after { animation: none; background-position: 50% 0; } }
.ip { position: relative; max-width: 100%; }
.ip-field { position: relative; }
.ip-field input { width: 100%; padding-left: 38px; }
.ip-prev { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: flex; pointer-events: none; }
.ip-prev:empty::before { content: ""; width: 18px; height: 18px; margin: 3px; border-radius: 4px; border: 1px dashed var(--border); }
.ip-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 12px 28px -12px rgba(0,0,0,.55); padding: 4px; }
.ip-opt { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.ip-opt.on, .ip-opt:hover { background: var(--surface-2); }
.ip-oi { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.ip-ico { width: 28px; height: 28px; flex: none; }
.ip-prev .ip-ico { width: 24px; height: 24px; }
.ip-on { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-id { margin-left: auto; color: var(--text-dim); font-size: .74rem; white-space: nowrap; }
.ip-none { padding: 8px; color: var(--text-dim); font-size: .82rem; }
.hc-ico { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.box-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.box-it { display: inline-flex; align-items: center; gap: 6px; }
.box-it .ip-ico, .kv .ip-ico { width: 24px; height: 24px; }
.pl-modal .ip-field input { width: 100%; min-width: 0; }
.ip.up .ip-list { top: auto; bottom: calc(100% + 4px); }
.meta-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.meta-l { font-size: .82rem; font-weight: 600; color: var(--text-dim); }
.ench-rows { display: grid; gap: 6px; }
.ench-rows:empty::before { content: "Keine"; color: var(--text-dim); font-size: .85rem; }
.ench-row { display: flex; gap: 6px; align-items: center; }
.ench-row select { flex: 1; min-width: 0; }
.pl-modal .ench-row select, .modal .ench-row select { width: auto; flex: 1; }
.give-more { margin-top: 8px; max-width: 560px; }
.give-more summary { cursor: pointer; color: var(--text-dim); font-size: .88rem; padding: 4px 0; }
.give-more[open] summary { margin-bottom: 6px; }
.slot .dur { position: absolute; left: 14%; right: 14%; bottom: 5px; height: 4px; background: #000; border-radius: 1px; }
.slot .dur i { display: block; height: 100%; }
.slot.has-ico .cnt { z-index: 1; }

/* Seitenleiste: Netzwerke (Proxy mit Unterservern), Sortieren per Drag & Drop */
.nav .srv .name .netsum { display: block; font-size: .7rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.nav .srv.net { align-items: center; }
.nav .srv .caret { flex: none; width: 16px; height: 16px; margin: 0 -4px 0 -6px; padding: 0; border: 0; background: none; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.nav .srv .caret::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav .srv .caret.open::before { transform: rotate(45deg) translate(-1px, -1px); }
.nav .srv .caret:hover { color: var(--text); background: var(--surface-2); }
.srv-children { margin-left: 15px; padding-left: 6px; border-left: 1px solid var(--border); }
.nav .srv[draggable="true"] { cursor: grab; }
.nav .srv.dragging { opacity: .4; }
.nav .srv.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.nav .srv.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.nav .srv.drop-into { background: color-mix(in srgb, var(--accent) 18%, transparent); outline: 1px dashed var(--accent); outline-offset: -1px; }
.srv-dropend { height: 10px; border-radius: 6px; margin: 2px 6px; }
.srv-dropend.on { box-shadow: inset 0 2px 0 var(--accent); }
@media (prefers-reduced-motion: reduce) { .nav .srv .caret::before { transition: none; } }

/* Übersicht: Unterserver eingerückt */
.srv-row.child .nm { padding-left: 22px; position: relative; }
.srv-row.child .nm::before { content: ""; position: absolute; left: 6px; top: -12px; bottom: 50%; width: 10px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); border-bottom-left-radius: 4px; }
.srv-row .net-tag { font-size: .72rem; color: var(--text-dim); font-weight: 400; margin-left: 6px; }
.path-box { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); overflow-x: auto; white-space: nowrap; font-size: .85rem; user-select: all; }
