/* ===========================================================================
   SV3N.APP – Dashboard / Admin / Pending  (modernes Design-System)
   =========================================================================== */
@font-face {
  font-family: "Space Grotesk";
  src: url("/dashboard/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --bg:        #0e1014;
  --bg-elev:   #14171f;
  --bg-elev2:  #181c25;
  --border:    #232834;
  --border-2:  #2c3340;
  --text:      #e8eaed;
  --muted:     #9aa3af;
  --faint:     #6b7280;
  --accent:    #ff8a2a;
  --accent-2:  #ffa657;
  --accent-soft: rgba(255, 138, 42, .12);
  --danger:    #ff5d5d;
  --danger-soft: rgba(255, 93, 93, .12);
  --ok:        #3ecf8e;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 8px 24px rgba(0, 0, 0, .38);
  --hi:        inset 0 1px 0 rgba(255, 255, 255, .045);
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* etwas hellerer, modernerer Grundverlauf */
  background:
    linear-gradient(165deg, #1a1f2b 0%, #12151d 45%, #0e1014 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Dynamischer, heller Aurora-Hintergrund (mehrere bewegte Farbflächen + sanftes Farb-Atmen) */
/* Refined: zwei ruhige, kaum gesättigte Glows statt fünf bunter Flächen +
   Hue-Rotation. ponytail: weniger Farbebenen, kein filter-Animate -> Control-Room. */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 48% at 14% 12%, rgba(255, 138, 42, .16), transparent 62%),
    radial-gradient(38% 46% at 86% 22%, rgba(88, 101, 242, .13), transparent 62%);
  animation: auroraDrift 48s ease-in-out infinite alternate,
             auroraBreath 22s ease-in-out infinite;
  will-change: transform, opacity;
}
body::after {
  content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(30% 38% at 66% 32%, rgba(255, 138, 42, .07), transparent 62%),
    radial-gradient(32% 40% at 30% 66%, rgba(88, 101, 242, .07), transparent 62%);
  animation: auroraDrift2 56s ease-in-out infinite alternate;
  will-change: transform;
}
/* feines Grid als oberste, sehr dezente Ebene */
html::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at 50% 18%, #000, transparent 82%);
          mask-image: radial-gradient(circle at 50% 18%, #000, transparent 82%);
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(3%, -2.5%, 0) scale(1.08) rotate(1.5deg); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.13) rotate(-1.5deg); }
}
@keyframes auroraDrift2 {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  100% { transform: translate3d(4%, -3%, 0) scale(1.15); }
}
/* sanftes "Atmen" – dezenter Helligkeits-Puls, bringt Leben ohne Ablenkung */
@keyframes auroraBreath {
  0%, 100% { opacity: .78; }
  50%      { opacity: 1; }
}
/* zusätzliche, sehr langsame Tiefen-Ebene (Parallax) – bewusst sehr dezent */
html::after {
  content: ""; position: fixed; inset: -15%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(26% 34% at 12% 64%, rgba(88, 101, 242, .08), transparent 62%),
    radial-gradient(24% 30% at 88% 38%, rgba(255, 138, 42, .06), transparent 62%);
  animation: auroraDrift3 58s ease-in-out infinite alternate,
             auroraBreath 19s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes auroraDrift3 {
  0%   { transform: translate3d(0, 0, 0) scale(1.10); }
  100% { transform: translate3d(-5%, 4%, 0) scale(1.20); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, html::after { animation: none; }
}

a { color: inherit; }
.accent { color: var(--accent); }
.muted  { color: var(--muted); }
.mono   { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: .92rem; font-weight: 600;
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(255,255,255,.03);
  color: var(--text); cursor: pointer; text-decoration: none;
  transition: all .16s ease; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent-soft); border-color: rgba(255,138,42,.4); color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: rgba(255,138,42,.22); }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }

