/**
 * System-wide dark overrides — cool navy surfaces, muted accent (not neon-green).
 */
html[data-theme="dark"] .master-matrix-container {
    background: transparent !important;
    color: #c5cad8;
}
html[data-theme="dark"] .master-table thead th {
    background: rgba(14, 16, 26, 0.98) !important;
    color: #8b93a7 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
html[data-theme="dark"] .master-table tbody td {
    color: #c5cad8 !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    background: rgba(12, 14, 22, 0.55);
}
html[data-theme="dark"] .master-table tbody tr:hover td {
    background: rgba(60, 90, 160, 0.08) !important;
}

/* Generic light Bootstrap leftovers on dark theme */
html[data-theme="dark"] .card.bg-white,
html[data-theme="dark"] .bg-white:not(.btn):not(.form-check-input),
html[data-theme="dark"] .bg-light:not(.btn) {
    background: rgba(22, 25, 38, 0.96) !important;
    color: #c5cad8 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}
html[data-theme="dark"] .text-dark {
    color: #eef0f6 !important;
}
html[data-theme="dark"] .text-muted {
    color: #8b93a7 !important;
}
html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #c5cad8;
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(60, 90, 160, 0.08);
    color: #c5cad8;
}
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    color: inherit;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background-color: rgba(14, 16, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    color: #eef0f6;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: rgba(14, 16, 26, 0.98);
    border-color: rgba(42, 155, 108, 0.45);
    color: #eef0f6;
    box-shadow: 0 0 0 0.2rem rgba(42, 155, 108, 0.12);
}
html[data-theme="dark"] .form-control::placeholder {
    color: #6b7388;
}
html[data-theme="dark"] .modal-content {
    background: rgba(18, 21, 31, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #c5cad8;
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .list-group-item {
    background: transparent;
    color: #c5cad8;
    border-color: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] code.text-dark {
    color: #9fb4ff !important;
}

/* Live engine badge */
.live-engine-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(42, 155, 108, 0.12);
    border: 1px solid rgba(42, 155, 108, 0.28);
    color: #3cb87a;
}
.live-engine-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2a9b6c;
    box-shadow: 0 0 6px rgba(42, 155, 108, 0.5);
    animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
