:root {
    color-scheme: dark;
    --theme-primary: #191c24;
    --theme-accent: #dc3545;
    --theme-info: #0dcaf0;
    --theme-success: #198754;
    --theme-danger: #af1763;
    --theme-warning: #ffc107;
    --theme-background: #14171f;
    --theme-surface: #1d212b;
    --theme-surface-raised: #252a36;
    --theme-border: #363c49;
    --theme-text: #e6e8ed;
    --theme-text-muted: #a5abba;
    --theme-chart-1: #38bdf8;
    --theme-chart-2: #34d399;
    --theme-chart-3: #fbbf24;
    --theme-chart-4: #a78bfa;
    --theme-chart-5: #fb7185;
    --theme-chart-6: #22d3ee;
}

[data-color-palette="ocean"] {
    --theme-primary: #102a43;
    --theme-accent: #38bdf8;
    --theme-info: #67e8f9;
    --theme-success: #34d399;
    --theme-danger: #fb7185;
    --theme-warning: #fbbf24;
    --theme-background: #0b1726;
    --theme-surface: #102033;
    --theme-surface-raised: #19314b;
    --theme-border: #29445f;
    --theme-text: #e6f4ff;
    --theme-text-muted: #9db4ca;
    --theme-chart-1: #38bdf8;
    --theme-chart-2: #34d399;
    --theme-chart-3: #fbbf24;
    --theme-chart-4: #a78bfa;
    --theme-chart-5: #fb7185;
    --theme-chart-6: #22d3ee;
}

[data-color-palette="forest"] {
    --theme-primary: #10221e;
    --theme-accent: #10b981;
    --theme-info: #22d3ee;
    --theme-success: #34d399;
    --theme-danger: #f43f5e;
    --theme-warning: #fbbf24;
    --theme-background: #0b1512;
    --theme-surface: #11231d;
    --theme-surface-raised: #1b332a;
    --theme-border: #2d4b3f;
    --theme-text: #e8f5ee;
    --theme-text-muted: #a3b8ad;
    --theme-chart-1: #34d399;
    --theme-chart-2: #fbbf24;
    --theme-chart-3: #38bdf8;
    --theme-chart-4: #a78bfa;
    --theme-chart-5: #fb7185;
    --theme-chart-6: #22d3ee;
}

[data-color-palette="amethyst"] {
    --theme-primary: #1c1730;
    --theme-accent: #8b5cf6;
    --theme-info: #38bdf8;
    --theme-success: #22c55e;
    --theme-danger: #f43f5e;
    --theme-warning: #f59e0b;
    --theme-background: #13101f;
    --theme-surface: #1c182c;
    --theme-surface-raised: #29233d;
    --theme-border: #403755;
    --theme-text: #f0ebff;
    --theme-text-muted: #b4adc9;
    --theme-chart-1: #a78bfa;
    --theme-chart-2: #38bdf8;
    --theme-chart-3: #34d399;
    --theme-chart-4: #fbbf24;
    --theme-chart-5: #fb7185;
    --theme-chart-6: #22d3ee;
}

[data-color-palette="rose"] {
    --theme-primary: #2b1821;
    --theme-accent: #f472b6;
    --theme-info: #f9a8d4;
    --theme-success: #34d399;
    --theme-danger: #fb7185;
    --theme-warning: #fbbf24;
    --theme-background: #1a1016;
    --theme-surface: #281822;
    --theme-surface-raised: #38212f;
    --theme-border: #503041;
    --theme-text: #fbeaf1;
    --theme-text-muted: #d0aebd;
    --theme-chart-1: #f472b6;
    --theme-chart-2: #2dd4bf;
    --theme-chart-3: #fbbf24;
    --theme-chart-4: #a78bfa;
    --theme-chart-5: #34d399;
    --theme-chart-6: #38bdf8;
}

[data-color-palette="slate"] {
    --theme-primary: #20242b;
    --theme-accent: #a78bfa;
    --theme-info: #60a5fa;
    --theme-success: #4ade80;
    --theme-danger: #f87171;
    --theme-warning: #fbbf24;
    --theme-background: #15171c;
    --theme-surface: #20242b;
    --theme-surface-raised: #2a3039;
    --theme-border: #3d4652;
    --theme-text: #ecf0f5;
    --theme-text-muted: #acb6c4;
    --theme-chart-1: #a78bfa;
    --theme-chart-2: #60a5fa;
    --theme-chart-3: #4ade80;
    --theme-chart-4: #fbbf24;
    --theme-chart-5: #f87171;
    --theme-chart-6: #22d3ee;
}

html,
body,
#wrapper,
.page-wrapper {
    background-color: var(--theme-background) !important;
    color: var(--theme-text);
}

body,
input,
button,
select,
textarea {
    color: var(--theme-text);
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
    color: var(--theme-text);
}

