/* ===================================
   Dark Theme Styles for ERP System
   Comprehensive Version - All Pages
   =================================== */

/* ===================================
   Critical Styles to Prevent Flash
   Applied via inline script for html.dark-theme
   =================================== */
html.dark-theme {
    background: linear-gradient(135deg, #1a1c20 0%, #2d3238 50%, #1e2328 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

/* Page fade-in animation for smooth transitions */
@keyframes darkThemeFadeIn {
    from {
        opacity: 0.97;
    }
    to {
        opacity: 1;
    }
}

html.dark-theme body {
    animation: darkThemeFadeIn 0.15s ease-out;
}

/* ===================================
   Theme Toggle Button Styles
   =================================== */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 18px;
    color: #fff;
    transition: all 0.4s ease;
}

.theme-icon-light {
    color: #ffd43b !important;
}

.theme-icon-dark {
    display: none;
    color: #f0f6fc !important;
}

body:not(.dark-theme) .theme-icon-light {
    display: inline-block;
}

body:not(.dark-theme) .theme-icon-dark {
    display: none;
}

body.dark-theme .theme-icon-light {
    display: none;
}

body.dark-theme .theme-icon-dark {
    display: inline-block;
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes moonGlow {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

.theme-toggle:hover .theme-icon-light {
    animation: sunPulse 1s ease-in-out infinite;
}

.theme-toggle:hover .theme-icon-dark {
    animation: moonGlow 1.5s ease-in-out infinite;
}

/* ===================================
   DARK THEME - Core Variables
   =================================== */
body.dark-theme {
    --dark-bg-primary: #1e2328;
    --dark-bg-secondary: #2d3238;
    --dark-bg-tertiary: #161a1e;
    --dark-border: #3d4450;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #e8eaed;
    --dark-text-muted: #9ca3ab;
    --dark-accent: #23b7e5;
}

/* Body Background with Beautiful Gradient */
html.dark-theme,
body.dark-theme {
    background: linear-gradient(135deg, #1a1c20 0%, #2d3238 50%, #1e2328 100%) !important;
    background-attachment: fixed !important;
    color: #e8eaed !important;
    min-height: 100vh;
}

/* Pre-loader Dark Theme */
html.dark-theme .loader-bg,
body.dark-theme .loader-bg {
    background: linear-gradient(135deg, #1a1c20 0%, #2d3238 100%) !important;
}

body.dark-theme .loader-track {
    background: #3d4450 !important;
}

body.dark-theme .loader-fill {
    background: linear-gradient(90deg, #23b7e5 0%, #17a2b8 100%) !important;
}

/* ===================================
   Header / Top Bar
   =================================== */
body.dark-theme .pcoded-header,
body.dark-theme .pcoded-header.header-lightblue {
    background: linear-gradient(90deg, #0d1117 0%, #161a1e 20%, #1a237e 50%, #283593 75%, #3949ab 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .pcoded-header .navbar-nav > li > a,
body.dark-theme .pcoded-header .navbar-nav > li > a > i,
body.dark-theme .pcoded-header a,
body.dark-theme .pcoded-header i {
    color: #ffffff !important;
}

body.dark-theme .pcoded-header .navbar-nav > li > a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .topbar-title {
    color: #ffffff !important;
}

body.dark-theme .pcoded-header .full-screen i {
    color: #ffffff !important;
}

body.dark-theme .pcoded-header .mobile-menu span,
body.dark-theme .pcoded-header .mobile-menu span::before,
body.dark-theme .pcoded-header .mobile-menu span::after {
    background: #ffffff !important;
}

/* Header Dropdowns */
body.dark-theme .pcoded-header .dropdown-menu {
    background-color: #1e2328 !important;
    border: 1px solid #3d4450 !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .pcoded-header .dropdown-menu a,
body.dark-theme .pcoded-header .dropdown-item {
    color: #e8eaed !important;
}

body.dark-theme .pcoded-header .dropdown-menu a:hover,
body.dark-theme .pcoded-header .dropdown-item:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* Notification Dropdown */
body.dark-theme .notification {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .noti-head {
    background: linear-gradient(90deg, #0d1117 0%, #161a1e 30%, #1a237e 70%, #283593 100%) !important;
    border-bottom: 1px solid rgba(57, 73, 171, 0.3) !important;
    border-radius: 10px 10px 0 0 !important;
}

body.dark-theme .noti-head h6 {
    color: #ffffff !important;
}

body.dark-theme .noti-body li {
    border-bottom: 1px solid rgba(61, 68, 80, 0.5) !important;
    transition: all 0.2s ease !important;
}

body.dark-theme .noti-body li a,
body.dark-theme .noti-body li .media-body p {
    color: #e8eaed !important;
}

body.dark-theme .noti-body li:hover {
    background: linear-gradient(90deg, rgba(57, 73, 171, 0.15) 0%, rgba(57, 73, 171, 0.05) 100%) !important;
}

body.dark-theme .notification-active {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%) !important;
}

/* Profile Dropdown */
body.dark-theme .profile-notification {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border: 1px solid #3d4450 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .profile-notification .pro-head {
    background: linear-gradient(90deg, #0d1117 0%, #161a1e 30%, #1a237e 70%, #283593 100%) !important;
    border-radius: 10px 10px 0 0 !important;
}

body.dark-theme .profile-notification .pro-head span {
    color: #ffffff !important;
}

body.dark-theme .profile-notification .pro-head .dud-logout {
    background: rgba(255, 255, 255, 0.15) !important;
}

body.dark-theme .profile-notification .pro-head .dud-logout:hover {
    background: rgba(220, 53, 69, 0.8) !important;
}

body.dark-theme .profile-notification .pro-head .dud-logout i {
    color: #ffffff !important;
}

body.dark-theme .profile-notification .pro-body li a {
    color: #e8eaed !important;
}

body.dark-theme .profile-notification .pro-body li a:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* ===================================
   Sidebar / Navigation Menu
   =================================== */
body.dark-theme .pcoded-navbar,
body.dark-theme .pcoded-navbar.navbar-lightblue,
body.dark-theme .pcoded-navbar.active-lightblue,
body.dark-theme .pcoded-navbar.title-lightblue,
body.dark-theme .pcoded-navbar.brand-lightblue {
    background: linear-gradient(180deg, #0d1117 0%, #161a1e 50%, #1e2328 100%) !important;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.4);
}

body.dark-theme .pcoded-navbar .navbar-brand,
body.dark-theme .pcoded-navbar .header-logo {
    background: linear-gradient(180deg, #0a0c10 0%, #0d1117 100%) !important;
    border-bottom: 1px solid rgba(35, 183, 229, 0.2);
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li > a {
    color: #b8bfc7 !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li > a > .pcoded-micon {
    color: #8b949e !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li > a:hover,
body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.active > a,
body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li:focus > a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li > a:hover > .pcoded-micon,
body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.active > a > .pcoded-micon {
    color: #23b7e5 !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar li.pcoded-menu-caption,
body.dark-theme .pcoded-navbar .pcoded-inner-navbar li.pcoded-menu-caption > label {
    color: #6c757d !important;
}

body.dark-theme .pcoded-navbar .pcoded-submenu {
    background: #0d1117 !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li > a {
    color: #9ca3ab !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li > a:hover,
body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li.active > a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu > a:after {
    color: #6c757d !important;
}

body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.active:after,
body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger:after {
    background: #23b7e5 !important;
}

body.dark-theme .pcoded-navbar .navbar-content {
    background: transparent !important;
}

body.dark-theme .pcoded-navbar .mobile-menu span,
body.dark-theme .pcoded-navbar .mobile-menu span::before,
body.dark-theme .pcoded-navbar .mobile-menu span::after {
    background: #ffffff !important;
}

/* ===================================
   Main Content Area
   =================================== */
body.dark-theme .pcoded-main-container,
body.dark-theme .pcoded-content,
body.dark-theme .pcoded-wrapper {
    background: transparent !important;
}

body.dark-theme .pcoded-inner-content {
    background-color: transparent !important;
}

/* ===================================
   Cards - With Rounded Corners & Subtle Gradient
   =================================== */
body.dark-theme .card {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border: 1px solid #3d4450 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

body.dark-theme .card-header {
    background: linear-gradient(145deg, #252a30 0%, #1e2328 100%) !important;
    border-bottom: 1px solid rgba(61, 68, 80, 0.7) !important;
    border-radius: 12px 12px 0 0 !important;
    color: #ffffff !important;
}

body.dark-theme .card-body {
    background: transparent !important;
    color: #e8eaed !important;
    border-radius: inherit !important;
}

body.dark-theme .card-footer {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border-top: 1px solid rgba(61, 68, 80, 0.7) !important;
    border-radius: 0 0 12px 12px !important;
    color: #e8eaed !important;
}

body.dark-theme .card-title,
body.dark-theme .card-header h5,
body.dark-theme .card h5 {
    color: #ffffff !important;
}

/* Card Border Colors */
body.dark-theme .card-border-c-blue {
    border-top: 4px solid #04a9f5 !important;
}

body.dark-theme .card-border-c-red {
    border-top: 4px solid #f44236 !important;
}

body.dark-theme .card-border-c-green {
    border-top: 4px solid #1de9b6 !important;
}

body.dark-theme .card-border-c-yellow {
    border-top: 4px solid #f4c22b !important;
}

body.dark-theme .card-border-c-purple {
    border-top: 4px solid #a389d4 !important;
}

/* ===================================
   Dashboard Stat Cards - GRADIENT FIX
   =================================== */
body.dark-theme .bg-c-blue {
    background: linear-gradient(135deg, #1976d2 0%, #64b5f6 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .bg-c-green {
    background: linear-gradient(135deg, #00897b 0%, #1de9b6 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .bg-c-yellow {
    background: linear-gradient(135deg, #f57c00 0%, #f4c22b 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .bg-c-red {
    background: linear-gradient(135deg, #c62828 0%, #ef5350 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .bg-c-purple {
    background: linear-gradient(135deg, #7b1fa2 0%, #ba68c8 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .bg-c-orenge {
    background: linear-gradient(135deg, #e65100 0%, #ff9800 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .theme-bg {
    background: linear-gradient(-135deg, #1de9b6 0%, #1dc4e9 100%) !important;
    border-radius: 10px !important;
}

body.dark-theme .theme-bg2 {
    background: linear-gradient(-135deg, #899FD4 0%, #A389D4 100%) !important;
    border-radius: 10px !important;
}

/* Order Cards & Stat Cards Text */
body.dark-theme .order-card,
body.dark-theme .order-card h6,
body.dark-theme .order-card h2,
body.dark-theme .order-card span,
body.dark-theme .order-card i,
body.dark-theme [class*="bg-c-"] .card-block,
body.dark-theme [class*="bg-c-"] h6,
body.dark-theme [class*="bg-c-"] h2,
body.dark-theme [class*="bg-c-"] p,
body.dark-theme [class*="bg-c-"] span,
body.dark-theme [class*="bg-c-"] i,
body.dark-theme .theme-bg h6,
body.dark-theme .theme-bg h2,
body.dark-theme .theme-bg p,
body.dark-theme .theme-bg span,
body.dark-theme .theme-bg2 h6,
body.dark-theme .theme-bg2 h2,
body.dark-theme .theme-bg2 p,
body.dark-theme .theme-bg2 span {
    color: #ffffff !important;
}

/* Bitcoin Wallet Card */
body.dark-theme .bitcoin-wallet {
    border-radius: 10px !important;
}

body.dark-theme .bitcoin-wallet h5,
body.dark-theme .bitcoin-wallet i {
    color: #ffffff !important;
}

/* ===================================
   Typography
   =================================== */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: #ffffff !important;
}

body.dark-theme p {
    color: #e8eaed !important;
}

body.dark-theme span:not([class*="badge"]):not([class*="bg-"]) {
    color: #e8eaed !important;
}

body.dark-theme label {
    color: #e8eaed !important;
}

body.dark-theme a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link) {
    color: #64b5f6;
}

body.dark-theme a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link):hover {
    color: #90caf9;
}

body.dark-theme .text-muted {
    color: #9ca3ab !important;
}

body.dark-theme small {
    color: #9ca3ab !important;
}

body.dark-theme strong {
    color: #ffffff !important;
}

/* ===================================
   Tables - With Subtle Gradients
   =================================== */
body.dark-theme .table {
    color: #e8eaed !important;
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

body.dark-theme .table th {
    background: linear-gradient(180deg, #161a1e 0%, #1a1e22 100%) !important;
    color: #ffffff !important;
    border-color: #3d4450 !important;
    font-weight: 600;
}

body.dark-theme .table td {
    border-color: rgba(61, 68, 80, 0.5) !important;
    color: #e8eaed !important;
    background: transparent !important;
}

body.dark-theme .table-striped tbody tr:nth-of-type(odd),
body.dark-theme .table-striped > tbody > tr:nth-of-type(2n+1) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(2n+1) > * {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.02) !important;
    background-color: transparent !important;
}

body.dark-theme .table-striped tbody tr:nth-of-type(even),
body.dark-theme .table-striped > tbody > tr:nth-of-type(2n) {
    background-color: transparent !important;
}

body.dark-theme .table-striped > tbody > tr:nth-of-type(2n) > * {
    --bs-table-accent-bg: transparent !important;
    background-color: transparent !important;
}

body.dark-theme .table-hover tbody tr:hover {
    background: linear-gradient(90deg, rgba(35, 183, 229, 0.08) 0%, rgba(35, 183, 229, 0.03) 100%) !important;
    color: #ffffff !important;
}

body.dark-theme .table-hover tbody tr:hover td {
    background: transparent !important;
}

body.dark-theme .table-bordered,
body.dark-theme .table-bordered th,
body.dark-theme .table-bordered td {
    border-color: #3d4450 !important;
}

/* ===================================
   DataTables - COMPREHENSIVE FIX
   =================================== */
body.dark-theme .dataTables_wrapper {
    color: #e8eaed !important;
}

body.dark-theme .dataTables_wrapper .dataTables_length,
body.dark-theme .dataTables_wrapper .dataTables_filter,
body.dark-theme .dataTables_wrapper .dataTables_info,
body.dark-theme .dataTables_wrapper .dataTables_processing,
body.dark-theme .dataTables_wrapper .dataTables_paginate {
    color: #e8eaed !important;
}

body.dark-theme .dataTables_wrapper .dataTables_length label,
body.dark-theme .dataTables_wrapper .dataTables_filter label {
    color: #e8eaed !important;
}

body.dark-theme .dataTables_wrapper .dataTables_length select,
body.dark-theme .dataTables_wrapper .dataTables_filter input {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

/* DataTables Buttons - FIX WHITE BACKGROUND */
body.dark-theme .dataTables_wrapper .dt-buttons,
body.dark-theme .dt-buttons.btn-group,
body.dark-theme div.dt-buttons {
    background-color: transparent !important;
}

body.dark-theme .dataTables_wrapper .dt-buttons .btn,
body.dark-theme .dt-buttons .btn,
body.dark-theme div.dt-buttons > .btn {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
    color: #23b7e5 !important;
}

body.dark-theme .dataTables_wrapper .dt-buttons .btn:hover,
body.dark-theme .dt-buttons .btn:hover {
    background-color: #2d3238 !important;
    border-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .btn-group.flex-wrap {
    background-color: transparent !important;
}

/* DataTables Pagination */
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e8eaed !important;
    background: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #23b7e5 !important;
    border-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #2d3238 !important;
    border-color: #3d4450 !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #6c757d !important;
}

/* DataTables Row Striping */
body.dark-theme table.dataTable tbody tr {
    background-color: #1e2328 !important;
}

body.dark-theme table.dataTable.table-striped > tbody > tr.odd,
body.dark-theme table.dataTable.table-striped > tbody > tr.odd > * {
    background-color: rgba(255, 255, 255, 0.03) !important;
    box-shadow: none !important;
}

body.dark-theme table.dataTable.table-striped > tbody > tr.even,
body.dark-theme table.dataTable.table-striped > tbody > tr.even > * {
    background-color: #1e2328 !important;
}

body.dark-theme table.dataTable tbody tr:hover,
body.dark-theme table.dataTable tbody tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* ===================================
   Forms - COMPREHENSIVE FIX
   =================================== */
body.dark-theme .form-control {
    background: linear-gradient(145deg, #161a1e 0%, #1a1e22 100%) !important;
    border: 1px solid #3d4450 !important;
    color: #e8eaed !important;
    transition: all 0.3s ease !important;
}

body.dark-theme .form-control:focus {
    background: linear-gradient(145deg, #1a1e22 0%, #1e2328 100%) !important;
    border-color: #5c6bc0 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.2), 0 0 15px rgba(92, 107, 192, 0.1);
}

body.dark-theme .form-control::placeholder {
    color: #6c757d !important;
}

body.dark-theme .form-control:disabled,
body.dark-theme .form-control[readonly] {
    background: linear-gradient(145deg, #0d1117 0%, #161a1e 100%) !important;
    color: #9ca3ab !important;
}

body.dark-theme .form-select,
body.dark-theme select.form-control,
body.dark-theme select {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .input-group-text {
    background: linear-gradient(145deg, #0d1117 0%, #161a1e 100%) !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .form-check-input {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
}

body.dark-theme .form-check-input:checked {
    background: linear-gradient(135deg, #3949ab 0%, #5c6bc0 100%) !important;
    border-color: #5c6bc0 !important;
}

body.dark-theme textarea.form-control {
    background: linear-gradient(145deg, #161a1e 0%, #1a1e22 100%) !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

/* Input Group */
body.dark-theme .input-group .form-control {
    background: linear-gradient(145deg, #161a1e 0%, #1a1e22 100%) !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

/* ===================================
   All Input Types - Dark Theme
   =================================== */
body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme input[type="tel"],
body.dark-theme input[type="url"],
body.dark-theme input[type="search"],
body.dark-theme input[type="date"],
body.dark-theme input[type="time"],
body.dark-theme input[type="datetime-local"] {
    background: #161a1e !important;
    border: 1px solid #3d4450 !important;
    color: #e8eaed !important;
    box-shadow: none !important;
}

body.dark-theme input[type="text"]:focus,
body.dark-theme input[type="email"]:focus,
body.dark-theme input[type="password"]:focus,
body.dark-theme input[type="number"]:focus,
body.dark-theme input[type="tel"]:focus,
body.dark-theme input[type="url"]:focus,
body.dark-theme input[type="search"]:focus,
body.dark-theme input[type="date"]:focus,
body.dark-theme input[type="time"]:focus,
body.dark-theme input[type="datetime-local"]:focus {
    background: #1a1e22 !important;
    border-color: #3949ab !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.2) !important;
}

/* Override any white backgrounds from plugins */
body.dark-theme .form-step input,
body.dark-theme .form-step textarea,
body.dark-theme .form-step select,
body.dark-theme .wizard input,
body.dark-theme .wizard textarea,
body.dark-theme .wizard select {
    background: #161a1e !important;
    border: 1px solid #3d4450 !important;
    color: #e8eaed !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
}

/* ===================================
   Fieldset / Scheduler Border - FIX
   =================================== */
body.dark-theme fieldset.scheduler-border {
    border: 1px dashed #3d4450 !important;
    background: transparent !important;
}

body.dark-theme fieldset.scheduler-border legend,
body.dark-theme legend.scheduler-border {
    background: #1e2328 !important;
    color: #ffffff !important;
}

/* ===================================
   Select2 - COMPREHENSIVE FIX
   =================================== */
body.dark-theme .select2-container--default .select2-selection--single,
body.dark-theme .select2-container--default .select2-selection--multiple {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e8eaed !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #e8eaed transparent transparent transparent !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}

body.dark-theme .select2-dropdown {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .select2-container--default .select2-results__option {
    color: #e8eaed !important;
    background-color: #1e2328 !important;
}

body.dark-theme .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #23b7e5 !important;
    border-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #ffffff !important;
}

/* ===================================
   User Card / Profile Page - FIX
   =================================== */
body.dark-theme .user-card,
body.dark-theme .user-card-1 {
    background-color: #1e2328 !important;
}

body.dark-theme .user-card .user-about-block {
    background-color: #1e2328 !important;
}

body.dark-theme .user-card .certificated-badge {
    background: #23b7e5 !important;
}

body.dark-theme .user-card .certificated-badge i {
    color: #ffffff !important;
}

body.dark-theme .profile-thumb {
    border-color: #3d4450 !important;
}

body.dark-theme .user-card h6,
body.dark-theme .user-card p,
body.dark-theme .user-card span {
    color: #e8eaed !important;
}

/* Profile Info Boxes */
body.dark-theme .row.g-2 .col,
body.dark-theme .row.gx-2 .col {
    background-color: transparent !important;
}

/* ===================================
   Invoice & Location Sale Cards
   =================================== */
body.dark-theme .Invoice-bar .invoice-lable label {
    background: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .location-sale .card-icon {
    background: #1e2328 !important;
    border-color: #3d4450 !important;
}

/* ===================================
   Code Blocks & Blockquotes
   =================================== */
body.dark-theme code {
    background-color: #161a1e !important;
    color: #ef5350 !important;
}

body.dark-theme .card .card-block code {
    background-color: #161a1e !important;
}

body.dark-theme pre {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

body.dark-theme .blockquote {
    border-left-color: #3d4450 !important;
}

/* ===================================
   Breadcrumb
   =================================== */
body.dark-theme .page-header {
    background-color: transparent !important;
}

body.dark-theme .page-header .page-header-title h5 {
    color: #ffffff !important;
}

body.dark-theme .breadcrumb {
    background-color: transparent !important;
}

body.dark-theme .breadcrumb-item a {
    color: #64b5f6 !important;
}

body.dark-theme .breadcrumb-item.active {
    color: #9ca3ab !important;
}

body.dark-theme .breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d !important;
}

/* ===================================
   Modals - With Gradients
   =================================== */
body.dark-theme .modal-content {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border: 1px solid #3d4450 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .modal-header {
    background: linear-gradient(145deg, #161a1e 0%, #1e2328 100%) !important;
    border-bottom: 1px solid rgba(61, 68, 80, 0.7) !important;
    border-radius: 12px 12px 0 0 !important;
    color: #ffffff !important;
}

body.dark-theme .modal-header .modal-title {
    color: #ffffff !important;
}

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

body.dark-theme .modal-body {
    color: #e8eaed !important;
    background: transparent !important;
}

body.dark-theme .modal-footer {
    background: linear-gradient(145deg, #1e2328 0%, #161a1e 100%) !important;
    border-top: 1px solid rgba(61, 68, 80, 0.7) !important;
    border-radius: 0 0 12px 12px !important;
}

/* ===================================
   General Dropdowns - With Gradients
   =================================== */
body.dark-theme .dropdown-menu {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border: 1px solid #3d4450 !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

body.dark-theme .dropdown-item {
    color: #e8eaed !important;
    transition: all 0.2s ease !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .dropdown-item:focus {
    background: linear-gradient(90deg, rgba(35, 183, 229, 0.15) 0%, rgba(35, 183, 229, 0.05) 100%) !important;
    color: #ffffff !important;
}

body.dark-theme .dropdown-divider {
    border-top-color: #3d4450 !important;
}

/* ===================================
   Buttons - With Gradient Backgrounds
   =================================== */
body.dark-theme .btn-primary {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #5c6bc0 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(57, 73, 171, 0.4) !important;
    transition: all 0.3s ease !important;
}

body.dark-theme .btn-primary:hover {
    background: linear-gradient(135deg, #283593 0%, #5c6bc0 50%, #7986cb 100%) !important;
    box-shadow: 0 5px 15px rgba(57, 73, 171, 0.6) !important;
    transform: translateY(-1px);
}

body.dark-theme .btn-secondary {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 50%, #7d868e 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3) !important;
}

body.dark-theme .btn-secondary:hover {
    background: linear-gradient(135deg, #6c757d 0%, #7d868e 50%, #8e969e 100%) !important;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.5) !important;
}

body.dark-theme .btn-success {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #43a047 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(46, 125, 50, 0.3) !important;
}

body.dark-theme .btn-success:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 50%, #66bb6a 100%) !important;
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.5) !important;
}

body.dark-theme .btn-danger {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 50%, #e53935 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(198, 40, 40, 0.3) !important;
}

body.dark-theme .btn-danger:hover {
    background: linear-gradient(135deg, #c62828 0%, #e53935 50%, #ef5350 100%) !important;
    box-shadow: 0 5px 15px rgba(198, 40, 40, 0.5) !important;
}

body.dark-theme .btn-warning {
    background: linear-gradient(135deg, #e65100 0%, #f57c00 50%, #fb8c00 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(245, 124, 0, 0.3) !important;
}

body.dark-theme .btn-warning:hover {
    background: linear-gradient(135deg, #f57c00 0%, #fb8c00 50%, #ff9800 100%) !important;
    box-shadow: 0 5px 15px rgba(245, 124, 0, 0.5) !important;
}

body.dark-theme .btn-info {
    background: linear-gradient(135deg, #0277bd 0%, #0288d1 50%, #039be5 100%) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(2, 136, 209, 0.3) !important;
}

body.dark-theme .btn-info:hover {
    background: linear-gradient(135deg, #0288d1 0%, #039be5 50%, #29b6f6 100%) !important;
    box-shadow: 0 5px 15px rgba(2, 136, 209, 0.5) !important;
}

body.dark-theme .btn-light {
    background: linear-gradient(135deg, #2d3238 0%, #3d4450 50%, #4a5568 100%) !important;
    border-color: transparent !important;
    color: #e8eaed !important;
}

body.dark-theme .btn-dark {
    background: linear-gradient(135deg, #0d1117 0%, #161a1e 50%, #1e2328 100%) !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .btn-outline-primary {
    color: #7986cb !important;
    border-color: #5c6bc0 !important;
}

body.dark-theme .btn-outline-primary:hover {
    background: linear-gradient(135deg, #3949ab 0%, #5c6bc0 100%) !important;
    border-color: #5c6bc0 !important;
    color: #ffffff !important;
}

body.dark-theme .btn-outline-secondary {
    color: #9ca3ab !important;
    border-color: #6c757d !important;
}

body.dark-theme .btn-outline-secondary:hover {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

/* ===================================
   Alerts - With Subtle Gradients
   =================================== */
body.dark-theme .alert-info {
    background: linear-gradient(135deg, rgba(35, 183, 229, 0.15) 0%, rgba(35, 183, 229, 0.08) 100%) !important;
    border-left: 4px solid #23b7e5 !important;
    border-color: rgba(35, 183, 229, 0.3) !important;
    color: #64b5f6 !important;
}

body.dark-theme .alert-success {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.15) 0%, rgba(46, 125, 50, 0.08) 100%) !important;
    border-left: 4px solid #2e7d32 !important;
    border-color: rgba(46, 125, 50, 0.3) !important;
    color: #81c784 !important;
}

body.dark-theme .alert-warning {
    background: linear-gradient(135deg, rgba(245, 124, 0, 0.15) 0%, rgba(245, 124, 0, 0.08) 100%) !important;
    border-left: 4px solid #f57c00 !important;
    border-color: rgba(245, 124, 0, 0.3) !important;
    color: #ffb74d !important;
}

body.dark-theme .alert-danger {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.15) 0%, rgba(198, 40, 40, 0.08) 100%) !important;
    border-left: 4px solid #c62828 !important;
    border-color: rgba(198, 40, 40, 0.3) !important;
    color: #ef5350 !important;
}

/* ===================================
   Pagination - With Gradients
   =================================== */
body.dark-theme .page-link {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
    transition: all 0.3s ease !important;
}

body.dark-theme .page-link:hover {
    background: linear-gradient(145deg, #2d3238 0%, #3d4450 100%) !important;
    border-color: #4a5568 !important;
    color: #ffffff !important;
}

body.dark-theme .page-item.active .page-link {
    background: linear-gradient(135deg, #3949ab 0%, #5c6bc0 100%) !important;
    border-color: #5c6bc0 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(57, 73, 171, 0.4) !important;
}

body.dark-theme .page-item.disabled .page-link {
    background: linear-gradient(145deg, #161a1e 0%, #1e2328 100%) !important;
    border-color: #3d4450 !important;
    color: #6c757d !important;
}

/* ===================================
   List Groups
   =================================== */
body.dark-theme .list-group-item {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .list-group-item:hover {
    background-color: #2d3238 !important;
}

body.dark-theme .list-group-item.active {
    background-color: #23b7e5 !important;
    border-color: #23b7e5 !important;
}

/* ===================================
   Nav Tabs & Pills
   =================================== */
body.dark-theme .nav-tabs {
    border-bottom-color: #3d4450 !important;
}

body.dark-theme .nav-tabs .nav-link {
    color: #9ca3ab !important;
}

body.dark-theme .nav-tabs .nav-link:hover {
    border-color: #3d4450 #3d4450 #3d4450 !important;
    color: #ffffff !important;
}

body.dark-theme .nav-tabs .nav-link.active {
    background-color: #1e2328 !important;
    border-color: #3d4450 #3d4450 #1e2328 !important;
    color: #ffffff !important;
}

body.dark-theme .nav-pills .nav-link {
    color: #e8eaed !important;
}

body.dark-theme .nav-pills .nav-link.active {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

/* Tab Content */
body.dark-theme .tab-content {
    background-color: #1e2328 !important;
}

body.dark-theme .tab-pane {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* ===================================
   Progress Bars
   =================================== */
body.dark-theme .progress {
    background-color: #3d4450 !important;
}

/* ===================================
   Badges
   =================================== */
body.dark-theme .badge {
    color: #ffffff !important;
}

body.dark-theme .badge-light,
body.dark-theme .bg-light {
    background-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .badge-secondary {
    background-color: #6c757d !important;
}

/* ===================================
   Loader
   =================================== */
body.dark-theme .loader-bg {
    background-color: #2d3238 !important;
}

body.dark-theme .loader-track {
    background-color: #3d4450 !important;
}

/* ===================================
   Chat Section
   =================================== */
body.dark-theme .header-user-list,
body.dark-theme .header-chat {
    background-color: #1e2328 !important;
}

body.dark-theme .h-list-header {
    background-color: #161a1e !important;
    border-bottom-color: #3d4450 !important;
}

/* ===================================
   HR & Borders
   =================================== */
body.dark-theme hr {
    border-color: #3d4450 !important;
}

body.dark-theme .border {
    border-color: #3d4450 !important;
}

body.dark-theme .border-top {
    border-top-color: #3d4450 !important;
}

body.dark-theme .border-bottom {
    border-bottom-color: #3d4450 !important;
}

body.dark-theme .border-left,
body.dark-theme .border-start {
    border-left-color: #3d4450 !important;
}

body.dark-theme .border-right,
body.dark-theme .border-end {
    border-right-color: #3d4450 !important;
}

/* ===================================
   Tooltips & Popovers
   =================================== */
body.dark-theme .tooltip-inner {
    background-color: #161a1e !important;
    color: #ffffff !important;
}

body.dark-theme .popover {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .popover-header {
    background-color: #161a1e !important;
    border-bottom-color: #3d4450 !important;
    color: #ffffff !important;
}

body.dark-theme .popover-body {
    color: #e8eaed !important;
}

/* ===================================
   Card Animation Border
   =================================== */
body.dark-theme .card .animated {
    border-color: #3d4450 !important;
}

/* ===================================
   Scrollbar Styling
   =================================== */
body.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #1e2328;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ===================================
   Background Color Utilities
   =================================== */
body.dark-theme .bg-white {
    background-color: #1e2328 !important;
}

body.dark-theme .bg-light {
    background-color: #2d3238 !important;
}

body.dark-theme .bg-secondary {
    background-color: #3d4450 !important;
}

/* ===================================
   Row/Column Backgrounds
   =================================== */
body.dark-theme .row {
    background-color: transparent !important;
}

body.dark-theme [class*="col-"] {
    background-color: transparent !important;
}

/* ===================================
   General White Background Override
   =================================== */
body.dark-theme div[style*="background-color: white"],
body.dark-theme div[style*="background-color: #fff"],
body.dark-theme div[style*="background-color:#fff"],
body.dark-theme div[style*="background: white"],
body.dark-theme div[style*="background: #fff"],
body.dark-theme div[style*="background:#fff"] {
    background-color: #1e2328 !important;
}

/* ===================================
   Main Search Input
   =================================== */
body.dark-theme .main-search {
    background-color: #161a1e !important;
}

body.dark-theme .main-search .input-group .form-control {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

/* ===================================
   Widget Cards
   =================================== */
body.dark-theme .widget-primary-card,
body.dark-theme .widget-purple-card {
    border-color: #3d4450 !important;
}

body.dark-theme .feed-card .card-body {
    background: #1e2328 !important;
}

body.dark-theme .latest-update-card .card-body .latest-update-box {
    background: #1e2328 !important;
}

body.dark-theme .latest-update-card .card-body .latest-update-box:after {
    border-left-color: #3d4450 !important;
}

body.dark-theme .recent-activity .activity-info {
    color: #e8eaed !important;
}

body.dark-theme .social-card {
    color: #ffffff !important;
}

body.dark-theme .statistic-card h4,
body.dark-theme .statistic-card h6 {
    color: #ffffff !important;
}

/* ===================================
   Icons
   =================================== */
body.dark-theme .feather,
body.dark-theme .fas,
body.dark-theme .far,
body.dark-theme .fab {
    color: inherit;
}

body.dark-theme .table .btn-sm {
    color: #ffffff !important;
}

/* ===================================
   Empty State / No Data
   =================================== */
body.dark-theme .dataTables_empty {
    color: #9ca3ab !important;
    background-color: #1e2328 !important;
}

/* ===================================
   Accordion
   =================================== */
body.dark-theme .accordion-item {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .accordion-button {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .accordion-button:not(.collapsed) {
    background-color: #161a1e !important;
    color: #ffffff !important;
}

body.dark-theme .accordion-body {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* ===================================
   Calendar
   =================================== */
body.dark-theme .fc {
    background-color: #1e2328 !important;
}

body.dark-theme .fc-toolbar-title {
    color: #ffffff !important;
}

body.dark-theme .fc-daygrid-day {
    background-color: #1e2328 !important;
}

body.dark-theme .fc-daygrid-day-number {
    color: #e8eaed !important;
}

body.dark-theme .fc-col-header-cell {
    background-color: #161a1e !important;
    color: #ffffff !important;
}

/* ===================================
   Print Styles - Exclude from Dark
   =================================== */
@media print {
    body.dark-theme,
    body.dark-theme * {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 992px) {
    body.dark-theme .pcoded-header .collapse:not(.show) .navbar-nav {
        background: #161a1e !important;
    }
    
    body.dark-theme .pcoded-header .navbar-nav > li > a {
        color: #ffffff !important;
    }
    
    body.dark-theme .pcoded-navbar {
        background: #161a1e !important;
    }
    
    body.dark-theme .m-header {
        background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%) !important;
    }
    
    body.dark-theme .m-header .mobile-menu span,
    body.dark-theme .m-header .mobile-menu span::before,
    body.dark-theme .m-header .mobile-menu span::after {
        background: #ffffff !important;
    }
    
    body.dark-theme .b-brand {
        color: #ffffff !important;
    }
}

@media (max-width: 768px) {
    body.dark-theme .pcoded-header {
        background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%) !important;
    }
    
    body.dark-theme .navbar-collapse {
        background: #161a1e !important;
    }
    
    body.dark-theme .card {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .theme-toggle {
        width: 35px;
        height: 35px;
        margin-right: 5px;
    }
    
    .theme-toggle i {
        font-size: 16px;
    }
    
    body.dark-theme .pcoded-header .navbar-nav > li {
        padding: 0 5px;
    }
}

/* ===================================
   Additional Form Elements
   =================================== */
body.dark-theme .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #23b7e5 !important;
    border-color: #23b7e5 !important;
}

body.dark-theme .custom-checkbox .custom-control-label::before {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
}

body.dark-theme .form-floating > label {
    color: #9ca3ab !important;
}

body.dark-theme .form-floating > .form-control:focus ~ label,
body.dark-theme .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #23b7e5 !important;
}

/* ===================================
   Image Placeholders
   =================================== */
body.dark-theme .img-thumbnail {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

/* ===================================
   Offcanvas
   =================================== */
body.dark-theme .offcanvas {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .offcanvas-header {
    border-bottom-color: #3d4450 !important;
}

body.dark-theme .offcanvas-title {
    color: #ffffff !important;
}

/* ===================================
   Toast
   =================================== */
body.dark-theme .toast {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .toast-header {
    background-color: #161a1e !important;
    border-bottom-color: #3d4450 !important;
    color: #ffffff !important;
}

body.dark-theme .toast-body {
    color: #e8eaed !important;
}

/* ===================================
   Spinners
   =================================== */
body.dark-theme .spinner-border {
    color: #23b7e5 !important;
}

body.dark-theme .spinner-grow {
    color: #23b7e5 !important;
}

/* ===================================
   Close Buttons
   =================================== */
body.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ===================================
   File Input
   =================================== */
body.dark-theme .form-control[type="file"] {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .form-control[type="file"]::file-selector-button {
    background-color: #3d4450 !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

/* ===================================
   Range Input
   =================================== */
body.dark-theme .form-range::-webkit-slider-runnable-track {
    background-color: #3d4450 !important;
}

body.dark-theme .form-range::-webkit-slider-thumb {
    background-color: #23b7e5 !important;
}

/* ===================================
   Ensure No White Strips/Backgrounds
   =================================== */
body.dark-theme .container,
body.dark-theme .container-fluid,
body.dark-theme .container-lg,
body.dark-theme .container-md,
body.dark-theme .container-sm,
body.dark-theme .container-xl,
body.dark-theme .container-xxl {
    background-color: transparent !important;
}

body.dark-theme main {
    background-color: transparent !important;
}

body.dark-theme section {
    background-color: transparent !important;
}

body.dark-theme article {
    background-color: transparent !important;
}

body.dark-theme aside {
    background-color: transparent !important;
}

body.dark-theme footer {
    background-color: transparent !important;
}

/* Fix any remaining white backgrounds in specific areas */
body.dark-theme .pcoded-main-container .container-fluid,
body.dark-theme .pcoded-content .container-fluid {
    background-color: transparent !important;
}

/* ===================================
   Specific Page Fixes
   =================================== */

/* Application/Admission Pages */
body.dark-theme .application-details,
body.dark-theme .admission-form {
    background-color: #1e2328 !important;
}

/* Profile Info Rows */
body.dark-theme .info-row,
body.dark-theme .detail-row {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

/* Alternate Row Colors for Info Display */
body.dark-theme .table-responsive {
    background-color: #1e2328 !important;
}

/* Any inline background white */
body.dark-theme *[style*="background: white"],
body.dark-theme *[style*="background-color: white"],
body.dark-theme *[style*="background:#fff"],
body.dark-theme *[style*="background-color:#fff"],
body.dark-theme *[style*="background: #fff"],
body.dark-theme *[style*="background-color: #fff"],
body.dark-theme *[style*="background: rgb(255, 255, 255)"],
body.dark-theme *[style*="background-color: rgb(255, 255, 255)"] {
    background-color: #1e2328 !important;
}

/* ===================================
   Collapsed Sidebar / Toggle Menu
   =================================== */

/* Collapsed Navbar Base */
body.dark-theme .pcoded-navbar.navbar-collapsed {
    background: linear-gradient(180deg, #161a1e 0%, #1e2328 100%) !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .header-logo {
    background: #0d1117 !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-menu-caption:after {
    background: #3d4450 !important;
}

/* Collapsed Submenu Popup - FIX WHITE BACKGROUND */
body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu {
    background: #161a1e !important;
    border: 1px solid #3d4450 !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu:after {
    background: #3d4450 !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu li a {
    color: #e8eaed !important;
    background: transparent !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu li a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu li.active > a {
    color: #23b7e5 !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu .pcoded-submenu {
    background: #0d1117 !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu .pcoded-submenu li a {
    color: #9ca3ab !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu .pcoded-submenu li a:hover {
    color: #ffffff !important;
}

/* Collapsed Hover State */
body.dark-theme .pcoded-navbar.navbar-collapsed:hover {
    background: linear-gradient(180deg, #161a1e 0%, #1e2328 100%) !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed:hover .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu li a {
    color: #e8eaed !important;
}

body.dark-theme .pcoded-navbar.navbar-collapsed:hover .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu li a:hover {
    color: #ffffff !important;
}

/* Layout variations */
body.dark-theme .pcoded-navbar.layout-2.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu,
body.dark-theme .pcoded-navbar.layout-2-2.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu,
body.dark-theme .pcoded-navbar.layout-3.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu,
body.dark-theme .pcoded-navbar.layout-4.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu {
    background: #161a1e !important;
}

/* ===================================
   Mobile & Tablet Responsive Fixes
   =================================== */

/* Mobile Open State */
body.dark-theme .pcoded-navbar.mob-open {
    background: linear-gradient(180deg, #161a1e 0%, #1e2328 100%) !important;
}

body.dark-theme .pcoded-navbar.mob-open .pcoded-submenu {
    background: #0d1117 !important;
}

body.dark-theme .pcoded-navbar.mob-open .pcoded-inner-navbar > li > a {
    color: #b8bfc7 !important;
}

body.dark-theme .pcoded-navbar.mob-open .pcoded-inner-navbar > li > a:hover,
body.dark-theme .pcoded-navbar.mob-open .pcoded-inner-navbar > li.active > a {
    color: #ffffff !important;
}

body.dark-theme .pcoded-navbar.mob-open .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li > a {
    color: #9ca3ab !important;
}

body.dark-theme .pcoded-navbar.mob-open .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li > a:hover,
body.dark-theme .pcoded-navbar.mob-open .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li.active > a {
    color: #ffffff !important;
}

/* Tablet Breakpoint */
@media (min-width: 768px) and (max-width: 1024px) {
    body.dark-theme .pcoded-navbar {
        background: linear-gradient(180deg, #161a1e 0%, #1e2328 100%) !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-submenu {
        background: #0d1117 !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu {
        background: #0d1117 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu li a {
        color: #e8eaed !important;
    }
    
    body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-trigger .pcoded-submenu {
        background: #161a1e !important;
        border: 1px solid #3d4450 !important;
        display: block !important;
    }
    
    body.dark-theme .pcoded-navbar.navbar-collapsed .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu {
        display: block !important;
    }
}

/* Small Tablet */
@media (max-width: 991px) {
    body.dark-theme .pcoded-navbar {
        background: #161a1e !important;
        margin-left: -240px;
    }
    
    body.dark-theme .pcoded-navbar.mob-open {
        margin-left: 0;
        background: linear-gradient(180deg, #161a1e 0%, #1e2328 100%) !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-submenu {
        background: #0d1117 !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li > a {
        color: #b8bfc7 !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li > a {
        color: #9ca3ab !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li > a:hover,
    body.dark-theme .pcoded-navbar .pcoded-inner-navbar > li.pcoded-hasmenu .pcoded-submenu li.active > a {
        color: #ffffff !important;
    }
}

@media (max-width: 767px) {
    body.dark-theme .pcoded-navbar {
        background: #161a1e !important;
    }
    
    body.dark-theme .pcoded-navbar.mob-open {
        background: linear-gradient(180deg, #161a1e 0%, #1e2328 100%) !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-submenu {
        background: #0d1117 !important;
    }
    
    body.dark-theme .m-header {
        background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%) !important;
    }
    
    body.dark-theme .pcoded-header .collapse.navbar-collapse {
        background: #161a1e !important;
    }
    
    body.dark-theme .pcoded-header .navbar-nav {
        background: #161a1e !important;
    }
    
    body.dark-theme .pcoded-header .navbar-nav > li > a {
        color: #ffffff !important;
    }
}

@media (max-width: 575px) {
    .theme-toggle {
        width: 32px;
        height: 32px;
        margin-right: 3px;
    }
    
    .theme-toggle i {
        font-size: 14px;
    }
    
    body.dark-theme .pcoded-navbar {
        background: #161a1e !important;
    }
    
    body.dark-theme .pcoded-navbar .pcoded-submenu {
        background: #0d1117 !important;
    }
}

/* ===================================
   Horizontal Theme Submenu Fix
   =================================== */
body.dark-theme .pcoded-navbar.theme-horizontal {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%) !important;
}

body.dark-theme .pcoded-navbar.theme-horizontal .pcoded-inner-navbar > li.pcoded-hasmenu.active > .pcoded-submenu,
body.dark-theme .pcoded-navbar.theme-horizontal .pcoded-inner-navbar > li.pcoded-hasmenu.pcoded-trigger > .pcoded-submenu {
    background: #161a1e !important;
    border: 1px solid #3d4450 !important;
}

body.dark-theme .pcoded-navbar.theme-horizontal .pcoded-inner-navbar .pcoded-hasmenu .pcoded-submenu li > a {
    color: #e8eaed !important;
}

body.dark-theme .pcoded-navbar.theme-horizontal .pcoded-inner-navbar .pcoded-hasmenu .pcoded-submenu li > a:hover,
body.dark-theme .pcoded-navbar.theme-horizontal .pcoded-inner-navbar .pcoded-hasmenu .pcoded-submenu li.active > a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .pcoded-navbar.theme-horizontal .pcoded-inner-navbar .pcoded-hasmenu .pcoded-submenu .pcoded-submenu {
    background: #0d1117 !important;
}

/* ===================================
   Material Datepicker Dark Mode
   =================================== */
body.dark-theme .dtp {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .dtp > .dtp-content {
    background-color: #1e2328 !important;
    border: 1px solid #3d4450 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .dtp > .dtp-content > .dtp-date-view > header.dtp-header {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .dtp div.dtp-date,
body.dark-theme .dtp div.dtp-time {
    background-color: #1a3a5c !important;
    color: #ffffff !important;
}

body.dark-theme .dtp div.dtp-actual-month,
body.dark-theme .dtp div.dtp-actual-year,
body.dark-theme .dtp div.dtp-actual-num {
    color: #ffffff !important;
}

body.dark-theme .dtp .dtp-picker-month,
body.dark-theme .dtp .dtp-picker-year {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.dark-theme .dtp table.dtp-picker-days {
    background-color: #1e2328 !important;
}

body.dark-theme .dtp table.dtp-picker-days tr > td {
    color: #e8eaed !important;
}

body.dark-theme .dtp table.dtp-picker-days tr > td > a {
    color: #e8eaed !important;
}

body.dark-theme .dtp table.dtp-picker-days tr > td > a:hover {
    background-color: rgba(35, 183, 229, 0.3) !important;
    color: #ffffff !important;
}

body.dark-theme .dtp table.dtp-picker-days tr > td > a.selected {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .dtp .dtp-picker-time {
    background-color: #1e2328 !important;
}

body.dark-theme .dtp .dtp-hand,
body.dark-theme .dtp .dtp-hand-ext {
    background-color: #23b7e5 !important;
}

body.dark-theme .dtp .dtp-select-hour,
body.dark-theme .dtp .dtp-select-minute {
    color: #e8eaed !important;
}

body.dark-theme .dtp .dtp-select-hour:hover,
body.dark-theme .dtp .dtp-select-minute:hover {
    background-color: rgba(35, 183, 229, 0.3) !important;
    color: #ffffff !important;
}

body.dark-theme .dtp .dtp-meridiem-am,
body.dark-theme .dtp .dtp-meridiem-pm {
    color: #9ca3ab !important;
}

body.dark-theme .dtp .dtp-meridiem-am:hover,
body.dark-theme .dtp .dtp-meridiem-pm:hover,
body.dark-theme .dtp .dtp-meridiem-am.selected,
body.dark-theme .dtp .dtp-meridiem-pm.selected {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .dtp .dtp-btn-ok,
body.dark-theme .dtp .dtp-btn-cancel {
    color: #23b7e5 !important;
}

body.dark-theme .dtp .dtp-btn-ok:hover,
body.dark-theme .dtp .dtp-btn-cancel:hover {
    background-color: rgba(35, 183, 229, 0.1) !important;
}

body.dark-theme .dtp .dtp-btn-now {
    color: #23b7e5 !important;
}

body.dark-theme .dtp .dtp-btn-clear {
    color: #ef5350 !important;
}

body.dark-theme .dtp .dtp-close > a {
    color: #9ca3ab !important;
}

body.dark-theme .dtp .dtp-close > a:hover {
    color: #ffffff !important;
}

/* Week days header */
body.dark-theme .dtp table.dtp-picker-days tr > th {
    color: #9ca3ab !important;
}

/* Disabled days */
body.dark-theme .dtp table.dtp-picker-days tr > td.disabled,
body.dark-theme .dtp table.dtp-picker-days tr > td.disabled > a {
    color: #4a5568 !important;
}

/* Today highlight */
body.dark-theme .dtp table.dtp-picker-days tr > td.today > a {
    background-color: rgba(35, 183, 229, 0.2) !important;
    border-radius: 50%;
}

/* Clock face */
body.dark-theme .dtp .dtp-picker-clock {
    background-color: #161a1e !important;
    border: 1px solid #3d4450 !important;
}

/* ===================================
   Bootstrap Datepicker (if used)
   =================================== */
body.dark-theme .datepicker {
    background-color: #1e2328 !important;
    border: 1px solid #3d4450 !important;
}

body.dark-theme .datepicker table tr td,
body.dark-theme .datepicker table tr th {
    color: #e8eaed !important;
}

body.dark-theme .datepicker table tr td.day:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

body.dark-theme .datepicker table tr td.active,
body.dark-theme .datepicker table tr td.active:hover {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .datepicker table tr td.today {
    background-color: rgba(35, 183, 229, 0.2) !important;
}

body.dark-theme .datepicker table tr td.disabled,
body.dark-theme .datepicker table tr td.disabled:hover {
    color: #4a5568 !important;
}

body.dark-theme .datepicker .datepicker-switch,
body.dark-theme .datepicker .prev,
body.dark-theme .datepicker .next {
    color: #e8eaed !important;
}

body.dark-theme .datepicker .datepicker-switch:hover,
body.dark-theme .datepicker .prev:hover,
body.dark-theme .datepicker .next:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* ===================================
   jQuery UI Datepicker (if used)
   =================================== */
body.dark-theme .ui-datepicker {
    background-color: #1e2328 !important;
    border: 1px solid #3d4450 !important;
}

body.dark-theme .ui-datepicker-header {
    background-color: #161a1e !important;
    border-bottom: 1px solid #3d4450 !important;
    color: #ffffff !important;
}

body.dark-theme .ui-datepicker-title {
    color: #ffffff !important;
}

body.dark-theme .ui-datepicker-prev,
body.dark-theme .ui-datepicker-next {
    color: #e8eaed !important;
}

body.dark-theme .ui-datepicker-calendar th {
    color: #9ca3ab !important;
}

body.dark-theme .ui-datepicker-calendar td {
    background-color: #1e2328 !important;
}

body.dark-theme .ui-datepicker-calendar td a {
    color: #e8eaed !important;
}

body.dark-theme .ui-datepicker-calendar td a:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

body.dark-theme .ui-datepicker-calendar td.ui-datepicker-today a {
    background-color: rgba(35, 183, 229, 0.2) !important;
}

body.dark-theme .ui-datepicker-calendar td.ui-datepicker-current-day a {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

/* ===================================
   Flatpickr (if used)
   =================================== */
body.dark-theme .flatpickr-calendar {
    background-color: #1e2328 !important;
    border: 1px solid #3d4450 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .flatpickr-months {
    background-color: #161a1e !important;
}

body.dark-theme .flatpickr-month {
    color: #ffffff !important;
}

body.dark-theme .flatpickr-current-month .flatpickr-monthDropdown-months {
    background-color: #161a1e !important;
    color: #ffffff !important;
}

body.dark-theme .flatpickr-weekdays {
    background-color: #1e2328 !important;
}

body.dark-theme .flatpickr-weekday {
    color: #9ca3ab !important;
}

body.dark-theme .flatpickr-days {
    background-color: #1e2328 !important;
}

body.dark-theme .flatpickr-day {
    color: #e8eaed !important;
}

body.dark-theme .flatpickr-day:hover {
    background-color: #2d3238 !important;
    border-color: #2d3238 !important;
}

body.dark-theme .flatpickr-day.selected {
    background-color: #23b7e5 !important;
    border-color: #23b7e5 !important;
    color: #ffffff !important;
}

body.dark-theme .flatpickr-day.today {
    border-color: #23b7e5 !important;
}

body.dark-theme .flatpickr-prev-month,
body.dark-theme .flatpickr-next-month {
    color: #e8eaed !important;
    fill: #e8eaed !important;
}

body.dark-theme .flatpickr-prev-month:hover,
body.dark-theme .flatpickr-next-month:hover {
    color: #ffffff !important;
    fill: #ffffff !important;
}

body.dark-theme .numInputWrapper input {
    background-color: #161a1e !important;
    color: #ffffff !important;
}

body.dark-theme .flatpickr-time {
    background-color: #1e2328 !important;
    border-top: 1px solid #3d4450 !important;
}

body.dark-theme .flatpickr-time input {
    color: #e8eaed !important;
}

body.dark-theme .flatpickr-am-pm {
    color: #e8eaed !important;
}

/* ===================================
   Wizard Form Dark Theme Styles
   =================================== */
body.dark-theme .wizard-sec-bg,
body.dark-theme .wizard-sec {
    background: linear-gradient(145deg, #1e2328 0%, #252a30 100%) !important;
}

body.dark-theme .wizard > .steps .current a,
body.dark-theme .wizard > .steps .current a:hover,
body.dark-theme .wizard > .steps .current a:active {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%) !important;
    color: #ffffff !important;
}

body.dark-theme .wizard > .steps a,
body.dark-theme .wizard > .steps a:hover,
body.dark-theme .wizard > .steps a:active {
    background: #2d3238 !important;
    color: #9ca3ab !important;
}

body.dark-theme .wizard > .steps .done a,
body.dark-theme .wizard > .steps .done a:hover,
body.dark-theme .wizard > .steps .done a:active {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%) !important;
    color: #ffffff !important;
}

body.dark-theme .wizard > .content {
    background: transparent !important;
    border: none !important;
}

body.dark-theme .wizard > .content > .body {
    background: transparent !important;
}

body.dark-theme .wizard > .actions a,
body.dark-theme .wizard > .actions a:hover,
body.dark-theme .wizard > .actions a:active {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

body.dark-theme .wizard > .actions .disabled a,
body.dark-theme .wizard > .actions .disabled a:hover,
body.dark-theme .wizard > .actions .disabled a:active {
    background: #3d4450 !important;
    color: #6c757d !important;
}

body.dark-theme .form-step .form-control {
    background-color: #161a1e !important;
    border: 1px solid #3d4450 !important;
    color: #e8eaed !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
}

body.dark-theme .form-step .form-control:focus {
    border-color: #3949ab !important;
    box-shadow: 0 0 0 0.2rem rgba(57, 73, 171, 0.25) !important;
}

/* ===================================
   Text Editor (CKEditor/TinyMCE) Dark Theme
   =================================== */
body.dark-theme .cke_chrome,
body.dark-theme .cke_inner,
body.dark-theme .cke_top,
body.dark-theme .cke_bottom,
body.dark-theme .cke_contents {
    background: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .cke_toolgroup,
body.dark-theme .cke_toolbar,
body.dark-theme .cke_combo_button {
    background: #2d3238 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .cke_button_icon {
    filter: invert(0.8) !important;
}

body.dark-theme .cke_button:hover,
body.dark-theme .cke_button.cke_button_on {
    background: #3d4450 !important;
}

body.dark-theme .cke_combo_text {
    color: #e8eaed !important;
}

body.dark-theme .cke_path_item,
body.dark-theme .cke_path a {
    color: #9ca3ab !important;
}

body.dark-theme .cke_wysiwyg_frame,
body.dark-theme .cke_wysiwyg_div {
    background: #1e2328 !important;
}

/* TinyMCE */
body.dark-theme .tox .tox-edit-area__iframe {
    background-color: #1e2328 !important;
}

body.dark-theme .tox .tox-toolbar,
body.dark-theme .tox .tox-toolbar__primary,
body.dark-theme .tox .tox-toolbar__overflow,
body.dark-theme .tox .tox-menubar {
    background: #2d3238 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .tox .tox-tbtn {
    color: #e8eaed !important;
}

body.dark-theme .tox .tox-tbtn:hover {
    background: #3d4450 !important;
}

body.dark-theme .tox .tox-statusbar {
    background: #1e2328 !important;
    border-color: #3d4450 !important;
    color: #9ca3ab !important;
}

/* Summernote Editor */
body.dark-theme .note-editor.note-frame,
body.dark-theme .note-editor.note-airframe {
    border-color: #3d4450 !important;
}

body.dark-theme .note-toolbar {
    background: #2d3238 !important;
    border-bottom: 1px solid #3d4450 !important;
}

body.dark-theme .note-btn {
    background: #2d3238 !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .note-btn:hover {
    background: #3d4450 !important;
}

body.dark-theme .note-editing-area .note-editable {
    background: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .note-statusbar {
    background: #1e2328 !important;
    border-top: 1px solid #3d4450 !important;
}

/* ===================================
   Dashboard Cards Dark Theme Gradients
   =================================== */
body.dark-theme .bg-custom-light-yellow {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.08) 100%) !important;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
}

body.dark-theme .bg-custom-light-yellow .card-title,
body.dark-theme .bg-custom-light-yellow .card-text,
body.dark-theme .bg-custom-light-yellow h5,
body.dark-theme .bg-custom-light-yellow h2 {
    color: #ffd54f !important;
}

body.dark-theme .bg-custom-light-blue {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2) 0%, rgba(33, 150, 243, 0.08) 100%) !important;
    border: 1px solid rgba(33, 150, 243, 0.3) !important;
}

body.dark-theme .bg-custom-light-blue .card-title,
body.dark-theme .bg-custom-light-blue .card-text,
body.dark-theme .bg-custom-light-blue h5,
body.dark-theme .bg-custom-light-blue h2 {
    color: #64b5f6 !important;
}

body.dark-theme .bg-custom-light-red {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(244, 67, 54, 0.08) 100%) !important;
    border: 1px solid rgba(244, 67, 54, 0.3) !important;
}

body.dark-theme .bg-custom-light-red .card-title,
body.dark-theme .bg-custom-light-red .card-text,
body.dark-theme .bg-custom-light-red h5,
body.dark-theme .bg-custom-light-red h2 {
    color: #ef5350 !important;
}

body.dark-theme .bg-custom-light-green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.08) 100%) !important;
    border: 1px solid rgba(76, 175, 80, 0.3) !important;
}

body.dark-theme .bg-custom-light-green .card-title,
body.dark-theme .bg-custom-light-green .card-text,
body.dark-theme .bg-custom-light-green h5,
body.dark-theme .bg-custom-light-green h2 {
    color: #81c784 !important;
}

/* Dashboard Gradient Cards for Second Row */
body.dark-theme .card-gradient-blue {
    background: linear-gradient(135deg, #1a237e 0%, #5c6bc0 50%, #7986cb 100%) !important;
    border: none !important;
}

body.dark-theme .card-gradient-yellow {
    background: linear-gradient(135deg, #e65100 0%, #ff9800 50%, #ffb74d 100%) !important;
    border: none !important;
}

body.dark-theme .card-gradient-green {
    background: linear-gradient(135deg, #1b5e20 0%, #43a047 50%, #66bb6a 100%) !important;
    border: none !important;
}

body.dark-theme .card-gradient-red {
    background: linear-gradient(135deg, #b71c1c 0%, #e53935 50%, #ef5350 100%) !important;
    border: none !important;
}

/* Dashboard card icon circles in dark theme */
body.dark-theme .bg-custom-light-yellow .bg-white,
body.dark-theme .bg-custom-light-blue .bg-white,
body.dark-theme .bg-custom-light-red .bg-white,
body.dark-theme .bg-custom-light-green .bg-white {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ===================================
   Logout Button Redesign (Both Themes)
   =================================== */
.profile-notification .pro-head {
    position: relative;
    padding-bottom: 50px !important;
}

.profile-notification .pro-head .logout-password-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    padding: 0;
}

.profile-notification .pro-head .logout-password-box .logout-btn,
.profile-notification .pro-head .logout-password-box .password-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 32px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.profile-notification .pro-head .logout-password-box .logout-btn {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
    color: #ffffff;
    margin-right: 0;
    border-radius: 6px;
}

.profile-notification .pro-head .logout-password-box .logout-btn:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(198, 40, 40, 0.4);
}

.profile-notification .pro-head .logout-password-box .divider {
    display: none;
}

.profile-notification .pro-head .logout-password-box .password-btn {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
    color: #ffffff;
    margin-left: 0;
    border-radius: 6px;
}

.profile-notification .pro-head .logout-password-box .password-btn:hover {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4);
}

.profile-notification .pro-head .logout-password-box .logout-btn i,
.profile-notification .pro-head .logout-password-box .password-btn i {
    font-size: 14px;
    color: #ffffff !important;
}

/* Hide old logout button */
.profile-notification .pro-head > .dud-logout {
    display: none !important;
}

/* Dark theme specific adjustments */
body.dark-theme .profile-notification .pro-head .logout-password-box {
    background: transparent;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .profile-notification .pro-head .logout-password-box {
        gap: 10px;
    }
    
    .profile-notification .pro-head .logout-password-box .logout-btn,
    .profile-notification .pro-head .logout-password-box .password-btn {
        width: 42px;
        height: 28px;
        border-radius: 5px;
    }
    
    .profile-notification .pro-head .logout-password-box .logout-btn i,
    .profile-notification .pro-head .logout-password-box .password-btn i {
        font-size: 12px;
    }
}

/* ===================================
   Native Select Option Elements - CRITICAL FIX
   =================================== */
body.dark-theme select option,
body.dark-theme .form-control option,
body.dark-theme .form-select option,
body.dark-theme select.form-control option,
body.dark-theme select.form-select option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme select optgroup {
    background-color: #161a1e !important;
    color: #ffffff !important;
}

body.dark-theme select optgroup option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* Native select element comprehensive styling */
body.dark-theme select,
body.dark-theme select.form-control,
body.dark-theme select.form-select,
body.dark-theme .form-select {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

body.dark-theme select:focus,
body.dark-theme select.form-control:focus,
body.dark-theme select.form-select:focus,
body.dark-theme .form-select:focus {
    background-color: #1a1e22 !important;
    border-color: #3949ab !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.2) !important;
}

/* Custom select (Bootstrap 4 legacy) */
body.dark-theme .custom-select {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23e8eaed' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") !important;
}

body.dark-theme .custom-select option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* Select2 Additional Fixes */
body.dark-theme .select2-results__options {
    background-color: #1e2328 !important;
}

body.dark-theme .select2-results__group {
    color: #ffffff !important;
    background-color: #161a1e !important;
    font-weight: 600;
}

body.dark-theme .select2-container--default .select2-results__message {
    color: #9ca3ab !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__clear {
    color: #e8eaed !important;
}

/* Bootstrap Dropdown Menu Additional Fixes */
body.dark-theme .dropdown-menu.show,
body.dark-theme .dropdown-menu[data-bs-popper],
body.dark-theme [class*="dropdown-menu"] {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .dropdown-header {
    color: #9ca3ab !important;
    background-color: transparent !important;
}

body.dark-theme .dropdown-item-text {
    color: #e8eaed !important;
}

/* Action dropdown menus */
body.dark-theme .btn-group .dropdown-menu,
body.dark-theme .dropup .dropdown-menu,
body.dark-theme .dropend .dropdown-menu,
body.dark-theme .dropstart .dropdown-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

/* Card action dropdowns */
body.dark-theme .card .dropdown-menu,
body.dark-theme .card-header .dropdown-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

/* Table action dropdowns */
body.dark-theme .table .dropdown-menu,
body.dark-theme td .dropdown-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .table .dropdown-menu .dropdown-item,
body.dark-theme td .dropdown-menu .dropdown-item {
    color: #e8eaed !important;
}

body.dark-theme .table .dropdown-menu .dropdown-item:hover,
body.dark-theme td .dropdown-menu .dropdown-item:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* Override inline white backgrounds */
body.dark-theme .navbar-content[style*="background-color"] {
    background-color: transparent !important;
}

body.dark-theme div[style*="background-color: #fff"],
body.dark-theme div[style*="background-color:#fff"],
body.dark-theme div[style*="background-color: white"],
body.dark-theme div[style*="background-color:white"],
body.dark-theme div[style*="background: #fff"],
body.dark-theme div[style*="background:#fff"],
body.dark-theme div[style*="background: white"],
body.dark-theme div[style*="background:white"] {
    background-color: #1e2328 !important;
    background: #1e2328 !important;
}

/* Typeahead dropdown */
body.dark-theme .tt-menu,
body.dark-theme .twitter-typeahead .tt-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .tt-suggestion {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .tt-suggestion:hover,
body.dark-theme .tt-suggestion.tt-cursor {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* Bootstrap Tags Input dropdown */
body.dark-theme .bootstrap-tagsinput {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme .bootstrap-tagsinput .tag {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

/* Autocomplete dropdowns */
body.dark-theme .ui-autocomplete,
body.dark-theme .ui-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .ui-menu-item,
body.dark-theme .ui-autocomplete .ui-menu-item {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .ui-menu-item:hover,
body.dark-theme .ui-menu-item.ui-state-active,
body.dark-theme .ui-autocomplete .ui-menu-item:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* Multiselect dropdown */
body.dark-theme .ms-container .ms-list {
    border-color: #3d4450 !important;
    background-color: #1e2328 !important;
}

body.dark-theme .ms-container .ms-selectable,
body.dark-theme .ms-container .ms-selection {
    background-color: #161a1e !important;
    color: #e8eaed !important;
}

body.dark-theme .ms-container .ms-list.ms-focus {
    border-color: #3949ab !important;
}

body.dark-theme .ms-container .ms-selectable li.ms-elem-selectable,
body.dark-theme .ms-container .ms-selection li.ms-elem-selection {
    color: #e8eaed !important;
}

body.dark-theme .ms-container .ms-optgroup-label {
    color: #ffffff !important;
    background-color: #161a1e !important;
}

body.dark-theme .ms-container .ms-selectable li.ms-hover,
body.dark-theme .ms-container .ms-selection li.ms-hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* Context menu dropdowns */
body.dark-theme .context-menu-list,
body.dark-theme .context-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme .context-menu-item {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

body.dark-theme .context-menu-item:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}
/* ===================================
   Sidebar Inline Style Override - CRITICAL
   =================================== */
body.dark-theme .navbar-content,
body.dark-theme .navbar-content[style],
body.dark-theme .navbar-content.scroll-div,
body.dark-theme .pcoded-navbar .navbar-content {
    background-color: transparent !important;
    background: transparent !important;
}

/* Form-control select styling */
body.dark-theme .card select.form-control,
body.dark-theme .card-body select.form-control,
body.dark-theme .card select.form-select,
body.dark-theme .card-body select.form-select,
body.dark-theme .modal select.form-control,
body.dark-theme .modal select.form-select,
body.dark-theme .modal-body select.form-control,
body.dark-theme .modal-body select.form-select {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

body.dark-theme .card select.form-control option,
body.dark-theme .card-body select.form-control option,
body.dark-theme .modal select.form-control option,
body.dark-theme .modal-body select.form-control option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* Action buttons dropdown fix */
body.dark-theme .dropdown-menu .btn,
body.dark-theme .dropdown-menu .btn-sm {
    color: inherit !important;
}

body.dark-theme .dropdown-menu .btn-icon,
body.dark-theme .dropdown-menu [class*="btn-icon"] {
    background-color: transparent !important;
}

/* Filter section dropdowns */
body.dark-theme .filter-section select,
body.dark-theme [class*="filter"] select,
body.dark-theme .report-filter select {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

body.dark-theme .filter-section select option,
body.dark-theme [class*="filter"] select option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* Ensure all dropdown lists within forms are styled */
body.dark-theme form select,
body.dark-theme form .form-control[type="select"],
body.dark-theme form .form-select {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

body.dark-theme form select option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* Pagination dropdown */
body.dark-theme .dataTables_length select,
body.dark-theme .pagination select {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

body.dark-theme .dataTables_length select option,
body.dark-theme .pagination select option {
    background-color: #1e2328 !important;
    color: #e8eaed !important;
}

/* Report and print dropdowns */
body.dark-theme .report-section select,
body.dark-theme .print-section select {
    background-color: #161a1e !important;
    color: #e8eaed !important;
    border-color: #3d4450 !important;
}

/* ===================================
   Additional Dark Theme Fixes
   =================================== */

/* Fix .text-dark class for dark theme */
body.dark-theme .text-dark {
    color: #e8eaed !important;
}

body.dark-theme .text-dark.fw-bold,
body.dark-theme .text-dark strong {
    color: #ffffff !important;
}

/* Badge with text-dark fix - keep dark for contrast */
body.dark-theme .badge.text-dark,
body.dark-theme .bg-warning.text-dark,
body.dark-theme .bg-light.text-dark {
    color: #1e2328 !important;
}

/* Status dropdown toggle button in tables */
body.dark-theme .table .dropdown-toggle.btn-secondary,
body.dark-theme td .btn-secondary.dropdown-toggle,
body.dark-theme .dropdown.show .btn-secondary {
    background-color: #3d4450 !important;
    border-color: #4a5568 !important;
    color: #e8eaed !important;
}

body.dark-theme .table .dropdown-toggle.btn-secondary:hover,
body.dark-theme td .btn-secondary.dropdown-toggle:hover {
    background-color: #4a5568 !important;
    border-color: #5c6bc0 !important;
    color: #ffffff !important;
}

/* Inline block dropdown menus */
body.dark-theme .d-inline-block .dropdown-menu,
body.dark-theme .dropdown.show.d-inline-block .dropdown-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .d-inline-block .dropdown-menu .dropdown-item,
body.dark-theme .dropdown.show.d-inline-block .dropdown-item {
    color: #e8eaed !important;
    background-color: transparent !important;
}

body.dark-theme .d-inline-block .dropdown-menu .dropdown-item:hover,
body.dark-theme .dropdown.show.d-inline-block .dropdown-item:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}

/* Teacher/Course card styles */
body.dark-theme .card[style*="border-left"] {
    background-color: #1e2328 !important;
}

body.dark-theme .card[style*="border-left"] .card-body p,
body.dark-theme .card[style*="border-left"] .card-body strong {
    color: #e8eaed !important;
}

/* Live search input in tables */
body.dark-theme #searchInput {
    background-color: #161a1e !important;
    border-color: #3d4450 !important;
    color: #e8eaed !important;
}

body.dark-theme #searchInput::placeholder {
    color: #6c757d !important;
}

body.dark-theme #noMatchMessage {
    color: #ef5350 !important;
}

/* Select2 employee search custom styles */
body.dark-theme .employee-id {
    color: #9ca3ab !important;
}

body.dark-theme .select2-results__option--highlighted .employee-id {
    color: #ffffff !important;
}

/* Calculation/Status dropdown menus */
body.dark-theme #dropdownCalculation + .dropdown-menu,
body.dark-theme #statusMenuLink + .dropdown-menu,
body.dark-theme #dropdownMenuLink + .dropdown-menu {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme #dropdownCalculation + .dropdown-menu .dropdown-item,
body.dark-theme #statusMenuLink + .dropdown-menu .dropdown-item,
body.dark-theme #dropdownMenuLink + .dropdown-menu .dropdown-item {
    color: #e8eaed !important;
}

body.dark-theme #dropdownCalculation + .dropdown-menu .dropdown-item:hover,
body.dark-theme #statusMenuLink + .dropdown-menu .dropdown-item:hover,
body.dark-theme #dropdownMenuLink + .dropdown-menu .dropdown-item:hover {
    background-color: #23b7e5 !important;
    color: #ffffff !important;
}

/* Fix for any remaining white dropdown backgrounds */
body.dark-theme ul.dropdown-menu,
body.dark-theme div.dropdown-menu,
body.dark-theme .dropdown-menu.show {
    background-color: #1e2328 !important;
    border-color: #3d4450 !important;
}

body.dark-theme ul.dropdown-menu li,
body.dark-theme ul.dropdown-menu a,
body.dark-theme div.dropdown-menu a {
    color: #e8eaed !important;
}

body.dark-theme ul.dropdown-menu li:hover,
body.dark-theme ul.dropdown-menu a:hover,
body.dark-theme div.dropdown-menu a:hover {
    background-color: #2d3238 !important;
    color: #ffffff !important;
}
