/* Dark Theme Styles */

/* Apply dark theme when body has dark-theme class */
html.dark-theme,
body.dark-theme {
    background-color: #1a1a1a;
    color: #ffffff;
    min-height: 100vh;
}

body.dark-theme {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Dashboard Styles */
body.dark-theme .dashboard-header {
    background: #2d2d2d;
    border-bottom: 2px solid #404040;
    color: #ffffff;
}

body.dark-theme .dashboard-sidebar {
    background: #252525;
    border-right: 1px solid #404040;
}

body.dark-theme .dashboard-panel {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-theme .dashboard-panel:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

body.dark-theme .dashboard-panel-header {
    background: #1e3a5f;
    border-bottom: 2px solid #2d5a8a;
}

body.dark-theme .sidebar-nav-item {
    color: #e0e0e0;
}

body.dark-theme .sidebar-nav-item:hover {
    background: #3d3d3d;
    color: #ffffff;
}

body.dark-theme .sidebar-nav-item.active {
    background: #1e3a5f;
    color: white;
    border-left: 3px solid #3498db;
}

/* Card Styles */
body.dark-theme .card {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .card-body {
    background: #2d2d2d;
    color: #ffffff;
}

body.dark-theme .card-title {
    color: #ffffff;
}

/* Form Controls */
body.dark-theme .form-control {
    background-color: #3d3d3d;
    border-color: #555;
    color: #ffffff;
}

body.dark-theme .form-control:focus {
    background-color: #3d3d3d;
    border-color: #3498db;
    color: #ffffff;
}

body.dark-theme .form-control::placeholder {
    color: #888;
}

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

/* MDB UI Kit form labels */
body.dark-theme .md-form label {
    color: #ffffff !important;
}

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

/* MDB form notch elements */
body.dark-theme .form-notch-leading,
body.dark-theme .form-notch-middle,
body.dark-theme .form-notch-trailing {
    border-color: #ffffff !important;
}

/* Active/focused labels in MDB */
body.dark-theme .md-form label.active,
body.dark-theme .md-form label:focus {
    color: #ffffff !important;
}

/* MDB specific label classes */
body.dark-theme .form-outline .form-label {
    color: #ffffff !important;
}

body.dark-theme .form-outline ~ .form-label {
    color: #ffffff !important;
}

/* Universal label fix for dark mode */
body.dark-theme label,
body.dark-theme .label,
body.dark-theme [class*="label"] {
    color: #ffffff !important;
}

/* DeviceList column divs */
body.dark-theme #DeviceList .col-1,
body.dark-theme #DeviceList .col-2,
body.dark-theme #DeviceList .col-3,
body.dark-theme #DeviceList .col-4,
body.dark-theme #DeviceList .col-5,
body.dark-theme #DeviceList .col-6,
body.dark-theme #DeviceList .col-7,
body.dark-theme #DeviceList .col-8,
body.dark-theme #DeviceList .col-9,
body.dark-theme #DeviceList .col-10,
body.dark-theme #DeviceList .col-11,
body.dark-theme #DeviceList .col-12 {
    color: #ffffff !important;
}

/* All column divs in list-group items */
body.dark-theme .list-group-item .col-1,
body.dark-theme .list-group-item .col-2,
body.dark-theme .list-group-item .col-3,
body.dark-theme .list-group-item .col-4,
body.dark-theme .list-group-item .col-5,
body.dark-theme .list-group-item .col-6,
body.dark-theme .list-group-item .col-7,
body.dark-theme .list-group-item .col-8,
body.dark-theme .list-group-item .col-9,
body.dark-theme .list-group-item .col-10,
body.dark-theme .list-group-item .col-11,
body.dark-theme .list-group-item .col-12 {
    color: #ffffff !important;
}

/* CartDeviceList and FleetDeviceList column divs */
body.dark-theme #DeviceListCart .col-1,
body.dark-theme #DeviceListCart .col-2,
body.dark-theme #DeviceListCart .col-3,
body.dark-theme #DeviceListCart .col-4,
body.dark-theme #DeviceListCart .col-5,
body.dark-theme #DeviceListCart .col-6,
body.dark-theme #DeviceListCart .col-7,
body.dark-theme #DeviceListCart .col-8,
body.dark-theme #DeviceListCart .col-9,
body.dark-theme #DeviceListCart .col-10,
body.dark-theme #DeviceListCart .col-11,
body.dark-theme #DeviceListCart .col-12 {
    color: #ffffff !important;
}

body.dark-theme #DeviceListFleet .col-1,
body.dark-theme #DeviceListFleet .col-2,
body.dark-theme #DeviceListFleet .col-3,
body.dark-theme #DeviceListFleet .col-4,
body.dark-theme #DeviceListFleet .col-5,
body.dark-theme #DeviceListFleet .col-6,
body.dark-theme #DeviceListFleet .col-7,
body.dark-theme #DeviceListFleet .col-8,
body.dark-theme #DeviceListFleet .col-9,
body.dark-theme #DeviceListFleet .col-10,
body.dark-theme #DeviceListFleet .col-11,
body.dark-theme #DeviceListFleet .col-12 {
    color: #ffffff !important;
}

