/* =========================================================
   VANTEX Dashboard-Theme
   Farben, Typo und Radien laut VANTEX UI & Design System v1.0
   (gleiche Tokens wie landing.css).
   ========================================================= */

:root {
    --primary: #7B5CFF;        /* Neon Purple */
    --secondary: #00D4FF;      /* Electric Blue */
    --accent: #FF2E9E;         /* Magenta */
    --bg: #0D0D14;             /* Deep Space */
    --surface: #1A1A24;        /* Graphite */
    --surface-2: #2A2A36;      /* Slate */
    --text: #F5F5F5;
    --muted: #9A9AAB;
    --success: #22C55E;
    --warning: #FACC15;
    --danger: #EF4444;
    --radius: 16px;
    --radius-sm: 10px;
    --grad: linear-gradient(135deg, var(--primary), var(--secondary));
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Raleway", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: rgba(26, 26, 36, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--surface-2);
    position: sticky;
    top: 0;
    z-index: 50;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .28em;
}
.brand svg { width: 26px; height: 26px; }
.brand-logo { width: 26px; height: 26px; border-radius: 50%; }
.user-box { display: flex; align-items: center; gap: 14px; }
.user-name { color: var(--muted); font-size: .9rem; font-weight: 600; }

.container { max-width: 860px; margin: 0 auto; padding: 32px 20px 60px; }

h1 { font-size: 1.6rem; margin: 0 0 6px; font-weight: 800; }
h2 { font-size: 1.15rem; margin: 0 0 16px; font-weight: 800; }
h3 { font-size: 1rem; margin: 20px 0 10px; font-weight: 700; }
.subtle { color: var(--muted); font-size: .9rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 12px;
    border: none;
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
    color: #fff;
}
.btn-primary {
    background: var(--grad);
    box-shadow: 0 4px 18px rgba(123, 92, 255, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(123, 92, 255, .5); }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--surface-2);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-big { padding: 13px 28px; font-size: 1rem; }

/* Flash */
.flash {
    background: rgba(34, 197, 94, .12);
    border: 1px solid var(--success);
    color: var(--success);
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

/* Login */
.login-card {
    max-width: 420px;
    margin: 80px auto;
    text-align: center;
    background: var(--surface);
    padding: 40px 32px;
    border-radius: var(--radius);
    border: 1px solid var(--surface-2);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}

/* Bot-Status (Heartbeat) */
.status-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.status-card.status-online { border-color: rgba(34, 197, 94, .45); }
.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--muted); flex-shrink: 0;
}
.status-online .status-dot { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-offline .status-dot { background: var(--danger); box-shadow: 0 0 8px rgba(239, 68, 68, .6); }
.status-head { display: flex; flex-direction: column; }
.status-head strong { font-size: 1rem; }
.status-label { font-size: .8rem; color: var(--muted); font-weight: 700; }
.status-online .status-label { color: var(--success); }
.status-offline .status-label { color: var(--danger); }
.status-metrics {
    display: flex; flex-wrap: wrap; gap: 6px 16px;
    margin-left: auto; color: var(--muted); font-size: .88rem;
}

/* Guild grid */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.guild-card {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: transform .15s ease, border-color .15s ease;
}
.guild-card:hover { transform: translateY(-2px); border-color: rgba(123, 92, 255, .5); }
.guild-disabled { opacity: .55; }
.guild-disabled:hover { transform: none; border-color: var(--surface-2); }
.guild-icon { margin-bottom: 12px; }
.guild-icon img { width: 64px; height: 64px; border-radius: 50%; }
.guild-initial {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--grad); color: #fff;
    font-size: 1.6rem; font-weight: 800;
}
.guild-name { font-weight: 700; margin-bottom: 14px; word-break: break-word; }
.empty { text-align: center; margin-top: 60px; color: var(--muted); }

/* Config */
.config-head { margin-bottom: 24px; }
.back-link { color: var(--muted); font-size: .9rem; }
.back-link:hover { color: var(--primary); }
.card {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.fields { display: grid; gap: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.field-help { color: var(--muted); font-size: .82rem; margin: 6px 0 0; }

input[type="text"], input[type="number"], input[type="password"], select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: .92rem;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123, 92, 255, .2);
}
/* Autofill vom Browser/Passwortmanager ans dunkle Design anpassen */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
    caret-color: var(--text);
}

