html.dark-mode,
body.dark-mode {
    background-color: #121212;
    color: #e4e6eb;
}

body.dark-mode a {
    color: #9ec5fe;
}

body.dark-mode .navbar {
    background-color: #1f1f1f !important;
}

body.dark-mode .navbar .nav-link,
body.dark-mode .navbar .navbar-brand {
    color: #f8f9fa !important;
}

body.dark-mode .dropdown-menu {
    background-color: #1f1f1f;
    border-color: #343a40;
    color: #f8f9fa;
}

body.dark-mode .dropdown-item {
    color: #f8f9fa;
}

body.dark-mode .dropdown-menu .text-dark {
    color: #f8f9fa !important;
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background-color: #2a2a2a;
    color: #fff;
}

body.dark-mode .kpi {
    background-color: #1f1f1f;
    border-color: #2c2c2c;
    color: #f8f9fa;
}

body.dark-mode .kpi .label span {
    color: #ced4da;
}

body.dark-mode .kpi .value {
    color: #fff;
}

body.dark-mode .table {
    color: #e4e6eb;
}

body.dark-mode .table>:not(caption)>*>* {
    background-color: #181818;
    color: #e4e6eb;
    border-color: #2c2c2c;
}

body.dark-mode .modal .table,
body.dark-mode .modal .table>:not(caption)>*>* {
    background-color: #1e1e1e;
    color: #f8f9fa;
}

body.dark-mode .modal .table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #242424;
}

body.dark-mode .modal .table-hover>tbody>tr:hover {
    background-color: #2c2c2c;
}

body.dark-mode .modal table.dataTable,
body.dark-mode .modal table.dataTable tbody tr,
body.dark-mode .modal table.dataTable tbody tr.odd,
body.dark-mode .modal table.dataTable tbody tr.even {
    background-color: #1e1e1e !important;
    color: #f8f9fa;
}

body.dark-mode .modal table.dataTable tbody td,
body.dark-mode .modal table.dataTable tbody tr td {
    background-color: #1e1e1e !important;
    color: #f8f9fa;
}

body.dark-mode .modal table.dataTable.display tbody tr.odd,
body.dark-mode .modal table.dataTable.stripe tbody tr.odd {
    background-color: #242424 !important;
}

body.dark-mode .modal table.dataTable.display tbody tr:hover,
body.dark-mode .modal table.dataTable.display tbody tr.odd:hover,
body.dark-mode .modal table.dataTable.display tbody tr.even:hover {
    background-color: #2c2c2c !important;
}

body.dark-mode table.dataTable {
    background-color: #181818;
}

body.dark-mode table.dataTable tbody tr {
    background-color: #181818 !important;
    color: #e4e6eb;
    border-color: #2c2c2c;
}

body.dark-mode table.dataTable tbody td,
body.dark-mode table.dataTable tbody th {
    border-color: #2c2c2c !important;
}

body.dark-mode table.dataTable.display tbody tr.odd,
body.dark-mode table.dataTable.stripe tbody tr.odd {
    background-color: #1f1f1f !important;
    color: #e4e6eb;
}

body.dark-mode table.dataTable.display tbody tr.even,
body.dark-mode table.dataTable.stripe tbody tr.even {
    background-color: #181818 !important;
    color: #e4e6eb;
}

body.dark-mode table.dataTable.display tbody tr:hover,
body.dark-mode table.dataTable.stripe tbody tr:hover {
    background-color: #2a2a2a;
}

body.dark-mode .table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: #1f1f1f !important;
    color: #e4e6eb;
}

body.dark-mode .table-striped>tbody>tr:nth-of-type(even)>* {
    background-color: #181818 !important;
    color: #e4e6eb;
}

body.dark-mode .table-hover>tbody>tr:hover>* {
    background-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .table>tbody>tr>td,
body.dark-mode .table>thead>tr>th {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

body.dark-mode #sitesTable thead th {
    background: #121d30 !important;
    color: #d5eafe !important;
    padding: 0.6rem 0.75rem;
    font-size: 0.76rem;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
}

body.dark-mode #sitesTable thead th:first-child {
    border-top-left-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}

body.dark-mode #sitesTable thead th:last-child {
    border-top-right-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

body.dark-mode #sitesTable tbody tr,
body.dark-mode #sitesTable tbody td {
    background: #171e2e !important;
    color: #d5eafe !important;
}

body.dark-mode #sitesTable {
    background: #0e1626 !important;
}

