/*
 * Fortress JMS — Intelligence Module Dark Theme
 * Apply class "intel-dark" to any container to activate.
 * Covers ALL Bootstrap 5 and custom elements comprehensively.
 */

/* ── Base ── */
.intel-dark { background: #0f172a !important; color: #e2e8f0 !important; min-height: 100vh; }

/* ── ALL text elements ── */
.intel-dark h1, .intel-dark h2, .intel-dark h3, .intel-dark h4, .intel-dark h5, .intel-dark h6 { color: #f1f5f9 !important; }
.intel-dark p, .intel-dark span, .intel-dark label, .intel-dark div, .intel-dark li, .intel-dark dt, .intel-dark dd { color: inherit; }
.intel-dark small, .intel-dark .small { color: #94a3b8 !important; }
.intel-dark .text-muted { color: #64748b !important; }
.intel-dark .text-dark { color: #e2e8f0 !important; }
.intel-dark .text-body { color: #e2e8f0 !important; }
.intel-dark .fw-bold, .intel-dark .fw-semibold { color: #e2e8f0 !important; }

/* ── Staff Call / Chat / Email slide-out panels — force light theme ── */
.intel-dark .module-toolbar-chat-panel,
.intel-dark .module-toolbar-chat-panel * { background-color: #fff; color: #212529 !important; }
.intel-dark .module-toolbar-chat-panel .fw-bold,
.intel-dark .module-toolbar-chat-panel .fw-semibold,
.intel-dark .module-toolbar-chat-panel h6,
.intel-dark .module-toolbar-chat-panel label,
.intel-dark .module-toolbar-chat-panel span:not(.badge),
.intel-dark .module-toolbar-chat-panel div,
.intel-dark .module-toolbar-chat-panel p,
.intel-dark .module-toolbar-chat-panel strong,
.intel-dark .module-toolbar-chat-panel pre { color: #212529 !important; }
.intel-dark .module-toolbar-chat-panel .text-muted { color: #6c757d !important; }
.intel-dark .module-toolbar-chat-panel .text-dark { color: #212529 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#6c757d"] { color: #6c757d !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#adb5bd"] { color: #adb5bd !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#6f42c1"] { color: #6f42c1 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#0d6efd"] { color: #0d6efd !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#198754"] { color: #198754 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#0dcaf0"] { color: #0dcaf0 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#e91e63"] { color: #e91e63 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#7c4dff"] { color: #7c4dff !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#00897b"] { color: #00897b !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#f57c00"] { color: #f57c00 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#c62828"] { color: #c62828 !important; }
.intel-dark .module-toolbar-chat-panel [style*="color:#1565c0"] { color: #1565c0 !important; }
.intel-dark .module-toolbar-chat-panel .form-control,
.intel-dark .module-toolbar-chat-panel .form-select { background: #fff !important; color: #212529 !important; border-color: #dee2e6 !important; }
.intel-dark .module-toolbar-chat-panel .input-group-text { background: #f8f9fa !important; color: #212529 !important; border-color: #dee2e6 !important; }
.intel-dark .module-toolbar-chat-panel a:not(.btn) { color: #0d6efd !important; }
.intel-dark .module-toolbar-chat-panel .border-bottom { border-color: #dee2e6 !important; }
.intel-dark .module-toolbar-chat-panel .border-top { border-color: #dee2e6 !important; }
.intel-dark .module-toolbar-chat-panel .badge { color: #fff !important; }
.intel-dark .module-toolbar-chat-panel .badge.bg-secondary { color: #fff !important; }
/* Preserve gradient header */
.intel-dark .module-toolbar-chat-panel [style*="linear-gradient"] { color: #fff !important; }
.intel-dark .module-toolbar-chat-panel [style*="linear-gradient"] * { color: #fff !important; background-color: transparent !important; }
.intel-dark a:not(.btn):not(.badge):not(.nav-link):not(.dropdown-item) { color: #93c5fd !important; }
.intel-dark a:not(.btn):hover { color: #bfdbfe !important; }
.intel-dark .font-monospace { color: #e2e8f0 !important; }

/* ── Cards ── */
.intel-dark .card { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .card-header { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .card-body { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark .card-footer { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .card.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,.3) !important; }

/* ── Tables ── */
.intel-dark .table { color: #e2e8f0 !important; --bs-table-bg: transparent; --bs-table-color: #e2e8f0; }
.intel-dark .table > thead { background: #1e293b !important; }
.intel-dark .table > thead > tr > th { color: #94a3b8 !important; border-color: #334155 !important; background: #1e293b !important; }
.intel-dark .table > tbody > tr > td { color: #e2e8f0 !important; border-color: #334155 !important; }
.intel-dark .table > tbody > tr:hover { background: #334155 !important; --bs-table-hover-bg: #334155; }
.intel-dark .table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(30,41,59,0.5) !important; --bs-table-striped-bg: rgba(30,41,59,0.5); }
.intel-dark .table-light { background: #1e293b !important; --bs-table-bg: #1e293b; }
.intel-dark .table-light > th, .intel-dark .table-light th { background: #1e293b !important; color: #94a3b8 !important; }
.intel-dark .table-warning { background: rgba(146,64,14,0.2) !important; }
.intel-dark .table-responsive { color: #e2e8f0 !important; }

/* ── Forms ── */
.intel-dark .form-control { background: #1e293b !important; border-color: #475569 !important; color: #e2e8f0 !important; }
.intel-dark .form-control::placeholder { color: #64748b !important; }
.intel-dark .form-control:focus { background: #1e293b !important; border-color: #3b82f6 !important; color: #e2e8f0 !important; box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.25) !important; }
.intel-dark .form-select { background-color: #1e293b !important; border-color: #475569 !important; color: #e2e8f0 !important; }
.intel-dark .form-label { color: #94a3b8 !important; }
.intel-dark .form-check-label { color: #94a3b8 !important; }
.intel-dark .form-check-input { background-color: #334155 !important; border-color: #475569 !important; }
.intel-dark .form-check-input:checked { background-color: #3b82f6 !important; border-color: #3b82f6 !important; }
.intel-dark .input-group-text { background: #334155 !important; border-color: #475569 !important; color: #94a3b8 !important; }
.intel-dark textarea.form-control { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark .form-switch .form-check-input { background-color: #475569 !important; }

/* ── Buttons ── */
.intel-dark .btn-outline-primary { border-color: #1e40af !important; color: #93c5fd !important; }
.intel-dark .btn-outline-primary:hover { background: #1e40af !important; color: #fff !important; }
.intel-dark .btn-outline-secondary { border-color: #475569 !important; color: #94a3b8 !important; }
.intel-dark .btn-outline-secondary:hover { background: #475569 !important; color: #fff !important; }
.intel-dark .btn-outline-danger { border-color: #7f1d1d !important; color: #fca5a5 !important; }
.intel-dark .btn-outline-danger:hover { background: #7f1d1d !important; color: #fff !important; }
.intel-dark .btn-outline-warning { border-color: #92400e !important; color: #fcd34d !important; }
.intel-dark .btn-outline-warning:hover { background: #92400e !important; color: #fff !important; }
.intel-dark .btn-outline-info { border-color: #155e75 !important; color: #67e8f9 !important; }
.intel-dark .btn-outline-info:hover { background: #155e75 !important; color: #fff !important; }
.intel-dark .btn-outline-success { border-color: #14532d !important; color: #86efac !important; }
.intel-dark .btn-outline-success:hover { background: #14532d !important; color: #fff !important; }
.intel-dark .btn-outline-dark { border-color: #64748b !important; color: #94a3b8 !important; }
.intel-dark .btn-outline-dark:hover { background: #64748b !important; color: #fff !important; }
.intel-dark .btn-close { filter: invert(1) grayscale(100%) brightness(200%) !important; }

/* ── Alerts ── */
.intel-dark .alert-danger { background: #450a0a !important; border-color: #7f1d1d !important; color: #fca5a5 !important; }
.intel-dark .alert-success { background: #052e16 !important; border-color: #14532d !important; color: #86efac !important; }
.intel-dark .alert-warning { background: #422006 !important; border-color: #854d0e !important; color: #fef3c7 !important; }
.intel-dark .alert-info { background: #0c4a6e !important; border-color: #075985 !important; color: #bae6fd !important; }

/* ── Badges — keep existing colors but fix contrast ── */
.intel-dark .badge.bg-light { background: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .badge.text-dark { color: #e2e8f0 !important; }
.intel-dark .badge.bg-secondary { background: #475569 !important; }
.intel-dark .badge.border { border-color: #475569 !important; }

/* ── HSGP / compliance badges (yellow bg unreadable in dark mode) ── */
.intel-dark .badge.bg-warning { background: #854d0e !important; color: #fef3c7 !important; }
.intel-dark .badge.bg-warning.text-dark { color: #fef3c7 !important; }
.intel-dark .badge.bg-info { background: #155e75 !important; color: #a5f3fc !important; }
.intel-dark .badge.bg-info.text-white { color: #a5f3fc !important; }
.intel-dark .badge.bg-danger { background: #7f1d1d !important; }
.intel-dark .badge.bg-success { background: #14532d !important; }
.intel-dark .badge.bg-dark { background: #1e293b !important; border-color: #475569 !important; }
.intel-dark .badge.bg-primary { background: #1e3a5f !important; }

/* ── SAR / filter tab buttons ── */
.intel-dark .sar-tab { background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important; }
.intel-dark .sar-tab:hover { background: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .sar-tab-active, .intel-dark .sar-tab.sar-tab-active { background: #3b82f6 !important; color: #fff !important; border-color: #3b82f6 !important; }
.intel-dark .sar-tabs { background: transparent !important; }

/* ── SAR data row colorization ── */
.intel-dark .table > tbody > tr > td:first-child { color: #93c5fd !important; } /* Activity type - blue */
.intel-dark .table > tbody > tr > td .badge.bg-warning { color: #fef3c7 !important; }

/* ── Dashboard alert feed source badges — colorize instead of bland ── */
.intel-dark [class*="alert-source"] { font-weight: 600 !important; }
.intel-dark .idash-source-keyword, .intel-dark [class*="source-keyword"] { background: #312e81 !important; color: #c4b5fd !important; }
.intel-dark .idash-source-ai, .intel-dark [class*="source-ai"] { background: #1e3a5f !important; color: #93c5fd !important; }
.intel-dark .idash-source-sar, .intel-dark [class*="source-sar"] { background: #422006 !important; color: #fcd34d !important; }
.intel-dark .idash-source-manual, .intel-dark [class*="source-manual"] { background: #134e4a !important; color: #5eead4 !important; }

/* ── Timeline sentiment badges (Threatening/Negative white-on-white) ── */
.intel-dark .badge-sentiment { background: #334155 !important; color: #94a3b8 !important; padding: 0.2em 0.5em !important; border-radius: 0.25rem !important; }

/* ── AI Review category badges (white-on-white) ── */
.intel-dark .badge-category { background: #334155 !important; color: #cbd5e1 !important; border-color: #475569 !important; }
.intel-dark .badge-hold { background: #7f1d1d !important; color: #fca5a5 !important; }
.intel-dark .badge-flag { background: #854d0e !important; color: #fef3c7 !important; }
.intel-dark .badge-clear { background: #14532d !important; color: #86efac !important; }

/* ── Tattoo SVG images — white background so line art is visible ── */
.intel-dark .page-thumb, .intel-dark .tt-card img, .intel-dark [class*="tattoo"] img,
.intel-dark img[src*="tattoo"], .intel-dark img[src*="svg"] {
    background: #ffffff !important;
    border-radius: 0.35rem !important;
    padding: 4px !important;
}

/* ── Emergency roster status badges colorize ── */
.intel-dark .badge.rounded-pill { font-weight: 600 !important; }

/* ── Dropdowns ── */
.intel-dark .dropdown-menu { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .dropdown-item { color: #e2e8f0 !important; }
.intel-dark .dropdown-item:hover, .intel-dark .dropdown-item:focus { background: #334155 !important; color: #f1f5f9 !important; }
.intel-dark .dropdown-divider { border-color: #334155 !important; }

/* ── Modals and popups (inline style overrides) ── */
.intel-dark [style*="background:white"],
.intel-dark [style*="background: white"],
.intel-dark [style*="background:#fff"],
.intel-dark [style*="background: #fff"] { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark [style*="border-bottom:1px solid #dee2e6"],
.intel-dark [style*="border-bottom: 1px solid #dee2e6"],
.intel-dark [style*="border-bottom:1px solid"],
.intel-dark [style*="border-top:1px solid #dee2e6"],
.intel-dark [style*="border-top: 1px solid #dee2e6"],
.intel-dark [style*="border-top:1px solid"] { border-color: #334155 !important; }
.intel-dark [style*="border-radius:0.75rem"] { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark [style*="box-shadow:0 10px"] { box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important; }

/* Modal specific elements */
.intel-dark .detail-modal, .intel-dark .modal-content { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark .detail-header, .intel-dark .modal-header { background: #0f172a !important; border-color: #334155 !important; color: #f1f5f9 !important; }
.intel-dark .detail-body, .intel-dark .modal-body { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark .detail-footer, .intel-dark .modal-footer { background: #0f172a !important; border-color: #334155 !important; }

/* ── Panels (custom classes used across intel pages) ── */
.intel-dark [class*="-panel"] { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark [class*="-panel-header"] { background: #0f172a !important; border-color: #334155 !important; color: #f1f5f9 !important; }
.intel-dark [class*="-panel-title"] { color: #f1f5f9 !important; }
.intel-dark [class*="-section-label"] { color: #94a3b8 !important; border-color: #334155 !important; }

/* ── Section dividers (AI Review, etc.) ── */
.intel-dark .section-divider.blue { background: #172554 !important; color: #93c5fd !important; }
.intel-dark .section-divider.green { background: #052e16 !important; color: #86efac !important; }
.intel-dark .section-divider.amber { background: #422006 !important; color: #fcd34d !important; }
.intel-dark .section-divider.purple { background: #2e1065 !important; color: #c4b5fd !important; }
.intel-dark .section-divider.red { background: #450a0a !important; color: #fca5a5 !important; }

/* ── Stat cards (older pattern still on some pages) ── */
.intel-dark .stat-card-ips { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .stat-label { color: #94a3b8 !important; }
.intel-dark .stat-value { color: inherit !important; }
.intel-dark .stat-sub { color: #64748b !important; }

/* ── Custom page elements ── */
.intel-dark .reasoning-box { background: #422006 !important; border-color: #854d0e !important; color: #fef3c7 !important; }
.intel-dark .msg-content-box { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .ocr-result { background: #422006 !important; border-color: #854d0e !important; color: #fef3c7 !important; }
.intel-dark .ocr-text-box { background: #0f172a !important; border-color: #334155 !important; color: #94a3b8 !important; }
.intel-dark .upload-card { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .drop-zone { background: #1e293b !important; border-color: #475569 !important; color: #94a3b8 !important; }
.intel-dark .settings-panel { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .bulk-bar { background: #172554 !important; border-color: #1e40af !important; }
.intel-dark .filter-btn { color: #94a3b8 !important; }

/* ── Code elements ── */
.intel-dark code { background: #334155 !important; color: #93c5fd !important; }
.intel-dark pre { background: #0f172a !important; color: #e2e8f0 !important; border-color: #334155 !important; }

/* ── Keyword monitoring specific ── */
.intel-dark .kw-td { color: #e2e8f0 !important; }
.intel-dark .kw-th { color: #94a3b8 !important; }
.intel-dark .kw-matched-text { color: #cbd5e1 !important; }
.intel-dark .kw-alert-new-row { background: rgba(127,29,29,0.3) !important; }
.intel-dark .kw-cat-custom { background: #334155 !important; color: #94a3b8 !important; }
.intel-dark .kw-cat-escape { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark .kw-pill-tabs button { color: #94a3b8 !important; }
.intel-dark .kw-pill-tabs button.active { background: #3b82f6 !important; color: #fff !important; }
.intel-dark .kw-pill-tabs button:hover:not(.active) { background: #334155 !important; }
.intel-dark .kw-alert-count { background: #dc3545 !important; }

/* ── Timeline filter pills, search, view toggle ── */
.intel-dark .itl-pills { background: #1e293b !important; }
.intel-dark .itl-pill { color: #94a3b8 !important; background: transparent !important; }
.intel-dark .itl-pill:hover { color: #e2e8f0 !important; }
.intel-dark .itl-pill.active { background: #334155 !important; color: #f1f5f9 !important; box-shadow: none !important; }
.intel-dark .itl-search { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .itl-search input { color: #e2e8f0 !important; background: transparent !important; }
.intel-dark .itl-search input::placeholder { color: #64748b !important; }
.intel-dark .itl-view-toggle { background: #1e293b !important; border-color: #475569 !important; color: #94a3b8 !important; }
.intel-dark .itl-view-toggle:hover { border-color: #3b82f6 !important; color: #93c5fd !important; background: #172554 !important; }
.intel-dark .itl-view-toggle.active { background: #3b82f6 !important; color: #fff !important; border-color: #3b82f6 !important; }
.intel-dark .itl-scroll-btn { background: #1e293b !important; border-color: #475569 !important; color: #94a3b8 !important; }
.intel-dark .itl-scroll-btn:hover { background: #3b82f6 !important; color: #fff !important; }

/* ── Timeline entry cards ── */
.intel-dark .itl-card { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .itl-card:hover { border-color: #475569 !important; }
.intel-dark .itl-card-preview { color: #cbd5e1 !important; }
.intel-dark .itl-card-meta { color: #64748b !important; }
.intel-dark .itl-date-sep-label { color: #94a3b8 !important; }
.intel-dark .itl-time { color: #64748b !important; }
.intel-dark .itl-time-date { color: #94a3b8 !important; }
.intel-dark .itl-card-top { color: #e2e8f0 !important; }

/* ── Timeline horizontal cards ── */
.intel-dark .itl-h-card { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .itl-h-date { color: #94a3b8 !important; }
.intel-dark .itl-h-time { color: #64748b !important; }
.intel-dark .itl-h-scroll::-webkit-scrollbar-thumb { background: #475569 !important; }
.intel-dark .itl-h-scroll::-webkit-scrollbar-track { background: #1e293b !important; }

/* ── Timeline comm type badges (SMS/Email/ScanMail/Voice) ── */
.intel-dark .badge-sms { background: #1e3a5f !important; color: #93c5fd !important; }
.intel-dark .badge-email { background: #2e1065 !important; color: #c4b5fd !important; }
.intel-dark .badge-scanmail { background: #134e4a !important; color: #5eead4 !important; }
.intel-dark .badge-voice { background: #431407 !important; color: #fdba74 !important; }
.intel-dark .badge-comm { border-color: #475569 !important; }

/* ── Timeline direction badges ── */
.intel-dark .badge-dir { border-color: #475569 !important; }
.intel-dark .badge-inbound { background: #1e293b !important; color: #94a3b8 !important; border-color: #475569 !important; }
.intel-dark .badge-outbound { background: #172554 !important; color: #93c5fd !important; border-color: #1e40af !important; }

/* ── Timeline sentiment/keyword badges ── */
.intel-dark .badge-sentiment { color: #94a3b8 !important; }
.intel-dark .badge-kw { background: #334155 !important; border-color: #475569 !important; color: #cbd5e1 !important; }

/* ── Classification badges on timeline ── */
.intel-dark .itl-badge-pending { background: #475569 !important; }

/* ── Timeline modal ── */
.intel-dark .itl-modal { background: #1e293b !important; color: #e2e8f0 !important; }
.intel-dark .itl-modal-header { border-color: #334155 !important; background: #0f172a !important; }
.intel-dark .itl-modal-footer { border-color: #334155 !important; background: #0f172a !important; }
.intel-dark .itl-section { color: #94a3b8 !important; }
.intel-dark .itl-section.s-blue { background: #172554 !important; color: #93c5fd !important; }
.intel-dark .itl-section.s-amber { background: #422006 !important; color: #fcd34d !important; }
.intel-dark .itl-section.s-red { background: #450a0a !important; color: #fca5a5 !important; }
.intel-dark .itl-section.s-green { background: #052e16 !important; color: #86efac !important; }
.intel-dark .itl-content-box { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .itl-reasoning-box { background: #422006 !important; border-color: #854d0e !important; color: #fef3c7 !important; }

/* ── Keyword/timeline specific ── */
.intel-dark [class*="keyword-pill"] { background: #312e81 !important; color: #c4b5fd !important; }
.intel-dark [class*="keyword-count"] { background: rgba(255,255,255,.15) !important; }
.intel-dark [class*="channel"] { color: #94a3b8 !important; }
.intel-dark [class*="alert-row"] { border-color: #334155 !important; }
.intel-dark [class*="alert-row"]:hover { background: #334155 !important; }
.intel-dark [class*="alert-text"], .intel-dark [class*="alert-summary"] { color: #cbd5e1 !important; }
.intel-dark [class*="alert-time"] { color: #64748b !important; }
.intel-dark [class*="risk-row"] { border-color: #334155 !important; }
.intel-dark [class*="risk-row"]:hover { background: #334155 !important; }
.intel-dark [class*="risk-name"] { color: #e2e8f0 !important; }
.intel-dark [class*="risk-rank"] { background: #334155 !important; color: #94a3b8 !important; }
.intel-dark [class*="view-all"] { color: #93c5fd !important; }

/* ── Transcript panel ── */
.intel-dark .transcript-panel { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark .transcript-header { background: #0f172a !important; border-color: #334155 !important; color: #f1f5f9 !important; }
.intel-dark .transcript-segment { color: #e2e8f0 !important; }
.intel-dark .transcript-segment:hover { background: #334155 !important; }
.intel-dark .transcript-timestamp { color: #93c5fd !important; }
.intel-dark .transcript-audio { background: #0f172a !important; border-color: #334155 !important; }

/* ── Timeline specific ── */
.intel-dark [class*="timeline"]::before { background: linear-gradient(to bottom, #334155, #475569, #334155) !important; }
.intel-dark [class*="-card"] { background: #1e293b !important; border-color: #334155 !important; }
.intel-dark [class*="-card"]:hover { box-shadow: 0 4px 16px rgba(0,0,0,.3) !important; }
.intel-dark [class*="-date-sep"] { color: #94a3b8 !important; }
.intel-dark [class*="-time"] { color: #64748b !important; }

/* ── Emergency roster specific ── */
.intel-dark .er-th { color: #94a3b8 !important; }
.intel-dark .er-td { color: #e2e8f0 !important; }

/* ── Scrollbar ── */
.intel-dark ::-webkit-scrollbar { width: 8px; height: 8px; }
.intel-dark ::-webkit-scrollbar-track { background: #1e293b; }
.intel-dark ::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
.intel-dark ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ── Refresh indicator ── */
.intel-dark [class*="refresh-indicator"] { background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important; }

/* ── Header icons (gradient boxes) ── */
.intel-dark [class*="header-icon"] { background: linear-gradient(135deg, #1e3a5f, #1e40af) !important; }

/* ── Page-specific header classes ── */
.intel-dark [class*="header-title"] { color: #f1f5f9 !important; }
.intel-dark [class*="header-subtitle"] { color: #94a3b8 !important; }

/* ── Quicklink bar buttons — purple needs special handling ── */
.intel-dark .btn-outline-secondary.rounded-pill[style*="6f42c1"] { border-color: #7c3aed !important; color: #c4b5fd !important; }

/* ── HSGP badge (yellow pill next to SAR title) ── */
.intel-dark .badge.bg-warning { background: #92400e !important; color: #fef3c7 !important; }

/* ── SAR filter/tab buttons ── */
.intel-dark .sar-tab, .intel-dark .btn-outline-secondary:not(.rounded-pill) { background: #1e293b !important; color: #e2e8f0 !important; border-color: #475569 !important; }
.intel-dark .sar-tab.active, .intel-dark .sar-tab:hover { background: #334155 !important; color: #f1f5f9 !important; border-color: #60a5fa !important; }
.intel-dark .nav-tabs .nav-link { background: #1e293b !important; color: #94a3b8 !important; border-color: #334155 !important; }
.intel-dark .nav-tabs .nav-link.active { background: #334155 !important; color: #f1f5f9 !important; border-bottom-color: #60a5fa !important; }

/* ── Dashboard alert source badges (colorized by type) ── */
.intel-dark .badge[style*="6f42c1"], .intel-dark .badge:contains("Keyword") { background: #5b21b6 !important; color: #ddd6fe !important; }

/* ── Timeline sentiment badges ── */
.intel-dark .badge.bg-danger { background: #991b1b !important; color: #fecaca !important; }
.intel-dark .badge.bg-success { background: #166534 !important; color: #bbf7d0 !important; }
.intel-dark .badge.bg-info { background: #155e75 !important; color: #cffafe !important; }
.intel-dark .badge.bg-secondary { background: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .badge.bg-primary { background: #1e3a8a !important; color: #bfdbfe !important; }
.intel-dark .badge.bg-dark { background: #1e293b !important; color: #e2e8f0 !important; border: 1px solid #475569 !important; }
.intel-dark .badge.bg-light { background: #334155 !important; color: #e2e8f0 !important; }

/* ── AI Review / generic white-on-white category badges ── */
.intel-dark .badge:not([class*="bg-"]):not([class*="ta-threat-"]) { background: #334155 !important; color: #e2e8f0 !important; }
.intel-dark span.badge:not([class*="ta-threat-"]) { background: #334155 !important; color: #e2e8f0 !important; }

/* ── Threat Assessment level badges — preserve colors in dark mode ── */
.intel-dark .ta-threat-critical { background: #dc2626 !important; color: #fff !important; }
.intel-dark .ta-threat-high { background: #ea580c !important; color: #fff !important; }
.intel-dark .ta-threat-medium { background: #f59e0b !important; color: #1e293b !important; }
.intel-dark .ta-threat-low { background: #3b82f6 !important; color: #fff !important; }
.intel-dark .ta-threat-none { background: #6b7280 !important; color: #fff !important; }

/* ── Tattoo images — force white background for black line-art SVGs ── */
.intel-dark img[src*="blob"], .intel-dark img[src*="tattoo"], .intel-dark .tattoo-img, .intel-dark .card-img-top { background: #ffffff !important; border-radius: 4px; }

/* ── Status pill colors for SAR/tables ── */
.intel-dark .badge.text-bg-danger, .intel-dark .badge.text-danger { background: #991b1b !important; color: #fecaca !important; }
.intel-dark .badge.text-bg-warning, .intel-dark .badge.text-warning { background: #92400e !important; color: #fef3c7 !important; }
.intel-dark .badge.text-bg-success, .intel-dark .badge.text-success { background: #166534 !important; color: #bbf7d0 !important; }
.intel-dark .badge.text-bg-info, .intel-dark .badge.text-info { background: #155e75 !important; color: #cffafe !important; }
.intel-dark .badge.text-bg-primary { background: #1e3a8a !important; color: #bfdbfe !important; }

/* ── Inline style overrides for badge backgrounds ── */
.intel-dark .badge[style*="background"] { color: #f1f5f9 !important; }

/* ── Dashboard risk inmate badges — preserve threat level colors ── */
.intel-dark .idash-tl-critical { background: #dc2626 !important; color: #fff !important; }
.intel-dark .idash-tl-high { background: #ea580c !important; color: #fff !important; }
.intel-dark .idash-tl-medium { background: #f59e0b !important; color: #1e293b !important; }
.intel-dark .idash-tl-low { background: #3b82f6 !important; color: #fff !important; }

/* ── SAR status badges — preserve colors in dark mode ── */
.intel-dark .sar-status-draft { background: #334155 !important; color: #94a3b8 !important; }
.intel-dark .sar-status-submitted { background: #1e3a5f !important; color: #93c5fd !important; }
.intel-dark .sar-status-under-review { background: #422006 !important; color: #fcd34d !important; }
.intel-dark .sar-status-closed { background: #14532d !important; color: #86efac !important; }
.intel-dark .sar-fusion-badge { background: #155e75 !important; color: #a5f3fc !important; }
.intel-dark .sar-card-type .text-info { color: #67e8f9 !important; }
.intel-dark .sar-card-meta .text-success { color: #86efac !important; }

/* ── Emergency Roster — preserve colored badges in dark mode ── */
.intel-dark .badge.bg-primary.bg-opacity-10 { background: rgba(59,130,246,0.15) !important; color: #93c5fd !important; border-color: #3b82f6 !important; }
.intel-dark .badge.bg-success.bg-opacity-10 { background: rgba(34,197,94,0.15) !important; color: #86efac !important; border-color: #22c55e !important; }
.intel-dark .badge.bg-warning.bg-opacity-10 { background: rgba(245,158,11,0.15) !important; color: #fcd34d !important; border-color: #f59e0b !important; }
.intel-dark .badge.bg-danger.bg-opacity-10 { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; border-color: #ef4444 !important; }
.intel-dark .badge.bg-info.bg-opacity-10 { background: rgba(6,182,212,0.15) !important; color: #67e8f9 !important; border-color: #06b6d4 !important; }
.intel-dark .badge.bg-secondary.bg-opacity-10 { background: rgba(100,116,139,0.15) !important; color: #cbd5e1 !important; border-color: #64748b !important; }
.intel-dark .badge.bg-light.text-dark { background: #334155 !important; color: #e2e8f0 !important; }
.intel-dark .badge.bg-light.text-muted { background: #1e293b !important; color: #94a3b8 !important; }
.intel-dark .text-primary { color: #93c5fd !important; }
.intel-dark .text-success { color: #86efac !important; }
.intel-dark .text-warning { color: #fcd34d !important; }
.intel-dark .text-danger { color: #fca5a5 !important; }
.intel-dark .text-info { color: #67e8f9 !important; }
.intel-dark .er-td .font-monospace { color: #93c5fd !important; }

/* ── Emergency Roster — row highlights + text contrast ── */
.intel-dark .er-row-discrepancy { background: rgba(146,64,14,0.2) !important; border-left: 3px solid #f59e0b !important; }
.intel-dark .er-row-discrepancy td { color: #fcd34d !important; }
.intel-dark .er-row-discrepancy .badge { border-color: #92400e !important; }
.intel-dark .er-row-missing { background: rgba(153,27,27,0.2) !important; border-left: 3px solid #ef4444 !important; }
.intel-dark .er-row-missing td { color: #fca5a5 !important; }
.intel-dark .er-td { color: #e2e8f0 !important; }
.intel-dark .er-td.fw-semibold { color: #f1f5f9 !important; }
.intel-dark .er-th { color: #94a3b8 !important; }
.intel-dark .badge.bg-danger.bg-opacity-10.text-danger { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }

/* ── Print: revert to light ── */
@media print {
    .intel-dark { background: white !important; color: black !important; }
    .intel-dark .card { background: white !important; border-color: #dee2e6 !important; }
    .intel-dark .table { color: black !important; }
}