/* ---------- Cards / Pages (Admin, Pending) ---------- */
.page { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.hint { color: var(--accent); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.fineprint { color: var(--faint); font-size: .88rem; }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); font-size: .82rem;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.online  { color: var(--ok);     background: rgba(62,207,142,.12); }
.badge.offline { color: var(--faint);  background: rgba(255,255,255,.05); }

/* ===========================================================================
   Dashboard-Layout
   =========================================================================== */
.app {
  max-width: min(2100px, 96vw); margin: 22px auto; padding: 0 18px 60px;
  display: grid; grid-template-columns: 280px 1fr; gap: 20px;
  align-items: start;
}
/* ---------- Server-Optionen (Umschalter-Menü + Command-Palette) ---------- */
.server-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent;
  color: var(--text); cursor: pointer; text-align: left;
  font: inherit; font-size: .92rem; transition: all .14s ease;
}
.server-item:hover { background: rgba(255,255,255,.04); }
.server-item.active { border-color: rgba(255,138,42,.4); background: var(--accent-soft); color: var(--accent); }
.server-item .ico { font-size: 1.15rem; }
.server-item .nm  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.server-item .dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(62,207,142,.6); }

/* ---------- Content ---------- */
.content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.server-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}

/* Custom Bild-Icon für Server (statt Emoji). em-basiert -> skaliert mit dem
   jeweiligen Kontext (Serverliste, Kopfzeile, Admin, System) automatisch mit. */
.srv-icon-img {
  height: 1.15em;
  width: 1.15em;
  object-fit: cover;
  border-radius: 5px;
  vertical-align: -0.22em;
  display: inline-block;
}