a,
a:focus,
a:hover {
    color: var(--theme-info);
}

.preloader {
    background-color: var(--theme-primary) !important;
}

.navbar-header,
.right-sidebar .rpanel-title,
.fix-sidebar .top-left-part {
    background: var(--theme-primary) !important;
}

.navbar-default,
.navbar-static-top,
.sidebar,
.sidebar-nav,
.right-sidebar,
.right-sidebar .rpanel-title {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-border) !important;
}

.navbar-default .navbar-brand,
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-toggle,
.navbar-header a,
.sidebar-nav ul#side-menu li a,
.right-sidebar,
.right-sidebar .rpanel-title {
    color: var(--theme-text) !important;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
    color: var(--theme-info) !important;
}

.sidebar-nav ul#side-menu li a:hover,
.sidebar-nav ul#side-menu li a.active,
.sidebar-nav ul#side-menu li a.active i,
.sidebar-nav ul#side-menu li a:hover i,
#side-menu ul > li > a:hover {
    color: var(--theme-accent) !important;
}

.bg-theme,
.bg-primary,
.btn-custom,
.nav-pills > li.active > a,
.nav-pills > li.active > a:focus,
.nav-pills > li.active > a:hover {
    background-color: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: #fff !important;
}

.text-primary,
.text-blue,
.sidebar-nav ul#side-menu li a.active,
.bl-primary {
    color: var(--theme-accent) !important;
}

.bg-primary,
.btn-primary,
.label-primary,
.badge-primary,
.bl-primary {
    border-color: var(--theme-accent) !important;
}

.btn-custom:hover {
    filter: brightness(1.12);
}

.page-wrapper,
.container-fluid {
    color: var(--theme-text);
}

.white-box,
.panel,
.panel-default,
.panel-heading,
.panel-footer,
.well,
.modal-content,
.modal-header,
.modal-footer,
.popover,
.popover-title,
.list-group-item,
.table-box,
.drop-title,
.mailbox,
.dropdown-menu,
.select2-dropdown,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.datepicker,
.datepicker table tr td,
.datepicker table tr th,
.daterangepicker,
.daterangepicker .calendar-table,
.ui-widget-content,
.ui-widget-header,
.swal2-popup,
.toast,
.bootstrap-select .dropdown-menu {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text);
}

.white-box .box-title,
.panel-title,
.modal-title,
.dropdown-menu > li > a,
.list-group-item,
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--theme-text);
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--theme-surface-raised) !important;
    color: var(--theme-info) !important;
}

.datepicker table tr td.day:hover,
.datepicker table tr td span:hover,
.ui-state-hover,
.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
    background-color: var(--theme-surface-raised) !important;
    color: var(--theme-info) !important;
}

.ui-widget-header {
    background-color: var(--theme-surface-raised) !important;
    color: var(--theme-text) !important;
}

