/*
 * HCIT readability overrides.
 *
 * The app renders with data-bs-theme="dark". Several Bootstrap contextual
 * classes assume a light page and become unreadable here, so they are
 * corrected globally rather than per page.
 *
 * Loaded after app.min.css in partial/head.blade.php and portal/layout.blade.php.
 */

/* Overdue rows. Bootstrap's dark-mode .table-danger keeps a light pink
   background while the table text stays light, which is close to illegible.
   Swap to a translucent red tint with light red text. */
[data-bs-theme="dark"] .table-danger,
[data-bs-theme="dark"] .table-striped .table-danger {
    --bs-table-bg: rgba(220, 53, 69, 0.15);
    --bs-table-striped-bg: rgba(220, 53, 69, 0.2);
    --bs-table-hover-bg: rgba(220, 53, 69, 0.28);
    --bs-table-color: #f8d7da;
    --bs-table-striped-color: #f8d7da;
    --bs-table-hover-color: #fff;
}

[data-bs-theme="dark"] .table-danger > td,
[data-bs-theme="dark"] .table-danger > th {
    color: #f8d7da;
}

[data-bs-theme="dark"] .table-danger a:not(.btn) {
    color: #ffe3e6;
}

/* Badges on pale backgrounds. Bootstrap's .badge sets white text, which
   against warning, info and light lands around 1.6:1 to 1.9:1. Anything using
   .text-bg-* already carries its own colour and is left alone. */
.badge.bg-warning,
.badge.bg-info,
.badge.bg-light {
    color: #1a1d20 !important;
}

.badge.bg-warning a,
.badge.bg-info a,
.badge.bg-light a {
    color: inherit;
}

/* .bg-light on a dark surface also needs a visible edge, otherwise a closed
   ticket's badge reads as a floating label. */
[data-bs-theme="dark"] .badge.bg-light {
    background-color: #dee2e6 !important;
}