.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch-row span { font-weight: 600; }

.checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; max-height: 260px; overflow-y: auto; padding: 4px 2px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Wortfilter */
.wordfilter { margin-top: 24px; border-top: 1px solid var(--surface-2); padding-top: 8px; }
.word-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.word-list li {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1px solid var(--surface-2);
    padding: 5px 5px 5px 12px; border-radius: 20px; font-size: .88rem;
}
.btn-tiny { border: none; cursor: pointer; border-radius: 50%; width: 22px; height: 22px; color: #fff; font-size: .7rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.add-word { display: flex; gap: 8px; }
.add-word input { flex: 1; }

/* Save bar */
.save-bar { text-align: right; margin-top: 8px; }

/* Guild-Navigation */
.guild-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--surface-2);
    padding-bottom: 12px;
}
.guild-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--surface-2);
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.guild-nav a:hover { color: var(--text); border-color: var(--primary); }
.guild-nav a.active {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(123, 92, 255, .35);
}

/* Datentabellen */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    text-align: left;
    padding: 8px 10px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .74rem;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--surface-2);
}
.data-table td {
    padding: 10px;
    border-bottom: 1px solid var(--surface-2);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td.muted { color: var(--muted); }
.data-table td.rank { font-weight: 800; color: var(--secondary); width: 40px; }
.data-table form { margin: 0; }
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(123, 92, 255, .12);
    border: 1px solid rgba(123, 92, 255, .45);
    font-size: .78rem;
    font-weight: 700;
    color: var(--text);
}

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px; }
.footer-claim { color: var(--primary); font-weight: 700; letter-spacing: .12em; }

/* Topbar-Link (z. B. Logs) */
.topbar-link { color: var(--muted); font-size: .9rem; font-weight: 700; }
.topbar-link:hover { color: var(--primary); }
.nav-badge { background: var(--primary); color: #fff; border-radius: 999px;
             font-size: .7rem; padding: 1px 7px; margin-left: 2px; }

