html {
    color-scheme: light;
}

html.dark {
    color-scheme: dark;
    --iq-title-text: #f8fafc;
    --iq-body-text: #cbd5e1;
    --iq-body-bg: #0f172a;
    --iq-secondary: #94a3b8;
    --iq-dark: #020617;
    --iq-light: #334155;
    --iq-black: #f8fafc;
    --iq-gray: #64748b;
    --iq-light-primary: #3b2435;
    --iq-light-secondary: #1e293b;
    --iq-light-success: #123c35;
    --iq-light-danger: #45251f;
    --iq-light-warning: #3f3718;
    --iq-light-info: #172554;
    --iq-light-dark: #1e293b;
    --iq-light-hover: #1e293b;
    --iq-border-light: #334155;
    --iq-light-card: #111827;
}

html.dark body,
html.dark .content-page {
    background-color: var(--iq-body-bg);
    color: var(--iq-body-text);
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6,
html.dark label,
html.dark legend,
html.dark .text-dark,
html.dark .text-gray-700,
html.dark .text-gray-800,
html.dark .text-gray-900 {
    color: var(--iq-title-text) !important;
}

html.dark .iq-card,
html.dark .iq-sidebar,
html.dark .iq-footer,
html.dark .card,
html.dark .modal-content,
html.dark .dropdown-menu,
html.dark .list-group-item,
html.dark .popover,
html.dark .iq-sub-dropdown .iq-card,
html.dark .select2-dropdown,
html.dark .select2-container--default .select2-selection--single,
html.dark .select2-container--default .select2-selection--multiple {
    background-color: var(--iq-light-card) !important;
    color: var(--iq-body-text);
    border-color: var(--iq-border-light) !important;
}

html.dark .table {
    color: var(--iq-body-text);
}

html.dark .table th,
html.dark .table td,
html.dark .table thead th,
html.dark .modal-header,
html.dark .modal-footer,
html.dark .dropdown-divider,
html.dark .border,
html.dark .border-top,
html.dark .border-right,
html.dark .border-bottom,
html.dark .border-left {
    border-color: var(--iq-border-light) !important;
}

html.dark .table-striped tbody tr:nth-of-type(odd),
html.dark .table-hover tbody tr:hover,
html.dark .dropdown-item:hover,
html.dark .dropdown-item:focus,
html.dark .list-group-item-action:hover {
    background-color: #1e293b;
    color: var(--iq-title-text);
}

html.dark .dropdown-item,
html.dark .close,
html.dark .nav-link,
html.dark .page-link,
html.dark .select2-container--default .select2-selection--single .select2-selection__rendered,
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice,
html.dark .select2-container--default .select2-results__option {
    color: var(--iq-body-text);
}

html.dark .form-control,
html.dark .custom-select,
html.dark .input-group-text,
html.dark .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #0b1220;
    border-color: var(--iq-border-light);
    color: var(--iq-title-text);
}

html.dark .form-control:focus,
html.dark .custom-select:focus {
    background-color: #0b1220;
    border-color: var(--iq-primary);
    color: var(--iq-title-text);
}

html.dark .form-control::placeholder,
html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

html.dark .page-item.disabled .page-link,
html.dark .page-link {
    background-color: var(--iq-light-card);
    border-color: var(--iq-border-light);
}

html.dark .logo-title > span {
    color: var(--iq-title-text) !important;
}

html.dark .logo-title > span > span {
    color: var(--iq-primary) !important;
}

html.dark .payment-remove-button {
    color: #fda4af !important;
}

html.dark .payment-checkout,
html.dark .payment-mobile-item,
html.dark .payment-total-panel {
    background-color: var(--iq-light-card);
}

html.dark .payment-confirmation-warning {
    background-color: #3f3718 !important;
    border-color: #665b24 !important;
    color: #fde68a !important;
}

html.dark .apexcharts-text,
html.dark .apexcharts-legend-text,
html.dark .apexcharts-title-text,
html.dark .apexcharts-subtitle-text {
    fill: var(--iq-body-text) !important;
    color: var(--iq-body-text) !important;
}

html.dark .apexcharts-gridline,
html.dark .apexcharts-xaxis line,
html.dark .apexcharts-yaxis line {
    stroke: var(--iq-border-light);
}

html.dark .bg-white,
html.dark .bg-gray-100 {
    background-color: var(--iq-light-card) !important;
}

html.dark .border-gray-100,
html.dark .border-gray-200 {
    border-color: var(--iq-border-light) !important;
}

html.dark .iq-card,
html.dark .iq-sidebar,
html.dark .iq-footer,
html.dark .shadow,
html.dark .shadow-md,
html.dark .shadow-sm {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28) !important;
}

.theme-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid var(--iq-border-light, #e2e8f0);
    border-radius: 999px;
    color: var(--iq-body-text, #475569);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: 0.45rem;
    justify-content: center;
    line-height: 1;
    padding: 0.55rem 0.75rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background-color: var(--iq-light-primary, #f8e7ec);
    border-color: var(--iq-primary, #eb0045);
    color: var(--iq-primary, #eb0045);
    outline: none;
}

.theme-toggle svg {
    height: 1.1rem;
    width: 1.1rem;
}

.theme-toggle__sun,
html.dark .theme-toggle__moon {
    display: none;
}

html.dark .theme-toggle__sun {
    display: block;
}

.theme-toggle--floating {
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 1050;
}

@media (max-width: 767.98px) {
    html.dark .iq-navbar-logo img {
        filter: brightness(0) invert(1);
    }

    .theme-toggle__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
