/* Galaxy ACP – Gestaltung
   Haltung: ein Betriebswerkzeug, kein Marketing. Ruhige Graphit-Flächen, eine einzige Akzentfarbe (das Marken-Cyan), Listen und Tabellen statt Kacheln.
   Farbe bedeutet genau eines: Akzent = bedienbar/ausgewählt, Grün/Gelb/Rot = Zustand (immer zusätzlich als Symbol + Text), Planetenfarbe = Identität eines Services.
   Barrierefreiheit (Apple HIG): Text >= 4.5:1, Ziele >= 32px, sichtbarer Tastaturfokus, reduzierte Bewegung/Transparenz, Hell/Dunkel. */

:root {
  color-scheme: light dark;
  --bg: #f4f5f7; --surface: #ffffff; --sunken: #eceef2; --line: #dfe2e8; --line-strong: #c9cdd6;
  --text: #14161b;            /* 17.6:1 auf --surface */
  --text-2: #565c6b;          /* 6.8:1 */
  --accent: #00748a;          /* 5.5:1 auf Weiß */
  --on-accent: #ffffff;
  --accent-soft: #e0f1f5;
  --ok: #1a7f45; --warn: #9a5a00; --bad: #b8352b; --info: #1a6aa6;
  --ok-bg: #e3f4ea; --warn-bg: #fbefd8; --bad-bg: #fbe6e3; --info-bg: #e2eef8;
  --radius: 10px; --radius-s: 6px;
  --font: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13; --surface: #14171c; --sunken: #1b1f26; --line: #262b34; --line-strong: #363c48;
    --text: #eceef2;          /* 15.5:1 */
    --text-2: #9ba2b1;        /* 7.0:1 */
    --accent: #4fd6ec; --on-accent: #041a1f; --accent-soft: #122a31;
    --ok: #55cf8b; --warn: #f0b64e; --bad: #ff7d73; --info: #6cb8f0;
    --ok-bg: #12291b; --warn-bg: #2e2410; --bad-bg: #331a18; --info-bg: #11263a;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 15px; font-weight: 600; } h2 { font-size: 14px; font-weight: 600; } h3 { font-size: 13px; font-weight: 600; }
a { color: var(--accent); text-underline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-2); } .small { font-size: 12.5px; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Gerüst ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; padding: 14px 10px 16px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 6px; font-size: 14px; font-weight: 650; letter-spacing: .01em; }
.brand svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.brand span { color: var(--text-2); font-weight: 500; }
.account { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--radius-s); }
.account .who { min-width: 0; line-height: 1.25; }
.account .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 6px; background: var(--sunken); image-rendering: pixelated; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--text-2); overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; }
.avatar.lg { width: 56px; height: 56px; border-radius: 8px; font-size: 20px; }
nav .group { margin-top: 10px; }
nav .group-title { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 8px; }
nav a.item { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 5px 8px; border-radius: var(--radius-s); color: var(--text); text-decoration: none; }
nav a.item svg { width: 17px; height: 17px; flex: none; color: var(--text-2); }
nav a.item:hover { background: var(--sunken); }
nav a.item[aria-current="page"] { background: var(--sunken); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }
nav a.item[aria-current="page"] svg { color: var(--accent); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.toolbar { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 24px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.content { overflow-y: auto; padding: 22px 24px 40px; flex: 1; }
.content > .page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .4); }
  .menu-btn { display: inline-flex; }
  .toolbar, .content { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Abschnitte: Linie statt Karte ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card > header { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); min-height: 44px; }
.card > header h2 { flex: 1; }
.card .body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
@media (max-width: 480px) { .grid.two { grid-template-columns: 1fr; } }

