/* Quenya Dunkelmodus. Wirkt nur mit html[data-theme="dark"]. Hell bleibt der Standard. */

html[data-theme="dark"] {
    color-scheme: dark;
    background: #12141a;
    --bg: #12141a;
    --bg0: #12141a;
    --bg1: #1a1d26;
    --bg-soft: #181b24;
    --section-muted: #1c2029;
    --surface: #1c2028;
    --paper: #1c2028;
    --text: #e7e9ee;
    --ink: #e7e9ee;
    --muted: #a3adbd;
    --border: rgba(255, 255, 255, 0.12);
    --line: rgba(255, 255, 255, 0.12);
    --accent-soft: rgba(56, 189, 214, 0.16);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.28);
    --q-text: #e7e9ee;
    --q-muted: #a1a1aa;
    --q-border: rgba(255, 255, 255, 0.12);
    --q-bg: #12141a;
    --sidebar-text: #e4e4e7;
    --sidebar-text-hover: #fafafa;
    --sidebar-bg-hover: rgba(255, 255, 255, 0.06);
    --sidebar-bg-active: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] body {
    visibility: hidden;
    background: #12141a !important;
    color: #e7e9ee;
}

html[data-theme="dark"].q-theme-ready body {
    visibility: visible;
}

html[data-theme="dark"] body::before {
    background:
        radial-gradient(ellipse 90% 70% at 12% 8%, rgba(56, 189, 214, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse 70% 55% at 92% 18%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        linear-gradient(180deg, #16181f 0%, #12141a 45%, #0e1014 100%) !important;
}

html[data-theme="dark"] body.has-sidebar {
    background: #12141a !important;
    color: #e7e9ee !important;
}

html[data-theme="dark"] .sidebar-nav {
    background: #18181b !important;
    color: #e4e4e7 !important;
    box-shadow: 2px 0 18px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .sidebar-logo,
html[data-theme="dark"] .sidebar-tenant-brand {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .sidebar-logo-text-img,
html[data-theme="dark"] .sidebar-logo-icon-img {
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] .sidebar-tenant-logo {
    background: #fff;
    border-radius: 8px;
    padding: 4px 6px;
}

html[data-theme="dark"] .sidebar-user {
    background: rgba(255, 255, 255, 0.04);
    border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.has-sidebar .sidebar-toggle {
    background: #1c1f27;
    color: #f4f4f5;
    border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] ::placeholder {
    color: #9aa3b2;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color-scheme: dark;
}

html[data-theme="dark"] .q-einfach-more,
html[data-theme="dark"] .q-einfach-hero,
html[data-theme="dark"] details.q-einfach-more > summary {
    background: #1c2028 !important;
    color: #e7e9ee !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

@media print {
    html[data-theme="dark"] body {
        visibility: visible !important;
    }
}

.sidebar-theme-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 10px 15px;
    margin-top: 8px;
    background: rgba(63, 63, 70, 0.08);
    color: #3f3f46;
    border: 1px solid rgba(63, 63, 70, 0.22);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    gap: 10px;
    text-align: left;
}

.sidebar-theme-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-theme-btn:hover {
    background: rgba(63, 63, 70, 0.14);
}

.sidebar-nav.collapsed .sidebar-theme-btn {
    padding: 10px;
    justify-content: center;
    width: auto;
    min-width: 44px;
}

.sidebar-nav.collapsed .sidebar-theme-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

html[data-theme="dark"] .sidebar-theme-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #e4e4e7;
    border-color: rgba(255, 255, 255, 0.14);
}

.quenya-theme-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(63, 63, 70, 0.22);
    background: #fff;
    color: #18181b;
    font: 600 13px/1.2 Inter, system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .quenya-theme-fab {
    background: #1c1f27;
    color: #f4f4f5;
    border-color: rgba(255, 255, 255, 0.16);
}
