/* ===== MythosNetwork Panel CSS ===== */
/* Schrift-Regel wie auf der Website: MinecraftFive nur fuer Buttons, Badges und Brand, Inter fuer alles andere.
   Beide liegen auf unserem Server (keine Google-Fonts: Sie wuerden die IP-Adresse der Besucher an Google senden). */

@font-face {
  font-family: 'MinecraftFive';
  src: url('/fonts/minecraft-five-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== THEME VARIABLES ===== */
:root {
  --bg-body: #070b12;
  --bg-card: #0f1827;
  --bg-input: #14213a;
  --bg-nav: rgba(7, 11, 18, 0.84);
  --bg-sidebar: #0a111b;
  --border: #1c2b44;
  --border-hover: #2b4266;
  --border-accent: #2f9bff;
  --text: #e4edf5;
  --text-muted: #7a95ad;
  --text-dim: #4a6a85;
  --accent: #2f9bff;
  --accent-hover: #1a7de6;
  --accent-glow: rgba(47, 155, 255, 0.2);
  --accent-light: #60b8ff;
  --green: #22c55e;
  --green-bg: rgba(34,197,94,0.1);
  --yellow: #eab308;
  --yellow-bg: rgba(234,179,8,0.1);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.1);
  --font-mc: 'MinecraftFive', monospace;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="light"] {
  --bg-body: #c8eefb;
  --bg-card: #ffffff;
  --bg-input: #e4f3fb;
  --bg-nav: rgba(200, 238, 251, 0.92);
  --bg-sidebar: #d6f0fc;
  --border: #8ecde8;
  --border-hover: #5cb8d9;
  --border-accent: #2f9bff;
  --text: #0f2d3d;
  --text-muted: #2e5468;
  --text-dim: #5a8a9e;
  --accent: #2f9bff;
  --accent-hover: #0074e0;
  --accent-glow: rgba(47, 155, 255, 0.15);
  --accent-light: #1a88f0;
  --green: #16a34a;
  --green-bg: rgba(34,197,94,0.12);
  --yellow: #ca8a04;
  --yellow-bg: rgba(234,179,8,0.12);
  --red: #dc2626;
  --red-bg: rgba(239,68,68,0.1);
}

/* ===== RESET ===== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: -1;
}

[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
}

a { color: var(--accent-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); }
[data-theme="light"] a { color: var(--accent); }
[data-theme="light"] a:hover { color: var(--accent-hover); }

img.pixel { image-rendering: pixelated; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; position: relative; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pixelPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 16px 4px var(--accent-glow); }
}

body.loaded .page-header { animation: fadeInUp 0.4s ease backwards; }
body.loaded .card { animation: fadeInUp 0.4s ease backwards; }
body.loaded .card:nth-child(2) { animation-delay: 0.06s; }
body.loaded .card:nth-child(3) { animation-delay: 0.12s; }
body.loaded .stats-grid { animation: fadeInUp 0.35s ease backwards; }
body.loaded .panel-sidebar { animation: slideInLeft 0.35s ease backwards; }
body.loaded .panel-main { animation: fadeIn 0.4s ease 0.1s backwards; }
body.loaded .auth-card { animation: fadeInUp 0.45s ease backwards; }

/* ===== TOP NAVIGATION ===== */
.topnav {
  background: var(--bg-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 3px solid var(--border);
  box-shadow: 0 4px 24px rgba(15,45,61,0.08);
}

.topnav-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tn-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Home: gefüllter Pixel-Button mit Haus, damit er sofort auffällt (vorher ein dünner Rahmen, der leicht übersehen wurde). */
.tn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 11px;
  font-family: var(--font-mc);
  font-size: 0.95rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
  color: #fff !important;
  background: var(--accent);
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: rgba(255,255,255,0.5);
  border-left-color: rgba(255,255,255,0.4);
  border-bottom-color: #1565c0;
  border-right-color: #0d47a1;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2), 0 3px 0 rgba(0,0,0,0.22);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}

.tn-back:hover {
  background: #5bb0ff;
  transform: translateY(1px);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2), 0 2px 0 rgba(0,0,0,0.22);
}

.tn-back:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.25);
}

/* ===== NAMENSPRÜFUNG (Registrierung, Schritt 3) ===== */
.mcv-steps {
  list-style: none;
  margin: 18px 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.mcv-steps li { display: flex; gap: 12px; align-items: flex-start; }

.mcv-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mc);
  color: #fff;
  background: var(--accent);
  border: 3px solid rgba(255,255,255,0.3);
  border-bottom-color: #1565c0;
  border-right-color: #0d47a1;
}