/* All list-group items in dark mode */
body.dark-theme .list-group-item {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

body.dark-theme .list-group {
    background-color: #2d2d2d;
}

/* Fix MDB floating labels */
body.dark-theme .form-floating > label,
body.dark-theme .form-floating label {
    color: #ffffff !important;
}

/* Force all label-like elements to white */
body.dark-theme .md-form > label,
body.dark-theme div > label,
body.dark-theme .form-outline > label,
body.dark-theme .form-control + label,
body.dark-theme .form-control ~ label {
    color: #ffffff !important;
}

/* MDB specific - target form-outline labels with specific positioning */
body.dark-theme .form-outline .form-label {
    color: #ffffff !important;
}

/* Force white on all labels regardless of specificity */
body.dark-theme label,
body.dark-theme * > label,
body.dark-theme * > * > label,
body.dark-theme * > * > * > label {
    color: #ffffff !important;
}

/* Override any inline styles on labels */
body.dark-theme label[style*="color"] {
    color: #ffffff !important;
}

/* Force all text in md-form to be white */
body.dark-theme .md-form {
    color: #ffffff !important;
}

body.dark-theme .md-form * {
    color: #ffffff !important;
}

/* Force all text in form-outline to be white */
body.dark-theme .form-outline {
    color: #ffffff !important;
}

body.dark-theme .form-outline * {
    color: #ffffff !important;
}

/* Specific label targeting with maximum specificity */
body.dark-theme div.md-form > label,
body.dark-theme div.form-outline > label,
body.dark-theme section > div > div.form-outline > label {
    color: #ffffff !important;
}

/* Target the specific label elements by their for attributes */
body.dark-theme label[for="inpNormalAssetNumber"],
body.dark-theme label[for="inpAssetId"],
body.dark-theme label[for="inpDescription"],
body.dark-theme label[for="inpNormalSerialNumber"],
body.dark-theme label[for="inpSerialNumber"],
body.dark-theme label[for="inpManufacturer"],
body.dark-theme label[for="model"],
body.dark-theme label[for="inpSiteUnassigned"] {
    color: #ffffff !important;
}

/* Ultra-specific targeting for MDB labels */
body.dark-theme .col-xl-4 .md-form label,
body.dark-theme .col-xl-8 .md-form label,
body.dark-theme .col-xl-12 .md-form label {
    color: #ffffff !important;
}

/* Force all children of md-form to inherit white color */
body.dark-theme .md-form,
body.dark-theme .md-form *,
body.dark-theme .form-outline,
body.dark-theme .form-outline * {
    color: #ffffff !important;
}

/* Override with maximum specificity using :where and :is */
:where(body.dark-theme) label,
:where(body.dark-theme) .form-label,
:where(body.dark-theme) .md-form label {
    color: #ffffff !important;
}

/* CSS Variable overrides for MDB */
body.dark-theme {
    --mdb-label-color: #ffffff !important;
    --mdb-input-color: #ffffff !important;
    --mdb-text-color: #ffffff !important;
}

/* Buttons */
body.dark-theme .btn-primary {
    background-color: #3498db;
    border-color: #2980b9;
    color: white;
}

body.dark-theme .btn-primary:hover {
    background-color: #2980b9;
    border-color: #1f6391;
    color: white;
}

body.dark-theme .btn-secondary {
    background-color: #6c757d;
    border-color: #5a6268;
    color: white;
}

body.dark-theme .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #495057;
    color: white;
}

