/* Cerberus.AI – Admin-Panel. Dunkel, leuchtendes Rot, Pixel-Logo. Keine Abhängigkeiten. */
:root {
  color-scheme: dark;
  --bg: #0a0b0e;
  --bg-2: #0f1116;
  --panel: #13161c;
  --panel-2: #181c24;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e4e7ec;
  --muted: #8f96a3;
  --faint: #5c6370;
  --red: #ff2a3a;
  --red-dim: rgba(255, 42, 58, 0.14);
  --green: #4fd38a;
  --yellow: #f3c54b;
  --orange: #ff8a3d;
  --purple: #b48cff;
  --blue: #5aa9ff;
  --radius: 14px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Oswald', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--red); }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
::selection { background: rgba(255, 42, 58, 0.35); }

.boot { height: 100vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.boot img { width: 132px; image-rendering: pixelated; filter: drop-shadow(0 0 12px rgba(255, 42, 58, 0.5)); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 20%, rgba(255, 42, 58, 0.14), transparent 70%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 32px 30px 28px; background: var(--panel); border: 1px solid rgba(255, 42, 58, 0.3); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 42, 58, 0.08); text-align: center; }
.login-card img { width: 160px; image-rendering: pixelated; filter: drop-shadow(0 0 2px #ff2a3a) drop-shadow(0 0 16px rgba(255, 42, 58, 0.5)); }
.login-card h1 { margin: 10px 0 2px; font: 700 28px/1 var(--display); letter-spacing: 0.1em; }
.login-card h1 b { color: var(--red); text-shadow: 0 0 12px rgba(255, 42, 58, 0.6); }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 10px; text-align: left; }
.login-card .error { color: #ff7b85; font-size: 13px; min-height: 18px; margin: 0; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px; background: var(--bg-2); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand img { width: 44px; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(255, 42, 58, 0.5)); }
.brand b { display: block; font: 700 16px/1 var(--display); letter-spacing: 0.1em; }
.brand b span { color: var(--red); }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.search { position: relative; margin: 0 4px 12px; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--faint); }
.nav { display: grid; gap: 2px; }
.nav .group { margin: 10px 8px 4px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a.is-active { color: var(--text); background: var(--red-dim); box-shadow: inset 2px 0 0 var(--red); }
.nav a .count { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 11px; font-weight: 700; color: var(--muted); }
.side-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13px; }
.side-foot .who small { color: var(--faint); font-size: 11.5px; }

.main { padding: 22px 26px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font: 700 30px/1 var(--display); letter-spacing: 0.04em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.topbar .right { display: flex; gap: 8px; align-items: center; }

/* ---------- Bausteine ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 0; }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-body { padding: 14px 18px 18px; }
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); }
.dash-mid { grid-template-columns: minmax(0, 3fr) 330px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.btn:hover { background: #1f2430; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 18px rgba(255, 42, 58, 0.25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8d95; border-color: rgba(255, 42, 58, 0.35); }
.btn.danger:hover { background: var(--red-dim); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); }
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; font-family: 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); outline: none; }
label.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.seg button { height: 28px; padding: 0 11px; background: none; border: 0; border-radius: 7px; color: var(--muted); font-weight: 700; font-size: 12px; }
.seg button.is-active { background: var(--panel-2); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.chip.green { color: var(--green); background: rgba(79, 211, 138, 0.12); border-color: rgba(79, 211, 138, 0.3); }
.chip.red { color: #ff8d95; background: var(--red-dim); border-color: rgba(255, 42, 58, 0.35); }
.chip.yellow { color: var(--yellow); background: rgba(243, 197, 75, 0.12); border-color: rgba(243, 197, 75, 0.3); }
.chip.orange { color: var(--orange); background: rgba(255, 138, 61, 0.12); border-color: rgba(255, 138, 61, 0.3); }
.chip.grey { color: var(--muted); background: rgba(255, 255, 255, 0.06); border-color: var(--line-2); }
.chip.blue { color: var(--blue); background: rgba(90, 169, 255, 0.12); border-color: rgba(90, 169, 255, 0.3); }
.chip.purple { color: var(--purple); background: rgba(180, 140, 255, 0.12); border-color: rgba(180, 140, 255, 0.3); }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pulse i { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 6px transparent; } }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 12px; }
.empty { padding: 36px 16px; text-align: center; color: var(--faint); }
.empty img { width: 90px; image-rendering: pixelated; opacity: 0.35; margin-bottom: 8px; }

/* Server-Karte */
.server-card { padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 118px; }
.server-card h2 { margin: 0; font: 700 28px/1.05 var(--display); letter-spacing: 0.02em; }
.server-card .meta { color: var(--muted); font-size: 13px; }
.facts { padding: 18px 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: center; }
.fact { display: grid; gap: 2px; }
.fact small { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.fact small svg { width: 14px; height: 14px; }
.fact b { font: 600 20px/1.2 var(--display); }
.fact b.ok { color: var(--green); }
.fact b.bad { color: var(--red); }

/* Hauptkurve */
.chart-panel .panel-body { padding-top: 6px; }
.big-number { font: 700 32px/1 var(--display); }
.chart { width: 100%; height: 260px; display: block; }
.chart .grid-line { stroke: rgba(255, 255, 255, 0.06); }
.chart .axis { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--red); stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 42, 58, 0.6)); }
.chart .area { fill: url(#areaFill); }
.chart .dot { fill: var(--red); }
.chart .hover-line { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 9px; background: #1c2029; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -120%); }

/* Stat-Karten mit Sparkline */
.stat { position: relative; overflow: hidden; padding: 16px 18px 0; min-height: 150px; }
.stat small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat b { display: block; margin-top: 2px; font: 700 30px/1.1 var(--display); }
.stat svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70px; display: block; }
.stat .spark { fill: none; stroke-width: 2; stroke-linejoin: round; }
.stat .spark-fill { opacity: 0.18; }
.stat.c-yellow .spark { stroke: var(--yellow); filter: drop-shadow(0 0 5px rgba(243, 197, 75, 0.7)); } .stat.c-yellow .spark-fill { fill: var(--yellow); }
.stat.c-orange .spark { stroke: var(--orange); filter: drop-shadow(0 0 5px rgba(255, 138, 61, 0.7)); } .stat.c-orange .spark-fill { fill: var(--orange); }
.stat.c-red .spark { stroke: var(--red); filter: drop-shadow(0 0 5px rgba(255, 42, 58, 0.7)); } .stat.c-red .spark-fill { fill: var(--red); }
.stat.c-purple .spark { stroke: var(--purple); filter: drop-shadow(0 0 5px rgba(180, 140, 255, 0.7)); } .stat.c-purple .spark-fill { fill: var(--purple); }
.stat .delta { position: absolute; top: 16px; right: 18px; }

/* Schnellaktionen */
.quick { display: grid; gap: 10px; align-content: start; min-width: 0; }
.quick .btn { justify-content: flex-start; height: 42px; }
.recent { display: grid; gap: 6px; }
.recent .row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; background: var(--bg-2); border-radius: 10px; font-size: 12.5px; }
.recent .row .chip { flex: none; }
.recent .row img { width: 22px; height: 22px; border-radius: 5px; image-rendering: pixelated; }
.recent .row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .row time { color: var(--faint); font-size: 11.5px; white-space: nowrap; flex: none; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 12px; color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: rgba(255, 255, 255, 0.025); }
.player-cell { display: flex; align-items: center; gap: 10px; }
.player-cell img { width: 28px; height: 28px; border-radius: 7px; image-rendering: pixelated; background: var(--bg-2); }
.player-cell b { display: block; }
.player-cell small { color: var(--faint); font-size: 11px; }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: 280px; }

/* Monitoring */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mon-card { padding: 14px; display: grid; gap: 10px; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.mon-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.mon-card.is-flag { border-color: rgba(243, 197, 75, 0.45); }
.mon-card.is-block { border-color: rgba(255, 42, 58, 0.6); box-shadow: 0 0 24px rgba(255, 42, 58, 0.12); }
.mon-head { display: flex; align-items: center; gap: 10px; }
.mon-head img { width: 40px; height: 40px; border-radius: 9px; image-rendering: pixelated; background: var(--bg-2); }
.mon-head b { display: block; font-size: 14px; }
.mon-head small { color: var(--faint); font-size: 11.5px; }
.mon-head .shield { margin-left: auto; width: 22px; height: 22px; }
.shield.ok { color: var(--green); filter: drop-shadow(0 0 5px rgba(79, 211, 138, 0.6)); }
.shield.warn { color: var(--yellow); }
.shield.bad { color: var(--red); filter: drop-shadow(0 0 5px rgba(255, 42, 58, 0.7)); }
.shield.none { color: var(--faint); }
.mon-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mon-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; }
.mon-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* Spieler-Detail (Schublade) */
.drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(560px, 100%); overflow: auto; background: var(--bg-2); border-left: 1px solid var(--line); box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5); animation: slide 0.2s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.drawer-head img { width: 56px; height: 56px; border-radius: 12px; image-rendering: pixelated; }
.drawer-head h2 { margin: 0; font: 700 24px/1 var(--display); }
.drawer-head .uuid { color: var(--faint); font-size: 11px; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 18px 20px; display: grid; gap: 16px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; font-size: 13px; }
.kv div { display: grid; gap: 1px; padding: 8px 10px; background: var(--panel); border-radius: 9px; }
.kv small { color: var(--faint); font-size: 11px; }
.history { display: grid; gap: 6px; }
.history .row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 8px 10px; background: var(--panel); border-radius: 9px; font-size: 12.5px; }
.history .row time { color: var(--faint); font-size: 11.5px; }
.history .row .reason { color: var(--muted); word-break: break-word; }
.mods { display: flex; flex-wrap: wrap; gap: 5px; }