.mcv-steps li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
/* Die Pixelschrift ist breit: Beschriftungen dürfen umbrechen und sind etwas kleiner, damit nichts über den Knopf hinausragt. */
.mcv-steps .btn-mc { white-space: normal; text-align: center; font-size: 0.9rem; padding-left: 10px; padding-right: 10px; }
.mcv-steps strong { color: var(--text); }
.mcv-steps small { color: var(--text-dim); line-height: 1.4; }

/* Auswahl des Weges (Server beitreten / Test-Skin) */
.mcv-tabs { display: flex; gap: 0; margin: 14px 0 6px; border: 3px solid var(--border); }
.mcv-tabs a {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  font-family: var(--font-mc);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  background: transparent;
}
.mcv-tabs a + a { border-left: 3px solid var(--border); }
.mcv-tabs a.on { color: #fff !important; background: var(--accent); }

/* Adresse zum Kopieren */
.mcv-copy { display: flex; gap: 8px; align-items: stretch; }
.mcv-copy input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-family: Consolas, Menlo, monospace;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-input);
  border: 3px solid var(--border);
}
.mcv-copy .btn-mc { font-size: 0.8rem; padding: 6px 10px; }

.mcv-status {
  padding: 8px 12px;
  border: 2px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.mcv-status.ok { border-style: solid; border-color: #34c77b; color: #34c77b; }
.mcv-status.err { border-style: solid; border-color: var(--red); color: var(--red); }

.tn-back svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  fill: currentColor;
  stroke: none;
  shape-rendering: crispEdges;
}

.tn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mc);
  font-size: 1.1rem;
  color: var(--text) !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tn-brand:hover { color: var(--accent-light) !important; }
.tn-brand img { image-rendering: pixelated; }

/* Center navigation */
.tn-center {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  padding: 0 16px;
}

.tn-center a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted) !important;
  padding: 8px 12px;
  position: relative;
  transition: all 0.2s;
  white-space: nowrap;
}

.tn-center a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%; width: 0; height: 3px;
  background: var(--accent);
  transition: width 0.25s, left 0.25s;
}

.tn-center a:hover { color: var(--text) !important; }
.tn-center a.on { color: var(--accent-light) !important; }
.tn-center a.on::after { width: 60%; left: 20%; }

.tn-center a.tab-admin {
  color: var(--yellow) !important;
  border: 2px solid rgba(234,179,8,0.3);
  margin-left: 8px;
}
.tn-center a.tab-admin:hover { border-color: var(--yellow); }
.tn-center a.tab-admin.on::after { background: var(--yellow); }

.nav-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mc);
  font-size: 0.75rem;
  line-height: 1.4;
  vertical-align: 1px;
}

/* Right section */
.tn-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tn-skin {
  width: 32px; height: 32px;
  image-rendering: pixelated;
  border: 3px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.tn-right:hover .tn-skin { border-color: var(--accent); }

.tn-user {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.tn-mc {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
}

.tn-mail {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Theme toggle */
.tn-theme {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.tn-theme:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Logout button */
.btn-out {
  font-family: var(--font-mc);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff !important;
  background: var(--red);
  border: 3px solid rgba(255,255,255,0.2);
  border-bottom-color: #991b1b;
  border-right-color: #991b1b;
  padding: 6px 14px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), 0 3px 0 rgba(0,0,0,0.2);
  flex-shrink: 0;
  transition: all 0.15s;
}

.btn-out:hover {
  background: #e24a4a;
  transform: translateY(1px);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25), 0 2px 0 rgba(0,0,0,0.2);
}

.btn-mc.btn-nav { padding: 6px 16px; }

/* Abmelden ist ein Formular (POST mit Token) - der Button sieht aus wie der frühere Link. */
.tn-logout { display: inline-flex; margin: 0; flex-shrink: 0; }
button.btn-out { cursor: pointer; line-height: 1.4; }

/* Ohne Mitte (Gast, Login) soll der rechte Block trotzdem rechts sitzen. */
.tn-right { margin-left: auto; }
.tn-center + .tn-right { margin-left: 0; }

/* Hamburger und aufklappbares Menü: erscheinen erst, wenn die Mitte nicht mehr passt. */
.tn-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  width: 36px; height: 36px;
  padding: 0 8px;
  background: transparent;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s;
}

.tn-burger:hover { border-color: var(--accent); }

.tn-burger span {
  display: block;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

.tn-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.tn-burger.open span:nth-child(2) { opacity: 0; }
.tn-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.tn-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  max-height: calc(100vh - 63px);
  overflow-y: auto;
  padding: 8px 16px 16px;
  background: var(--bg-sidebar);
  border-bottom: 3px solid var(--border);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.tn-mobile a {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted) !important;
  padding: 13px 8px;
  border-bottom: 2px solid var(--border);
}

.tn-mobile a.on { color: var(--accent-light) !important; }
.tn-mobile a.tab-admin { color: var(--yellow) !important; }

.tn-mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}

