/*
 * Final theme overrides.
 * Loaded after page-level {% block extrahead %} styles so legacy inline CSS
 * cannot force light-only colors over the dark theme.
 */

.table-light {
    --bs-table-bg: var(--mz-muted-bg);
    --bs-table-color: var(--mz-body-color);
    --bs-table-border-color: var(--mz-card-border);
}

.table-success {
    --bs-table-bg: var(--mz-row-success);
    --bs-table-color: var(--mz-body-color);
    --bs-table-border-color: var(--mz-card-border);
}

.bg-light {
    background-color: var(--mz-muted-bg) !important;
    color: var(--mz-body-color) !important;
}

.bw-percent-ok {
    color: var(--mz-bw-ok-color) !important;
    font-weight: 700;
}

.bw-percent-warning {
    color: var(--mz-bw-warning-color) !important;
    font-weight: 700;
}

.bw-percent-danger {
    color: var(--mz-bw-danger-color) !important;
    font-weight: 700;
}

.service-renew-expired,
.service-renew-red {
    background: var(--mz-renew-red-bg) !important;
    color: var(--mz-renew-red-color) !important;
    font-weight: 700;
}

.service-renew-yellow {
    background: var(--mz-renew-yellow-bg) !important;
    color: var(--mz-renew-yellow-color) !important;
    font-weight: 700;
}

.service-renew-green {
    color: var(--mz-renew-green-color) !important;
}

.service-monitor.service-monitor-ok {
    background: var(--mz-monitor-ok-bg) !important;
    color: var(--mz-monitor-ok-color) !important;
}

.service-monitor.service-monitor-warn {
    background: var(--mz-monitor-warn-bg) !important;
    color: var(--mz-monitor-warn-color) !important;
}

.service-monitor.service-monitor-crit {
    background: var(--mz-monitor-crit-bg) !important;
    color: var(--mz-monitor-crit-color) !important;
}

.service-monitor.service-monitor-unknown {
    background: var(--mz-monitor-unknown-bg) !important;
    color: var(--mz-monitor-unknown-color) !important;
}

.service-table tbody tr:nth-child(even):not(.service-unmanaged):not(.service-managed):not(.payment-succeeded)>*:not(.service-monitor):not([class*="service-renew-"]) {
    background-color: var(--mz-table-stripe) !important;
}

.service-table tbody tr.service-unmanaged>*:not(.service-monitor):not([class*="service-renew-"]) {
    background-color: var(--mz-service-unmanaged) !important;
}

.service-table tbody tr.service-unmanaged:nth-child(even)>*:not(.service-monitor):not([class*="service-renew-"]) {
    background-color: var(--mz-service-unmanaged-alt) !important;
}

.service-table tbody tr.service-managed>*:not(.service-monitor):not([class*="service-renew-"]) {
    background-color: var(--mz-service-managed) !important;
}

.service-table tbody tr.service-managed:nth-child(even)>*:not(.service-monitor):not([class*="service-renew-"]) {
    background-color: var(--mz-service-managed-alt) !important;
}

.service-table tbody tr.payment-succeeded>*:not(.service-monitor):not([class*="service-renew-"]),
.payment-succeeded>*,
.payment-row-verified-success>*,
.invoice-row-paid>* {
    background: var(--mz-row-success) !important;
}

.payment-row-non-success>*,
.invoice-row-void>* {
    background: var(--mz-row-muted) !important;
    color: var(--mz-muted-color) !important;
}

.service-table tbody tr.service-parent>*:not(.service-monitor):not([class*="service-renew-"]) {
    border-top-color: var(--mz-service-parent-border) !important;
}

.service-table tbody tr.service-child>*:not(.service-monitor):not([class*="service-renew-"]) {
    background: var(--mz-service-child) !important;
}

.service-subrow {
    background: var(--mz-muted-bg) !important;
}

.dedic-list tbody tr.dedic-unmanaged>* {
    background-color: var(--mz-service-unmanaged) !important;
}

.dedic-list tbody tr.dedic-unmanaged:nth-child(even)>* {
    background-color: var(--mz-service-unmanaged-alt) !important;
}

.dedic-list tbody tr.dedic-managed>* {
    background-color: var(--mz-service-managed) !important;
}

.dedic-list tbody tr.dedic-managed:nth-child(even)>* {
    background-color: var(--mz-service-managed-alt) !important;
}

[data-bs-theme="dark"] .dedic-list tbody tr.dedic-inactive>* {
    background-color: #30343b !important;
    color: var(--mz-body-color) !important;
}

[data-bs-theme="dark"] .dedic-list tbody tr.dedic-inactive a {
    color: #9ec5fe !important;
}

[data-bs-theme="dark"] .dedic-list tbody tr.dedic-inactive .text-muted {
    color: var(--mz-muted-color) !important;
}

.staff-ticket-table tbody tr:hover>* {
    background: var(--mz-ticket-hover) !important;
}

.ticket-assigned-me>*:not(.ticket-priority-cell) {
    background: var(--mz-ticket-assigned-me) !important;
}

.ticket-assigned-group:not(.ticket-assigned-me)>*:not(.ticket-priority-cell) {
    background: var(--mz-ticket-assigned-group) !important;
}

.ticket-closed>* {
    background: var(--mz-ticket-closed) !important;
}

.staff-ticket-table tbody tr.ticket-closed:hover>* {
    background: var(--mz-ticket-closed-hover) !important;
}

.staff-ticket-cat:hover,
.staff-ticket-cat.active {
    background: var(--mz-ticket-assigned-group) !important;
    border-color: var(--mz-service-parent-border) !important;
}

.ticket-followup-staff .card-header {
    background-color: var(--mz-ticket-staff-followup) !important;
}

.ticket-followup-conflict-new .card-header {
    background-color: var(--mz-renew-red-bg) !important;
    color: var(--mz-renew-red-color) !important;
}

.ticket-followup-conflict-new .card-body {
    background-color: var(--mz-ticket-conflict-bg) !important;
}

.ticket-change-log {
    background: var(--mz-ticket-change-bg) !important;
    border-top-color: var(--mz-card-border) !important;
    color: var(--mz-ticket-change-color) !important;
}

.ticket-staff-subject,
.ticket-title-staff-subject {
    color: var(--mz-ticket-purple) !important;
}

.ticket-todo {
    background: var(--mz-ticket-todo-bg) !important;
    color: var(--mz-ticket-todo-color) !important;
}

.ticket-chip-staff {
    background: var(--mz-ticket-chip-staff) !important;
}

.ticket-chip-group {
    background: var(--mz-ticket-chip-group) !important;
}

.select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

.select2-container--bootstrap-5 .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection__placeholder,
.select2-container--bootstrap-5 .select2-selection__clear,
.select2-container--bootstrap-5 .select2-selection__arrow b,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--bs-body-color) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--mz-muted-bg) !important;
    border-color: var(--mz-card-border) !important;
    color: var(--mz-body-color) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__display {
    color: var(--mz-body-color) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--mz-muted-color) !important;
}

.select2-container--bootstrap-5 .select2-dropdown,
.select2-container--bootstrap-5 .select2-results__option {
    background-color: var(--mz-card-bg) !important;
    border-color: var(--mz-card-border) !important;
    color: var(--mz-body-color) !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option[aria-selected="true"] {
    background-color: var(--mz-primary) !important;
    color: #fff !important;
}

.select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
    background-color: var(--mz-muted-bg) !important;
    color: var(--mz-body-color) !important;
}

.select2-container--bootstrap-5 .select2-search__field,
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    background-color: var(--bs-body-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}
