html[data-theme="light"] { color-scheme: light; }
@media screen { html[data-theme="dark"] {
    color-scheme: dark;
    --text-dark: #eee8e2; --text-muted: #b9b1bd; --border-color: #403746;
    --bg-light: #211d28; --bg-cream: #17141d; --bg-warm: #292330;
    --bg-section-alt: #211d28; --accent: #f078a6; --accent-dark: #b82c65;
    --gold-dark: #dcc07d; --admin-cream: #17141d; --admin-card-bg: #211d28;
    --admin-border: #403746; --admin-accent: #f078a6; --admin-gold: #dcc07d;
    --bs-body-bg: #17141d; --bs-body-color: #eee8e2;
    --bs-secondary-color: #b9b1bd; --bs-border-color: #403746;
} }
.theme-toggle {
    position: relative; display: flex; align-items: center; gap: 16px;
    width: max-content; min-height: 44px; margin: 16px auto 0; padding: 8px 0;
    border: 0; border-radius: 4px; background: transparent;
    color: inherit; font: 500 12px/1.4 Inter, system-ui, sans-serif;
    letter-spacing: .02em; cursor: pointer; opacity: .8;
}
.theme-toggle::after {
    content: ''; width: 32px; height: 18px; border-radius: 20px;
    background: #8b818e; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.theme-toggle::before {
    content: ''; position: absolute; right: 18px; width: 12px; height: 12px;
    border-radius: 50%; background: #fff; transition: transform .18s ease;
}
.theme-toggle[aria-pressed="true"]::after { background: #ac874c; }
.theme-toggle[aria-pressed="true"]::before { transform: translateX(16px); }
.theme-toggle:hover { opacity: 1; }
.theme-toggle:focus-visible { outline: 2px solid #b88a44; outline-offset: 5px; opacity: 1; }
.sidebar-footer .theme-toggle { margin: 8px 0 0; width: 100%; justify-content: space-between; color: #ded6e2; }
.sidebar-footer .theme-toggle::before { right: 18px; }
.admin-login-card .theme-toggle { margin-top: 20px; }
.footer-bottom-preferences { display: flex; align-items: center; justify-content: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.footer-bottom-preferences .footer-bottom-links { margin-bottom: 0; }
.footer-bottom [data-theme-host] .theme-toggle { margin: 0; color: #c8bfcb; }
@media (max-width: 767.98px) { .footer-bottom-preferences { justify-content: center; margin-top: 12px; } }
body.admin-login-page { overflow-y: auto !important; }
@media (prefers-reduced-motion: reduce) { .theme-toggle::before { transition: none; } }
@media screen {
    html[data-theme="dark"] body { background: #17141d !important; color: #eee8e2 !important; }
    html[data-theme="dark"] :is(.sp, .sp-launch) {
        --sp-ink: #eee8e2; --sp-text: #eee8e2; --sp-muted: #b9b1bd;
        --sp-line: #403746; --sp-soft: #292330; --sp-cream: #17141d;
        --sp-accent-ink: #f078a6; --sp-gold-ink: #dcc07d;
    }
    html[data-theme="dark"] :is(.bg-white, .bg-light, .card, .modal-content, .dropdown-menu, .offcanvas) {
        background-color: #211d28 !important; color: #eee8e2; border-color: #403746;
    }
    html[data-theme="dark"] :is(.text-dark, .text-body, h1, h2, h3, h4, h5, h6) { color: #eee8e2; }
    html[data-theme="dark"] .text-muted { color: #b9b1bd !important; }
    html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select, .form-control, .form-select) {
        background-color: #211d28 !important; color: #eee8e2 !important; border-color: #66576c !important;
    }
    html[data-theme="dark"] ::placeholder { color: #b9b1bd !important; opacity: 1; }
    html[data-theme="dark"] .form-floating input::placeholder { opacity: 0 !important; }
    html[data-theme="dark"] .table { --bs-table-bg: #211d28; --bs-table-color: #eee8e2; --bs-table-striped-bg: #292330; --bs-table-striped-color: #eee8e2; --bs-table-hover-bg: #352b3c; --bs-table-hover-color: #fff; border-color: #403746; }
    html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }
    html[data-theme="dark"] :is(.btn-primary, .bg-primary) { color: #fff !important; background-color: #b82c65 !important; border-color: #b82c65 !important; }
    html[data-theme="dark"] .theme-toggle { color: #c8bfcb; }
}
@media print { .theme-toggle { display: none !important; } }