/* ---- Spieler (FRM) ---- */
.players-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.players-head strong { font-size: 1.05rem; }
.players-list { display: flex; flex-direction: column; gap: 8px; }
.player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
}
.player-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.player-dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(62,207,142,.6); }
.player-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-hp { color: #ff7a7a; font-size: .85rem; white-space: nowrap; }
.player-tag.dead { color: var(--faint); font-size: .8rem; }
.players-history { margin-top: 18px; }
.players-history > summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 6px 0; }
.players-hist { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 320px; overflow: auto; }
.hist-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; padding: 5px 8px; border-radius: 7px; }
.hist-row.join  { background: rgba(62,207,142,.07); }
.hist-row.leave { background: rgba(255,120,120,.06); }
.hist-ev { width: 110px; flex-shrink: 0; font-weight: 600; }
.hist-row.join  .hist-ev { color: var(--ok); }
.hist-row.leave .hist-ev { color: #ff8a8a; }
.hist-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-time { color: var(--faint); font-size: .78rem; white-space: nowrap; }

/* ---- Zustimmungs-Status im Bearbeiten-Modal ---- */
.pm-consent { display: flex; flex-direction: column; gap: 3px; padding: 10px 13px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; border: 1px solid transparent; }
.pm-consent.ok { background: rgba(62,207,142,.09); border-color: rgba(62,207,142,.25); }
.pm-consent.pending { background: rgba(255,176,80,.09); border-color: rgba(255,176,80,.28); }
.pm-consent-meta { color: var(--muted); font-size: .8rem; }
.pm-consent .mono { color: var(--faint); }

/* ---- Ankündigungen (Admin) ---- */
.ann-form { display: flex; flex-direction: column; gap: 12px; }
.ann-form textarea {
  width: 100%; resize: vertical; min-height: 54px; box-sizing: border-box;
  padding: 10px 12px; border-radius: 9px; font: inherit;
  background: rgba(255,255,255,.04); color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
}
.ann-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.ann-row .fld { min-width: 150px; }
.ann-row .fld.grow { flex: 1; min-width: 220px; }
.ann-row .chk { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.ann-item {
  display: flex; gap: 12px; align-items: center; padding: 11px 14px;
  border-radius: 10px; margin-bottom: 8px;
  background: rgba(255,255,255,.03); border-left: 4px solid var(--faint);
}
.ann-item.lvl-info { border-left-color: #63a0ff; }
.ann-item.lvl-warn { border-left-color: #ffb050; }
.ann-item.lvl-critical { border-left-color: #ff5050; }
.ann-item-main { flex: 1; min-width: 0; }
.ann-item-txt { font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.ann-item-meta { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.ann-form textarea { white-space: pre-wrap; }

/* ---- Admin-Launcher (Kacheln zum Öffnen der Verwaltungs-Modals) ---- */
.admin-launcher h1 { font-size: 1.5rem; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 22px 0; }
.admin-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  padding: 18px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); color: var(--text);
  transition: background .15s, border-color .15s, transform .12s;
}
.admin-tile:hover { background: var(--accent-soft); border-color: rgba(255,138,42,.4); transform: translateY(-2px); }
.admin-tile .ico { font-size: 1.7rem; line-height: 1; margin-bottom: 4px; }
.admin-tile .lbl { font-weight: 700; font-size: 1.02rem; }
.admin-tile .sub { color: var(--muted); font-size: .8rem; }
.admin-quick { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.server-head h1 { font-size: 1.25rem; font-weight: 700; }
.server-head .sub { color: var(--faint); font-size: .82rem; }
.server-head .controls { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.placeholder {
  display: grid; place-items: center; min-height: 50vh;
  color: var(--faint); text-align: center; gap: 10px;
}
.placeholder[hidden] { display: none; }   /* sonst gewinnt display:grid gegen [hidden] */
.placeholder .big { font-size: 3rem; opacity: .5; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; }
.tab {
  border: 1px solid var(--border); background: rgba(255,255,255,.02);
  color: var(--muted); padding: 9px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; font-size: .9rem; transition: all .14s ease;
}
.tab:hover { color: var(--accent); border-color: var(--accent); }
.tab.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.tabpanel { display: none; }
.tabpanel.active { display: block; }

/* ---------- Panel-Box ---------- */
.panel {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}

/* ---------- Console ---------- */
.console {
  height: 56vh; min-height: 340px; overflow: auto;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #0a0c10; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem; line-height: 1.55; color: #c9ced6; white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.console::-webkit-scrollbar { width: 10px; }
.console::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
/* Console-Syntax-Highlighting */
.console .c-line { display: block; }
.console .c-bracket { color: #5b6472; }
.console .c-date    { color: var(--accent-2); }
.console .c-time    { color: var(--accent); font-weight: 600; }
.console .c-info    { color: #4aa3ff; font-weight: 600; }
.console .c-warn    { color: #ffcf4d; font-weight: 600; }
.console .c-error   { color: #ff6b6b; font-weight: 700; }
.console .c-debug   { color: #7b8494; }
.console .c-line.l-warn  { background: rgba(255, 207, 77, .06); }
.console .c-line.l-error { background: rgba(255, 107, 107, .08); }
.cmdbar { margin-top: 12px; display: flex; gap: 10px; }
.cmdbar input {
  flex: 1; height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(255,255,255,.03);
  color: var(--text); padding: 0 14px; outline: none; font: inherit;
  font-family: ui-monospace, monospace;
}
.cmdbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmdbar input:disabled { opacity: .5; }

/* ---------- Dateimanager ---------- */
.files-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.breadcrumb {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: .9rem; color: var(--muted); flex: 1; min-width: 200px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.breadcrumb a:hover { color: var(--accent); background: var(--accent-soft); }
.breadcrumb .sep { color: var(--faint); }

.filetable { width: 100%; border-collapse: collapse; }
.filetable th {
  text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.filetable td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .9rem; }
.filetable tr:hover td { background: rgba(255,255,255,.025); }
.filetable .fname { display: flex; align-items: center; gap: 9px; }
.filetable .fname .fi { font-size: 1.05rem; }
.filetable .clickable { cursor: pointer; }
.filetable .clickable:hover { color: var(--accent); }
.filetable .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.size { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--bg-elev2); border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 12px 16px; box-shadow: var(--shadow); font-size: .9rem; max-width: 360px;
  animation: toastIn .2s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.ok  { border-left-color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Admin: Tabelle + Rechte-Matrix ---------- */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top;
}
.admin-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); }
.row-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row-banned { background: rgba(255, 93, 93, .06); }
.ban-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px; border: 1px solid rgba(255, 93, 93, .3); border-radius: var(--radius-sm);
  background: rgba(255, 93, 93, .05); margin-top: 4px;
}
.ban-form input { flex: 1; min-width: 160px; }
select.role, input, select {
  font: inherit; color: var(--text); background: var(--bg-elev2);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; outline: none;
}
select.role:focus, input:focus { border-color: var(--accent); }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.perm-server { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.perm-server > summary.perm-srv-head {
  display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; list-style: none;
}
.perm-server > summary.perm-srv-head::-webkit-details-marker { display: none; }
.perm-server .srv-caret { color: var(--faint); transition: transform .15s ease; flex-shrink: 0; }
.perm-server[open] .srv-caret { transform: rotate(90deg); }
.perm-server .perm-count {
  font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.06); padding: 2px 8px; border-radius: 999px;
}
.perm-server .caps-wrap { margin-top: 10px; }
.pm-quick { display: flex; gap: 6px; margin-bottom: 8px; }
.perm-server .caps { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); padding: 0; }
.dim { opacity: .5; }
details.user-row > summary { cursor: pointer; list-style: none; }
details.user-row > summary::-webkit-details-marker { display: none; }

/* ---------- Modal (Texteditor) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100001; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-elev); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow); width: min(960px, 100%); max-height: 88vh; display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head .name { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .x { cursor: pointer; color: var(--muted); background: none; border: none; font-size: 1.3rem; padding: 4px 8px; border-radius: 8px; }
.modal-head .x:hover { color: var(--danger); background: var(--danger-soft); }
/* Datei-Editor-Textarea (nur der Editor, NICHT jede Modal-Textarea) */
#editorArea {
  flex: 1; min-height: 50vh; resize: none; border: none; outline: none; background: #0a0c10; color: #d6dae0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.5;
  padding: 16px; white-space: pre; tab-size: 4;
}
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .info { color: var(--faint); font-size: .82rem; flex: 1; min-width: 120px; }
.modal-body { flex: 1; overflow: auto; padding: 18px; }
.pm-avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); }
.pm-danger {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 93, 93, .3); background: rgba(255, 93, 93, .05);
}
.pm-danger > summary.pm-danger-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-weight: 700; color: #ff8a8a;
}
.pm-danger > summary.pm-danger-head::-webkit-details-marker { display: none; }
.pm-danger .srv-caret { color: #ff8a8a; transition: transform .15s ease; }
.pm-danger[open] .srv-caret { transform: rotate(90deg); }
.pm-danger-body { margin-top: 12px; }
.pm-purge { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 12px; }
.pm-danger-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Befehls-Sperrliste */
.cmd-block { margin-top: 12px; }
.cmd-block label { display: block; font-size: .76rem; color: var(--faint); margin-bottom: 4px; }
.cmd-block input { width: 100%; }

/* Audit-/Aktivitäts-Modal */
.au-h { font-size: .9rem; color: var(--text); margin: 16px 0 8px; font-weight: 700; }
.au-h:first-child { margin-top: 0; }
.au-list { display: flex; flex-direction: column; gap: 5px; }
.au-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: .84rem; background: rgba(255, 255, 255, .015);
}
.au-when { color: var(--faint); font-variant-numeric: tabular-nums; min-width: 132px; }
.au-act { font-weight: 600; }
.au-det { font-family: ui-monospace, monospace; font-size: .78rem; }
.au-ua { font-size: .76rem; }

/* ---------- Server-Verwaltung (Admin) ---------- */
.srv-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: rgba(255,255,255,.015); }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.srv-grid .full { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.fld input { width: 100%; }
.srv-card > summary.srv-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
}
.srv-card > summary.srv-head::-webkit-details-marker { display: none; }
.srv-card .srv-head .grow { flex: 1; }
.srv-card .srv-caret { color: var(--faint); transition: transform .15s ease; flex-shrink: 0; }
.srv-card[open] .srv-caret { transform: rotate(90deg); }
.srv-card > .srv-grid { margin-top: 12px; }
.srv-card-actions { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- Online/Offline-Ring um Avatar (Verwaltung) ---------- */
.user-cell .av { position: relative; flex-shrink: 0; }
.user-cell .av img { display: block; }
.user-cell .av.online img  { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--ok); }
.user-cell .av.offline img { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--danger); }
.user-cell .av .ind {
  position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px;
  border-radius: 50%; border: 2px solid var(--bg-elev); background: var(--faint);
}
.user-cell .av.online  .ind { background: var(--ok); }
.user-cell .av.offline .ind { background: var(--danger); }

/* ---------- Lockdown-Banner ---------- */
.lockbar {
  display: none; align-items: center; gap: 10px; margin: 0 auto 14px;
  max-width: min(2100px, 96vw); padding: 12px 16px;
  border: 1px solid rgba(255, 93, 93, .4); background: rgba(255, 93, 93, .12);
  border-radius: var(--radius-sm); color: #ffb3b3; font-weight: 600;
}
.lockbar.on { display: flex; }
.lockbar .ico { font-size: 1.15rem; }

/* ---------- Footer ---------- */
.sv3n-footer {
  margin-top: 40px; padding: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--faint); font-size: .8rem; display: flex; gap: 8px;
  justify-content: center; align-items: center; flex-wrap: wrap;
}
.sv3n-footer a { color: var(--faint); text-decoration: none; }
.sv3n-footer a:hover { color: var(--accent); }
.sv3n-footer .sep { opacity: .5; }

/* ---------- Erstanmelde-Hinweis ---------- */
#consent {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 9000; max-width: 560px; width: calc(100% - 32px);
  background: var(--bg-elev2); border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 14px 16px;
  display: none; align-items: center; gap: 14px; font-size: .88rem; color: var(--muted);
}
#consent.show { display: flex; }
#consent a { color: var(--accent); text-decoration: none; }
#consent a:hover { text-decoration: underline; }
#consent .btn { white-space: nowrap; }

/* ---------- Vorschau-/Test-Modus ---------- */
#previewFrame {
  display: none; position: fixed; inset: 0; z-index: 99990; pointer-events: none;
  border: 4px solid #a855f7; box-shadow: inset 0 0 28px rgba(168, 85, 247, .35);
}
body.preview-mode #previewFrame { display: block; }
#previewBar {
  display: none; position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 99991; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff;
  padding: 9px 12px 9px 18px; border-radius: 999px; box-shadow: 0 10px 30px rgba(124, 58, 237, .5);
  font-size: .9rem; font-weight: 600; max-width: calc(100% - 24px);
}
body.preview-mode #previewBar { display: flex; }
#previewBar b { font-weight: 800; }
#previewBar .btn { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .45); color: #fff; white-space: nowrap; }
#previewBar .btn:hover { background: rgba(255, 255, 255, .34); color: #fff; border-color: #fff; }

