html[data-sfera-theme="dark"],
body[data-sfera-theme="dark"] {
    color-scheme: dark;
    background: #0f172a;
    color: #e5e7eb;
}

body[data-sfera-theme="dark"] {
    --bs-body-bg: #0f172a;
    --bs-body-color: #e5e7eb;
    --bs-border-color: #334155;
    --bs-secondary-color: #a7b3c6;
    --bs-tertiary-bg: #111827;
    --cri-brand-red-soft: #3b171b;
    --cri-brand-red-soft-border: #6f252d;
    --cri-brand-red-soft-text: #fecdd3;
    --sfera-chip-surface: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    --sfera-chip-surface-hover: linear-gradient(180deg, #273449 0%, #172033 100%);
    --sfera-chip-text: #fecdd3;
    --sfera-chip-border: rgba(248, 113, 113, 0.25);
    --sfera-chip-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    --sfera-chip-shadow-active: 0 14px 26px rgba(0, 0, 0, 0.32);
    --sfera-chip-disabled-bg: #182033;
    --sfera-chip-disabled-border: #273449;
    --sfera-chip-disabled-text: #74849a;
    --sfera-chip-neutral-bg: #1f2937;
    --sfera-chip-neutral-border: #334155;
    --sfera-chip-neutral-text: #cbd5e1;
    --sfera-chip-success-bg: #123523;
    --sfera-chip-success-border: #1f5b3d;
    --sfera-chip-success-text: #bbf7d0;
    --sfera-chip-warning-bg: #3a2a0a;
    --sfera-chip-warning-border: #7c5b16;
    --sfera-chip-warning-text: #fde68a;
    --sfera-chip-dark-bg: #111827;
    --sfera-chip-dark-border: #475569;
    --sfera-chip-dark-text: #f8fafc;
}

body[data-sfera-theme="dark"] .fullscreen-image,
body[data-sfera-theme="dark"] .main-container {
    background: #0f172a;
}

body[data-sfera-theme="dark"] .card,
body[data-sfera-theme="dark"] .modal-content,
body[data-sfera-theme="dark"] .offcanvas,
body[data-sfera-theme="dark"] .dropdown-menu,
body[data-sfera-theme="dark"] .list-group-item,
body[data-sfera-theme="dark"] .accordion-item,
body[data-sfera-theme="dark"] .toast,
body[data-sfera-theme="dark"] .e-dialog,
body[data-sfera-theme="dark"] .e-card,
body[data-sfera-theme="dark"] .e-popup,
body[data-sfera-theme="dark"] .e-ddl.e-popup,
body[data-sfera-theme="dark"] .e-dropdownbase,
body[data-sfera-theme="dark"] .e-tooltip-wrap,
body[data-sfera-theme="dark"] .e-tab,
body[data-sfera-theme="dark"] .e-grid,
body[data-sfera-theme="dark"] .e-treeview,
body[data-sfera-theme="dark"] .e-schedule,
body[data-sfera-theme="dark"] .e-calendar,
body[data-sfera-theme="dark"] .e-datepicker,
body[data-sfera-theme="dark"] .e-datetimepicker {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body[data-sfera-theme="dark"] .card-header,
body[data-sfera-theme="dark"] .card-footer,
body[data-sfera-theme="dark"] .modal-header,
body[data-sfera-theme="dark"] .modal-footer,
body[data-sfera-theme="dark"] .e-grid .e-headercontent,
body[data-sfera-theme="dark"] .e-grid .e-gridheader,
body[data-sfera-theme="dark"] .e-toolbar,
body[data-sfera-theme="dark"] .e-tab .e-tab-header {
    background-color: #182033 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body[data-sfera-theme="dark"] .table {
    --bs-table-bg: #111827;
    --bs-table-color: #e5e7eb;
    --bs-table-border-color: #334155;
    --bs-table-striped-bg: #172033;
    --bs-table-striped-color: #e5e7eb;
    --bs-table-hover-bg: #1f2937;
    --bs-table-hover-color: #ffffff;
}

body[data-sfera-theme="dark"] .text-muted,
body[data-sfera-theme="dark"] .form-text,
body[data-sfera-theme="dark"] .small.text-muted,
body[data-sfera-theme="dark"] .e-emptyrow {
    color: #a7b3c6 !important;
}

body[data-sfera-theme="dark"] .bg-white,
body[data-sfera-theme="dark"] .bg-light {
    background-color: #111827 !important;
    color: #e5e7eb !important;
}

body[data-sfera-theme="dark"] .border,
body[data-sfera-theme="dark"] .border-top,
body[data-sfera-theme="dark"] .border-end,
body[data-sfera-theme="dark"] .border-bottom,
body[data-sfera-theme="dark"] .border-start {
    border-color: #334155 !important;
}

body[data-sfera-theme="dark"] .form-control,
body[data-sfera-theme="dark"] .form-select,
body[data-sfera-theme="dark"] .form-check-input,
body[data-sfera-theme="dark"] .e-input,
body[data-sfera-theme="dark"] .e-input-group,
body[data-sfera-theme="dark"] .e-control-wrapper,
body[data-sfera-theme="dark"] .e-multiselect,
body[data-sfera-theme="dark"] .e-ddl,
body[data-sfera-theme="dark"] .e-numerictextbox,
body[data-sfera-theme="dark"] .e-datepicker,
body[data-sfera-theme="dark"] .e-datetimepicker {
    background-color: #0f172a !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

body[data-sfera-theme="dark"] .form-control::placeholder,
body[data-sfera-theme="dark"] .e-input::placeholder {
    color: #94a3b8 !important;
}

body[data-sfera-theme="dark"] .e-input-group .e-input-group-icon,
body[data-sfera-theme="dark"] .e-control-wrapper .e-input-group-icon,
body[data-sfera-theme="dark"] .e-float-text,
body[data-sfera-theme="dark"] .e-label,
body[data-sfera-theme="dark"] label {
    color: #cbd5e1 !important;
}

body[data-sfera-theme="dark"] .e-grid .e-headercell,
body[data-sfera-theme="dark"] .e-grid .e-rowcell,
body[data-sfera-theme="dark"] .e-grid .e-summarycell,
body[data-sfera-theme="dark"] .e-grid .e-groupcaption,
body[data-sfera-theme="dark"] .e-grid .e-detailcell {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
}

body[data-sfera-theme="dark"] .e-grid .e-altrow .e-rowcell,
body[data-sfera-theme="dark"] .e-grid .e-row:hover .e-rowcell {
    background-color: #172033 !important;
}

body[data-sfera-theme="dark"] .e-menu-wrapper,
body[data-sfera-theme="dark"] .e-menu-container,
body[data-sfera-theme="dark"] .e-menu-popup,
body[data-sfera-theme="dark"] .e-menu-popup .e-menu-parent {
    background-color: #111827 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item,
body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item a,
body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item .e-menu-icon,
body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item .e-caret {
    color: #f8fafc !important;
}

body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item:hover,
body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item.e-focused,
body[data-sfera-theme="dark"] .e-menu-popup .e-menu-item.e-selected {
    background-color: #1f2937 !important;
}

body[data-sfera-theme="dark"] .cri-menu.e-menu-wrapper,
body[data-sfera-theme="dark"] .cri-menu.e-menu-container,
body[data-sfera-theme="dark"] .cri-menu .e-menu,
body[data-sfera-theme="dark"] .cri-menu .e-menu-item,
body[data-sfera-theme="dark"] .cri-menu .e-menu-wrapper,
body[data-sfera-theme="dark"] .cri-menu .e-menu-container,
body[data-sfera-theme="dark"] .cri-menu .e-menu-popup,
body[data-sfera-theme="dark"] .cri-menu .e-menu-popup .e-menu-item,
body[data-sfera-theme="dark"] .cri-menu .e-menu-popup ul .e-menu-item a {
    background: var(--cri-brand-red) !important;
    color: var(--cri-text-on-brand) !important;
}

body[data-sfera-theme="dark"] .cri-menu .e-menu-item.e-selected,
body[data-sfera-theme="dark"] .cri-menu .e-menu-item.e-focused,
body[data-sfera-theme="dark"] .cri-menu .e-menu-item.e-active,
body[data-sfera-theme="dark"] .cri-menu .e-menu-popup .e-menu-item.e-selected,
body[data-sfera-theme="dark"] .cri-menu .e-menu-popup .e-menu-item.e-focused,
body[data-sfera-theme="dark"] .cri-menu .e-menu-popup .e-menu-item.e-active {
    background: var(--cri-brand-red-hover) !important;
    color: var(--cri-text-on-brand) !important;
}

body[data-sfera-theme="dark"] a:not(.btn):not(.btn-link) {
    color: #fca5a5;
}

body[data-sfera-theme="dark"] a:not(.btn):not(.btn-link):visited {
    color: #fecdd3;
}

body[data-sfera-theme="dark"] a:not(.btn):not(.btn-link):hover,
body[data-sfera-theme="dark"] a:not(.btn):not(.btn-link):focus {
    color: #ffffff;
}

body[data-sfera-theme="dark"] .btn-light,
body[data-sfera-theme="dark"] .btn-outline-light:hover {
    color: #111827;
}

body[data-sfera-theme="dark"] #blazor-error-ui {
    background: #3a2a0a;
    color: #fde68a;
}