.tn-mobile-user > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.tn-mobile .tn-mail { display: block; max-width: none; }

/* ===== PANEL LAYOUT (sidebar pages) ===== */
.panel-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px;
  gap: 40px;
  min-height: calc(100vh - 130px);
  position: relative;
}

.panel-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}

.sidebar-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 12px 10px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  width: 100%;
  text-align: left;
  line-height: 1.4;
}

.sidebar-link:hover {
  background: var(--bg-input);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(47,155,255,0.1);
  border-left-color: var(--accent);
  color: var(--accent-light);
}

.sidebar-link svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; flex-shrink: 0;
  stroke-linecap: square; stroke-linejoin: miter;
}

.sidebar-link.active svg { stroke: var(--accent-light); }

.sidebar-divider {
  height: 2px;
  background: var(--border);
  margin: 10px 0;
}

.sidebar-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 12px 12px 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.panel-main {
  min-width: 0;
}

/* Tab panes for JS-powered tabs */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease; }

/* ===== PAGE HEADER ===== */
.page-header { margin: 0 0 20px; }

.page-header h1,
.manage-header h1 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.25;
}

.page-header p,
.manage-header p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.9rem;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  padding: 18px;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 20px rgba(47,155,255,0.06);
  transform: translateY(-2px);
}

.stat-value {
  font-family: var(--font-mc);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--accent-light);
  letter-spacing: 1px;
}

.stat-value.stat-green { color: var(--green); }
.stat-value.stat-yellow { color: var(--yellow); }
.stat-value.stat-red { color: var(--red); }

.stat-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  margin-bottom: 20px;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.card-header {
  padding: 12px 20px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
}

.card-body { padding: 20px; }

.card-narrow { max-width: 560px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  letter-spacing: 0.8px;
  white-space: nowrap;
  text-transform: uppercase;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.85rem;
}

.data-table tr { transition: background 0.15s; }
.data-table tr:hover td { background: rgba(47,155,255,0.03); }

.mono { font-family: 'Courier New', monospace; font-size: 0.85rem; font-weight: 700; }
.text-strong { font-weight: 700; }
.text-red { color: var(--red); }
.text-small { font-size: 0.8rem; color: var(--text-muted); }
.text-muted { color: var(--text-dim); font-size: 0.85rem; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  font-family: var(--font-mc);
  font-size: 0.8rem;
  line-height: 1.3;
  padding: 2px 8px;
  letter-spacing: 0.5px;
  border: 2px solid;
  text-transform: uppercase;
}

.badge-active { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.badge-pending { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }
.badge-paired { color: var(--accent-light); border-color: var(--accent); background: rgba(47,155,255,0.1); }
.badge-revoked { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.badge-role-admin { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }
.badge-role-user { color: var(--text-muted); border-color: var(--border); }

/* ===== BUTTONS ===== */
.btn-mc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  font-family: var(--font-mc);
  font-size: 1rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: rgba(255,255,255,0.5);
  border-left-color: rgba(255,255,255,0.4);
  box-shadow:
    inset 0 -4px 0 rgba(0,0,0,0.2),
    0 4px 0 rgba(0,0,0,0.22);
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.15);
  transition: all 0.12s;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-mc:hover {
  transform: translateY(2px);
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 2px 0 rgba(0,0,0,0.22);
}

.btn-mc:active {
  transform: translateY(4px);
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.25);
}