/* ---------- System-Auslastung ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.stat-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 12px; }
.stat-big { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sys-chart { width: 100%; height: 90px; display: block; }
.sys-bar { height: 9px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 12px; }
.sys-bar.sm { height: 7px; margin-top: 4px; }
.sys-bar .fill { height: 100%; width: 0; border-radius: 999px; transition: width .5s ease, background .5s ease; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .92rem; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }

.srv-stat {
  display: grid; grid-template-columns: minmax(160px, 1.4fr) 1fr 1fr; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.srv-stat:last-child { border-bottom: none; }
.srv-stat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.srv-stat-metric .lbl { font-size: .82rem; color: var(--muted); margin-bottom: 2px; }
.srv-stat-metric .lbl b { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .srv-stat { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Legal-Seiten ---------- */
.legal { line-height: 1.65; color: var(--muted); }
.legal h2 { color: var(--text); font-size: 1.05rem; margin: 20px 0 8px; }
.legal p { margin-bottom: 8px; }
.legal ul { margin: 6px 0 12px 22px; }
.legal li { margin-bottom: 4px; }

/* ===========================================================================
   Mobile-Korrekturen
   =========================================================================== */
img, canvas { max-width: 100%; }

@media (max-width: 760px) {
  .app { padding: 0 12px 48px; gap: 14px; }
  .page { padding: 0 12px; margin: 16px auto; }
  .card { padding: 18px 14px; }

  /* Server-Kopf: Steuerbuttons unter den Titel, volle Breite */
  .server-head { padding: 14px; }
  .server-head .controls { margin-left: 0; width: 100%; }

  /* Dateitabelle horizontal scrollbar */
  .filetable {
    display: block; width: 100%; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Userverwaltung: Tabelle -> gestapelte Karten (alles sichtbar & bedienbar) */
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr {
    border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .015);
  }
  .admin-table td { border: none; padding: 5px 0; }
  .admin-table td.nowrap { white-space: normal; }
  .admin-table .row-btns { justify-content: flex-start; margin-top: 8px; }
  .ban-form input { flex: 1 1 100%; }

  .tabs { flex-wrap: wrap; }
  .modal-overlay { padding: 10px; }
  .modal { max-height: 92vh; }
  .modal textarea { min-height: 40vh; }
  .files-toolbar { gap: 8px; }
  .breadcrumb { width: 100%; }

  /* Modal-Fußzeile: Info auf eigene Zeile, Buttons immer sichtbar */
  .modal-foot .info { flex: 1 1 100%; order: -1; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 480px) {
  .srv-switch-main .nm { font-size: 1.02rem; }
  .srv-switch > .ico { font-size: 1.3rem; }
  .stat-big { font-size: 1.55rem; }
  .btn { padding: .55rem .8rem; font-size: .88rem; }
  .btn-sm { padding: .4rem .6rem; }
  .console { height: 50vh; font-size: .8rem; }
  /* Steuerbuttons gleichmäßig verteilen */
  .server-head .controls { flex-wrap: wrap; }
  .server-head .controls .btn { flex: 1 1 auto; justify-content: center; }
}

/* ===========================================================================
   Refined Control Room — Politur (Typo, Tiefe, Puls, Labels)
   Additiv am Dateiende, damit die Regeln sicher gewinnen.
   =========================================================================== */
h1, h2, .server-head h1, .stat-big, .admin-tile .lbl, .admin-launcher h1 {
  font-family: var(--font-display);
  letter-spacing: -.01em;
}

/* Tiefe: feine obere Lichtkante statt schwerer Schatten */
.server-head, .panel { box-shadow: var(--hi); }
.card, .stat-card, .modal    { box-shadow: var(--hi), var(--shadow); }

/* Status-Badges als Control-Room-Mikrolabel */
.badge { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }

/* Online-Status pulsiert dezent (Serverliste + Spielerliste + Badge) */
@keyframes pulseOn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, .45); }
  50%      { box-shadow: 0 0 0 5px rgba(62, 207, 142, 0); }
}
.server-item .dot.on, .player-dot.on { animation: pulseOn 2.4s ease-in-out infinite; }
.badge.online::before                { animation: pulseOn 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .server-item .dot.on, .player-dot.on, .badge.online::before { animation: none; }
}

