:root {
    --bg: #0A0710; --bg2: #0E0A16;
    --panel: #14101F; --panel-2: #1B1530; --panel-3: #221A38;
    --line: rgba(255,255,255,0.06); --line-strong: rgba(255,255,255,0.10);
    --violet: #8B5CF6; --violet-2: #C084FC; --grad: linear-gradient(135deg,#8B5CF6,#C084FC);
    --text: #ECE8F6; --muted: #8A819F; --dim: #5d556e;
    --danger: #F43F5E; --warn: #FB923C; --ok: #34D399;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Gilroy','Inter','Segoe UI',system-ui,sans-serif; font-size: 14px; }
.hidden { display: none !important; }
a { color: var(--violet-2); text-decoration: none; }
.btn { border: none; cursor: pointer; font-weight: 700; font-size: 13px; color: #fff; padding: 10px 16px; border-radius: 9px; font-family: inherit; transition: filter .15s, background .15s; }
.btn.primary { background: var(--grad); } .btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); } .btn.ghost:hover { background: var(--panel-3); }
.btn.danger { background: var(--danger); } .btn.danger:hover { filter: brightness(1.08); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.discord { background: #5865F2; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
    radial-gradient(1000px 600px at 50% -10%, rgba(139,92,246,.14), transparent 60%), var(--bg); }
.login-card { width: 380px; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line-strong); border-radius: 16px; padding: 34px 30px; text-align: center; }
.login-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 14px; }
.login-card h2 { font-size: 22px; font-weight: 800; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card input { background: var(--bg2); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; color: var(--text); font-family: inherit; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--violet); }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; margin: 16px 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.login-terms { color: var(--dim); font-size: 11px; margin-top: 18px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 16px; }

