html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ==================== CWR SIGNATURE PAD STYLES ==================== */
/* Touch-friendly digital signature capture for legally binding documents */

.signature-pad-container {
    margin-bottom: 1rem;
}

.signature-canvas-wrapper {
    position: relative;
    background-color: #ffffff;
    border-radius: 0.375rem;
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; /* Prevent scrolling on mobile */
    cursor: crosshair;
}

.signature-canvas-wrapper:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.signature-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .signature-canvas-wrapper {
        width: 100% !important;
    }
    
    .signature-canvas {
        min-height: 150px;
    }
    
    .signature-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Print styles for signature images */
@media print {
    .signature-actions {
        display: none;
    }
    
    .signature-canvas-wrapper {
        border: 1px solid #000;
        break-inside: avoid;
    }
}

/* ==================== CWR STATUS BADGE STYLES ==================== */
/* Bright, visible status indicators for Active/Inactive states */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge.status-active {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.status-badge.status-inactive {
    background: linear-gradient(135deg, #78909c, #90a4ae);
    color: white;
    box-shadow: 0 2px 6px rgba(120, 144, 156, 0.3);
}

.status-badge.status-pending {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: white;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
}

.status-badge.status-error {
    background: linear-gradient(135deg, #d32f2f, #ef5350);
    color: white;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.status-badge.status-full {
    background: linear-gradient(135deg, #e53935, #ef5350);
    color: white;
    box-shadow: 0 2px 6px rgba(229, 57, 53, 0.3);
}

.status-badge.status-maintenance {
    background: linear-gradient(135deg, #fb8c00, #ffa726);
    color: white;
    box-shadow: 0 2px 6px rgba(251, 140, 0, 0.3);
}

.status-badge.status-archived {
    background: linear-gradient(135deg, #546e7a, #78909c);
    color: white;
    box-shadow: 0 2px 6px rgba(84, 110, 122, 0.3);
}

/* ==================== CWR GLOBAL UI FIXES ==================== */
/* Fix visibility, contrast, and sizing issues across the app */

/* Fix Bootstrap badges that are too small or have poor contrast */
.badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    min-width: 1.5rem;
    text-align: center;
}

/* Ensure numbered badges have proper sizing */
.badge.rounded-pill {
    min-width: 1.8rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===========================================
   GLOBAL BADGE TEXT COLOR FIXES
   Ensures ALL badges have proper text contrast
   =========================================== */

/* Dark backgrounds = WHITE text */
.badge.bg-primary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-dark,
.badge.bg-secondary,
.badge.bg-purple,
.badge.bg-indigo,
.badge.bg-teal,
.badge.bg-orange,
.badge.bg-cwr-blue {
    color: white !important;
}

/* Medium backgrounds = WHITE text (info needs white) */
.badge.bg-info {
    background-color: #17a2b8 !important;
    color: white !important;
}

/* Light backgrounds = DARK text */
.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
    font-weight: 700;
}

.badge.bg-light {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
}

/* Fix bg-secondary badges - make them more visible */
.badge.bg-secondary {
    background-color: #5a6268 !important;
    color: white !important;
}

/* Status-specific badge improvements */
.badge.status-enroute,
.badge.bg-enroute {
    background-color: #0d6efd !important;
    color: white !important;
}

.badge.status-delivering,
.badge.bg-delivering {
    background-color: #198754 !important;
    color: white !important;
}

.badge.status-loading,
.badge.bg-loading {
    background-color: #0dcaf0 !important;
    color: #000 !important;
    font-weight: 700;
}

/* Fix table cell text that's hard to read */
.table td .text-muted {
    color: #6c757d !important;
}

/* Ensure "Not scheduled", "Pending" states are visible */
.table td span.text-muted,
.table td small.text-muted {
    color: #495057 !important;
}

/* Fix nav tab badges that are too small */
.nav-tabs .nav-link .badge,
.nav-pills .nav-link .badge {
    font-size: 0.75rem;
    min-width: 1.5rem;
    padding: 0.25em 0.5em;
    vertical-align: middle;
}

/* Ensure proper contrast in status badges */
.status-badge {
    border: none;
}

/* Workshop page specific fixes */
.table td .badge.bg-success,
.table td .badge.bg-danger,
.table td .badge.bg-warning {
    min-width: 70px;
}

/* Fix icon visibility in table cells */
.table td .fas,
.table td .far,
.table td .fab {
    opacity: 1 !important;
}

/* Make sure all date badges are readable */
.table td .badge {
    white-space: nowrap;
}

/* Job card badge fixes */
.card .badge {
    font-size: 0.8rem;
}

/* Fix Active Vehicles status badges */
.vehicle-status-badge,
.status-filter .badge {
    font-size: 0.85rem !important;
    padding: 0.4em 0.8em !important;
    font-weight: 600 !important;
}

/* Ensure compliance status is visible */
.compliance-status,
.compliance-badge {
    font-weight: 600;
}

.compliance-status.pending,
.compliance-badge.pending {
    color: #e65100 !important;
    background-color: #fff3e0 !important;
    border: 1px solid #ffcc80;
}

/* Fix text alignment in tables */
.table th,
.table td {
    vertical-align: middle;
}

.table td .action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
}

/* Fix "ADD-ON" badges in navigation */
.cwr-nav-link .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.4em;
    vertical-align: middle;
}

/* ── In-app notification badge ── */
.cwr-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: #e74c3c;
    border-radius: 9px;
    margin-left: 5px;
    vertical-align: middle;
    animation: cwr-badge-pop 0.25s ease;
}

@keyframes cwr-badge-pop {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Section header badge (sits beside the title text) */
.nav-section-header .cwr-notification-badge {
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
}

/* Status indicators for vehicles/equipment */
.status-operational {
    color: #28a745 !important;
}

.status-workshop,
.status-in-workshop {
    color: #fd7e14 !important;
}

.status-off-road {
    color: #dc3545 !important;
}

/* Improve card stat visibility */
.card .display-6,
.card .display-5 {
    font-weight: 700;
}

/* Fix text that should never be grey/light */
strong, b, .fw-bold {
    color: inherit;
}

/* Ensure proper padding on small widgets */
.widget-card .badge {
    margin-left: 0.5rem;
}

/* Custom badge colors for status displays */
.bg-purple {
    background-color: #6f42c1 !important;
    color: white !important;
}

.bg-orange {
    background-color: #fd7e14 !important;
    color: white !important;
}

.bg-teal {
    background-color: #20c997 !important;
    color: white !important;
}

.bg-indigo {
    background-color: #6610f2 !important;
    color: white !important;
}

/* CWR branded blue */
.bg-cwr-blue {
    background-color: #005EB8 !important;
    color: white !important;
}

.btn-cwr-blue {
    background-color: #005EB8;
    border-color: #005EB8;
    color: white;
}

.btn-cwr-blue:hover {
    background-color: #004c93;
    border-color: #004c93;
    color: white;
}

/* ==================== CWR ALIGNMENT & CONSISTENCY FIXES ==================== */
/* Global fixes for buttons, text alignment, and spacing */

/* TABLE ALIGNMENT FIXES */
.table {
    width: 100%;
}

.table th {
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    text-align: left;
    padding: 0.75rem 0.5rem;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

/* Center-align specific columns */
.table th.text-center,
.table td.text-center {
    text-align: center !important;
}

/* Action column alignment */
.table th:last-child,
.table td:last-child {
    text-align: center;
}

/* Fix action buttons in tables */
.table td .btn-group {
    display: inline-flex;
    vertical-align: middle;
    justify-content: center;
}

.table td .btn-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* Ensure buttons in table cells are centered */
.table td .btn-group-sm {
    display: inline-flex;
    gap: 0;
}

.table td > .btn-group {
    white-space: nowrap;
}

/* BUTTON GROUP FIXES */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 0 1 auto;
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Fix filter button groups */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* BADGE ALIGNMENT */
.badge {
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Badges in table cells */
.table td .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
}

/* Badges with icons */
.badge i,
.badge .fas,
.badge .far,
.badge .fab {
    margin-right: 0.25rem;
    line-height: 1;
}

/* STATUS BADGE ALIGNMENT */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    line-height: 1.2;
}

.status-badge i {
    margin-right: 0.35rem;
    font-size: 0.85em;
}

/* CARD HEADER ALIGNMENT */
.card-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}

.card-header h5,
.card-header h6 {
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.card-header .btn-group {
    margin-left: auto;
}

/* PAGE HEADER ALIGNMENT */
.d-flex.justify-content-between.align-items-center {
    gap: 1rem;
}

.d-flex.justify-content-between.align-items-center h2,
.d-flex.justify-content-between.align-items-center h3,
.d-flex.justify-content-between.align-items-center h4 {
    margin-bottom: 0;
}

/* FORM CONTROL ALIGNMENT */
.form-control,
.form-select {
    padding: 0.375rem 0.75rem;
    line-height: 1.5;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1 1 auto;
}

.input-group .btn {
    display: flex;
    align-items: center;
}

/* NAV TABS ALIGNMENT */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.nav-tabs .nav-link.active {
    border-bottom-color: #005EB8;
    color: #005EB8;
    font-weight: 600;
}

.nav-tabs .nav-link .badge {
    margin-left: 0.5rem;
}

/* MODAL ALIGNMENT */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.modal-header h5 {
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
}

/* STAT CARDS ALIGNMENT */
.card .display-6,
.card .display-5,
.card .display-4 {
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.card-body .d-flex {
    align-items: center;
}

/* ICON ALIGNMENT */
.fas, .far, .fab {
    vertical-align: middle;
}

/* Icon with text */
i + span,
i + small,
.fas + span,
.far + span {
    margin-left: 0.25rem;
}

/* LIST GROUP ALIGNMENT */
.list-group-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}

.list-group-item.d-flex {
    gap: 0.5rem;
}

/* FLEX UTILITIES */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

/* ACTION BUTTONS ROW */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* TABLE ROW HEIGHT CONSISTENCY */
.table tbody tr {
    height: auto;
    min-height: 3rem;
}

/* FIX SMALL TEXT ALIGNMENT */
small, .small {
    line-height: 1.4;
}

.table td small {
    display: block;
    line-height: 1.3;
}

/* CUSTOMER/INFO CELLS */
.customer-info,
.waste-info,
.assignment-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* FIX BUTTON ICON ALIGNMENT */
.btn i {
    line-height: 1;
}

.btn i + span,
.btn .fas + span,
.btn .far + span {
    margin-left: 0.35rem;
}

/* DROPDOWN ALIGNMENT */
.dropdown-menu {
    padding: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.dropdown-item i {
    width: 1.25rem;
    margin-right: 0.5rem;
}

/* ALERT ALIGNMENT */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert i {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

/* TOOLTIP/TITLE ATTRIBUTE CONSISTENCY */
[title] {
    cursor: pointer;
}

/* FIX TEXT WRAPPING IN CELLS */
.table td.text-nowrap {
    white-space: nowrap;
}

/* RESPONSIVE TABLE FIXES */
@media (max-width: 992px) {
    .table-responsive .table th,
    .table-responsive .table td {
        min-width: 80px;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* ENSURE CONSISTENT SPACING BETWEEN ELEMENTS */
.mb-0 { margin-bottom: 0 !important; }
.mt-0 { margin-top: 0 !important; }

/* FIX INLINE FLEX ITEMS */
.d-inline-flex {
    display: inline-flex !important;
    align-items: center;
}

/* PROGRESS BAR ALIGNMENT */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
}

/* ==================== BULLETPROOF BADGE TEXT VISIBILITY FIXES ==================== */
/* These rules ensure ALL badges and status indicators have proper text contrast */
/* Using high specificity and !important to override any conflicting styles */

/* All badges with dark backgrounds need white text */
span.badge.bg-primary,
span.badge.bg-success,
span.badge.bg-danger,
span.badge.bg-dark,
span.badge.bg-secondary,
span.badge.bg-info,
span.badge.bg-purple,
span.badge.bg-indigo,
span.badge.bg-teal,
span.badge.bg-orange,
span.badge.bg-cwr-blue,
div.badge.bg-primary,
div.badge.bg-success,
div.badge.bg-danger,
div.badge.bg-dark,
div.badge.bg-secondary,
div.badge.bg-info,
div.badge.bg-purple,
div.badge.bg-indigo,
div.badge.bg-teal,
div.badge.bg-orange,
div.badge.bg-cwr-blue {
    color: white !important;
}

/* Light backgrounds need dark text */
span.badge.bg-warning,
span.badge.bg-light,
div.badge.bg-warning,
div.badge.bg-light {
    color: #000 !important;
}

/* Status badges with lowercase class names */
.status-badge.warning,
.status-badge.expiring,
.status-badge.expiringsoon,
.status-badge.status-warning,
.status-badge.status-expiring {
    background-color: #fd7e14 !important;
    color: white !important;
}

.status-badge.success,
.status-badge.valid,
.status-badge.active,
.status-badge.status-success,
.status-badge.status-valid,
.status-badge.status-active {
    background-color: #198754 !important;
    color: white !important;
}

.status-badge.danger,
.status-badge.expired,
.status-badge.status-danger,
.status-badge.status-expired {
    background-color: #dc3545 !important;
    color: white !important;
}

.status-badge.info,
.status-badge.submitted,
.status-badge.pending,
.status-badge.status-info,
.status-badge.status-submitted,
.status-badge.status-pending {
    background-color: #17a2b8 !important;
    color: white !important;
}

/* Dynamic status classes from enum.ToString().ToLower() */
.status-badge.status-booked,
.status-badge.status-enroute,
.status-badge.status-tipped,
.status-badge.status-confirmed,
.status-badge.status-dispatched,
.status-badge.status-completed {
    color: white !important;
}

.status-badge.status-booked { background-color: #0d6efd !important; }
.status-badge.status-enroute { background-color: #0dcaf0 !important; }
.status-badge.status-tipped { background-color: #198754 !important; }
.status-badge.status-confirmed { background-color: #198754 !important; }
.status-badge.status-dispatched { background-color: #0d6efd !important; }
.status-badge.status-completed { background-color: #198754 !important; }

/* Kanban header text fix */
.kanban-header,
.kanban-header strong {
    color: white !important;
}

/* Generic fallback - any element with bg-* and no text color */
[class*="bg-primary"]:not([class*="text-"]),
[class*="bg-success"]:not([class*="text-"]),
[class*="bg-danger"]:not([class*="text-"]),
[class*="bg-info"]:not([class*="text-"]),
[class*="bg-secondary"]:not([class*="text-"]),
[class*="bg-dark"]:not([class*="text-"]),
[class*="bg-orange"]:not([class*="text-"]),
[class*="bg-purple"]:not([class*="text-"]) {
    color: white !important;
}

[class*="bg-warning"]:not([class*="text-"]),
[class*="bg-light"]:not([class*="text-"]) {
    color: #000 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GLOBAL TABLE RESPONSIVE FIX
   Ensures ALL data tables fit within the viewport without horizontal page scroll.
   Tables inside .content automatically get overflow-x scrolling.
   ═══════════════════════════════════════════════════════════════════════════════ */
.content table:not(.table-borderless):not(.calendar-grid) {
    width: 100%;
    max-width: 100%;
}

.content .card-body > table,
.content > .container-fluid table,
.content > div > table,
.content .tab-pane table {
    display: table;
    width: 100%;
}

/* Auto-wrap any direct-child table in a scrollable container */
.content .card-body,
.content .tab-pane,
.content > .container-fluid > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent wide tables from pushing the page layout */
article.content {
    overflow-x: auto;
    max-width: 100%;
}

article.content > .container-fluid,
article.content > div {
    overflow-x: auto;
    max-width: 100%;
}

/* Ensure table cells don't force excessive width */
.content table th,
.content table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 500px;
}

/* Allow description/name columns to wrap */
.content table td:first-child,
.content table td:nth-child(2) {
    white-space: normal;
    max-width: 400px;
}

/* Small screen table adjustments */
@media (max-width: 1200px) {
    .content table th,
    .content table td {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
    
    .content table .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 768px) {
    .content table th,
    .content table td {
        font-size: 0.78rem;
        padding: 0.3rem 0.4rem;
        max-width: 180px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CWR TEST ID BADGES - For testing, support, and issue identification
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ID Badge - Element-level identification */
/* The anchor is always zero-size so badges never affect layout */
.cwr-id-anchor {
    display: inline;
    position: static;
    width: 0;
    height: 0;
    overflow: visible;
    line-height: 0;
    font-size: 0;
}

/* Hidden by default; shown when body has .cwr-test-ids-active class */
.cwr-id-badge {
    display: none !important;
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
    cursor: help;
    font-family: 'Inter', monospace;
    min-width: 24px;
    text-align: center;
    pointer-events: none;
    user-select: none;
}

/* Show all badges when test IDs are active */
body.cwr-test-ids-active .cwr-id-badge {
    display: inline-block !important;
}

.cwr-id-badge.badge-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    font-size: 10px;
    padding: 3px 7px;
}

.cwr-id-badge.badge-modal {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    box-shadow: 0 2px 6px rgba(245, 87, 108, 0.4);
}

.cwr-id-badge.badge-page {
    position: fixed !important;
    bottom: 16px;
    right: 16px;
    top: auto;
    background: linear-gradient(135deg, #dc3545 0%, #c0392b 100%) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.5);
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 99999;
}

/* Ensure cards have relative positioning for badge placement */
.card {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DEBUG PAGE REFERENCE BADGES - Legacy styles (keeping for compatibility)
   ═══════════════════════════════════════════════════════════════════════════════ */
.page-ref-badge {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: help;
    font-family: monospace;
}

.page-ref-badge:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Modal reference badges */
.modal-ref-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #fd7e14;
    color: white;
    font-weight: bold;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 100000;
    font-family: monospace;
    pointer-events: none;
}