/* Adress-Chip: neutraler Theme-Look statt weißem Default-Button + Kopier-Feedback */
#svAddress {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
#svAddress::before { display: none; }               /* kein Status-Punkt vor der Adresse */
#svAddress:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
#svAddress.copied { animation: copyPop .45s ease; }
@keyframes copyPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.08); color: var(--ok); border-color: var(--ok); background: rgba(62, 207, 142, .15); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { #svAddress.copied { animation: none; } }

/* Spielerzahl in der Sidebar-Zeile: klein & gedämpft, damit der Status-Punkt
   der Blickfang bleibt. Sitzt (durch .nm flex:1) direkt links neben dem Punkt. */
.server-item .srv-players {
  font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums;
  flex-shrink: 0; white-space: nowrap; opacity: .9;
}

/* ===========================================================================
   Command Deck — Server-Umschalter (Kopf) + Command-Palette (⌘K)
   Sidebar entfällt; Console + Steuerung bekommen die volle Breite.
   Additiv am Dateiende -> überschreibt sicher das alte Zweispalten-Grid.
   =========================================================================== */
.app { grid-template-columns: 1fr; max-width: min(1400px, 94vw); }

/* Der Kopf trägt das Dropdown -> relativ positionieren */
.server-head { position: relative; }

/* --- Der Wählschalter selbst (Signatur-Element) --- */
.srv-switch {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(255,255,255,.03);
  color: var(--text); cursor: pointer; font: inherit; text-align: left;
  transition: border-color .16s ease, background .16s ease;
}
.srv-switch:hover, .srv-switch.open { border-color: var(--accent); background: var(--accent-soft); }
.srv-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.srv-switch > .ico { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.srv-switch-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.srv-switch-main .nm {
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srv-switch-main .sub {
  color: var(--faint); font-size: .74rem; font-family: ui-monospace, SFMono-Regular, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.srv-switch-led { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.srv-switch-led.online { background: var(--ok); box-shadow: 0 0 10px rgba(62,207,142,.7); animation: pulseOn 2.4s ease-in-out infinite; }
.srv-switch-caret { color: var(--faint); flex-shrink: 0; font-size: .78rem; transition: transform .18s ease; }
.srv-switch.open .srv-switch-caret { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .srv-switch-led.online { animation: none; } }

/* --- Dropdown-Menü am Deck --- */
.srv-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 288px; max-width: min(380px, 90vw); max-height: 60vh; overflow: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--bg-elev2); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow), var(--hi);
}
.srv-menu[hidden] { display: none; }

/* --- Command-Palette (⌘K) --- */
.palette-overlay {
  position: fixed; inset: 0; z-index: 100002;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
}
.palette-overlay[hidden] { display: none; }
.palette {
  width: min(560px, 100%); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elev2); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow), var(--hi);
  animation: paletteIn .16s ease;
}
@keyframes paletteIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .palette { animation: none; } }
.palette-input {
  border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  background: transparent; color: var(--text); font: inherit; font-size: 1.05rem;
  padding: 16px 18px; outline: none;
}
.palette-input::placeholder { color: var(--faint); }
.palette-list { display: flex; flex-direction: column; gap: 4px; padding: 8px; max-height: 52vh; overflow: auto; }
.palette-list .empty, .srv-menu .empty { color: var(--faint); font-size: .88rem; padding: 12px; text-align: center; }
/* Tastatur-Vorauswahl in Menü + Palette */
.srv-menu .server-item.kbd-active,
.palette-list .server-item.kbd-active { border-color: rgba(255,138,42,.4); background: var(--accent-soft); }
.palette-hint {
  padding: 10px 16px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: .76rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}

/* Tastenkappen (Palette-Hinweis + Platzhalter) */
kbd {
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: .72rem; line-height: 1.4;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-2);
  border-radius: 5px; padding: 1px 6px; color: var(--muted);
}

/* Platzhalter-Hinweis (kein Server gewählt) */
.placeholder .ph-hint { display: flex; gap: 5px; align-items: center; color: var(--faint); font-size: .82rem; }

/* Mobil: Deck + Menü über die volle Breite */
@media (max-width: 760px) {
  .srv-switch { width: 100%; }
  .srv-menu { left: 0; right: 0; min-width: 0; max-width: none; }
}