/* Bot-Umschalter in der Topbar (mehrere Instanzen) */
.instance-switch {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
}
.instance-pill {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.instance-pill:hover { color: var(--primary); }
.instance-pill.active {
    background: var(--primary);
    color: #fff;
}

/* Bots-Verwaltung: Status-Badges, Aktions-Buttons und Anlege-Formular */
.badge { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.badge-on { color: #3ddc84; }
.badge-off { color: var(--muted); }
.badge-wait { color: #f5b942; }

.actions-cell { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.btn-small {
    border: none; cursor: pointer; display: inline-block;
    border-radius: 8px; padding: 6px 12px;
    font-size: .82rem; font-weight: 700; color: #fff;
    background: rgba(255, 255, 255, .08);
    white-space: nowrap;
}
.btn-small:hover { background: rgba(255, 255, 255, .16); }
.btn-small.btn-danger { background: var(--danger); }
.btn-small.btn-danger:hover { background: #dc2626; }
.btn-small[disabled] { opacity: .45; cursor: not-allowed; }

.stack-form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.stack-form button { align-self: flex-start; }

/* Zugriff verwalten: Rollen-Zeilen mit Rechte-Checkboxen */
.mt { margin-top: 22px; }
.role-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .07);
}
.role-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex: 1; }
.role-name { font-weight: 800; min-width: 120px; }
.role-perms { display: flex; gap: 14px; flex-wrap: wrap; }
.perm-check { display: flex; align-items: center; gap: 5px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.perm-check input { width: auto; }

/* Admin-Login / Konto / Admin-Center */
.auth-card { max-width: 400px; margin: 40px auto; }
.auth-alt { margin-top: 16px; text-align: center; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; width: max-content; margin: 12px 0; }
.qr-box svg { display: block; width: 200px; height: 200px; }

.user-row { padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.user-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.user-form select, .user-form input { width: auto; }
.user-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Übersicht: Statistik-Karten */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 700; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.stat-sub { color: var(--muted); font-size: .78rem; }
.stat-sub a:hover { color: var(--primary); }

/* Übersicht: Aktivitäts-Chart */
.chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: .82rem; }
.dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot-purple { background: var(--primary); }
.dot-blue { background: var(--secondary); }
.dot-green { background: var(--success); }
.dot-red { background: var(--danger); }
.activity-chart { width: 100%; height: auto; display: block; }

/* Analytics: Zeitraum-Umschalter */
.range-switch { display: flex; gap: 6px; }
.range-pill {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--surface-2);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}
.range-pill:hover { color: var(--primary); border-color: var(--primary); }
.range-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Analytics: Kanal-Heatmap & Funnel (Balkenlisten) */
.heatmap, .funnel { display: flex; flex-direction: column; gap: 10px; }
.heat-row, .funnel-row { display: flex; align-items: center; gap: 12px; }
.heat-name, .funnel-label {
    flex: 0 0 140px; font-weight: 600; font-size: .9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.heat-bar, .funnel-bar {
    flex: 1; height: 12px; border-radius: 999px;
    background: var(--surface-2); overflow: hidden;
}
.heat-fill { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.funnel-fill { display: block; height: 100%; background: var(--success); border-radius: 999px; }
.heat-val, .funnel-val { flex: 0 0 auto; font-size: .85rem; font-weight: 700; min-width: 44px; text-align: right; }
@media (max-width: 600px) {
    .heat-name, .funnel-label { flex-basis: 90px; }
}

/* Status-Badges */
.badge-green {
    background: rgba(34, 197, 94, .12);
    border-color: rgba(34, 197, 94, .5);
    color: var(--success);
}
.badge-yellow {
    background: rgba(250, 204, 21, .10);
    border-color: rgba(250, 204, 21, .45);
    color: var(--warning);
}

/* Kleine Buttons in Tabellen */
.btn-small { padding: 5px 12px; font-size: .8rem; border-radius: 8px; }

/* Log-Ansicht */
.log-card { padding: 10px; }
.log-view {
    margin: 0;
    max-height: 520px;
    overflow: auto;
    background: var(--bg);
    border: 1px solid var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: Consolas, "Cascadia Mono", monospace;
    font-size: .78rem;
    line-height: 1.55;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Fehlerseiten */
.error-page { text-align: center; padding: 60px 0; }
.error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.error-page h1 { margin-bottom: 10px; }
.error-page .subtle { max-width: 420px; margin: 0 auto; }
.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

/* Mobile */
@media (max-width: 600px) {
    .topbar { padding: 12px 16px; }
    .brand { letter-spacing: .2em; font-size: .95rem; }
    .user-name { display: none; }
    .container { padding: 24px 14px 48px; }

    .card { padding: 18px 14px; overflow-x: auto; }
    .data-table { min-width: 480px; }

    .status-card { flex-wrap: wrap; padding: 14px 16px; }
    .status-metrics { margin-left: 0; width: 100%; }

    .guild-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .guild-nav { gap: 5px; }
    .guild-nav a { padding: 7px 11px; font-size: .84rem; }

    .save-bar .btn-big { width: 100%; }
    .error-code { font-size: 4.5rem; }

    .embed-grid { grid-template-columns: 1fr; }
    .embed-preview-wrap { position: static; }
}

/* Embed-Editor */
.embed-grid {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 380px);
    gap: 24px;
    align-items: start;
}
.embed-preview-wrap { position: sticky; top: 20px; }
.embed-preview-wrap .field-help { display: block; margin-bottom: 8px; }
.embed-preview {
    background: var(--surface);
    border: 1px solid var(--surface-2);
    border-left: 4px solid var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    min-height: 60px;
}
.embed-preview-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    word-break: break-word;
}
.embed-preview-desc {
    color: #dcddde;
    font-size: .92rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.embed-preview-img {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}
.embed-preview-footer {
    color: var(--muted);
    font-size: .78rem;
    margin-top: 12px;
}
.row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
.embed-inputs input[disabled] { opacity: .6; cursor: not-allowed; }
.embed-inputs textarea#description { min-height: 300px; resize: vertical; }

/* Custom-Commands */
.cmd-form { margin-top: 6px; }
.cmd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cmd-embed-fields, .cmd-text-fields { display: grid; gap: 18px; }
@media (max-width: 600px) {
    .cmd-row { grid-template-columns: 1fr; }
}