body.dark-mode .site-asset-list {
    padding: 0.5rem 0.75rem 0.5rem 1.8rem;
    border-top: 1px solid rgba(248, 249, 250, 0.08);
    border-bottom: 1px solid rgba(248, 249, 250, 0.08);
}

body.dark-mode .site-asset-row {
    border-bottom: 1px solid rgba(248, 249, 250, 0.08);
    min-height: 40px;
}

body.dark-mode .site-asset-row:last-child {
    border-bottom: none;
}

body.dark-mode .site-asset-serial {
    color: rgba(248, 249, 250, 0.9);
}

body.dark-mode .site-asset-product {
    color: rgba(248, 249, 250, 0.75);
}

body.dark-mode .site-asset-location {
    color: rgba(248, 249, 250, 0.75);
}

body.dark-mode .site-asset-w3w {
    color: rgba(248, 249, 250, 0.75);
}

body.dark-mode .site-asset-w3w a {
    color: rgba(248, 249, 250, 0.9);
}

body.dark-mode .site-asset-serial a {
    color: rgba(248, 249, 250, 0.9);
    text-decoration: underline;
}

body.dark-mode .site-asset-ppm .bi-check-lg {
    color: #34d399;
}

body.dark-mode .site-asset-ppm .bi-x-lg {
    color: #f87171;
}

body.dark-mode .site-asset-ppm .bi-check-circle-fill {
    color: #34d399;
}

body.dark-mode .site-asset-ppm .bi-x-circle-fill {
    color: #f87171;
}

body.dark-mode .site-asset-ppm .bi-exclamation-triangle-fill {
    color: #f59e0b;
}

body.dark-mode .site-asset-header {
    color: rgba(248, 249, 250, 0.65);
}

body.dark-mode #sitesTablePagination .btn-outline-secondary {
    color: #d5eafe;
    background-color: transparent;
    border-color: rgba(213, 234, 254, 0.35);
}

body.dark-mode #sitesTablePagination .btn-outline-secondary:hover {
    color: #ffffff;
    background-color: rgba(213, 234, 254, 0.12);
    border-color: rgba(213, 234, 254, 0.6);
}

body.dark-mode #sitesTablePagination .btn-outline-secondary.active,
body.dark-mode #sitesTablePagination .btn-outline-secondary:active {
    color: #0d1525;
    background-color: #d5eafe;
    border-color: #d5eafe;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e4e6eb !important;
    background: transparent;
    border-color: #444;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    background-color: #2a2a2a !important;
    border-color: #555;
}

body.dark-mode .pagination .page-link,
body.dark-mode .page-link {
    color: #e4e6eb;
    background-color: #1f1f1f;
    border-color: #444;
}

body.dark-mode .pagination .page-link:hover,
body.dark-mode .page-link:hover {
    color: #fff;
    background-color: #2c2c2c;
}

body.dark-mode .pagination .page-item.active .page-link,
body.dark-mode .page-item.active .page-link {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

body.dark-mode .pagination .page-item.disabled .page-link,
body.dark-mode .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #1f1f1f;
    border-color: #444;
}

body.dark-mode .dataTables_wrapper .dataTables_info {
    color: #ced4da;
}

body.dark-mode .table thead,
body.dark-mode table.dataTable thead th,
body.dark-mode table.dataTable thead td,
body.dark-mode table.dataTable thead .sorting,
body.dark-mode table.dataTable thead .sorting_asc,
body.dark-mode table.dataTable thead .sorting_desc {
    background-color: #1f1f1f !important;
    color: #f8f9fa !important;
    border-color: #333 !important;
}

body.dark-mode table.dataTable thead .sorting::before,
body.dark-mode table.dataTable thead .sorting::after,
body.dark-mode table.dataTable thead .sorting_asc::before,
body.dark-mode table.dataTable thead .sorting_asc::after,
body.dark-mode table.dataTable thead .sorting_desc::before,
body.dark-mode table.dataTable thead .sorting_desc::after {
    color: #adb5bd;
}

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

body.dark-mode .table-hover>tbody>tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .nav-tabs {
    border-color: #343a40;
}

body.dark-mode .nav-tabs .nav-link {
    color: #ced4da;
}

body.dark-mode .nav-tabs .nav-link.active {
    background-color: #1f1f1f;
    border-color: #343a40 #343a40 #1f1f1f;
    color: #fff;
}