body.dark-theme .btn-outline-primary {
    color: #3498db;
    border-color: #3498db;
}

body.dark-theme .btn-outline-primary:hover {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

body.dark-theme .btn-outline-secondary {
    color: #b0b0b0;
    border-color: #b0b0b0;
}

body.dark-theme .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Navigation */
body.dark-theme .nav-link {
    color: #e0e0e0;
}

body.dark-theme .nav-link:hover {
    color: #3498db;
}

body.dark-theme .nav-link.active {
    color: #3498db;
    background-color: #2d2d2d;
}

body.dark-theme .nav-tabs {
    border-bottom-color: #404040;
}

/* Tables */
body.dark-theme table {
    color: #ffffff;
}

body.dark-theme .table {
    color: #ffffff;
}

body.dark-theme .table thead th {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

body.dark-theme .table tbody tr {
    background-color: #2d2d2d;
}

body.dark-theme .table tbody tr:hover {
    background-color: #3d3d3d;
}

body.dark-theme .table td,
body.dark-theme .table th {
    border-color: #404040;
}

/* Alerts */
body.dark-theme .alert {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

body.dark-theme .alert-info {
    background-color: #1e3a5f;
    border-color: #2d5a8a;
    color: #d1ecf1;
}

body.dark-theme .alert-warning {
    background-color: #856404;
    border-color: #997404;
    color: #fff3cd;
}

body.dark-theme .alert-danger {
    background-color: #721c24;
    border-color: #821d24;
    color: #f8d7da;
}

body.dark-theme .alert-success {
    background-color: #155724;
    border-color: #1e7e34;
    color: #d4edda;
}

/* Fieldset */
body.dark-theme fieldset {
    border-color: #404040;
}

body.dark-theme legend {
    color: #ffffff;
}

/* Links */
body.dark-theme a {
    color: #3498db;
}

body.dark-theme a:hover {
    color: #5dade2;
}

/* Dropdowns */
body.dark-theme .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .dropdown-item {
    color: #ffffff;
}

body.dark-theme .dropdown-item:hover {
    background-color: #3d3d3d;
    color: #ffffff;
}

/* Override inline background-color on dropdown items in dark mode */
body.dark-theme .dropdown-menu a[style*="background-color: white"],
body.dark-theme .dropdown-menu a[style*="background-color:white"] {
    background-color: #3d3d3d !important;
    color: #ffffff !important;
}

/* Override inline background-color on all anchors in dark mode */
body.dark-theme a[style*="background-color: white"],
body.dark-theme a[style*="background-color:white"] {
    background-color: #3d3d3d !important;
    color: #3498db !important;
}

/* Make Assignment History and other dropdown links more distinct */
body.dark-theme .dropdown-menu a {
    background-color: #3d3d3d !important;
    color: #3498db !important;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

body.dark-theme .dropdown-menu a:hover {
    background-color: #3498db !important;
    color: #ffffff !important;
}

/* Fix overlapping li elements in dropdown menus */
body.dark-theme .dropdown-menu li {
    margin: 4px 0;
}

body.dark-theme .dropdown-menu li a {
    display: block;
    width: 100%;
}

/* Light mode dropdown menu styling for consistent sizing */
body:not(.dark-theme) .dropdown-menu li {
    margin: 4px 0;
}

body:not(.dark-theme) .dropdown-menu li a {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Extra small button class for clear buttons */
.btn-xs {
    padding: 2px 8px;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 3px;
}

/* Dropdown trigger cursor */
.dropdown,
.dropdown i {
    cursor: pointer;
}

/* PeoplePicker dark theme */
body.dark-theme #PeoplePickerRoles {
    background-color: #3d3d3d;
    color: #ffffff;
    border-color: #555;
}

body.dark-theme #searchPeoplePicker {
    background-color: #3d3d3d;
    border-color: #555;
}

body.dark-theme #searchPeoplePicker .ui.icon.input {
    background-color: #3d3d3d;
}

body.dark-theme #searchPeoplePicker .ui.icon.input input {
    background-color: #3d3d3d;
    color: #ffffff;
}

body.dark-theme #PeoplePickerECFRequest {
    background-color: #3d3d3d;
    color: #ffffff;
    border-color: #555;
}

