:root {
    --imi-bg: #f8f9fc;
    --imi-surface: #ffffff;
    --imi-surface-soft: #f8f9fc;
    --imi-surface-muted: #eaecf4;
    --imi-border: #e3e6f0;
    --imi-text: #5a5c69;
    --imi-text-strong: #3a3b45;
    --imi-text-muted: #858796;
    --imi-input-bg: #ffffff;
    --imi-input-text: #6e707e;
    --imi-sidebar-start: #4e73df;
    --imi-sidebar-end: #224abe;
    --imi-shadow: 0 .15rem 1.75rem 0 rgba(58, 59, 69, .15);
}

html[data-theme="dark"] {
    --imi-bg: #111827;
    --imi-surface: #1f2937;
    --imi-surface-soft: #273244;
    --imi-surface-muted: #374151;
    --imi-border: #374151;
    --imi-text: #d1d5db;
    --imi-text-strong: #f9fafb;
    --imi-text-muted: #9ca3af;
    --imi-input-bg: #111827;
    --imi-input-text: #f3f4f6;
    --imi-sidebar-start: #172554;
    --imi-sidebar-end: #0f172a;
    --imi-shadow: 0 .15rem 1.75rem 0 rgba(0, 0, 0, .35);
}

body {
    background-color: var(--imi-bg);
    color: var(--imi-text);
}

.theme-toggle {
    border: 0;
    line-height: 1;
    min-width: 2.75rem;
}

.theme-toggle:focus {
    box-shadow: none;
}

.theme-toggle-light-icon,
html[data-theme="dark"] .theme-toggle-dark-icon {
    display: none;
}

html[data-theme="dark"] .theme-toggle-light-icon {
    display: inline-block;
    color: #fbbf24;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #wrapper,
html[data-theme="dark"] #content-wrapper,
html[data-theme="dark"] #content,
html[data-theme="dark"] .container-fluid {
    background-color: var(--imi-bg) !important;
    color: var(--imi-text);
}

html[data-theme="dark"] .bg-gradient-primary {
    background-color: var(--imi-sidebar-start);
    background-image: linear-gradient(180deg, var(--imi-sidebar-start) 10%, var(--imi-sidebar-end) 100%) !important;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .sticky-footer,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .collapse-inner,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .jumbotron {
    background-color: var(--imi-surface) !important;
    color: var(--imi-text);
    border-color: var(--imi-border);
}

html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-lg {
    box-shadow: var(--imi-shadow) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light {
    background-color: var(--imi-surface) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .dropdown-header,
html[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--imi-surface-soft) !important;
    border-color: var(--imi-border);
    color: var(--imi-text-strong);
}

html[data-theme="dark"] .text-gray-100,
html[data-theme="dark"] .text-gray-200,
html[data-theme="dark"] .text-gray-300,
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] label,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .collapse-item,
html[data-theme="dark"] .navbar-light .navbar-nav .nav-link,
html[data-theme="dark"] .navbar-light .navbar-brand {
    color: var(--imi-text-strong) !important;
}

html[data-theme="dark"] .small,
html[data-theme="dark"] small,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .dataTables_info,
html[data-theme="dark"] .dataTables_length,
html[data-theme="dark"] .dataTables_filter {
    color: var(--imi-text-muted) !important;
}

html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.collapse-item) {
    color: #93c5fd;
}

html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.collapse-item):hover {
    color: #bfdbfe;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .collapse-item:hover,
html[data-theme="dark"] .collapse-item:focus {
    background-color: var(--imi-surface-muted) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] .sidebar-divider,
html[data-theme="dark"] hr,
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-right,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-left {
    border-color: var(--imi-border) !important;
}

html[data-theme="dark"] .table,
html[data-theme="dark"] .table-bordered,
html[data-theme="dark"] .table-striped,
html[data-theme="dark"] .table-hover {
    color: var(--imi-text);
    background-color: var(--imi-surface);
}

html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table-bordered th,
html[data-theme="dark"] .table-bordered td {
    border-color: var(--imi-border) !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .thead-light th {
    background-color: var(--imi-surface-soft) !important;
    color: var(--imi-text-strong) !important;
    border-color: var(--imi-border) !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, .035);
}

html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(147, 197, 253, .12);
    color: var(--imi-text-strong);
}