body.dark-mode .client-dashboard .client-kpi-card {
    background: linear-gradient(135deg, #0b0f1a, #121829);
    border-color: #1f2633;
    color: #f8f9fa;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

body.dark-mode .client-dashboard .client-kpi-label {
    color: rgba(248, 249, 250, 0.85);
}

body.dark-mode .client-dashboard .client-kpi-value {
    color: #fff;
}

body.dark-mode .client-dashboard .client-kpi-subtext {
    color: rgba(248, 249, 250, 0.75);
}

body.dark-mode .client-dashboard .client-panel {
    background: linear-gradient(160deg, #0b1222, #111a2a);
    border-color: #1f2633;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.4);
}

body.dark-mode .client-dashboard .client-panel-subtitle,
body.dark-mode .client-dashboard .client-panel-meta {
    color: rgba(248, 249, 250, 0.6);
}

body.dark-mode .client-dashboard .revenue-bar,
body.dark-mode .client-dashboard .risk-bar {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .client-dashboard .coverage-ring-inner {
    background: #0e1625;
}

body.dark-mode .client-dashboard .risk-tab {
    color: rgba(248, 249, 250, 0.55);
}

body.dark-mode .client-dashboard .risk-tab.is-active {
    color: #f8f9fa;
}

body.dark-mode .card,
body.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #333;
}

body.dark-mode .card.bg-light,
body.dark-mode .card.text-dark,
body.dark-mode .card.bg-light .card-header,
body.dark-mode .card.text-dark .card-header {
    background-color: #1e1e1e !important;
    color: #f8f9fa !important;
    border-color: #333;
}

body.dark-mode .card-header,
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    background-color: #242424;
    border-color: #333;
    color: #f8f9fa;
}

body.dark-mode .btn-close {
    filter: invert(1);
}

body.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .modal .form-control,
body.dark-mode .modal .form-select,
body.dark-mode .dataTables_wrapper .dataTables_filter input,
body.dark-mode .dataTables_wrapper .dataTables_length select {
    background-color: #121212;
    color: #f8f9fa;
    border-color: #444;
}

body.dark-mode select option {
    color: #f8f9fa;
    background-color: #1e1e1e;
}

body.dark-mode select,
body.dark-mode .filters select {
    background-color: #121212 !important;
    color: #f8f9fa !important;
    border-color: #444 !important;
}

body.dark-mode select.form-select {
    color: #f8f9fa !important;
}

body.dark-mode .form-control-plaintext,
body.dark-mode .modal .form-control-plaintext {
    color: #f8f9fa;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: #171717;
    color: #fff;
    border-color: #666;
    box-shadow: none;
}

body.dark-mode .badge.bg-dark {
    background-color: #343a40 !important;
}

body.dark-mode .dataTables_wrapper .dt-buttons .btn-secondary,
body.dark-mode .btn-outline-secondary {
    background-color: #2a2a2a;
    color: #f8f9fa;
    border-color: #444;
}

body.dark-mode .dataTables_wrapper .dt-buttons .btn-secondary:hover,
body.dark-mode .btn-outline-secondary:hover {
    background-color: #3a3a3a;
    color: #fff;
}

body.dark-mode .assignee-filter-cell .select2-selection,
body.dark-mode .select2-container--default .select2-selection--single {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #444;
}

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

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #ced4da !important;
}

body.dark-mode .select2-container--default .select2-selection--multiple {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #444;
}

body.dark-mode .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #6ea8fe;
    box-shadow: 0 0 0 0.2rem rgba(110, 168, 254, 0.2);
}

body.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: #f8f9fa;
    background-color: transparent;
}

body.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2a2a2a;
    border: 1px solid #4a4a4a;
    color: #f8f9fa;
}

body.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #ced4da;
}

body.dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffffff;
}

body.dark-mode .select2-container--default .select2-search--inline .select2-search__field {
    color: #f8f9fa !important;
}

body.dark-mode .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: #adb5bd;
}

body.dark-mode .select2-dropdown {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #444;
}

body.dark-mode .select2-container--bootstrap-5 .select2-selection {
    background-color: #121212;
    color: #f8f9fa;
    border-color: #444;
}

body.dark-mode .select2-container--bootstrap-5 .select2-selection__rendered {
    color: #f8f9fa !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-selection__placeholder {
    color: #ced4da !important;
}

body.dark-mode .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #444;
}

/* Dispute PO history */
body.dark-mode #dispute_po_history {
    background-color: #121212 !important;
    color: #f8f9fa !important;
    border-color: #333 !important;
}

body.dark-mode .select2-results__option--highlighted {
    background-color: #343a40;
}

body.dark-mode .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #2a2a2a;
    color: #f8f9fa;
}

body.dark-mode .select2-container--default .select2-results__option {
    color: #f8f9fa;
}

body.dark-mode .modal .list-group-item {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #333;
}

