/* ============================================================
   Farmoria.de Bot-Webpanel – Dark Theme (Discord-Style)
   ============================================================ */

:root {
    --bg:            #36393F;
    --bg-alt:        #2F3136;
    --bg-sidebar:    #2B2D31;
    --bg-input:      #202225;
    --border:        #26282C;
    --text:          #E3E5E8;
    --text-muted:    #9DA2A6;
    --accent:        #5865F2;
    --accent-hover:  #4752C4;
    --green:         #3BA55D;
    --red:           #ED4245;
    --yellow:        #FAA61A;
    --radius:        8px;
    --shadow:        0 4px 14px rgba(0,0,0,0.35);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
            "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100vh; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout (App) ─────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}

.sidebar-brand small { color: var(--text-muted); font-weight: 400; }

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), #7A82FF);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.guild-switcher {
    padding: 12px 12px 8px;
}

.guild-switcher label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.guild-switcher select {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    background: var(--bg-alt);
    color: var(--text);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent);
    color: #fff;
}

.nav-icon { width: 22px; text-align: center; font-size: 16px; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

/* ── Hauptbereich ─────────────────────────────────────────── */
.content {
    flex: 1;
    padding: 24px 28px 48px;
    overflow-x: hidden;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 16px;
    flex-wrap: wrap;
}

.content-header h1 { font-size: 24px; font-weight: 700; }
.content-header p.muted { margin-top: 2px; }

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-input);
    object-fit: cover;
}

.pill {
    display: inline-block;
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* ── Cards & Container ────────────────────────────────────── */
.card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.card h3 { margin-bottom: 10px; font-size: 17px; }
.card h4 { margin: 18px 0 10px; font-size: 15px; color: var(--text); }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 22px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-col { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 900px) {
    .grid-2, .form-row { grid-template-columns: 1fr; }
    .sidebar { width: 200px; min-width: 200px; }
    .content { padding: 16px 14px 32px; }
}

@media (max-width: 640px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; min-width: 0; height: auto; position: static; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .content-header { flex-direction: column; align-items: flex-start; }
}
/* ── Statistik-Karten ────────────────────────────────────── */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
    background: var(--bg-input);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ── Tabellen ────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.table tr:hover td { background: var(--bg-input); }

.table code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ── Listen & Toggles ────────────────────────────────────── */
.plain-list { list-style: none; }

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.list-row small { color: var(--text-muted); }

.log-list { list-style: none; }

.log-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.log-desc { flex: 1; font-size: 13px; color: var(--text); }

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.toggle-row:hover { background: #303338; }

.toggle {
    width: 40px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    background: #4E5058;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle:checked { background: var(--accent); }

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
}

.toggle:checked::after { left: 20px; }

/* ── Chips (Variablen-Hilfe) ─────────────────────────────── */
.var-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }

.chip {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
}

/* ── Embed-Vorschau ──────────────────────────────────────── */
.embed-preview {
    background: var(--bg-input);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 14px;
}

.embed-preview strong { color: var(--text); }
.embed-preview hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.embed-preview small { color: var(--text-muted); }
/* ── Toasts ──────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    max-width: 340px;
}

.toast {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    box-shadow: var(--shadow);
    animation: toastIn 0.25s ease;
}

.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--yellow); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Login-Seite ─────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 20px;
}

.login-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 460px;
    padding: 40px 36px;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--accent), #7A82FF);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: var(--shadow);
}

.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }
.login-hint { color: var(--text-muted); font-size: 13px; margin: 14px 0 4px; }
.login-legal { color: var(--text-muted); font-size: 12px; margin-top: 24px; }

.btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-discord:hover {
    background: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}

/* ── Guild-Liste (Server-Auswahl) ────────────────────────── */
.guild-list { margin-top: 8px; }

.guild-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.guild-row:hover {
    border-color: var(--accent);
    background: #3A3D44;
    text-decoration: none;
}

.guild-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.guild-icon-fallback {
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.guild-row-info { display: flex; flex-direction: column; flex: 1; text-align: left; }
.guild-row-arrow { color: var(--text-muted); font-size: 18px; }

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Scrolling & misc ────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3A3D44; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #4E5058; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.hidden { display: none; }
code {
    background: var(--bg-input);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "Consolas", "Menlo", monospace;
}