/* App shell */
#app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 6px; } .sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.brand span { font-weight: 700; letter-spacing: .5px; font-size: 15px; } .brand b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.server-select { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.server-select .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav .group { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; background: transparent; border: none; color: var(--muted); padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; text-align: left; width: 100%; transition: background .12s, color .12s; }
.nav-item .ic { width: 16px; text-align: center; opacity: .8; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: #fff; }
.nav-item.active .ic { color: var(--violet-2); opacity: 1; }
.nav-item .tag-soon { margin-left: auto; font-size: 9px; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 5px; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 4px; } .ver { color: var(--dim); font-size: 11px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.greeting { font-size: 15px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.server-state { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.server-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.server-state i.online { background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.6); }
.avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #fff; }
.iconbtn { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--muted); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 15px; }
.iconbtn:hover { color: var(--text); }

.content { padding: 22px 26px; flex: 1; }
.crumb { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; font-size: 13px; color: var(--muted); margin-bottom: 20px; display: inline-block; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: 14px; padding: 20px; position: relative; overflow: hidden; }
.stat .num { font-size: 30px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stat .ic { position: absolute; top: 18px; right: 18px; font-size: 18px; opacity: .25; }

.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2,1fr); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.card h3 { font-size: 14px; color: var(--violet-2); margin-bottom: 14px; font-weight: 700; }
.card-h { display: flex; align-items: center; justify-content: space-between; }

.section-h { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); margin: 4px 0 12px; }

.feed { display: flex; flex-direction: column; gap: 9px; }
.threat { background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--violet); border-radius: 9px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; }
.threat .t-cat { font-weight: 700; font-size: 13px; } .threat .t-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.threat .t-meta { text-align: right; } .threat .t-name { font-size: 12px; font-weight: 600; } .threat .t-time { font-size: 11px; color: var(--muted); }
.tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 3px 7px; border-radius: 5px; margin-left: 6px; }
.tag.ban { background: rgba(244,63,94,.16); color: var(--danger); } .tag.kick { background: rgba(251,146,60,.16); color: var(--warn); } .tag.ok { background: rgba(52,211,153,.16); color: var(--ok); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.mono { font-family: ui-monospace,monospace; font-size: 11px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.search { width: 100%; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; color: var(--text); font-size: 13px; margin-bottom: 14px; font-family: inherit; }
.search:focus { outline: none; border-color: var(--violet); }
.empty { text-align: center; color: var(--muted); padding: 46px 0; font-size: 14px; }

/* license dashboard table */
.lic-table-head { background: var(--panel-2); }

/* Settings */
.settings-grid { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.set-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.set-card h3 { font-size: 14px; margin-bottom: 14px; color: var(--violet-2); }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.set-row input[type=number] { width: 110px; background: var(--bg2); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; color: var(--text); font-family: inherit; font-size: 13px; }
.set-row input:focus { outline: none; border-color: var(--violet); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: none; color: var(--muted); padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.seg button.active { background: var(--grad); color: #fff; }
.switch { position: relative; width: 44px; height: 24px; } .switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--bg2); border: 1px solid var(--line-strong); border-radius: 20px; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch input:checked + .track { background: rgba(139,92,246,.35); border-color: var(--violet); }
.switch input:checked + .track::after { left: 23px; background: var(--violet-2); }
.set-actions { display: flex; gap: 10px; align-items: center; }
.set-note { font-size: 12px; color: var(--muted); }
.lic-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.lic-select, .lic-note { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 13px; }
.lic-note { flex: 1; min-width: 180px; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-head .avatar { width: 56px; height: 56px; font-size: 24px; border-radius: 12px; }
.profile-head .pname { font-size: 20px; font-weight: 800; } .profile-head .prole { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 13px; }
.kv .k { color: var(--muted); }

/* Buy */
.tiers { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 820px){ .tiers { grid-template-columns: 1fr; } }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 22px; text-align: center; }
.tier.feature { border-color: rgba(139,92,246,.5); background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(192,132,252,.04)); }
.tier h3 { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.tier .price { font-size: 34px; font-weight: 800; margin: 12px 0 4px; }
.tier .price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.tier ul { list-style: none; text-align: left; margin: 16px 0; font-size: 13px; }
.tier li { padding: 6px 0; border-bottom: 1px solid var(--line); } .tier li::before { content: "✓ "; color: var(--ok); }

.modal { position: fixed; inset: 0; background: rgba(5,3,10,.72); display: grid; place-items: center; z-index: 20; }
.modal-card { width: 380px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; padding: 24px; }
.modal-card h3 { font-size: 17px; margin-bottom: 8px; } .modal-text { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
#modalInput { width: 100%; background: var(--bg2); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; color: var(--text); font-size: 13px; margin-bottom: 18px; font-family: inherit; }
#modalInput:focus { outline: none; border-color: var(--violet); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel-3); border: 1px solid var(--line-strong); padding: 12px 20px; border-radius: 10px; font-size: 13px; z-index: 30; }
.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 30px 0 10px; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
@media (max-width: 820px){ #app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }

/* Statistiken */
.cats { display: flex; flex-direction: column; gap: 10px; }
.catrow { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 10px; font-size: 12px; }
.catname { color: var(--text); } .catval { color: var(--muted); text-align: right; }
.catbar { height: 8px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.catbar span { display: block; height: 100%; background: var(--grad); border-radius: 6px; }

/* Profil-/Konfig-Tabs */
.ptabs, .ctabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.ptab, .ctab { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--muted); padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.ptab:hover, .ctab:hover { color: var(--text); }
.ptab.active, .ctab.active { background: var(--grad); color: #fff; border-color: transparent; }
.permrow { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0; }
.permcheck { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-strong); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.permcheck input { accent-color: var(--violet); }

/* Admin-Seiten */
.tablescroll { max-height: 60vh; overflow-y: auto; }
.tablescroll::-webkit-scrollbar { width: 6px; } .tablescroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
.map-grid { position: relative; width: 100%; aspect-ratio: 1/1; max-width: 560px; margin: 0 auto; background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 10%,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 10% 100%, var(--bg2);
    border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.mapdot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--violet-2); box-shadow: 0 0 8px var(--violet); cursor: help; }

/* Listen-Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 8px 5px 10px; font-size: 12px; font-family: ui-monospace,monospace; }
.chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--danger); }
.hint { font-size: 12px; color: var(--muted); }

/* Konfig-Aktionsleiste (Anvil-Stil) */
.cfg-topbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