/* Statuszeile: ein Satz statt Kennzahl-Kacheln */
.statusline { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.statusline b { color: var(--text); font-weight: 600; }
.statusline .sep { margin: 0 .5em; color: var(--line-strong); }

/* Schlüssel-Wert-Liste (Informationen zu …) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 22px; padding: 14px 16px; }
.kv dt { color: var(--text-2); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.meter { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; background: var(--text-2); }
.meter.hot > i { background: var(--warn); } .meter.crit > i { background: var(--bad); }

/* ---------- Bedienelemente ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 5px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--sunken); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.icon { padding: 0; width: 32px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-group { display: inline-flex; gap: 4px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s); min-height: 32px; padding: 5px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: 16px; min-height: 16px; height: 16px; accent-color: var(--accent); }
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--text-2); font-size: 12.5px; } .err { color: var(--bad); font-size: 12.5px; }
.search { position: relative; max-width: 320px; flex: 1; }
.search input { padding-left: 30px; }
.search svg { position: absolute; left: 9px; top: 8px; width: 16px; height: 16px; color: var(--text-2); }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { appearance: none; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border-radius: 99px; background: var(--line-strong); cursor: pointer; border: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--sunken); border-radius: var(--radius-s); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; padding: 4px 11px; min-height: 28px; border-radius: 5px; cursor: pointer; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line-strong); }
.seg button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface); }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; }
th button:hover { color: var(--text); }
th button:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--sunken); }
td.num, th.num { text-align: right; }
td .sub { display: block; color: var(--text-2); font-size: 12.5px; }
td.wrapcell { white-space: normal; min-width: 200px; }

/* Zustand: Symbol + Text, keine Hintergrundpillen */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.info { color: var(--info); }
.pill.warn::before { border-radius: 1px; transform: rotate(45deg); }
.pill.bad::before { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pill.plain { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 6px; color: var(--text-2); }
.pill.plain::before { display: none; }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; }

/* ---------- Schichtenkarte (eigene Idee): Proxy → Lobby → Planeten ---------- */
.tiers { padding: 4px 16px 12px; }
.tier { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 10px 0; position: relative; }
.tier::before { content: ""; position: absolute; left: 0; top: 22px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.tier:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 34px; bottom: -22px; border-left: 2px solid var(--line-strong); }
.tier-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 9px 0 0 22px; }
.tier-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.node { --pc: var(--text-2); display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-width: 156px; padding: 8px 12px 10px; border: 1px solid var(--line-strong); border-left: 3px solid var(--pc); border-radius: var(--radius-s); background: var(--surface); text-decoration: none; color: var(--text); position: relative; }
.node:hover { background: var(--sunken); }
.node b { font-weight: 600; }
.node .meta { grid-column: 1 / -1; color: var(--text-2); font-size: 12.5px; }
.node .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sunken); }
.node .bar i { display: block; height: 100%; background: var(--pc); opacity: .8; }
.node.off { border-style: dashed; border-left-style: solid; color: var(--text-2); }
.node.off .bar { display: none; }
.node .st { grid-column: 2; justify-self: end; }
@media (max-width: 560px) { .tier { grid-template-columns: 1fr; } .tier-name { padding-top: 0; } .tier::before { top: 14px; } .tier:not(:last-child)::after { top: 26px; bottom: -14px; } .tier-name { padding-left: 22px; } }

/* ---------- Konsole ---------- */
.console { background: #0b0d10; color: #dfe3ea; border-radius: var(--radius-s); font: 12.5px/1.55 var(--mono); height: 420px; overflow: auto; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); }
.console .l-warn { color: #f0b64e; } .console .l-err { color: #ff7d73; }
.cmdline { display: flex; gap: 8px; margin-top: 10px; } .cmdline input { font-family: var(--mono); }

/* ---------- Dialog, Toast, Hinweise ---------- */
dialog { border: 1px solid var(--line-strong); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .35); width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.wide { width: min(800px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(5 7 10 / .55); }
dialog form { display: flex; flex-direction: column; max-height: inherit; }
dialog .dh { padding: 18px 20px 4px; } dialog .dh h2 { font-size: 16px; }
dialog .db { padding: 10px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
dialog .df { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: var(--radius-s); display: flex; gap: 10px; align-items: flex-start; animation: pop .16s ease-out; }
.toast.err { background: var(--bad); color: #fff; }
.toast svg, .banner svg, .empty svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }
.empty { padding: 36px 20px; color: var(--text-2); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.empty b { color: var(--text); font-weight: 600; font-size: 14px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-s); background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.banner.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.skeleton { background: var(--sunken); border-radius: 6px; min-height: 18px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.setting { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .txt { flex: 1; min-width: 0; } .setting .txt b { display: block; font-weight: 600; }
.setting .ctl { width: 220px; flex: none; display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .setting { flex-wrap: wrap; } .setting .ctl { width: 100%; justify-content: flex-start; } .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-box { width: min(400px, 100%); }
.login-box .brand { padding: 0 0 22px; font-size: 15px; }
.login-box h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 6px; }
.codebox { font: 600 24px/1 var(--mono); letter-spacing: .16em; text-align: center; text-transform: uppercase; min-height: 54px; }
.steps { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: s; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; }
.steps li::before { content: counter(s); flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; margin-top: 1px; }
.steps b { color: var(--text); font-family: var(--mono); font-weight: 600; }

.palette { padding: 0; width: min(540px, calc(100vw - 32px)); margin-top: 12vh; }
.palette input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 46px; font-size: 15px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); cursor: pointer; }
.palette li svg { width: 16px; height: 16px; color: var(--text-2); }
.palette li[aria-selected="true"] { background: var(--sunken); box-shadow: inset 2px 0 0 var(--accent); }
kbd { font: 600 11.5px var(--mono); padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text-2); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .btn, .card, .node { border: 1px solid CanvasText; } }

.svc { display: flex; align-items: center; gap: 10px; }
.dot { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-2); font: 11px var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .b-BAN, .legend.b-BAN::before { fill: var(--bad); background: var(--bad); }
.chart .b-MUTE, .legend.b-MUTE::before { fill: var(--warn); background: var(--warn); }
.chart .b-KICK, .legend.b-KICK::before { fill: var(--info); background: var(--info); }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.legend::before { content: ""; width: 10px; height: 10px; border-radius: 2px; }
.actions-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.actions-row:last-child { border-bottom: 0; }
.actions-row .txt { flex: 1; min-width: 200px; } .actions-row .txt b { display: block; font-weight: 600; }
.note { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.note:last-child { border-bottom: 0; } .note .txt { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
