/* Only authenticated dark workspaces. Login, light theme and printed documents
   retain their own presentation; semantic status colors are not remapped. */
@media screen {
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) {
        color-scheme: dark;
        background-color: var(--ui-dark-page) !important;
        color: var(--ui-dark-text);
        scrollbar-color: #50676f var(--ui-dark-page);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) ::selection {
        background: #75dfc044; color: #f1fbf7;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(.bg-card,[class~="bg-card/90"],.bg-dark) {
        background-color: var(--ui-dark-surface) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .bg-darker {
        background-color: var(--ui-dark-page) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .from-card { --tw-gradient-from: var(--ui-dark-surface) var(--tw-gradient-from-position) !important; }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) [class~="to-card/50"] { --tw-gradient-to: var(--ui-dark-soft) var(--tw-gradient-to-position) !important; }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is([class~="bg-white/5"],[class~="bg-white/10"]) {
        background-color: var(--ui-dark-soft) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is([class~="border-white/10"],[class~="border-white/5"]) {
        border-color: var(--ui-dark-line) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(.text-gray-400,.text-gray-500) {
        color: var(--ui-dark-muted) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is([class~="hover:bg-white/5"],[class~="hover:bg-white/10"],[class~="hover:bg-white/3"]):hover {
        background-color: var(--ui-dark-soft) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(input:not([type]),input[type="text"],input[type="search"],input[type="email"],input[type="password"],input[type="tel"],input[type="url"],input[type="number"],input[type="date"],input[type="datetime-local"],input[type="month"],input[type="time"],select,textarea) {
        background-color: var(--ui-dark-field) !important;
        color: var(--ui-dark-text) !important;
        border-color: var(--ui-dark-control-line) !important;
        color-scheme: dark;
        caret-color: var(--brand-mint);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(input,textarea)::placeholder {
        color: var(--ui-dark-muted) !important; opacity: 1;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) select option {
        background: var(--ui-dark-surface); color: var(--ui-dark-text);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(input,select,textarea):focus {
        border-color: var(--brand-mint) !important;
        box-shadow: 0 0 0 3px #75dfc01f;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(a,button,input,select,textarea,[tabindex]):focus-visible {
        outline: 2px solid var(--brand-mint) !important; outline-offset: 3px;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) :is(input,select,textarea):disabled {
        opacity: .65; cursor: not-allowed;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) table.dataTable thead th {
        background-color: var(--ui-dark-soft); color: var(--ui-dark-muted);
        border-color: var(--ui-dark-line);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) table.dataTable tbody :is(td,tr) {
        border-color: var(--ui-dark-line);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) table.dataTable tbody tr:hover {
        background-color: var(--ui-dark-soft);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .dataTables_wrapper :is(.dataTables_info,.dataTables_length,.dataTables_filter) {
        color: var(--ui-dark-muted);
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .dataTables_wrapper .dataTables_paginate .paginate_button {
        background: var(--ui-dark-surface) !important; color: var(--ui-dark-text) !important;
        border: 1px solid var(--ui-dark-line) !important; border-radius: 7px;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
        background: var(--ui-dark-soft) !important; border-color: var(--ui-dark-control-line) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: var(--brand-mint) !important; color: var(--brand-ink) !important; border-color: var(--brand-mint) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
        color: var(--ui-dark-muted) !important; opacity: .6;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .btn-outline-primary {
        color: var(--brand-mint) !important; border-color: #75dfc066 !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .btn-outline-primary:hover {
        color: var(--brand-ink) !important; background: var(--brand-mint) !important;
    }
    html body:where(:has(#sidebar[data-navigation-theme="dark"])) .swal2-popup {
        background: var(--ui-dark-surface); color: var(--ui-dark-text); border: 1px solid var(--ui-dark-line);
    }
}