.btn-primary {
  background: var(--accent);
  border-bottom-color: #1565c0;
  border-right-color: #0d47a1;
}
.btn-primary:hover { background: #5bb0ff; }

.btn-green {
  background: #34c77b;
  border-bottom-color: #239b59;
  border-right-color: #1a7a44;
}
.btn-green:hover { background: #45d48a; }

.btn-secondary {
  color: var(--text);
  background: var(--bg-card);
  border-color: var(--border);
  text-shadow: none;
}
.btn-secondary:hover { background: var(--bg-input); }

.btn-red {
  background: var(--red);
  border-bottom-color: #991b1b;
  border-right-color: #7f1d1d;
}
.btn-red:hover { background: #e24a4a; }

.btn-full { width: 100%; }

.btn-sm {
  font-family: var(--font-mc);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 2px solid;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  line-height: 1.4;
}

.btn-warn { color: var(--yellow); border-color: var(--yellow); }
.btn-warn:hover { background: var(--yellow-bg); }

.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }

.btn-secondary.btn-sm { color: var(--text-muted); border-color: var(--border); }
.btn-secondary.btn-sm:hover { border-color: var(--border-hover); color: var(--text); }

.btn-disabled, .btn-mc:disabled {
  background: #2a2a3a !important;
  color: #666 !important;
  border-color: #1e1e2e !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.6;
}

[data-theme="light"] .btn-disabled,
[data-theme="light"] .btn-mc:disabled {
  background: #b8d8e8 !important;
  color: #7a9aaa !important;
  border-color: #a0c0d0 !important;
}

.actions-cell { white-space: nowrap; }
.actions-cell > * { display: inline-block; vertical-align: middle; margin-right: 6px; }
.actions-cell > *:last-child { margin-right: 0; }
.data-table .mono { white-space: nowrap; }
.inline-action { display: inline; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder { color: var(--text-dim); }
.form-group input:disabled { opacity: 0.5; }

.inline-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 4px; }

.filter-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.5;
}

.filter-link:hover { color: var(--text-muted); border-color: var(--border); }

.filter-link.active {
  color: var(--accent-light);
  border-color: var(--accent);
  background: rgba(47,155,255,0.08);
}

/* ===== ALERTS ===== */
.alert {
  padding: 10px 16px;
  margin: 0 0 20px;
  border: 2px solid;
  border-left-width: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeInUp 0.3s ease;
}

.alert-success { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.alert-error { color: var(--red); border-color: var(--red); background: var(--red-bg); }

/* ===== AUTH PAGES ===== */
.auth-wrapper {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(15,45,61,0.12);
}

.auth-icon { text-align: center; margin-bottom: 12px; }
.auth-icon img { image-rendering: pixelated; }

.auth-card h1 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.3;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.auth-subtitle strong { color: var(--accent-light); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .form-group { margin-bottom: 0; }

.auth-footer {
  text-align: center;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.code-input {
  text-align: center;
  font-size: 1.6rem !important;
  letter-spacing: 8px;
  font-family: var(--font-mc) !important;
}

/* Registration steps */
.reg-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 24px;
}

.reg-step {
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mc);
  font-size: 1rem;
  background: var(--bg-input);
  border: 3px solid var(--border);
  color: var(--text-muted);
  transition: all 0.3s;
}

.reg-step.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px var(--accent-glow);
  animation: pixelPulse 2s infinite;
}

.reg-step.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.reg-line {
  width: 32px; height: 4px;
  background: var(--border);
}

.reg-line.done { background: var(--green); }

.reg-progress {
  text-align: center;
  margin: 8px 0 20px;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.reg-progress strong { color: var(--accent-light); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state p:first-child {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 2px solid var(--border);
  padding: 18px 0;
  margin-top: 40px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.8rem;
  position: relative;
}

/* ===== POPUP / MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.2s ease;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  padding: 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  animation: fadeInUp 0.3s ease;
}

.modal-card h3 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.3;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* ===== SETTINGS FORMS ===== */
.settings-form .form-group:last-of-type { margin-bottom: 18px; }
.card-text { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ===== DANGER ZONE (delete account) ===== */
.danger-zone {
  border-color: var(--red) !important;
}

.danger-zone .card-header {
  border-bottom-color: var(--red);
}

.danger-zone .card-header h2 {
  color: var(--red);
}

/* ===== HOLD BUTTON ===== */
.btn-hold {
  position: relative;
  overflow: hidden;
}

.btn-hold::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 100%;
  background: rgba(255,255,255,0.15);
  transition: width 3s linear;
}

.btn-hold.holding::before {
  width: 100%;
}

/* ===== RESPONSIVE ===== */
/* Marke, fünf Links und Konto brauchen zusammen rund 1300 px; darunter gibt es das Hamburger-Menü.
   Die E-Mail-Adresse steht in der Leiste erst ab 1700 px, im Menü immer. */
@media (max-width: 1700px) {
  .tn-mail { display: none; }
}

@media (max-width: 1400px) {
  .tn-center { display: none; }
  .tn-burger { display: flex; }
  .tn-center + .tn-right { margin-left: auto; }
  .tn-mobile.open { display: flex; }
}

/* Die Mitte sitzt immer in der Seitenmitte: links (Home, Marke) und rechts (Konto) bekommen gleich viel Platz. */
@media (min-width: 1401px) {
  .tn-left { flex: 1 1 0; }
  .tn-center { flex: 0 0 auto; margin: 0; }
  .tn-center + .tn-right { flex: 1 1 0; justify-content: flex-end; margin-left: 0; }
}

@media (max-width: 960px) {
  .tn-user { display: none; }
  .tn-back span { display: none; }
}

@media (max-width: 900px) {
  .panel-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .panel-sidebar {
    position: static;
    border-bottom: 2px solid var(--border);
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }

  .sidebar-link {
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .sidebar-link.active { border-bottom-color: var(--accent); }

  .sidebar-title { display: none; }
  .sidebar-divider { display: none; }
  .sidebar-label { display: none; }
}

@media (max-width: 800px) {
  .topnav-inner { padding: 0 12px; }
  .tn-user { display: none; }
  .tn-back span { display: none; }
  .tn-brand span { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .inline-form { flex-direction: column; }
  .inline-form .form-group { min-width: 100%; }
  .filter-bar { flex-wrap: wrap; }
}

@media (max-width: 500px) {
  .auth-card { padding: 24px 18px; }
  .page-header h1 { font-size: 1.35rem; }
}

/* Schmale Handys: Abstände in der Kopfzeile verkleinern, damit Logout und Menü nicht abgeschnitten werden. */
@media (max-width: 480px) {
  .topnav-inner { gap: 8px; }
  .tn-left { gap: 8px; }
  .tn-right { gap: 8px; }
  .tn-back { padding: 6px 8px; }
  .btn-out { padding: 6px 10px; }
}

@media (max-width: 360px) {
  .tn-right > .tn-skin { display: none; }
}

/* ===== SERVER CARDS ===== */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.server-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.server-card.inactive { opacity: 0.65; }

.server-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.server-card-name {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.server-card-icon {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-input);
  overflow: hidden;
}

.server-card-icon img { image-rendering: pixelated; }

.server-manage-bar {
  padding: 8px;
  text-align: center;
  font-family: var(--font-mc);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== SPACING UTILITIES ===== */
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 14px; }
.mt-lg { margin-top: 20px; }

/* ===== SERVER MANAGE / CONFIG PAGES ===== */
.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.manage-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .manage-columns { grid-template-columns: 1fr; }
}

.console-output {
  background: #0b1018;
  color: #8fd18f;
  font-size: 0.8rem;
  padding: 14px;
  height: 360px;
  overflow-y: auto;
  border: 2px solid var(--border);
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
}

.command-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: flex-end;
}

.command-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.checkbox-lg {
  width: 22px;
  height: 22px;
}

/* ===== a.btn-mc TEXT COLOR FIX =====
   [data-theme="light"] a { color: var(--accent); } hat hoehere Spezifitaet
   (Attribut+Element) als .btn-mc { color: #fff; } (nur eine Klasse) und
   gewinnt dadurch im Light-Theme. Diese kombinierten Selektoren sind
   spezifischer und gewinnen zuverlaessig, in beiden Themes. */
a.btn-mc.btn-primary,
a.btn-mc.btn-green { color: #fff; }
a.btn-mc.btn-secondary { color: var(--text); }

/* =====================================================================
   v30: Live-Status, Server-Verwaltung, Einstellungen, Ablaufdatum
   ===================================================================== */

/* Das hidden-Attribut muss auch gegen display:flex/grid gewinnen. */
[hidden] { display: none !important; }

/* Seiten ohne Seitenleiste: Luft unter der Kopfzeile (vorher klebte die Überschrift direkt am Rand). */
main.container { padding-top: 32px; padding-bottom: 12px; }

.card-narrow { max-width: 680px; }

/* ---------- Status-Anzeige: Closed / Starting / Running ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 10px;
  font-family: var(--font-mc);
  font-size: 0.85rem;
  line-height: 1.4;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 2px solid var(--border);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: currentColor;
}

.status-running { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.status-running .status-dot { animation: statusPulse 2s ease-in-out infinite; }
.status-starting { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }
.status-starting .status-dot { animation: statusBlink 0.9s steps(2, jump-none) infinite; }
.status-closed { color: var(--red); border-color: var(--red); background: var(--red-bg); }
.status-expired { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes statusBlink {
  0% { opacity: 1; }
  100% { opacity: 0.2; }
}

.badge-expired { color: var(--yellow); border-color: var(--yellow); background: var(--yellow-bg); }

/* Lizenz-Ablauf */
.expiry-none { color: var(--text-dim); }
.expiry-soon { color: var(--yellow); font-weight: 700; }
.expiry-expired { color: var(--red); font-weight: 700; }
.expiry-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.stats-grid-5 { grid-template-columns: repeat(5, 1fr); }

.stat-value.stat-small { font-size: 1.25rem; padding: 6px 0; }

/* Kleine Auswahl-Knöpfe */
.chip {
  padding: 4px 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.chip:hover { color: var(--text); border-color: var(--accent); }

.btn-compact { padding: 6px 16px; font-size: 0.9rem; }

/* ---------- Server-Übersicht ---------- */
.server-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.server-card-top {
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
}

.server-card-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.server-card-icon { width: 46px; height: 46px; }

.server-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 20px;
}

.server-meta dt {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.server-meta dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------- Server-Verwaltung ---------- */
.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.manage-title { min-width: 0; }

.manage-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.manage-title-row h1 { overflow-wrap: anywhere; }

.manage-title p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 10px;
}

.manage-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.manage-actions .btn-mc { padding: 6px 18px; }

.live-tiles { margin-bottom: 24px; }

.manage-columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.manage-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.manage-side .card,
.console-card { margin-bottom: 0; }

.console-output {
  height: 380px;
  padding: 14px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #8fd18f;
  background: #0b1018;
  border: 2px solid var(--border);
  white-space: normal;
}

.console-output:focus-visible { outline: 3px solid var(--accent-glow); }

.console-output .c-cmd {
  margin-top: 12px;
  font-weight: 700;
  color: #7ec8ff;
  overflow-wrap: anywhere;
}

.console-output .c-cmd:first-child { margin-top: 0; }
.console-output .c-cmd::before { content: '> '; color: #4a6a85; }

.console-output .c-out {
  padding-left: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.console-output .c-out:empty { display: none; }
.console-output .c-pending,
.console-output .c-dispatched { color: #e0b341; font-style: italic; }

.c-empty {
  padding: 90px 12px;
  text-align: center;
  color: #4a6a85;
  white-space: normal;
}

.console-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 2px solid var(--border);
}

.player-row img { flex-shrink: 0; }

.player-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-empty {
  padding: 14px 8px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.quick-form { margin-bottom: 20px; }
.quick-form:last-child { margin-bottom: 0; }

.quick-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-row { display: flex; gap: 8px; }

.quick-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-input);
  border: 2px solid var(--border);
}

.quick-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.info-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.info-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.info-list > div:first-child { padding-top: 0; }

.info-list dt { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.info-list dd { margin: 0; font-size: 0.86rem; text-align: right; overflow-wrap: anywhere; }

/* ---------- Mod-Einstellungen ---------- */
.cfg-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cfg-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cfg-search input {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-input);
  border: 2px solid var(--border);
}

.cfg-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.cfg-tabs { display: flex; flex-direction: column; gap: 2px; }

.cfg-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cfg-tab small {
  padding: 1px 7px;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-input);
}

.cfg-tab:hover { color: var(--text); background: var(--bg-input); }

.cfg-tab.active {
  color: var(--accent-light);
  background: rgba(47, 155, 255, 0.1);
  border-left-color: var(--accent);
}

.cfg-note {
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--yellow-bg);
  border: 2px solid var(--yellow);
}

.cfg-main { min-width: 0; }
.cfg-main .card { margin-bottom: 20px; }
.cfg-main .card-header { align-items: baseline; }
.cfg-main .card-body { padding-top: 8px; padding-bottom: 8px; }

/* Suche: alle Kategorien zeigen, nur Treffer behalten */
.cfg-layout.searching .tab-pane { display: block; }
.cfg-layout .tab-pane.no-match { display: none; }

.cfg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, box-shadow 0.15s;
}

.cfg-row:last-child { border-bottom: none; }

.cfg-row.changed {
  background: rgba(47, 155, 255, 0.07);
  box-shadow: inset 3px 0 0 var(--accent);
}

.cfg-info { min-width: 0; }

.cfg-info label {
  display: block;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.cfg-info p { margin-top: 2px; font-size: 0.82rem; line-height: 1.45; color: var(--text-muted); }

.cfg-key {
  display: inline-block;
  margin-top: 5px;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.cfg-control { flex-shrink: 0; }

/* Schalter */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; cursor: pointer; }

.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 3px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  transition: transform 0.15s, background 0.15s;
}

.switch input:checked + .switch-track { background: var(--green-bg); border-color: var(--green); }
.switch input:checked + .switch-track .switch-thumb { background: var(--green); transform: translateX(24px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-glow); }

/* Zahlenfeld mit Plus und Minus */
.stepper {
  display: inline-flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 2px solid var(--border);
}

.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.stepper input {
  width: 84px;
  padding: 6px;
  font-family: var(--font-mc);
  font-size: 1rem;
  text-align: center;
  color: var(--text);
  background: transparent;
  border: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.step-btn {
  width: 36px;
  font-family: var(--font-mc);
  font-size: 1.1rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.step-btn:hover { color: var(--accent-light); background: rgba(47, 155, 255, 0.12); }

.cfg-text {
  width: 260px;
  max-width: 100%;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-input);
  border: 2px solid var(--border);
}

.cfg-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Leiste "ungespeicherte Änderungen" */
.cfg-savebar {
  position: sticky;
  bottom: 16px;
  z-index: 50;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 12px 18px;
  font-weight: 700;
  background: var(--bg-card);
  border: 3px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.cfg-save-actions { display: flex; gap: 10px; }

/* ---------- Anmeldung: "Angemeldet bleiben" ---------- */
.check-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.check-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.check-row:hover .check-box { border-color: var(--accent); }
.check-row input:checked + .check-box { background: var(--accent); border-color: var(--accent); }

.check-row input:checked + .check-box::after {
  content: '';
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.check-row input:focus-visible + .check-box { box-shadow: 0 0 0 3px var(--accent-glow); }

.check-text { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.check-text small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-dim); }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .stats-grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .cfg-layout { grid-template-columns: 1fr; }
  .cfg-nav { position: static; }
  .cfg-tabs { flex-direction: row; overflow-x: auto; gap: 4px; }
  .cfg-tab { flex-shrink: 0; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .cfg-tab.active { border-bottom-color: var(--accent); }
  .manage-columns { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .stats-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .server-grid { grid-template-columns: 1fr; }
  .console-output { height: 300px; }
}

@media (max-width: 640px) {
  main.container { padding-top: 20px; }
  .cfg-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cfg-text { width: 100%; }
  .manage-actions { width: 100%; }
  .manage-actions .btn-mc { flex: 1; }
  .cfg-savebar { bottom: 8px; padding: 10px 14px; }
}

/* Servername soll in eine Zeile passen; die Karte füllt die Höhe, damit die Leiste immer unten sitzt. */
.server-card-name { font-size: 1rem; }
.server-card .card-body { flex: 1; }

/* Kacheln der Serveranzeige: gleiche Breite, Pixelschrift kleiner, damit "12,4 ms" und "3 / 20" nicht umbrechen. */
.live-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.live-tiles .stat-value { font-size: 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-tiles .stat-value.stat-small { font-size: 1.05rem; white-space: normal; line-height: 1.35; padding: 5px 0; }
@media (max-width: 800px) {
  .live-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-tiles .stat-value { font-size: 1.25rem; }
}

/* Drei Kacheln (Zustand steht schon oben in der Überschrift); Buttons in schmalen Karten dürfen umbrechen. */
.live-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.manage-columns { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
.manage-side .btn-mc { white-space: normal; text-align: center; line-height: 1.3; }
@media (max-width: 900px) {
  .manage-columns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .live-tiles { grid-template-columns: 1fr; }
}

/* ---------- Bewerbungen (Admin-Tab) ---------- */
.app-settings { margin-bottom: 22px; }
.app-setting-switch { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.app-setting-switch strong { display: block; margin-bottom: 2px; }
.app-filters { flex-wrap: wrap; align-items: center; margin-bottom: 16px; gap: 6px; }
.app-filter-sep { width: 1px; height: 22px; margin: 0 8px; background: var(--border); }
.app-search { margin-left: auto; }
.app-search input { width: 200px; padding: 6px 10px; font-family: var(--font-body); font-size: 0.85rem; color: var(--text); background: var(--bg-input); border: 2px solid var(--border); }
.app-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.app-card { margin-bottom: 14px; border-left-width: 5px; }
.app-card.app-pending { border-left-color: var(--yellow); }
.app-card.app-accepted { border-left-color: var(--green); }
.app-card.app-rejected { border-left-color: var(--red); }
.app-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.app-head-img { width: 48px; height: 48px; flex-shrink: 0; border: 3px solid var(--border); }
.app-head-text { flex: 1; min-width: 0; }
.app-head-text h2 { font-size: 1.1rem; line-height: 1.25; }
.app-details summary { cursor: pointer; padding: 10px 18px 14px; font-weight: 700; font-size: 0.88rem; color: var(--accent-light); list-style: none; }
.app-details summary::-webkit-details-marker { display: none; }
.app-details summary::before { content: '▸ '; }
.app-details[open] summary::before { content: '▾ '; }
.app-details[open] summary { margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.app-answers { display: grid; gap: 12px; padding: 0 18px 14px; margin: 0; }
.app-answers dt { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }
.app-answers dd { margin: 2px 0 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.app-decide, .app-delete { padding: 0 18px 16px; }
.app-delete { padding-top: 4px; }
@media (max-width: 720px) {
  .app-search { margin-left: 0; width: 100%; }
  .app-search input { width: 100%; }
  .app-filter-sep { display: none; }
  .app-head { flex-wrap: wrap; }
}

/* ================================================================
   Design v2 (30.09.2026): Pixelschrift in den Titeln, harte Schatten, mehr Bewegung, breiteres Raster.
   Steht bewusst am Ende und überschreibt ältere Regeln. Gleiche Sprache wie Startseite und Bestenliste.
   ================================================================ */

.page-header h1,
.manage-header h1 { font-family: var(--font-mc); font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: 0.5px; word-spacing: -0.15em; line-height: 1.15; }
.page-header p, .manage-header p { margin-top: 10px; font-size: 0.95rem; }
.page-header { margin-bottom: 26px; }

/* Flächen: harte Kante unten statt weicher Schatten */
.card, .stat-card { box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
[data-theme="light"] .card, [data-theme="light"] .stat-card { box-shadow: 0 4px 0 rgba(15, 45, 61, 0.14); }
.card, .stat-card, .server-card { transition: border-color 0.25s, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s; }
.stat-card:hover, a.server-card:hover, .server-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22), 0 18px 40px -22px var(--accent-glow); }
.card-header h2 { font-family: var(--font-body); }

/* Knöpfe glänzen beim Überfahren */
.btn-mc { position: relative; overflow: hidden; }
.btn-mc::after {
  content: ''; position: absolute; top: 0; left: -70%; width: 40%; height: 100%; pointer-events: none; transform: skewX(-20deg);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.26), transparent); transition: left 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.btn-mc:hover::after { left: 140%; }
.btn-mc:disabled::after, .btn-disabled::after { display: none; }

/* Tabellen: ruhigere Zeilen, klare Kopfzeile */
.data-table th { background: var(--bg-input); border-bottom: 2px solid var(--border-hover); }
.data-table td { transition: background 0.15s; }
.data-table tr:hover td { background: rgba(47, 155, 255, 0.06); }
.table-wrap { border: 2px solid var(--border); overflow-x: auto; }

/* Auf dem Status leuchtet der Punkt */
.status-running .status-dot { animation: pulseDot 2s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Einblenden: Kinder der Seite kommen nacheinander (gesteuert von admin.js über --i) */
body.loaded .stagger > * { animation: fadeInUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms); }
.count-up { font-variant-numeric: tabular-nums; }

/* Anmelden / Registrieren: Karte mit leuchtender Kante und Pixel-Überschrift */
.auth-card { position: relative; border-color: var(--border-hover); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 30px 60px -30px var(--accent-glow); }
.auth-card::before { content: ''; position: absolute; left: -3px; top: -3px; right: -3px; height: 4px; background: linear-gradient(90deg, var(--accent), var(--green)); }
.auth-card h1 { font-family: var(--font-mc); font-weight: 700; letter-spacing: 0.6px; }
.auth-icon img { animation: floatY 4.5s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Tastatur-Fokus überall gut sichtbar */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }


/* Seitenleiste am Handy: nur so breit wie der Bildschirm, die Einträge scrollen seitlich */
@media (max-width: 900px) {
  .panel-layout { grid-template-columns: minmax(0, 1fr); }
  .panel-sidebar { min-width: 0; overflow: hidden; }
  .sidebar-nav { overflow-x: auto; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
