/* Skarvox Bot Dashboard */
:root {
  --bg: #0e1013;
  --bg-2: #13161a;
  --panel: #171a1f;
  --panel-2: #1d2127;
  --panel-3: #23282f;
  --line: #2a2f36;
  --line-2: #363c45;
  --text: #dfe2e6;
  --text-2: #b4bac2;
  --muted: #858c95;
  --red: #ff2a2a;
  --red-2: #ff5c5c;
  --red-dim: rgba(255, 42, 42, 0.14);
  --green: #4caf50;
  --green-dim: rgba(76, 175, 80, 0.15);
  --orange: #ffb020;
  --orange-dim: rgba(255, 176, 32, 0.12);
  --dc-bg: #313338;
  --dc-embed: #2b2d31;
  --dc-text: #dbdee1;
  --dc-muted: #949ba4;
  --dc-link: #00a8fc;
  --dc-mention: rgba(88, 101, 242, 0.3);
  --head: "Bahnschrift", "DIN Alternate", "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "SF Mono", Monaco, monospace;
  --r: 8px;
  --side: 250px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
a { color: var(--red-2); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 60; padding: 8px 12px; background: var(--red); color: #fff; border-radius: 6px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Kopf */
.top { position: sticky; top: 0; z-index: 30; background: rgba(14, 16, 19, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand__mark { width: 34px; height: 34px; }
.brand__txt { display: flex; flex-direction: column; line-height: 1; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; }
.brand__txt b { font-size: 19px; color: #fff; }
.brand__txt small { font-size: 11px; color: var(--red-2); letter-spacing: 0.2em; margin-top: 3px; }
.top__guild { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); font-size: 14px; padding-left: 16px; border-left: 1px solid var(--line-2); }
.top__guild img { width: 24px; height: 24px; border-radius: 50%; }
.top__guild span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.iconbtn { display: inline-grid; place-items: center; min-width: 36px; height: 34px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; text-decoration: none; }
.iconbtn:hover { color: #fff; border-color: var(--line-2); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn--txt { font-family: var(--head); font-size: 13px; letter-spacing: 0.08em; }
.navtoggle { display: none; }
.userbox { display: flex; align-items: center; gap: 8px; }
.userbox img, .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-3); flex: 0 0 auto; object-fit: cover; }
.avatar { display: inline-grid; place-items: center; font-family: var(--head); color: var(--text-2); font-size: 14px; }
.userbox__name { display: flex; flex-direction: column; line-height: 1.15; font-size: 14px; }
.userbox__name small { color: var(--muted); font-size: 12px; }

/* ---------- Rahmen */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.side { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 14px 10px 30px; border-right: 1px solid var(--line); background: var(--bg-2); }
.side__group { margin: 16px 8px 6px; font-family: var(--head); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.side__group:first-child { margin-top: 2px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.side a:hover { background: var(--panel-2); color: #fff; }
.side a[aria-current="page"] { background: var(--red-dim); color: #fff; box-shadow: inset 2px 0 0 var(--red); }
.side a svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.85; }
.side a .dot { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: 0 0 auto; }
.dot.is-on { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.main { padding: 26px 32px 120px; min-width: 0; outline: none; }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- Kopf einer Seite */
.phead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.phead__txt { flex: 1 1 320px; min-width: 0; }
.phead h1 { margin: 0; font-family: var(--head); font-size: 28px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; line-height: 1.15; }
.phead p { margin: 6px 0 0; color: var(--text-2); max-width: 760px; }
.phead__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Hinweise */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 18px; border: 1px solid var(--line-2); border-left: 3px solid var(--orange); border-radius: var(--r); background: var(--orange-dim); color: var(--text); font-size: 14px; }
.note--red { border-left-color: var(--red); background: var(--red-dim); }
.note--info { border-left-color: var(--dc-link); background: rgba(0, 168, 252, 0.08); }

/* ---------- Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.card__top { display: flex; align-items: center; gap: 10px; }
.card__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--panel-3); color: var(--red-2); flex: 0 0 auto; }
.card__icon svg { width: 20px; height: 20px; }
.card h3 { margin: 0; font-family: var(--head); font-size: 17px; font-weight: 600; letter-spacing: 0.04em; color: #fff; flex: 1 1 auto; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--red-2); }
.card p { margin: 0; color: var(--text-2); font-size: 14px; flex: 1 1 auto; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.badge--soon { border-style: dashed; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.stat b { display: block; font-family: var(--head); font-size: 26px; color: #fff; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
h2.sec { margin: 28px 0 12px; font-family: var(--head); font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }

/* ---------- Knoepfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn--primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn--ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { border-color: var(--line-2); }
.btn--danger:hover { border-color: var(--red); color: var(--red-2); }
.btn--sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* Schalter */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); transition: background 0.15s ease; flex: 0 0 auto; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--red-2); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.5; }
.switch--big .switch__track { width: 52px; height: 30px; }
.switch--big .switch__track::after { width: 24px; height: 24px; }
.switch--big input:checked + .switch__track::after { transform: translateX(22px); }
.switch__lbl { font-size: 14px; color: var(--text-2); }

/* ---------- Formular */
.form { display: flex; flex-direction: column; gap: 4px; max-width: 980px; }
.fsec { margin: 22px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-family: var(--head); font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red-2); font-weight: 600; }
.fsec:first-child { margin-top: 0; }
.field { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 8px 22px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(42, 47, 54, 0.5); }
.field--wide { grid-template-columns: minmax(0, 1fr); }
.field__label { padding-top: 7px; }
.field__label label, .field__label .lbl { font-weight: 600; color: var(--text); font-size: 14px; }
.field__help { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.field__ctl { min-width: 0; }
.inp, .sel, .area { width: 100%; max-width: 520px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2); color: var(--text); font-size: 14px; }
.inp:focus, .sel:focus, .area:focus { border-color: var(--red-2); outline: none; box-shadow: 0 0 0 3px var(--red-dim); }
.inp--num { max-width: 140px; }
.area { max-width: none; min-height: 90px; resize: vertical; line-height: 1.45; }
.sel { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4bac2' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.sel option, .sel optgroup { background: var(--panel); color: var(--text); }
.colorrow { display: flex; align-items: center; gap: 8px; }
.colorrow input[type="color"] { width: 42px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2); cursor: pointer; }
.colorrow .inp { max-width: 120px; font-family: var(--mono); }

/* Mehrfachauswahl mit Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); font-size: 13px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.chip button:hover { background: var(--red-dim); color: #fff; }
.chip--missing { border-color: var(--red); color: var(--red-2); }

/* Listen (z. B. Hubs, Ticket-Kategorien) */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.item__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.item__head b { flex: 1 1 auto; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__head svg { width: 16px; height: 16px; transition: transform 0.15s ease; }
.item.is-open > .item__head > .chev { transform: rotate(90deg); }
.item__body { display: none; padding: 4px 16px 12px; border-top: 1px solid var(--line); }
.item.is-open > .item__body { display: block; }
.item__body .field { grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); }

/* ---------- Embed-Baukasten */
.msged { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 18px; align-items: start; }
.msged__edit { min-width: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); cursor: pointer; font-size: 14px; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--red); }
.tab small { color: var(--muted); margin-left: 4px; }
.vars { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.vars button { padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); color: var(--text-2); font: 12px var(--mono); cursor: pointer; }
.vars button:hover { border-color: var(--red-2); color: #fff; }
.emb { margin-top: 10px; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--r); background: var(--bg-2); }
.emb__head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.emb__head b { flex: 1 1 auto; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-2); }
.emb__body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 0 10px 12px; }
.emb__body .full { grid-column: 1 / -1; }
.emb__body label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.emb__body .inp, .emb__body .area { max-width: none; }
.efield { display: grid; grid-template-columns: 1fr 1.6fr auto auto; gap: 6px; align-items: center; margin-top: 6px; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.msged__prev { position: sticky; top: 76px; }
.msged__prev h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* Discord-Vorschau */
.dc { padding: 14px 14px 16px; border-radius: var(--r); background: var(--dc-bg); color: var(--dc-text); font: 15px/1.375 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; overflow-wrap: anywhere; }
.dc__msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 14px; }
.dc__av { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-3); }
.dc__name { font-weight: 600; color: #fff; }
.dc__tag { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; line-height: 15px; vertical-align: 2px; }
.dc__time { margin-left: 6px; color: var(--dc-muted); font-size: 12px; }
.dc__content { white-space: pre-wrap; margin-top: 2px; }
.dc__content:empty { display: none; }
.dc__embed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; max-width: 432px; margin-top: 6px; padding: 8px 16px 16px 12px; border-left: 4px solid #1e1f22; border-radius: 4px; background: var(--dc-embed); }
.dc__embed > * { grid-column: 1; }
.dc__author { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: #fff; }
.dc__author img { width: 24px; height: 24px; border-radius: 50%; }
.dc__title { margin-top: 8px; font-weight: 600; color: #fff; }
.dc__title a { color: var(--dc-link); text-decoration: none; }
.dc__desc { margin-top: 8px; font-size: 14px; white-space: pre-wrap; }
.dc__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.dc__field { grid-column: 1 / -1; font-size: 14px; }
.dc__field.inline { grid-column: auto; }
.dc__field b { display: block; color: #fff; font-weight: 600; margin-bottom: 2px; }
.dc__field div { white-space: pre-wrap; }
.dc__thumb { grid-column: 2 !important; grid-row: 1 / 6; width: 80px; height: 80px; margin-top: 8px; border-radius: 4px; object-fit: cover; }
.dc__img { grid-column: 1 / -1 !important; margin-top: 16px; max-width: 400px; border-radius: 4px; }
.dc__footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--dc-muted); }
.dc__footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc a { color: var(--dc-link); }
.dc code { padding: 0 3px; border-radius: 3px; background: #1e1f22; font: 13px var(--mono); }
.dc pre { margin: 4px 0; padding: 7px; border-radius: 4px; background: #1e1f22; border: 1px solid #1e1f22; font: 13px var(--mono); white-space: pre-wrap; }
.dc blockquote { margin: 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.dc .ment { padding: 0 2px; border-radius: 3px; background: var(--dc-mention); color: #c9cdfb; font-weight: 500; }
.dc h1, .dc h2, .dc h3 { margin: 6px 0 2px; color: #fff; line-height: 1.25; }
.dc h1 { font-size: 22px; } .dc h2 { font-size: 19px; } .dc h3 { font-size: 16px; }
.dc .sub { font-size: 12px; color: var(--dc-muted); }
.dc__empty { color: var(--dc-muted); font-style: italic; font-size: 14px; }

/* ---------- Tabelle (Protokoll) */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-family: var(--head); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tbl tr:hover td { background: var(--panel); }
.tbl details summary { cursor: pointer; color: var(--text-2); }
.tbl pre { margin: 6px 0 0; padding: 8px; max-height: 280px; overflow: auto; border-radius: 6px; background: var(--bg-2); font: 12px/1.4 var(--mono); white-space: pre-wrap; }
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }

/* ---------- Speicherleiste, Meldungen */
.savebar { position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 40; padding: 12px 32px; pointer-events: none; }
.savebar__in { display: flex; align-items: center; gap: 10px; max-width: 980px; padding: 10px 12px 10px 18px; border: 1px solid var(--line-2); border-radius: 10px; background: #0b0c0f; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); pointer-events: auto; }
.savebar__txt { flex: 1 1 auto; font-size: 14px; }
.toasts { position: fixed; right: 18px; top: 74px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 10px 14px; border: 1px solid var(--line-2); border-left: 3px solid var(--green); border-radius: 8px; background: #0b0c0f; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5); font-size: 14px; animation: tin 0.15s ease; }
.toast--err { border-left-color: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Login- und Fehlerseite */
.plain { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.plain__box { width: min(440px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: center; }
.plain__box img { margin: 0 auto 12px; }
.plain__box h1 { margin: 0 0 8px; font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; font-size: 24px; color: #fff; }
.plain__box p { color: var(--text-2); }
.btn--discord { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; min-height: 42px; padding: 0 20px; }
.btn--discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }

/* ---------- Handy */
@media (max-width: 1180px) {
  .msged { grid-template-columns: minmax(0, 1fr); }
  .msged__prev { position: static; }
}
@media (max-width: 860px) {
  :root { --side: 0px; }
  .navtoggle { display: inline-grid; }
  .top__guild { display: none; }
  .userbox__name { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 60px; z-index: 35; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 0.18s ease; box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5); }
  .side.is-open { transform: none; }
  .main { padding: 18px 16px 120px; }
  .field, .item__body .field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .field__label { padding-top: 0; }
  .savebar { padding: 10px 16px; }
  .savebar__txt { font-size: 13px; }
  .emb__body { grid-template-columns: minmax(0, 1fr); }
  .efield { grid-template-columns: minmax(0, 1fr) auto auto; }
  .efield .inp:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .phead h1 { font-size: 23px; }
}