body.dark-mode .modal .accordion-button {
    background-color: #1f1f1f;
    color: #f8f9fa;
}

body.dark-mode .modal .accordion-button:not(.collapsed) {
    color: #fff;
    background-color: #272727;
}

body.dark-mode .modal .accordion-button::after {
    filter: invert(1);
}

body.dark-mode .modal .accordion-item,
body.dark-mode .modal .accordion-body {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #333;
}

body.dark-mode .modal .nav-tabs .nav-link.active {
    background-color: #1f1f1f;
    border-color: #343a40;
    color: #fff;
}

body.dark-mode .nav.nav-tabs.call-notes-tabs .nav-link {
    color: #f1f3f5;
    opacity: 1;
}

body.dark-mode .nav.nav-tabs.call-notes-tabs .nav-link:hover {
    color: #fff;
}

body.dark-mode .nav.nav-tabs.call-notes-tabs .nav-link.disabled,
body.dark-mode .nav.nav-tabs.call-notes-tabs .nav-link.disabled:hover {
    color: #777;
}

body.dark-mode .call-date-value {
    color: #f8f9fa;
}

body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

body.dark-mode input[type="date"],
body.dark-mode input[type="datetime-local"],
body.dark-mode input[type="time"] {
    background-color: #121212;
    color: #f8f9fa;
    border-color: #444;
}

/* Accordions */
body.dark-mode .accordion,
body.dark-mode .accordion-item {
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode .accordion-button {
    background-color: #1e1e1e;
    color: #f8f9fa;
    border-color: #333;
}

body.dark-mode .accordion-button:not(.collapsed) {
    color: #f8f9fa;
    background-color: #242424;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-mode .accordion-button::after {
    filter: invert(1);
}

body.dark-mode .accordion-body {
    background-color: #121212;
    color: #f8f9fa;
    border-color: #333;
}

/* Highcharts */
body.dark-mode .highcharts-background {
    fill: #1e1e1e !important;
}

body.dark-mode .highcharts-plot-background {
    fill: #181818 !important;
}

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

body.dark-mode .highcharts-axis-labels text {
    fill: #f8f9fa !important;
    color: #f8f9fa !important;
}

body.dark-mode .highcharts-legend-item text {
    fill: #f8f9fa !important;
    color: #f8f9fa !important;
}

/* FullCalendar */
body.dark-mode .fc-theme-standard td,
body.dark-mode .fc-theme-standard th {
    border-color: #2c2c2c;
}

body.dark-mode .fc-theme-standard .fc-scrollgrid {
    border-color: #2c2c2c;
    background-color: #0f0f0f;
}

body.dark-mode .fc .fc-col-header-cell {
    background-color: #1c1c1c;
}

body.dark-mode .fc .fc-col-header-cell-cushion {
    color: #d7dce4;
}

body.dark-mode .fc .fc-daygrid-day-frame {
    background-color: #111;
}

body.dark-mode .fc .fc-daygrid-day-number {
    color: #9ec5fe;
}

/* History timeline */
body.dark-mode .history-timeline .timeline-line {
    background: #4b5563;
}

body.dark-mode .history-timeline .timeline-label {
    color: #9ca3af;
}

body.dark-mode .history-timeline .timeline-bubble {
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .history-timeline .timeline-gridline {
    background: rgba(156, 163, 175, 0.35);
}

body.dark-mode .history-timeline .timeline-gridline--year {
    background: rgba(156, 163, 175, 0.65);
}

body.dark-mode .history-timeline .timeline-year-label {
    color: #9ca3af;
}

body.dark-mode .history-timeline .timeline-crosshair {
    background: rgba(229, 231, 235, 0.55);
}

body.dark-mode .history-timeline .timeline-hover-date {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

body.dark-mode .history-timeline-filters .timeline-filter {
    border-color: #4b5563;
}

body.dark-mode .history-timeline-filters .timeline-filter.is-active {
    color: #111827;
}

body.dark-mode .repair-summary-timeline__items::after {
    background: linear-gradient(90deg, #14b8a6 0%, #3b82f6 70%, #64748b 100%);
}

body.dark-mode .repair-summary-timeline__card {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

body.dark-mode .repair-summary-timeline__title {
    color: #93c5fd;
}

body.dark-mode .repair-summary-timeline__date {
    color: #e2e8f0;
}

body.dark-mode .repair-summary-timeline__meta {
    color: #a5b4fc;
}

body.dark-mode .repair-summary-timeline__dot {
    border-color: #0f172a;
}

body.dark-mode .repair-summary-timeline__delta {
    color: #5eead4;
}
