:root {
    --bg-main: #0b0f19;
    --bg-sidebar: #111827;
    --bg-panel: #161f33;
    --bg-elevated: #1e293b;
    --bg-hover: #253349;
    --border-color: #263248;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --color-admin: #818cf8;
    --color-mod: #f59e0b;
    --color-male: #60a5fa;
    --color-female: #f472b6;
    --color-diverse: #c084fc;
    --color-none: #cbd5e1;
}

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

html, body {
    height: 100%;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #2b3850;
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3d4e6d;
}

.hidden { display: none !important; }

/* Rollen-Badges vor dem Namen (A / M) */
.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-right: 5px;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.role-badge.role-admin {
    background: color-mix(in srgb, var(--color-admin) 20%, transparent);
    color: var(--color-admin);
    border: 1px solid color-mix(in srgb, var(--color-admin) 55%, transparent);
}

.role-badge.role-moderator {
    background: color-mix(in srgb, var(--color-mod) 20%, transparent);
    color: var(--color-mod);
    border: 1px solid color-mix(in srgb, var(--color-mod) 55%, transparent);
}

.gender-male { color: var(--color-male); }
.gender-female { color: var(--color-female); }
.gender-diverse { color: var(--color-diverse); }
.gender-none { color: var(--color-none); }

.gender-symbol {
    margin-left: 4px;
    font-size: 13px;
    opacity: 0.9;
}

/* Avatare */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #334155, #1e293b);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }

/* Standard-Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-main); border-color: var(--border-color); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.28); }
.btn-warning { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.btn-warning:hover:not(:disabled) { background: rgba(245, 158, 11, 0.28); }
.btn-success { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.45); }
.btn-success:hover:not(:disabled) { background: rgba(16, 185, 129, 0.3); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 7px; font-size: 11px; border-radius: 5px; }

.input, .select, .textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
}
.textarea { resize: vertical; min-height: 80px; }

/* Auth Card */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #172038 0%, var(--bg-main) 65%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 900;
}
.auth-card {
    width: 100%;
    max-width: 410px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.auth-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}
.auth-sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--bg-main);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 18px;
}
.auth-tab {
    padding: 8px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-tab.active {
    background: var(--bg-elevated);
    color: var(--text-main);
}
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.form-error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    margin-bottom: 14px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 800;
}
.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.modal-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 18px;
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text-main); }
.modal-body {
    padding: 18px;
    overflow-y: auto;
}
.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Toast Notifications */
.brand-emblem {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.brand-emblem-img-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #05050d;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.brand-emblem-img-wrap.lg {
    width: 54px;
    height: 54px;
}
.brand-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.brand-emblem-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-main);
}
.brand-emblem-sub {
    color: var(--accent);
    font-weight: 700;
}
.sidebar-brand-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border-color);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}
.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 13px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    animation: slideIn 0.2s ease;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