body.dark-theme #searchPeoplePickerECFRequest {
    background-color: #3d3d3d;
    border-color: #555;
}

body.dark-theme #searchPeoplePickerECFRequest .ui.icon.input {
    background-color: #3d3d3d;
}

body.dark-theme #searchPeoplePickerECFRequest .ui.icon.input input {
    background-color: #3d3d3d;
    color: #ffffff;
}


/* Modal */
body.dark-theme .modal-content {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-theme .modal-header {
    border-bottom-color: #404040;
}

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

body.dark-theme .dat-modal-close.btn-close:hover,
body.dark-theme .dat-modal-close.btn-close:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .modal-footer {
    border-top-color: #404040;
}

/* API error dialog — light theme (default) */
.error-modal {
    color: #212529;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0;
    max-width: 520px;
    width: calc(100% - 2rem);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.error-modal::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.error-modal-content {
    padding: 1.5rem 1.75rem 1.25rem;
}

.error-modal-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    text-align: center;
}

.error-modal-summary {
    margin: 0;
    color: #495057;
    text-align: center;
    line-height: 1.5;
    font-size: 0.95rem;
}

.error-modal-details-toggle {
    text-align: center;
    margin-top: 0.85rem;
}

.error-modal-details-link {
    color: #0d6efd;
    font-size: 0.875rem;
    text-decoration: none;
}

.error-modal-details-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.error-modal-details-panel {
    margin-top: 0.85rem;
    max-height: 320px;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.error-modal-details-text {
    margin: 0;
    padding: 0.75rem;
    color: #212529;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.error-modal-details-divider {
    margin: 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}

.error-modal-request-label {
    padding: 0.5rem 0.75rem 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c757d;
}

.error-modal-footer {
    text-align: center;
    margin-top: 1.25rem;
}

.error-modal-close-btn {
    color: #ffffff;
    background-color: #6c757d;
    border: 1px solid #6c757d;
    border-radius: 4px;
    padding: 0.45rem 1.25rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.error-modal-close-btn:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

/* API error dialog — dark theme */
body.dark-theme .error-modal {
    color: #ffffff;
    background-color: #1e1e1e;
    border-color: #404040;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.dark-theme .error-modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

body.dark-theme .error-modal-title {
    color: #ffffff;
}

body.dark-theme .error-modal-summary {
    color: #e0e0e0;
}

body.dark-theme .error-modal-details-link {
    color: #7cb8ff;
}

body.dark-theme .error-modal-details-link:hover {
    color: #a8d0ff;
}

body.dark-theme .error-modal-details-panel {
    border-color: #404040;
    background-color: #141414;
}

body.dark-theme .error-modal-details-text {
    color: #d4d4d4;
}

body.dark-theme .error-modal-details-divider {
    border-top-color: #404040;
}

body.dark-theme .error-modal-request-label {
    color: #9aa0a6;
}

body.dark-theme .error-modal-close-btn {
    background-color: #333;
    border-color: #555;
}

body.dark-theme .error-modal-close-btn:hover {
    background-color: #444;
}

/* Success dialog — matches loader panel palette */
.success-modal {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.success-modal:not([open]) {
    display: none;
}

.success-modal[open] {
    position: fixed;
    inset: 0;
    width: fit-content;
    height: fit-content;
    max-width: calc(100% - 2rem);
    max-height: calc(100% - 2rem);
    margin: auto;
    overflow: visible;
}

.success-modal::backdrop {
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.success-modal-content.loader-panel {
    min-width: 280px;
    max-width: 360px;
    margin: 0;
}

.success-modal-icon {
    text-align: center;
    margin-bottom: 0.85rem;
    font-size: 2.75rem;
    line-height: 1;
}

.success-modal-icon--success {
    color: #198754;
}

.success-modal-icon--info {
    color: #b78103;
}

.success-modal-title {
    margin-bottom: 0.65rem;
}

.success-modal-summary {
    margin: 0;
    text-align: center;
    line-height: 1.5;
}

.success-modal-footer {
    text-align: center;
    margin-top: 1.35rem;
}

.success-modal-close-btn {
    color: #212529;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.45rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 7rem;
}

.success-modal-close-btn:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.success-modal--info .success-modal-close-btn {
    color: #212529;
    background-color: #ffffff;
    border-color: #dee2e6;
}

.success-modal--info .success-modal-close-btn:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

/* Success dialog — dark theme */
body.dark-theme .success-modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

body.dark-theme .success-modal-icon--success {
    color: #3dd68c;
}

body.dark-theme .success-modal-icon--info {
    color: #f0c14b;
}

body.dark-theme .success-modal-close-btn {
    color: #ffffff;
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .success-modal-close-btn:hover {
    background-color: #3d3d3d;
    border-color: #555555;
}

body.dark-theme .success-modal--info .success-modal-close-btn {
    color: #ffffff;
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .success-modal--info .success-modal-close-btn:hover {
    background-color: #3d3d3d;
    border-color: #555555;
}

body.dark-theme .access-denied-card {
    background-color: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

body.dark-theme .access-denied-icon {
    color: #9aa0a6;
}

body.dark-theme .access-denied-title {
    color: #ffffff;
}

body.dark-theme .access-denied-message {
    color: #c5c8ce;
}

/* Input Group */
body.dark-theme .input-group-text {
    background-color: #3d3d3d;
    border-color: #555;
    color: #ffffff;
}

/* Progress Bar */
body.dark-theme .progress {
    background-color: #3d3d3d;
}

body.dark-theme .progress-bar {
    background-color: #3498db;
}

/* Tooltip */
body.dark-theme .tooltip .tooltiptext {
    background-color: #2d2d2d;
    color: #ffffff;
    border: 1px solid #404040;
}

/* Custom Scrollbar for Dark Theme */
body.dark-theme ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

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

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

/* Loader */
body.dark-theme #loaderOverlay {
    background: rgba(0, 0, 0, 0.55);
}

body.dark-theme .loader-panel {
    background-color: #1e1e1e;
    border-color: #404040;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

body.dark-theme .loader-panel-title {
    color: #ffffff;
}

body.dark-theme .loader-panel-subtitle {
    color: #b0b0b0;
}

body.dark-theme .loader {
    background-color: #2d2d2d;
    box-shadow: 0 0 0 6px rgba(52, 152, 219, 0.12);
}

body.dark-theme .loaderText {
    color: #3498db;
}

/* Microsoft Fabric Panel Dark Theme */
body.dark-theme .ms-Panel {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-theme .ms-Panel-contentInner {
    background-color: #2d2d2d;
    color: #ffffff;
}

body.dark-theme .ms-Panel-closeButton {
    color: #ffffff;
}

body.dark-theme .ms-Panel-closeButton:hover {
    color: #3498db;
}

/* Spinner */
body.dark-theme .spinner {
    border-color: #3498db;
    border-bottom-color: rgba(0,0,0,0);
}

/* Semantic UI Overrides */
body.dark-theme .ui.grid {
    color: #ffffff;
}

body.dark-theme .ui.grid .column {
    color: #ffffff;
}

/* MDB UI Kit Overrides */
body.dark-theme .md-form input:focus,
body.dark-theme .md-form textarea:focus {
    border-color: #3498db;
    box-shadow: 0 1px 0 0 #3498db;
}

body.dark-theme .md-form input,
body.dark-theme .md-form textarea {
    color: #ffffff;
}

body.dark-theme .form-notch-leading {
    border-color: #3498db !important;
}

body.dark-theme .form-notch-middle {
    border-color: #3498db !important;
}

body.dark-theme .form-notch-trailing {
    border-color: #3498db !important;
}

/* DataTables */
body.dark-theme .dataTables_wrapper {
    color: #ffffff;
}

body.dark-theme .dataTables_length,
body.dark-theme .dataTables_filter,
body.dark-theme .dataTables_info,
body.dark-theme .dataTables_paginate {
    color: #ffffff;
}

body.dark-theme .dataTables_wrapper .dataTables_length select,
body.dark-theme .dataTables_wrapper .dataTables_filter input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #ffffff;
}

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

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #3498db !important;
    color: white !important;
    border: none;
}

body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #3d3d3d !important;
    color: #3498db !important;
    border: none;
}

/* DataTables table rows */
body.dark-theme .dataTables_wrapper table.dataTable,
body.dark-theme table.dataTable,
body.dark-theme #dataTableECF,
body.dark-theme #dataTableETF {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr,
body.dark-theme table.dataTable tbody tr,
body.dark-theme #dataTableECF tbody tr,
body.dark-theme #dataTableETF tbody tr,
body.dark-theme .dataTables_wrapper table.dataTable tbody tr.even,
body.dark-theme table.dataTable tbody tr.even,
body.dark-theme #dataTableECF tbody tr.even,
body.dark-theme #dataTableETF tbody tr.even,
body.dark-theme .dataTables_wrapper table.dataTable tbody tr.odd,
body.dark-theme table.dataTable tbody tr.odd,
body.dark-theme #dataTableECF tbody tr.odd,
body.dark-theme #dataTableETF tbody tr.odd {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr:hover,
body.dark-theme table.dataTable tbody tr:hover,
body.dark-theme #dataTableECF tbody tr:hover,
body.dark-theme #dataTableETF tbody tr:hover,
body.dark-theme .dataTables_wrapper table.dataTable tbody tr.even:hover,
body.dark-theme table.dataTable tbody tr.even:hover,
body.dark-theme #dataTableECF tbody tr.even:hover,
body.dark-theme #dataTableETF tbody tr.even:hover,
body.dark-theme .dataTables_wrapper table.dataTable tbody tr.odd:hover,
body.dark-theme table.dataTable tbody tr.odd:hover,
body.dark-theme #dataTableECF tbody tr.odd:hover,
body.dark-theme #dataTableETF tbody tr.odd:hover {
    background-color: #3d3d3d !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody td,
body.dark-theme table.dataTable tbody td,
body.dark-theme #dataTableECF tbody td,
body.dark-theme #dataTableETF tbody td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr.selected,
body.dark-theme table.dataTable tbody tr.selected,
body.dark-theme #dataTableECF tbody tr.selected,
body.dark-theme #dataTableETF tbody tr.selected {
    background-color: #3498db !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr.selected td,
body.dark-theme table.dataTable tbody tr.selected td,
body.dark-theme #dataTableECF tbody tr.selected td,
body.dark-theme #dataTableETF tbody tr.selected td {
    background-color: #3498db !important;
    color: #ffffff !important;
}

/* DataTables child rows */
body.dark-theme .dataTables_wrapper table.dataTable tbody tr.child,
body.dark-theme table.dataTable tbody tr.child,
body.dark-theme #dataTableECF tbody tr.child,
body.dark-theme #dataTableETF tbody tr.child {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr.child td,
body.dark-theme table.dataTable tbody tr.child td,
body.dark-theme #dataTableECF tbody tr.child td,
body.dark-theme #dataTableETF tbody tr.child td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr.child table,
body.dark-theme table.dataTable tbody tr.child table,
body.dark-theme #dataTableECF tbody tr.child table,
body.dark-theme #dataTableETF tbody tr.child table {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

body.dark-theme .dataTables_wrapper table.dataTable tbody tr.child table td,
body.dark-theme table.dataTable tbody tr.child table td,
body.dark-theme #dataTableECF tbody tr.child table td,
body.dark-theme #dataTableETF tbody tr.child table td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

/* General table styling for dark theme - catch-all */
body.dark-theme table tbody tr,
body.dark-theme table tbody tr td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

body.dark-theme table tbody tr:hover {
    background-color: #3d3d3d !important;
}

/* Specific targeting for DataTables display class tables */
body.dark-theme table.display tbody tr,
body.dark-theme table.display tbody tr td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

body.dark-theme table.display tbody tr:hover {
    background-color: #3d3d3d !important;
}

/* Select2 */
body.dark-theme .select2-container--default .select2-selection--single {
    background-color: #3d3d3d;
    border-color: #555;
}

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

body.dark-theme .select2-dropdown {
    background-color: #2d2d2d;
    border-color: #404040;
}

body.dark-theme .select2-container--default .select2-results__option {
    color: #ffffff;
}

body.dark-theme .select2-container--default .select2-results__option--highlighted {
    background-color: #3498db;
    color: white;
}

/* Search Input */
body.dark-theme .psda-search-input {
    background-color: #3d3d3d;
    border-color: #555;
    color: #ffffff;
}

/* Panel Control Buttons */
body.dark-theme .panel-control-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}

body.dark-theme .panel-control-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

/* Strikeout */
body.dark-theme .strikeout::after {
    border-bottom-color: #e74c3c;
}

/* Additional text colors */
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;
}

body.dark-theme p {
    color: #ffffff;
}

body.dark-theme span {
    color: #ffffff;
}

/* Inline styled text elements */
body.dark-theme .w-auto {
    color: #ffffff;
}

/* Legend elements */
body.dark-theme legend {
    color: #ffffff;
}

/* Prefix icons with text */
body.dark-theme .prefix {
    color: #ffffff;
}

/* Override inline color styles in dark mode */
body.dark-theme [style*="color: black"],
body.dark-theme [style*="color:black"] {
    color: #ffffff !important;
}

body.dark-theme [style*="color: #000"],
body.dark-theme [style*="color:#000"] {
    color: #ffffff !important;
}

body.dark-theme [style*="color: #000000"],
body.dark-theme [style*="color:#000000"] {
    color: #ffffff !important;
}

/* Make red text brighter in dark mode */
body.dark-theme [style*="color: red"],
body.dark-theme [style*="color:red"] {
    color: #ff6b6b !important;
}

body.dark-theme [style*="color: #ff0000"],
body.dark-theme [style*="color:#ff0000"] {
    color: #ff6b6b !important;
}

/* Make green text brighter in dark mode */
body.dark-theme [style*="color: green"],
body.dark-theme [style*="color:green"] {
    color: #51cf66 !important;
}

body.dark-theme [style*="color: #008000"],
body.dark-theme [style*="color:#008000"] {
    color: #51cf66 !important;
}

/* Make blue text brighter in dark mode */
body.dark-theme [style*="color: #3975b0"],
body.dark-theme [style*="color:#3975b0"] {
    color: #74c0fc !important;
}

body.dark-theme [style*="color: rgb(0, 191, 255"],
body.dark-theme [style*="color:rgb(0, 191, 255"] {
    color: #74c0fc !important;
}

/* Make orange text brighter in dark mode */
body.dark-theme [style*="color: orange"],
body.dark-theme [style*="color:orange"] {
    color: #ffa94d !important;
}

/* Make any dark colored text white in dark mode */
body.dark-theme [style*="color: #2"],
body.dark-theme [style*="color:#2"],
body.dark-theme [style*="color: #3"],
body.dark-theme [style*="color:#3"],
body.dark-theme [style*="color: #4"],
body.dark-theme [style*="color:#4"],
body.dark-theme [style*="color: #5"],
body.dark-theme [style*="color:#5"] {
    color: #ffffff !important;
}

/* HR */
body.dark-theme hr {
    border-color: #404040;
}

/* Code blocks */
body.dark-theme code,
body.dark-theme pre {
    background-color: #3d3d3d;
    color: #ffffff;
}

/* Badge */
body.dark-theme .badge {
    color: #ffffff;
}

body.dark-theme .badge-primary {
    background-color: #3498db;
}

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

/* Toggle Button Styles */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid #404040;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    background: #3d3d3d;
    border-color: #3498db;
}

body:not(.dark-theme) .theme-toggle-btn {
    color: #495057;
    border-color: #ced4da;
}

body:not(.dark-theme) .theme-toggle-btn:hover {
    background: #e9ecef;
}

/* Remove any nav-link bottom border from theme toggle button */
.theme-toggle-btn.nav-link {
    border-bottom: none !important;
}

.dat-icon-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dat-icon-actions .nav-link {
    padding-left: 6px;
    padding-right: 6px;
    margin: 0;
}

.dat-icon-actions .theme-toggle-btn {
    padding: 6px 8px;
}

#impersonateToggle.impersonate-active {
    color: #c9a227;
    border-color: #c9a227;
}

body.dark-theme #impersonateToggle.impersonate-active {
    color: #f0c14b;
    border-color: #f0c14b;
}