/* Modal */
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.modal { width: min(440px, 100%); padding: 22px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); display: grid; gap: 12px; animation: slide-up 0.18s ease; }
@keyframes slide-up { from { transform: translateY(12px); opacity: 0; } }
.modal h3 { margin: 0; font: 700 20px/1.1 var(--display); letter-spacing: 0.03em; }
.modal .row-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.modal .target { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-2); border-radius: 10px; }
.modal .target img { width: 30px; height: 30px; border-radius: 7px; image-rendering: pixelated; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); padding: 10px 16px; background: #1c2029; border: 1px solid var(--line-2); border-radius: 12px; font-weight: 600; font-size: 13px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); animation: slide-up 0.18s ease; }
.toast.error { border-color: rgba(255, 42, 58, 0.5); color: #ff8d95; }
.toast.ok { border-color: rgba(79, 211, 138, 0.4); color: var(--green); }

.warn-box { padding: 12px 14px; border-radius: 10px; background: rgba(243, 197, 75, 0.1); border: 1px solid rgba(243, 197, 75, 0.3); color: #ffd98a; font-size: 13px; }
.info-box { padding: 12px 14px; border-radius: 10px; background: rgba(90, 169, 255, 0.08); border: 1px solid rgba(90, 169, 255, 0.25); color: #a9ccff; font-size: 13px; }
.danger-box { padding: 12px 14px; border-radius: 10px; background: var(--red-dim); border: 1px solid rgba(255, 42, 58, 0.35); color: #ff9aa1; font-size: 13px; }

@media (max-width: 1100px) {
  .dash-top, .dash-mid, .cols-4, .cols-3 { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .dash-top, .dash-mid, .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Utility-Klassen (CSP erlaubt keine Inline-Styles) */
.u-s125 { font-size: 12.5px; } .u-s12 { font-size: 12px; } .u-s11 { font-size: 11px; } .u-s115 { font-size: 11.5px; } .u-s18 { font-size: 18px; }
.u-nowrap { white-space: nowrap; } .u-m0 { margin: 0; } .u-mt14 { margin-top: 14px; } .u-mb14 { margin-bottom: 14px; } .u-pt8 { padding: 8px 0 0; } .u-p0 { padding: 0; }
.u-label { font-size: 12px; font-weight: 700; margin-bottom: 6px; } .u-grid12 { display: grid; gap: 12px; } .u-grid10 { display: grid; gap: 10px; } .u-grid8 { display: grid; gap: 8px; }
.u-right { text-align: right; } .u-rel { position: relative; } .u-ann { min-height: 90px; font-family: var(--font); } .u-reason { max-width: 380px; word-break: break-word; font-size: 12px; }
.u-scroll { max-height: 360px; overflow: auto; } .u-pick { margin: 4px 4px 0 0; } .u-chips { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; } .u-end { justify-content: flex-end; }
.u-check { flex-direction: row; align-items: center; display: flex; gap: 10px; } .u-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; } .u-flex8 { display: flex; gap: 8px; }
.u-red { color: var(--red); } .u-green { color: var(--green); }

/* Screenshots */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.shot-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shot-card { margin: 0; overflow: hidden; cursor: zoom-in; }
.shot-card > img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.shot-card figcaption { padding: 10px 12px; display: grid; gap: 4px; }
.shot-who { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.shot-who img { width: 20px; height: 20px; border-radius: 5px; image-rendering: pixelated; }
.shot-reason { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-card time { color: var(--faint); font-size: 11.5px; }
.modal.is-wide { width: min(1280px, 100%); }
.lightbox img { display: block; width: 100%; border-radius: 10px; background: #000; }
.shot-link { cursor: pointer; margin-left: 4px; }