html[data-theme="dark"] .table td .btn-link,
html[data-theme="dark"] .dataTable td .btn-link {
    color: #bfdbfe !important;
    background-color: rgba(96, 165, 250, .12);
    border: 1px solid rgba(147, 197, 253, .28);
    border-radius: .35rem;
    text-decoration: none;
}

html[data-theme="dark"] .table td .btn-link:hover,
html[data-theme="dark"] .table td .btn-link:focus,
html[data-theme="dark"] .dataTable td .btn-link:hover,
html[data-theme="dark"] .dataTable td .btn-link:focus {
    color: #ffffff !important;
    background-color: rgba(96, 165, 250, .26);
    border-color: rgba(191, 219, 254, .58);
    box-shadow: 0 0 0 .12rem rgba(96, 165, 250, .18);
}

html[data-theme="dark"] .table td .btn-link.text-danger,
html[data-theme="dark"] .dataTable td .btn-link.text-danger {
    color: #fca5a5 !important;
    background-color: rgba(248, 113, 113, .12);
    border-color: rgba(252, 165, 165, .28);
}

html[data-theme="dark"] .table td .btn-link.text-danger:hover,
html[data-theme="dark"] .table td .btn-link.text-danger:focus,
html[data-theme="dark"] .dataTable td .btn-link.text-danger:hover,
html[data-theme="dark"] .dataTable td .btn-link.text-danger:focus {
    color: #ffffff !important;
    background-color: rgba(248, 113, 113, .28);
    border-color: rgba(254, 202, 202, .62);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .custom-select,
html[data-theme="dark"] .custom-file-label,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]) {
    background-color: var(--imi-input-bg) !important;
    border-color: var(--imi-border) !important;
    color: var(--imi-input-text) !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #9ca3af !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .custom-select:focus {
    background-color: #0b1220 !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 .2rem rgba(96, 165, 250, .22);
}

html[data-theme="dark"] .page-link {
    background-color: var(--imi-surface);
    border-color: var(--imi-border);
    color: #93c5fd;
}

html[data-theme="dark"] .page-link:hover {
    background-color: var(--imi-surface-muted);
    border-color: var(--imi-border);
    color: #ffffff;
}

html[data-theme="dark"] .alert {
    border-color: transparent;
}

html[data-theme="dark"] .alert-success {
    background-color: #12372a;
    border-color: #276749;
    color: #d1fae5;
}

html[data-theme="dark"] .alert-success.border-left-success {
    border-left-color: #34d399 !important;
}

html[data-theme="dark"] .alert-success .close {
    color: #d1fae5;
    opacity: .85;
}

html[data-theme="dark"] .alert-success .close:hover,
html[data-theme="dark"] .alert-success .close:focus {
    color: #ffffff;
    opacity: 1;
}

html[data-theme="dark"] .support-ticket-guide {
    background-color: #1f2937 !important;
    border-color: #374151;
    border-left-color: #38bdf8 !important;
}

html[data-theme="dark"] .support-ticket-guide .card-header {
    background-color: #155e75 !important;
    border-bottom-color: #0891b2;
}

html[data-theme="dark"] .support-ticket-guide .card-header h6 {
    color: #ffffff !important;
}

html[data-theme="dark"] .support-ticket-guide .text-primary {
    color: #93c5fd !important;
}

html[data-theme="dark"] .support-ticket-guide .text-success {
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .support-ticket-guide .text-gray-600 {
    color: #d1d5db !important;
}

html[data-theme="dark"] .support-ticket-guide .badge-primary {
    background-color: #2563eb;
    color: #ffffff !important;
}

html[data-theme="dark"] .support-ticket-guide .badge-success {
    background-color: #047857;
    color: #ffffff !important;
}

html[data-theme="dark"] .support-ticket-guide a.badge-success:hover,
html[data-theme="dark"] .support-ticket-guide a.badge-success:focus {
    background-color: #059669;
    color: #ffffff !important;
}

html[data-theme="dark"] .close {
    color: #ffffff;
    text-shadow: none;
}

html[data-theme="dark"] .scroll-to-top {
    background-color: rgba(55, 65, 81, .9);
}

html[data-theme="dark"] .progress {
    background-color: var(--imi-surface-muted);
}

html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-theme="dark"] .select2-dropdown {
    background-color: var(--imi-input-bg);
    border-color: var(--imi-border);
    color: var(--imi-input-text);
}

html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-theme="dark"] .select2-results__option {
    color: var(--imi-input-text);
}

html[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #2563eb;
    color: #ffffff;
}
