:root {
  --bg: #0b0b10; --bg2: #101018; --panel: #15151f; --panel2: #1c1c29; --panel3: #242436; --border: #262638; --border2: #33334a;
  --text: #ececf4; --muted: #8e8ea8; --accent: #8b5cf6; --accent-d: #6d28d9; --accent-soft: #8b5cf622;
  --green: #22c55e; --red: #ef4444; --yellow: #eab308; --blue: #3b82f6; --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; font: 14px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(900px 500px at 85% -10%, #8b5cf61f, transparent 60%), radial-gradient(700px 400px at -10% 110%, #3b82f614, transparent 60%); }
.hidden { display: none !important; }
a { color: #b9a4ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--panel3); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1em; }
img.ico { width: 20px; height: 20px; flex: none; }
img.ico.lg { width: 38px; height: 38px; }

/* Login */
.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 34px; text-align: center; }
.login-card .logo { width: 64px; margin: 0 auto; }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; justify-content: center; padding: 11px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border2); }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #0f0f17cc; backdrop-filter: blur(10px); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 6px 8px 12px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; background: var(--panel3); }
.brand b { display: block; font-size: 15px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.guild-switch { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px; }
.guild-switch img { width: 28px; height: 28px; border-radius: 8px; background: var(--panel3); }
.guild-switch select { border: 0; background: transparent; padding: 4px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
nav .group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
nav a { color: #cfcfe0; padding: 8px 10px; border-radius: 10px; display: flex; gap: 11px; align-items: center; font-weight: 500; transition: background .15s; }
nav a:hover { background: var(--panel2); text-decoration: none; }
nav a.active { background: linear-gradient(90deg, var(--accent-soft), transparent); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
nav .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.me { display: flex; gap: 10px; align-items: center; padding: 10px 8px 0; border-top: 1px solid var(--border); }
.me img { width: 32px; height: 32px; border-radius: 50%; background: var(--panel3); }
.me div { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 30px 36px 60px; max-width: 1280px; width: 100%; }

/* Seitenkopf */
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* Karten */
.card { background: linear-gradient(180deg, var(--panel), #13131c); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 13px; width: 100%; margin-top: -6px; padding-left: 30px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .grid2, .grid3 { grid-template-columns: 1fr; } .layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } main { padding: 20px; } }
.stat { background: linear-gradient(180deg, var(--panel), #13131c); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat b { font-size: 24px; display: block; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.warn { border-color: #eab30866; }
a.stat:hover { text-decoration: none; border-color: var(--border2); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Setup-Checkliste */
.checklist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.check-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--border); color: var(--text); }
a.check-item:hover { text-decoration: none; border-color: var(--border2); }
.check-item.ok { opacity: .7; }
.check-item .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.check-item.ok .st { background: #22c55e33; color: var(--green); }
.check-item.todo .st { background: #eab30833; color: var(--yellow); }
.progress { height: 8px; background: var(--panel3); border-radius: 8px; overflow: hidden; flex: 1; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--accent), #c084fc); }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); padding: 4px; border-radius: 12px; margin-bottom: 18px; flex-wrap: wrap; width: fit-content; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 14px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--panel3); color: #fff; }
.tabs img { width: 18px; height: 18px; }

/* Formulare */
label { display: block; font-size: 12px; color: #a9a9c2; margin-bottom: 5px; font-weight: 600; }
.field { margin-bottom: 14px; }
.field small { color: var(--muted); display: block; margin-top: 4px; font-size: 12px; }
input, select, textarea { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--border2); border-radius: 10px; padding: 9px 12px; font: inherit; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=color] { padding: 3px; height: 40px; }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; color: var(--text); font-weight: 500; margin: 4px 0 12px; cursor: pointer; }
.savebar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; background: #15151fee; border: 1px solid var(--border2); border-radius: 14px; backdrop-filter: blur(8px); margin-top: 8px; }

/* Buttons */
.btn { background: var(--panel3); color: var(--text); border: 1px solid var(--border2); border-radius: 10px; padding: 8px 15px; cursor: pointer; font: inherit; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-d)); border-color: #7c3aed; color: #fff; box-shadow: 0 4px 14px #7c3aed40; }
.btn.green { background: linear-gradient(180deg, #22c55e, #16a34a); border-color: #16a34a; color: #fff; }
.btn.red { background: #ef444422; border-color: #ef444455; color: #fca5a5; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn img { width: 16px; height: 16px; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
tbody tr:hover { background: #ffffff05; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--panel3); }
.pill.pending, .pill.open, .pill.awaiting_payment { background: #eab30822; color: #fde047; }
.pill.approved, .pill.on { background: #22c55e22; color: #86efac; }
.pill.rejected, .pill.closed, .pill.off { background: #ef444422; color: #fca5a5; }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty img { width: 48px; opacity: .85; display: block; margin: 0 auto 10px; }
.emo { height: 20px; vertical-align: middle; }

/* Toast */
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--panel3); border: 1px solid var(--border2); padding: 12px 18px; border-radius: 12px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; z-index: 99; box-shadow: 0 10px 30px #0008; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: var(--red); }

/* Bildauswahl */
.img-pick { display: flex; gap: 8px; align-items: center; }
.img-pick img { width: 70px; height: 40px; object-fit: cover; border-radius: 8px; background: var(--panel3); border: 1px solid var(--border2); flex: none; }

/* Emojis */
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.emoji-item { background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; gap: 10px; align-items: center; }
.emoji-item img { width: 34px; height: 34px; }
.emoji-item .nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-item code { cursor: pointer; font-size: 11px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.pack-grid div { text-align: center; font-size: 11px; color: var(--muted); background: var(--panel2); border-radius: 12px; padding: 10px 4px; border: 1px solid var(--border); }
.pack-grid img { width: 40px; height: 40px; display: block; margin: 0 auto 6px; }
.dropzone { border: 2px dashed var(--border2); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone b { color: var(--text); }
.slot { display: flex; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.slot .prev { width: 26px; height: 26px; display: grid; place-items: center; font-size: 20px; flex: none; }
.slot .prev img { width: 26px; height: 26px; }
.slot .lbl { flex: 1; font-weight: 600; font-size: 13px; }
.slot select { width: 150px; padding: 6px 8px; font-size: 12px; }

/* Server-Karten */
.guild-card { display: flex; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.guild-card img { width: 44px; height: 44px; border-radius: 12px; background: var(--panel3); }
.guild-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Discord-Vorschau */
.preview { background: #313338; border-radius: 12px; padding: 16px; position: sticky; top: 20px; }
.dc-container { background: #2b2d31; border-left: 4px solid var(--accent); border-radius: 8px; padding: 14px; max-width: 520px; }
.dc-container img.banner { width: 100%; border-radius: 6px; margin-bottom: 10px; }
.dc-head { display: flex; gap: 10px; }
.dc-head img { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.dc-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.dc-text { white-space: pre-wrap; color: #dbdee1; }
.dc-sep { border-top: 1px solid #3f4147; margin: 12px 0; }
.dc-btn { display: inline-block; background: #4e5058; color: #fff; padding: 5px 14px; border-radius: 6px; margin: 4px 6px 0 0; font-size: 13px; }
.dc-footer { color: #949ba4; font-size: 12px; margin-top: 8px; }
.q-item { border: 1px solid var(--border); background: var(--panel2); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border2); border-radius: 16px; width: min(760px, 95vw); padding: 24px; box-shadow: 0 30px 80px #000c; }
dialog h2 { margin-bottom: 18px; }
dialog::backdrop { background: #000b; backdrop-filter: blur(3px); }
img[src=""], img:not([src]) { visibility: hidden; }

.restart-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: rgba(5,7,14,.85); backdrop-filter: blur(6px); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(96,165,250,.2); border-top-color: #60a5fa; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner-prev { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; background: var(--panel3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow: auto; padding: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; background: var(--panel3); border: 1px solid transparent; color: inherit; cursor: pointer; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { background: #5865f233; border-color: #5865f2; font-weight: 600; }
tr.cat-row td { background: rgba(255,255,255,.02); }
.btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.sr-prev { background: #313338; border-radius: 10px; padding: 14px; border-left: 4px solid #5865f2; }
.sr-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.sr-text { color: #dbdee1; font-size: 13.5px; margin-bottom: 10px; white-space: pre-wrap; }
.sr-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sr-btn { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: 13.5px; font-weight: 500; padding: 7px 14px; border-radius: 8px; }
.sr-btn img.emo { width: 18px; height: 18px; }
.ev-box { margin-top: 10px; border-top: 1px solid var(--border, #ffffff14); padding-top: 8px; }
.ev-box summary { cursor: pointer; font-size: 13px; color: #a5b4fc; font-weight: 600; padding: 4px 0; }
.ev-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; align-items: center; margin-top: 6px; }
.ev-row select { padding: 6px 8px; font-size: 13px; }