.form-control,
input,
select,
textarea,
.input-group-addon {
    background-color: var(--theme-primary);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    background-color: var(--theme-primary);
    border-color: var(--theme-accent);
    color: var(--theme-text);
    box-shadow: 0 0 0 2px rgb(175 23 99 / 18%);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder,
.text-muted,
.help-block {
    color: var(--theme-text-muted);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
    background-color: var(--theme-surface-raised);
    color: var(--theme-text-muted);
}

table,
.table,
table.dataTable {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

table > thead > tr,
.table > thead > tr,
table.dataTable > thead > tr,
table > thead > tr > th,
.table > thead > tr > th,
table.dataTable > thead > tr > th {
    background-color: var(--theme-primary);
    border-color: var(--theme-border);
    border-bottom: 2px solid var(--theme-accent);
    color: var(--theme-text);
}

table > tbody > tr:first-child > th,
.table > tbody > tr:first-child > th,
table.dataTable > tbody > tr:first-child > th {
    background-color: var(--theme-primary);
    border-bottom: 2px solid var(--theme-accent);
    color: var(--theme-text);
}

table > tbody > tr,
.table > tbody > tr,
table.dataTable > tbody > tr,
table > tfoot > tr,
.table > tfoot > tr,
table.dataTable > tfoot > tr {
    background-color: var(--theme-surface);
    color: var(--theme-text);
}

table > tbody > tr > th,
table > tbody > tr > td,
.table > tbody > tr > th,
.table > tbody > tr > td,
table.dataTable > tbody > tr > th,
table.dataTable > tbody > tr > td,
table > tfoot > tr > th,
table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > tfoot > tr > td,
table.dataTable > tfoot > tr > th,
table.dataTable > tfoot > tr > td {
    background-color: transparent;
    border-color: var(--theme-border);
    color: var(--theme-text);
}

table.table-striped > tbody > tr:nth-of-type(odd),
table.table-striped > tbody > tr:nth-of-type(odd) > td,
table.table-striped > tbody > tr:nth-of-type(odd) > th,
table.dataTable.stripe > tbody > tr.odd,
table.dataTable.display > tbody > tr.odd,
table.dataTable.stripe > tbody > tr.odd > td,
table.dataTable.display > tbody > tr.odd > td {
    background-color: var(--theme-surface-raised);
}

table.table-hover > tbody > tr:hover,
table.table-hover > tbody > tr:hover > td,
table.table-hover > tbody > tr:hover > th,
table.dataTable.hover > tbody > tr:hover,
table.dataTable.display > tbody > tr:hover,
table.dataTable.hover > tbody > tr:hover > td,
table.dataTable.display > tbody > tr:hover > td {
    background-color: #303644;
}

table > tfoot > tr > th,
table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > tfoot > tr > td,
table.dataTable > tfoot > tr > th,
table.dataTable > tfoot > tr > td {
    background-color: var(--theme-primary);
    border-top: 1px solid var(--theme-accent);
}

table th,
table td,
.table th,
.table td {
    border-color: var(--theme-border);
    color: var(--theme-text);
}

table caption,
.dataTables_empty {
    color: var(--theme-text-muted) !important;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::after {
    color: var(--theme-info) !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child::before {
    background-color: var(--theme-accent) !important;
    color: #fff !important;
}

hr,
.b-all,
.b-t,
.b-b,
.b-l,
.b-r {
    border-color: var(--theme-border);
}

.bg-title {
    background-color: var(--theme-surface) !important;
    border-bottom-color: var(--theme-border);
}

.bg-title .breadcrumb .active,
.footer {
    color: var(--theme-text-muted);
}

.footer {
    background-color: var(--theme-primary);
    border-top-color: var(--theme-border);
}

.btn-primary,
.label-primary,
.badge-primary {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
}

.btn-info,
.label-info,
.badge-info {
    background-color: var(--theme-info);
    border-color: var(--theme-info);
}

.btn-success,
.label-success,
.badge-success {
    background-color: var(--theme-success);
    border-color: var(--theme-success);
}

.btn-danger,
.label-danger,
.badge-danger {
    background-color: var(--theme-danger);
    border-color: var(--theme-danger);
}

.btn-warning,
.label-warning,
.badge-warning {
    background-color: var(--theme-warning);
    border-color: var(--theme-warning);
    color: var(--theme-primary);
}

.progress {
    background-color: var(--theme-surface-raised);
}

.pagination > li > a,
.pagination > li > span,
.nav-tabs > li > a {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

.pagination > .active > a,
.pagination > .active > span,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
    color: #fff;
}

.dataTables_wrapper,
.dataTables_info,
.dataTables_length,
.dataTables_filter,
.dataTables_paginate {
    color: var(--theme-text) !important;
}

.dataTables_wrapper input,
.dataTables_wrapper select {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--theme-text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--theme-surface-raised) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-info) !important;
}

.ct-chart .ct-label,
.ct-chart .ct-label span {
    color: var(--theme-text-muted) !important;
    fill: var(--theme-text-muted) !important;
}

.ct-chart .ct-grid {
    stroke: var(--theme-border) !important;
}

.stat-widget .stat .ct-series-a .ct-line,
.stat-widget .stat .ct-series-a .ct-point,
.ct-sd-chart .ct-series-a .ct-line,
.ct-sd-chart .ct-series-a .ct-point {
    stroke: var(--theme-accent) !important;
}

.stat-widget .stat .ct-series-b .ct-line,
.stat-widget .stat .ct-series-b .ct-point,
.ct-sd-chart .ct-series-b .ct-line,
.ct-sd-chart .ct-series-b .ct-point,
.ct-ie-chart .ct-series-b .ct-line,
.ct-ie-chart .ct-series-b .ct-point {
    stroke: var(--theme-info) !important;
}

.sc-widget .ct-series-a .ct-bar,
.ct-ie-chart .ct-series-a .ct-line,
.ct-ie-chart .ct-series-a .ct-point {
    stroke: var(--theme-success) !important;
}

.sc-widget .ct-series-b .ct-bar {
    stroke: var(--theme-accent) !important;
}

.ct-chart .ct-series-a .ct-point,
.ct-chart .ct-series-a .ct-line,
.ct-chart .ct-series-a .ct-bar,
.ct-chart .ct-series-a .ct-slice-donut {
    stroke: var(--theme-accent);
}

.ct-chart .ct-series-a .ct-slice-pie,
.ct-chart .ct-series-a .ct-area {
    fill: var(--theme-accent);
}

.ct-chart .ct-series-b .ct-point,
.ct-chart .ct-series-b .ct-line,
.ct-chart .ct-series-b .ct-bar,
.ct-chart .ct-series-b .ct-slice-donut {
    stroke: var(--theme-info);
}

.ct-chart .ct-series-b .ct-slice-pie,
.ct-chart .ct-series-b .ct-area {
    fill: var(--theme-info);
}

.ct-chart .ct-series-c .ct-point,
.ct-chart .ct-series-c .ct-line,
.ct-chart .ct-series-c .ct-bar,
.ct-chart .ct-series-c .ct-slice-donut {
    stroke: var(--theme-success);
}

.ct-chart .ct-series-c .ct-slice-pie,
.ct-chart .ct-series-c .ct-area {
    fill: var(--theme-success);
}

.ct-chart .ct-series-d .ct-point,
.ct-chart .ct-series-d .ct-line,
.ct-chart .ct-series-d .ct-bar,
.ct-chart .ct-series-d .ct-slice-donut {
    stroke: var(--theme-danger);
}

.ct-chart .ct-series-d .ct-slice-pie,
.ct-chart .ct-series-d .ct-area {
    fill: var(--theme-danger);
}

.ct-chart .ct-series-e .ct-point,
.ct-chart .ct-series-e .ct-line,
.ct-chart .ct-series-e .ct-bar,
.ct-chart .ct-series-e .ct-slice-donut {
    stroke: var(--theme-warning);
}

.ct-chart .ct-series-e .ct-slice-pie,
.ct-chart .ct-series-e .ct-area {
    fill: var(--theme-warning);
}

.ct-chart .ct-tooltip {
    background-color: var(--theme-primary) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.highcharts-background,
.highcharts-plot-background {
    fill: var(--theme-surface) !important;
}

.highcharts-title,
.highcharts-subtitle,
.highcharts-axis-title,
.highcharts-axis-labels text,
.highcharts-legend-item text,
.highcharts-data-label text,
.highcharts-tooltip text {
    fill: var(--theme-text) !important;
    color: var(--theme-text) !important;
}

.highcharts-grid-line {
    stroke: var(--theme-border) !important;
}

.highcharts-tooltip-box {
    fill: var(--theme-primary) !important;
    stroke: var(--theme-border) !important;
}

.google-visualization-tooltip,
.google-visualization-tooltip-item-list,
.google-visualization-tooltip-item {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.google-visualization-tooltip-item,
.google-visualization-tooltip-item span {
    color: var(--theme-text) !important;
}

.ct-chart,
.highcharts-container,
.google-visualization-chart,
.flot-chart {
    background-color: transparent !important;
}

.highcharts-container svg {
    color: var(--theme-text);
}

.theme-palette-picker {
    margin: 20px 0;
}

.theme-palette-picker h4 {
    margin: 0 0 6px;
    color: var(--theme-text);
    font-weight: 600;
}

.theme-palette-picker p {
    margin: 0 0 12px;
    color: var(--theme-text-muted);
    font-size: 12px;
}

.theme-palette-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.theme-palette-option {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--theme-border);
    border-radius: 6px;
    background: var(--theme-surface);
    color: var(--theme-text);
    cursor: pointer;
    text-align: left;
}

.theme-palette-option:hover,
.theme-palette-option:focus-visible {
    border-color: var(--theme-accent);
    outline: none;
}

.theme-palette-option[aria-pressed="true"] {
    border-color: var(--theme-accent);
    box-shadow: inset 0 0 0 1px var(--theme-accent);
}

.theme-palette-swatches {
    display: flex;
    gap: 4px;
}

.theme-palette-swatches span {
    width: 15px;
    height: 15px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 50%;
}

.theme-palette-name {
    overflow: hidden;
    max-width: 100%;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[style*="background: #fff" i],
[style*="background:#fff" i],
[style*="background-color: #fff" i],
[style*="background-color:#fff" i],
[style*="background: white" i],
[style*="background:white" i],
[style*="background-color: white" i],
[style*="background-color:white" i],
[style*="background: #f4f8f9" i],
[style*="background-color: #f4f8f9" i],
[style*="background: #f7fafc" i],
[style*="background-color: #f7fafc" i] {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text) !important;
}

[style*="background: lightyellow" i],
[style*="background-color: lightyellow" i] {
    background-color: var(--theme-surface-raised) !important;
    color: var(--theme-text) !important;
}

@media print {
    :root {
        color-scheme: light;
    }

    html,
    body,
    #wrapper,
    .page-wrapper {
        background: #fff !important;
        color: #000 !important;
    }

    .white-box,
    .panel,
    .modal-content,
    .table,
    table,
    table > thead > tr > th,
    table > tbody > tr > th,
    table > tbody > tr > td,
    table > tfoot > tr > th,
    table > tfoot > tr > td,
    .table > thead > tr > th,
    .table > tbody > tr > th,
    .table > tbody > tr > td,
    .table > tfoot > tr > th,
    .table > tfoot > tr > td,
    th,
    td {
        background: #fff;
        color: #000;
        border-color: #ccc;
    }
}
