:root {
  color-scheme: dark;
  --bg: #04060b; --card: rgba(12,17,28,.72); --text: #e6edf7; --muted: #7d8aa3; --line: rgba(80,140,255,.14);
  --accent: #2f8cff; --accent-2: #1a6fe0; --cyan: #3ad6ff; --green: #22d39a; --red: #ff4d6a; --amber: #ffb547; --blue: #3aa0ff;
  --side: rgba(5,8,14,.92); --side-text: #9fb0cc; --radius: 12px;
  --shadow: 0 0 0 1px rgba(47,140,255,.05), 0 10px 40px -20px rgba(0,0,0,.8);
  --glow: 0 0 18px rgba(47,140,255,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(47,140,255,.16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(58,214,255,.08), transparent 60%),
    linear-gradient(rgba(47,140,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,140,255,.045) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px; background-attachment: fixed; }
::selection { background: rgba(47,140,255,.45); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #1a2436; border-radius: 10px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; color: #9fd0ff; background: rgba(47,140,255,.1); border: 1px solid rgba(47,140,255,.15); padding: 1px 5px; border-radius: 4px; }
h1 { font-size: 22px; letter-spacing: .01em; font-weight: 650; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h3 { font-size: 12px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); font-weight: 600; }
.mt { margin-top: 22px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.red { color: var(--red); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.trunc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--side); border-right: 1px solid var(--line); backdrop-filter: blur(12px); color: var(--side-text); display: flex; flex-direction: column;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #fff; padding: 4px 10px 22px; line-height: 1.25; }
.brand.big { color: #fff; font-size: 14px; padding: 0 0 18px; justify-content: center; text-shadow: 0 0 18px rgba(47,140,255,.6); }
.brand:hover { text-decoration: none; }
.logo { flex: none; width: 30px; height: 30px; position: relative; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: linear-gradient(135deg, var(--cyan), var(--accent) 60%, #0b3a8a); box-shadow: var(--glow); }
.logo::after { content: ""; position: absolute; inset: 7px; clip-path: inherit; background: #050810; }
.logo::before { content: ""; position: absolute; inset: 12px; z-index: 1; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { color: var(--side-text); padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; transition: all .15s; }
.sidebar nav a:hover { background: rgba(47,140,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(47,140,255,.2), rgba(47,140,255,.03)); border-color: rgba(47,140,255,.3); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.nav-label { text-transform: uppercase; font-size: 10.5px; letter-spacing: .2em; color: #3f5577; margin: 16px 10px 6px; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 12px 10px 0; display: grid; gap: 8px; }
.sidebar-foot .me { color: #fff; font-weight: 600; }
.pill { font-size: 10px; background: rgba(47,140,255,.25); border: 1px solid rgba(47,140,255,.4); color: #fff; border-radius: 99px; padding: 1px 7px; vertical-align: middle; }
.content { flex: 1; padding: 26px 32px 60px; min-width: 0; max-width: 1400px; }
.center-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex: none; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .content { padding: 18px 14px 50px; }
}

/* Cards */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.card::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(58,214,255,.55), transparent); pointer-events: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 16px; }
.grid-side { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start; }
.grid2 > .card, .grid-side > .card { margin-bottom: 18px; }
@media (max-width: 1000px) { .grid2, .grid3, .grid-side { grid-template-columns: 1fr; } }
.form-wide { max-width: 980px; }
.empty { text-align: center; padding: 40px; }

/* Server-Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.server-card { color: var(--text); display: grid; gap: 8px; transition: transform .1s, border-color .1s; margin: 0; }
.server-card:hover { text-decoration: none; border-color: rgba(47,140,255,.55); transform: translateY(-2px); box-shadow: var(--glow); }
.sc-top { display: flex; align-items: center; gap: 8px; }
.sc-top strong { flex: 1; font-size: 15px; }
.sc-ips { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-res { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; display: inline-block; flex: none; }
.dot.running { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 2px var(--green); } }
.dot.stopped { background: #9ca3af; }
.dot.paused { background: var(--amber); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.stats .card { margin: 0; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.big { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; margin: 2px 0 6px; }
.small-big { font-size: 15px; }
.meter { height: 4px; background: rgba(47,140,255,.1); border-radius: 99px; overflow: hidden; margin: 4px 0 8px; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--cyan)); box-shadow: 0 0 8px rgba(58,214,255,.6); border-radius: 99px; transition: width .5s; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.charts canvas { width: 100%; height: 140px; display: block; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.node { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.node:last-child { border: 0; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.table tbody tr:hover td { background: rgba(47,140,255,.04); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 6px 8px; }
.table input { padding: 5px 8px; margin: 0; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 24px 6px 0; width: 180px; vertical-align: top; }
.kv td { padding: 6px 0; }
.w-xs { width: 70px !important; } .w-s { width: 100px !important; } .w-m { width: 150px !important; }

/* Formulare */
label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(3,6,12,.7); color: var(--text); font: inherit; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,140,255,.18), var(--glow); }
input[type=checkbox], input[type=radio] { width: auto; display: inline-block; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--accent); }
label.check { display: flex; align-items: center; font-weight: 400; }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }
.row-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-form input { width: auto; flex: 1; min-width: 150px; margin: 0; }
details { margin-bottom: 14px; }
summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
form.inline { display: inline; }
.os-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.os-option { display: flex; align-items: flex-start; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; cursor: pointer; margin: 0; font-weight: 400; }
.os-option:has(input:checked) { border-color: var(--accent); background: rgba(47,140,255,.08); box-shadow: var(--glow); }
.os-option input { margin-top: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(47,140,255,.22); background: rgba(10,16,28,.8); transition: all .15s;
  color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(47,140,255,.25); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.loading { opacity: .7; cursor: progress; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #1458c8); border-color: rgba(58,214,255,.5); color: #fff; box-shadow: 0 0 16px rgba(47,140,255,.35); }
.btn-primary:hover { background: linear-gradient(135deg, #46a0ff, var(--accent)); box-shadow: 0 0 24px rgba(47,140,255,.55); }
.btn-green { background: rgba(34,211,154,.12); border-color: rgba(34,211,154,.5); color: var(--green); }
.btn-green:hover { border-color: var(--green); box-shadow: 0 0 14px rgba(34,211,154,.35); }
.btn-danger { color: var(--red); border-color: rgba(255,77,106,.4); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-ghost { background: transparent; color: var(--side-text); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.power { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dropdown { position: relative; display: inline-block; }
.dropdown .menu { display: none; position: absolute; right: 0; top: 110%; background: #0a101c; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 200px; z-index: 20; padding: 4px; }
.dropdown.open .menu { display: block; }
.menu form { display: block; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; color: var(--text); font: inherit; cursor: pointer; }
.menu-item:hover { background: rgba(47,140,255,.12); }

/* Badges, Hinweise */
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; vertical-align: middle; }
.b-green { background: rgba(34,211,154,.08); color: var(--green); }
.b-red { background: rgba(255,77,106,.08); color: var(--red); }
.b-blue { background: rgba(58,160,255,.08); color: var(--blue); }
.b-grey { background: rgba(125,138,163,.08); color: var(--muted); }
.flash { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; border: 1px solid; border-left-width: 3px; backdrop-filter: blur(8px); }
.flash-ok { background: rgba(34,211,154,.06); border-color: rgba(34,211,154,.35); }
.flash-err { background: rgba(255,77,106,.07); border-color: rgba(255,77,106,.4); }
.flash-warn { background: rgba(255,181,71,.06); border-color: rgba(255,181,71,.4); }
.taskbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; background: rgba(47,140,255,.08);
  border: 1px solid rgba(47,140,255,.35); box-shadow: var(--glow); margin-bottom: 14px; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(58,214,255,.2); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.danger-zone { border-color: rgba(255,77,106,.35); }
.danger-zone::before { background: linear-gradient(90deg, transparent, rgba(255,77,106,.6), transparent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: #fff; border-bottom-color: var(--cyan); font-weight: 600; text-shadow: 0 0 12px rgba(58,214,255,.5); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 5px 11px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: rgba(47,140,255,.25); color: #fff; box-shadow: inset 0 0 0 1px var(--accent); }

/* Login / Setup */
.auth-card { position: relative; width: 100%; max-width: 410px; background: var(--card); border: 1px solid rgba(47,140,255,.25); border-radius: 16px; padding: 32px;
  box-shadow: 0 0 60px -10px rgba(47,140,255,.35); backdrop-filter: blur(14px); }
.auth-card::before { content: ""; position: absolute; left: 30px; right: 30px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { justify-content: center; font-size: 20px; margin-bottom: 14px; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 20px; gap: 6px; counter-reset: s; }
.steps li { flex: 1; font-size: 12.5px; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.on { color: #fff; border-color: var(--cyan); font-weight: 600; box-shadow: 0 -6px 12px -8px var(--cyan); }
.steps li.done { border-color: var(--green); }
.credentials { display: grid; gap: 8px; margin: 16px 0; }
.credentials div { display: flex; align-items: center; gap: 12px; }
.credentials span { width: 80px; }
.credentials code { font-size: 15px; padding: 5px 10px; cursor: pointer; }
code.copied::after { content: " ✓ kopiert"; color: var(--green); }
.qr { background: #fff; display: inline-block; padding: 10px; border-radius: 8px; }
.qr svg { display: block; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* Konsole */
.console-body { background: #000; height: 100vh; display: flex; flex-direction: column; }
.console-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #05080f; border-bottom: 1px solid var(--line); color: #ddd; }

.spacer { flex: 1; }
#screen { flex: 1; overflow: hidden; display: flex; justify-content: center; align-items: center; }
#screen > div { width: 100%; height: 100%; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: #0a101c; color: var(--text); width: min(520px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.5); }

/* Logo */
.brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand.big { align-items: center; }
.brand-logo { display: block; width: 168px; height: auto; filter: drop-shadow(0 0 14px rgba(47,140,255,.35)); }
.brand.big .brand-logo { width: 240px; }
.brand-sub { font-size: 10.5px; letter-spacing: .42em; color: var(--cyan); font-weight: 600; text-transform: uppercase; padding-left: 2px; text-shadow: 0 0 10px rgba(58,214,255,.5); }

/* Traffic & Pakete */
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0 16px; }
@media (max-width: 1000px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.meter.warn span { background: linear-gradient(90deg, var(--amber), var(--red)); box-shadow: 0 0 8px rgba(255,77,106,.6); }
.sc-traffic { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 8px; }
.sc-traffic .meter { margin: 0; }
.stat-link { color: var(--text); }
.stat-link:hover { text-decoration: none; border-color: rgba(47,140,255,.5); }
[data-traffic-chart] { width: 100%; height: 220px; display: block; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lg-a { background: var(--accent); } .lg-b { background: var(--cyan); margin-left: 10px; }
.w-auto { width: auto; margin: 0; padding: 5px 10px; }
.traffic-line { margin-bottom: 6px; }
.plans input { min-width: 0; }
.new-row td { background: rgba(47,140,255,.04); }
.tls-modes { display: grid; gap: 8px; margin-bottom: 14px; }
.fp-box { border: 1px solid rgba(255,181,71,.4); border-radius: 10px; padding: 16px; background: rgba(255,181,71,.05); margin-bottom: 14px; }
code.fp { display: block; font-size: 13px; padding: 10px; word-break: break-all; line-height: 1.6; margin: 10px 0; color: #fff; letter-spacing: .02em; }
