body.dark-mode {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
    color-scheme: dark;
}

body.dark-mode #wrapper #content-wrapper {
    background-color: #121212 !important;
}

body.dark-mode .bg-white {
    background-color: #1e1e1e !important;
}

body.dark-mode .text-gray-900,
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-700,
body.dark-mode .text-dark,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 {
    color: #e0e0e0 !important;
}

body.dark-mode .card,
body.dark-mode .dropdown-menu {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

body.dark-mode .card-header {
    background-color: #2c2c2c !important;
    border-bottom: 1px solid #444 !important;
}

body.dark-mode .table {
    color: #e0e0e0 !important;
}

body.dark-mode .table td, 
body.dark-mode .table th {
    border-top: 1px solid #2a2a2a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .table thead th {
    border-bottom: 2px solid #2a2a2a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .table-bordered,
body.dark-mode .table-bordered td, 
body.dark-mode .table-bordered th {
    border: 1px solid #2a2a2a !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .form-control,
body.dark-mode .custom-select {
    background-color: #2c2c2c !important;
    border: 1px solid #444 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .custom-select:focus {
    background-color: #333 !important;
    color: #fff !important;
}

body.dark-mode .modal-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

body.dark-mode .modal-header {
    border-bottom: 1px solid #444 !important;
}

body.dark-mode .modal-footer {
    border-top: 1px solid #444 !important;
}

body.dark-mode .close {
    color: #e0e0e0 !important;
}

body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-mode .dropdown-item {
    color: #e0e0e0 !important;
}

body.dark-mode .dropdown-item:hover {
    background-color: #333 !important;
    color: #fff !important;
}

body.dark-mode .dropdown-divider {
    border-top: 1px solid #444 !important;
}

body.dark-mode .topbar .dropdown-list .dropdown-header {
    background-color: #2c2c2c !important;
    border-color: #2c2c2c !important;
}

body.dark-mode .topbar .dropdown-list .dropdown-item {
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    border-bottom: 1px solid #444 !important;
}

body.dark-mode .btn-light {
    background-color: #333 !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .btn-light:hover {
    background-color: #444 !important;
    color: #fff !important;
}

body.dark-mode .page-item.disabled .page-link,
body.dark-mode .page-link {
    background-color: #1e1e1e !important;
    border-color: #444 !important;
}

body.dark-mode .page-item.active .page-link {
    background-color: #4e73df !important;
    border-color: #4e73df !important;
}

/* Fix sidebar color */
body.dark-mode .sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.8);
}
body.dark-mode .sidebar .nav-item .nav-link:hover {
    color: #fff;
}
body.dark-mode .sidebar .sidebar-heading {
    color: rgba(255, 255, 255, 0.6);
}

/* Scrollbar adjustment */
body.dark-mode ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
body.dark-mode ::-webkit-scrollbar-track {
    background: #1e1e1e;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: #444;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sidebar submenus fix */
body.dark-mode .sidebar .collapse-inner {
    background-color: #2c2c2c !important;
}

body.dark-mode .sidebar .collapse-item {
    color: #e0e0e0 !important;
}

body.dark-mode .sidebar .collapse-item:hover {
    background-color: #3d3d3d !important;
    color: #fff !important;
}

body.dark-mode .sidebar .collapse-item.active {
    color: #4fc3f7 !important;
}

/* Adapted colors for cards and text in dark mode */
body.dark-mode .border-left-primary { border-left-color: #728ced !important; }
body.dark-mode .border-left-success { border-left-color: #3bd19e !important; }
body.dark-mode .border-left-info { border-left-color: #4ec3d4 !important; }
body.dark-mode .border-left-warning { border-left-color: #f7d070 !important; }
body.dark-mode .border-left-danger { border-left-color: #ed7468 !important; }

body.dark-mode .text-primary { color: #728ced !important; }
body.dark-mode .text-success { color: #3bd19e !important; }
body.dark-mode .text-info { color: #4ec3d4 !important; }
body.dark-mode .text-warning { color: #f7d070 !important; }
body.dark-mode .text-danger { color: #ed7468 !important; }

/* Skeleton loading dark mode */
body.dark-mode .skeleton-loading {
    background: #2a2a2a !important;
    background: linear-gradient(110deg, #2a2a2a 8%, #3a3a3a 18%, #2a2a2a 33%) !important;
    background-size: 200% 100% !important;
}

/* SweetAlert2 Dark Mode */
body.dark-mode .swal2-popup {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

body.dark-mode .swal2-title,
body.dark-mode .swal2-content,
body.dark-mode .swal2-html-container {
    color: #e0e0e0 !important;
}

body.dark-mode .swal2-icon.swal2-warning {
    border-color: #f7d070 !important;
    color: #f7d070 !important;
}

body.dark-mode .swal2-icon.swal2-error {
    border-color: #ed7468 !important;
    color: #ed7468 !important;
}

body.dark-mode .swal2-icon.swal2-success {
    border-color: #3bd19e !important;
    color: #3bd19e !important;
}

body.dark-mode .swal2-icon.swal2-info {
    border-color: #4ec3d4 !important;
    color: #4ec3d4 !important;
}

body.dark-mode .swal2-icon.swal2-question {
    border-color: #728ced !important;
    color: #728ced !important;
}
