/* ================================================================
   DARK MODE — TAILWIND UTILITY CLASS OVERRIDES

   Overrides the most common Tailwind color utilities used across
   all templates so dark mode works without modifying any template.
   ================================================================ */

/* ================ BACKGROUNDS ================ */

/* bg-white (231 uses) */
html.dark .bg-white {
    background-color: var(--surface-primary) !important;
}

/* bg-gray-50 (125 uses) */
html.dark .bg-gray-50 {
    background-color: var(--surface-secondary) !important;
}
html.dark .bg-gray-50\/50 {
    background-color: rgba(30, 30, 56, 0.5) !important;
}

/* bg-gray-100 (53 uses) */
html.dark .bg-gray-100 {
    background-color: var(--surface-tertiary) !important;
}

/* bg-gray-200 (22 uses) */
html.dark .bg-gray-200 {
    background-color: #2a2a45 !important;
}

/* bg-gray-300 */
html.dark .bg-gray-300 {
    background-color: #3a3a55 !important;
}

/* bg-gray-500 */
html.dark .bg-gray-500 {
    background-color: #6b7280 !important;
}

/* bg-gray-600 */
html.dark .bg-gray-600 {
    background-color: #7c8494 !important;
}

/* bg-gray-900 */
html.dark .bg-gray-900 {
    background-color: #f1f5f9 !important;
}

/* ================ TEXT COLORS ================ */

/* text-gray-900 (391 uses) */
html.dark .text-gray-900 {
    color: #f1f5f9 !important;
}

/* text-gray-800 (20 uses) */
html.dark .text-gray-800 {
    color: #e2e8f0 !important;
}

/* text-gray-700 (192 uses) */
html.dark .text-gray-700 {
    color: #cbd5e1 !important;
}

/* text-gray-600 (309 uses) */
html.dark .text-gray-600 {
    color: #94a3b8 !important;
}

/* text-gray-500 (455 uses) — emails, secondary labels */
html.dark .text-gray-500 {
    color: #94a3b8 !important;
}

/* text-gray-400 — icons, muted text */
html.dark .text-gray-400 {
    color: #7c8594 !important;
}

/* text-gray-300 */
html.dark .text-gray-300 {
    color: #4b5563 !important;
}

/* text-white — keep white in dark mode (already correct for colored backgrounds) */

/* ================ BORDERS ================ */

/* border-gray-100 (106 uses) — sidebar dividers, card borders */
html.dark .border-gray-100 {
    border-color: #2f2f4a !important;
}

/* border-gray-200 (48 uses) */
html.dark .border-gray-200 {
    border-color: #2f2f4a !important;
}

/* border-gray-300 */
html.dark .border-gray-300 {
    border-color: #3a3a55 !important;
}

/* border-gray-400 */
html.dark .border-gray-400 {
    border-color: #4a4a65 !important;
}

/* ================ DIVIDE COLORS ================ */
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: #2f2f4a !important;
}

html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #2f2f4a !important;
}

/* ================ RING / OUTLINE ================ */
html.dark .ring-gray-100 {
    --tw-ring-color: #2f2f4a !important;
}

html.dark .ring-gray-200 {
    --tw-ring-color: #2f2f4a !important;
}

/* ================ GREEN ACCENTS (keep vibrant) ================ */

/* Green backgrounds — slightly adjust for dark contrast */
html.dark .bg-green-50 {
    background-color: rgba(2, 160, 55, 0.1) !important;
}
html.dark .bg-green-50\/50 {
    background-color: rgba(2, 160, 55, 0.06) !important;
}

html.dark .bg-green-100 {
    background-color: rgba(2, 160, 55, 0.15) !important;
}

html.dark .bg-green-500 {
    background-color: #02a037 !important;
}

/* Green text — bump brightness for dark backgrounds */
html.dark .text-green-600 {
    color: #4ade80 !important;
}

html.dark .text-green-700 {
    color: #22c55e !important;
}

html.dark .text-green-800 {
    color: #16a34a !important;
}

/* Green borders */
html.dark .border-green-100 {
    border-color: rgba(2, 160, 55, 0.2) !important;
}

html.dark .border-green-200 {
    border-color: rgba(2, 160, 55, 0.3) !important;
}

html.dark .border-green-500 {
    border-color: #02a037 !important;
}

/* ================ HOVER STATE OVERRIDES ================ */

html.dark .hover\:bg-gray-50:hover {
    background-color: var(--surface-secondary) !important;
}

html.dark .hover\:bg-gray-100:hover {
    background-color: var(--surface-tertiary) !important;
}

html.dark .hover\:bg-green-50:hover {
    background-color: rgba(2, 160, 55, 0.1) !important;
}

html.dark .hover\:bg-green-50\/50:hover {
    background-color: rgba(2, 160, 55, 0.08) !important;
}

html.dark .hover\:bg-white:hover {
    background-color: var(--surface-elevated) !important;
}

html.dark .hover\:text-gray-700:hover {
    color: #cbd5e1 !important;
}

html.dark .hover\:text-gray-900:hover {
    color: #f1f5f9 !important;
}

html.dark .hover\:border-gray-300:hover {
    border-color: #3a3a55 !important;
}

/* ================ RED / DESTRUCTIVE ================ */
html.dark .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

html.dark .text-red-600 {
    color: #f87171 !important;
}

html.dark .text-red-700 {
    color: #ef4444 !important;
}

html.dark .border-red-200 {
    border-color: rgba(239, 68, 68, 0.25) !important;
}

html.dark .hover\:bg-red-50:hover {
    background-color: rgba(239, 68, 68, 0.15) !important;
}

html.dark .hover\:border-red-200:hover {
    border-color: rgba(239, 68, 68, 0.35) !important;
}

html.dark .hover\:text-red-700:hover {
    color: #f87171 !important;
}

/* ================ YELLOW / WARNING ================ */
html.dark .bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

html.dark .text-yellow-600 {
    color: #fbbf24 !important;
}

html.dark .text-yellow-800 {
    color: #fbbf24 !important;
}

html.dark .border-yellow-200 {
    border-color: rgba(245, 158, 11, 0.25) !important;
}

/* ================ BLUE / INFO ================ */
html.dark .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

html.dark .text-blue-600 {
    color: #60a5fa !important;
}

html.dark .text-blue-700 {
    color: #3b82f6 !important;
}

html.dark .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.25) !important;
}

/* ================ PURPLE ================ */
html.dark .bg-purple-50 {
    background-color: rgba(124, 58, 237, 0.1) !important;
}

html.dark .text-purple-600 {
    color: #a78bfa !important;
}

html.dark .text-purple-700 {
    color: #8b5cf6 !important;
}

html.dark .border-purple-200 {
    border-color: rgba(124, 58, 237, 0.25) !important;
}

/* ================ AMBER (impersonation banner, etc.) ================ */
html.dark .bg-amber-500 {
    background-color: #d97706 !important;
}

/* ================ BRAND GREEN OPACITY VARIANTS ================ */
html.dark .bg-brand-green\/10 {
    background-color: rgba(2, 160, 55, 0.15) !important;
}

/* ================ SHADOW ADJUSTMENTS ================ */
html.dark .shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html.dark .shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3) !important;
}

html.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3) !important;
}

html.dark .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3) !important;
}

/* ================ PLACEHOLDER TEXT ================ */
html.dark .placeholder-gray-400::placeholder {
    color: #6b7280 !important;
}

html.dark .placeholder-gray-500::placeholder {
    color: #8b92a5 !important;
}

/* ================================================================
   INLINE STYLE OVERRIDES

   Many templates have inline <style> blocks with hardcoded hex
   colors. These overrides catch those class names so the entire
   page goes dark, not just the sidebar and Tailwind utilities.
   ================================================================ */

/* ---- Page backgrounds ---- */
html.dark .crm-page {
    background: var(--surface-secondary) !important;
}

/* ---- Page header ---- */
html.dark .page-header {
    background: var(--gradient-green-header) !important;
    border-bottom-color: rgba(2, 160, 55, 0.15) !important;
}

html.dark .page-title {
    color: var(--text-primary) !important;
}

html.dark .page-subtitle {
    color: var(--text-tertiary) !important;
}

/* ---- Stat cards ---- */
html.dark .stat-card-neutral {
    background: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .stat-card-neutral .stat-icon-wrap {
    background: rgba(2, 160, 55, 0.12) !important;
}

/* ---- Toolbar ---- */
html.dark .toolbar-container {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

/* ---- Search & filter inputs ---- */
html.dark .search-box input {
    background: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

html.dark .search-box input:focus {
    background: var(--surface-primary) !important;
}

html.dark .search-box input::placeholder {
    color: var(--text-tertiary) !important;
}

html.dark .search-box .search-icon {
    color: var(--text-tertiary) !important;
}

html.dark .filter-select {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-secondary) !important;
}

html.dark .filter-select:focus {
    background-color: var(--surface-primary) !important;
}

html.dark .filter-select:hover {
    border-color: var(--border-secondary) !important;
}

/* ---- Table ---- */
html.dark .table-container {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

html.dark .crm-table th {
    color: var(--text-tertiary) !important;
    background: linear-gradient(180deg, var(--surface-secondary) 0%, var(--surface-tertiary) 100%) !important;
    border-bottom-color: var(--border-secondary) !important;
}

html.dark .crm-table td {
    color: var(--text-secondary) !important;
}

html.dark .crm-table tbody tr {
    border-bottom-color: var(--border-secondary) !important;
}

/* ---- Person / entity names ---- */
html.dark .person-name,
html.dark .company-name,
html.dark .entity-name {
    color: var(--text-primary) !important;
}

/* ---- Tags ---- */
html.dark .role-tag,
html.dark .industry-tag,
html.dark .meta-tag {
    background: var(--surface-tertiary) !important;
    color: var(--text-tertiary) !important;
}

/* ---- Pagination ---- */
html.dark .pagination-bar {
    background: var(--surface-secondary) !important;
    border-top-color: var(--border-primary) !important;
}

html.dark .pagination-info {
    color: var(--text-tertiary) !important;
}

html.dark .pagination-btn {
    background: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-secondary) !important;
}

html.dark .pagination-btn:hover:not(:disabled) {
    background: rgba(2, 160, 55, 0.1) !important;
}

/* ---- Empty state ---- */
html.dark .empty-state-icon {
    background: linear-gradient(135deg, var(--surface-secondary) 0%, var(--surface-tertiary) 100%) !important;
}

html.dark .empty-state h3 {
    color: var(--text-primary) !important;
}

html.dark .empty-state p {
    color: var(--text-tertiary) !important;
}

/* ---- Modal ---- */
html.dark .modal-section {
    background: var(--surface-secondary) !important;
}

html.dark .modal-section-title {
    color: var(--text-tertiary) !important;
}

/* ---- View toggle (companies page) ---- */
html.dark .view-toggle {
    background: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .view-toggle-btn {
    color: var(--text-secondary) !important;
}

/* ---- Tab bar ---- */
html.dark .tab-bar {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

html.dark .tab-btn {
    color: var(--text-secondary) !important;
}

/* ---- Section cards ---- */
html.dark .section-card {
    background: var(--surface-primary) !important;
    border-color: var(--border-primary) !important;
}

html.dark .section-header {
    color: var(--text-primary) !important;
}

/* ---- Skeleton loaders ---- */
html.dark .skeleton {
    background: linear-gradient(90deg, var(--surface-tertiary) 25%, var(--surface-secondary) 50%, var(--surface-tertiary) 75%) !important;
    background-size: 200% 100% !important;
}

/* ---- Placeholder dashes ---- */
html.dark .placeholder-dash {
    color: var(--text-tertiary) !important;
}

/* ---- Quick chips (investor detail, etc.) ---- */
html.dark .quick-chip-purple,
html.dark .quick-chip-orange,
html.dark .quick-chip-green {
    border-color: var(--border-secondary) !important;
}

/* ---- Health messages ---- */
html.dark .health-message {
    background: var(--surface-secondary) !important;
    border-color: var(--border-primary) !important;
}

/* ---- Intel tooltip ---- */
html.dark .intel-tooltip {
    background: var(--surface-elevated) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

/* ---- Investor rows ---- */
html.dark .investor-row:hover {
    background: rgba(2, 160, 55, 0.04) !important;
}

/* ================================================================
   VIEWABILITY ENHANCEMENTS

   Fine-tuned overrides for form controls, badges, toggles, and
   other interactive elements that need extra attention in dark mode.
   ================================================================ */

/* ---- Checkboxes & radio buttons ---- */
html.dark input[type="checkbox"],
html.dark input[type="radio"] {
    background-color: var(--surface-tertiary) !important;
    border-color: #4a4a65 !important;
    color-scheme: dark;
}

html.dark input[type="checkbox"]:checked,
html.dark input[type="radio"]:checked {
    background-color: #02a037 !important;
    border-color: #02a037 !important;
}

/* ---- View toggle (People / Companies switcher) ---- */
html.dark .view-toggle-btn:hover:not(.active) {
    color: var(--text-primary) !important;
    background: var(--surface-tertiary) !important;
}

html.dark .view-toggle-btn.active {
    background: var(--surface-elevated) !important;
    color: #02a037 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* ---- Tab buttons ---- */
html.dark .tab-btn:hover:not(.active) {
    color: var(--text-primary) !important;
}

html.dark .tab-btn.active {
    color: #02a037 !important;
    background: var(--surface-primary) !important;
}

html.dark .tab-badge {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ---- Stat card neutral — improve number/label contrast ---- */
html.dark .stat-card-neutral .stat-number {
    color: var(--text-primary) !important;
}

html.dark .stat-card-neutral .stat-label {
    color: var(--text-secondary) !important;
    opacity: 1 !important;
}

/* ---- Action pills (Review Duplicates, Deal Pipeline, etc.) ---- */
html.dark .action-pill-purple {
    background: var(--surface-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .action-pill-purple:hover {
    background: var(--surface-elevated) !important;
    border-color: #4a4a65 !important;
}

html.dark .action-pill-green {
    background: rgba(2, 160, 55, 0.1) !important;
    color: #4ade80 !important;
    border-color: rgba(2, 160, 55, 0.25) !important;
}

html.dark .action-pill-green:hover {
    background: rgba(2, 160, 55, 0.15) !important;
    border-color: rgba(2, 160, 55, 0.35) !important;
}

/* ---- Entity / person meta text (emails, secondary info) ---- */
html.dark .entity-meta,
html.dark .person-meta {
    color: var(--text-tertiary) !important;
}

html.dark .entity-meta .meta-tag {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ---- Table row hover (CRM inline styles) ---- */
html.dark .crm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ---- Confidence & stage badges — subtle dark backgrounds ---- */
html.dark .confidence-high {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #4ade80 !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.dark .confidence-medium {
    background: rgba(202, 138, 4, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(202, 138, 4, 0.3) !important;
}

html.dark .confidence-low {
    background: rgba(220, 38, 38, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
}

html.dark .stage-pre_seed {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-secondary) !important;
}

html.dark .stage-seed {
    background: rgba(202, 138, 4, 0.15) !important;
    color: #fbbf24 !important;
    border-color: rgba(202, 138, 4, 0.3) !important;
}

html.dark .stage-series_a {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #4ade80 !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.dark .stage-series_b {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #4ade80 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

html.dark .stage-series_c_plus {
    background: rgba(4, 120, 87, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(4, 120, 87, 0.3) !important;
}

/* ---- Status badges ---- */
html.dark .status-review {
    background: rgba(185, 28, 28, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(185, 28, 28, 0.3) !important;
}

html.dark .status-healthcare {
    background: rgba(5, 150, 105, 0.15) !important;
    color: #4ade80 !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
}

html.dark .review-badge {
    background: rgba(180, 83, 9, 0.2) !important;
    color: #fbbf24 !important;
}

/* ---- Submission badge ---- */
html.dark .submission-badge-single {
    background: var(--surface-tertiary) !important;
    color: var(--text-secondary) !important;
}

/* ---- Repeat submitters badge (inline Tailwind on people page) ---- */
html.dark .bg-white.border.border-gray-200 {
    background-color: var(--surface-primary) !important;
    border-color: var(--border-secondary) !important;
}

/* ---- Select / dropdown styling ---- */
html.dark select {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

/* ---- Generic input/textarea ---- */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
html.dark textarea {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border-secondary) !important;
    color: var(--text-primary) !important;
}

html.dark input:focus:not([type="checkbox"]):not([type="radio"]),
html.dark textarea:focus,
html.dark select:focus {
    background-color: var(--surface-primary) !important;
}

/* ---- Links in table cells ---- */
html.dark .crm-table a {
    color: #4ade80 !important;
}

html.dark .crm-table a:hover {
    color: #22c55e !important;
}

/* ---- Stat card action/alert (dark gray cards) — brighten in dark mode ---- */
html.dark .stat-card-action {
    background: linear-gradient(135deg, #22223a 0%, #2a2a45 100%) !important;
    box-shadow: 0 2px 12px -4px rgba(0, 0, 0, 0.4) !important;
}

html.dark .stat-card-alert {
    background: #22223a !important;
}

html.dark .stat-card-alert:hover {
    background: #2a2a45 !important;
}

/* ================ SCROLLBAR STYLING ================ */
html.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html.dark ::-webkit-scrollbar-track {
    background: var(--surface-primary);
}

html.dark ::-webkit-scrollbar-thumb {
    background: #3a3a55;
    border-radius: 4px;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: #4a4a65;
}

/* ================================================================
   DEALS PAGE — DARK MODE OVERRIDES

   Covers stage badges, priority badges, source badges, action
   buttons, deck/report indicators, analysis badges, fit scores,
   company avatars, and modals rendered by deals.css / deals.js.
   ================================================================ */

/* ---- Stage badges ---- */
html.dark .stage-sourced {
    background: rgba(156, 163, 175, 0.12);
    color: #94a3b8;
    border-color: rgba(156, 163, 175, 0.25);
}
html.dark .stage-sourced::before { background: #6b7280; }

html.dark .stage-deck_analyzing {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.25);
}
html.dark .stage-deck_analyzing::before { background: #94a3b8; }

html.dark .stage-deck_reviewed {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
    border-color: rgba(5, 150, 105, 0.3);
}
html.dark .stage-deck_reviewed::before { background: #10b981; }

html.dark .stage-questionnaire_sent {
    background: rgba(202, 138, 4, 0.15);
    color: #fbbf24;
    border-color: rgba(202, 138, 4, 0.3);
}
html.dark .stage-questionnaire_sent::before { background: #d97706; }

html.dark .stage-questionnaire_received {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}
html.dark .stage-questionnaire_received::before { background: #f59e0b; }

html.dark .stage-qa_analyzed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
html.dark .stage-qa_analyzed::before { background: #10b981; }

html.dark .stage-followup_sent {
    background: rgba(202, 138, 4, 0.15);
    color: #fbbf24;
    border-color: rgba(202, 138, 4, 0.3);
}
html.dark .stage-followup_sent::before { background: #ca8a04; }

html.dark .stage-followup_received {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}
html.dark .stage-followup_received::before { background: #d97706; }

html.dark .stage-partner_review {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.25);
}
html.dark .stage-partner_review::before { background: #94a3b8; }

html.dark .stage-term_sheet {
    background: rgba(4, 120, 87, 0.15);
    color: #34d399;
    border-color: rgba(4, 120, 87, 0.3);
}
html.dark .stage-term_sheet::before { background: #059669; }

html.dark .stage-passed {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}
html.dark .stage-passed::before { background: #ef4444; }

html.dark .stage-invested {
    background: #02a037;
    color: white;
}

/* ---- Priority badges ---- */
html.dark .priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

html.dark .priority-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

html.dark .priority-low {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

/* ---- Source badges (DEALUM, New, Days) ---- */
html.dark .source-badge-dealum {
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-secondary);
}

html.dark .source-badge-new {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
    border-color: rgba(5, 150, 105, 0.3);
}

html.dark .source-badge-days {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

/* ---- Industry tag ---- */
html.dark .industry-tag {
    background: var(--surface-tertiary);
    color: var(--text-tertiary);
}

/* ---- Deck / Report indicators ---- */
html.dark .deck-indicator.deck-yes {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
}

html.dark .deck-indicator.deck-no {
    background: rgba(148, 163, 184, 0.08);
    color: #4a4a65;
}

/* ---- Analysis badges ---- */
html.dark .analysis-complete {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
    border-color: rgba(5, 150, 105, 0.3);
}

html.dark .analysis-complete:hover {
    background: rgba(5, 150, 105, 0.22);
}

html.dark .analysis-pending {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

html.dark .analysis-error {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}

html.dark .analysis-progress {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.2);
}

/* ---- Fit score badges ---- */
html.dark .fit-high {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
    border-color: rgba(5, 150, 105, 0.3);
}

html.dark .fit-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

html.dark .fit-low {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}

/* ---- Action buttons ---- */
html.dark .action-btn-report {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
    border-color: rgba(5, 150, 105, 0.3);
}
html.dark .action-btn-report:hover {
    background: rgba(5, 150, 105, 0.25);
}

html.dark .action-btn-analyze {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border-color: rgba(124, 58, 237, 0.3);
}
html.dark .action-btn-analyze:hover {
    background: rgba(124, 58, 237, 0.25);
}

html.dark .action-btn-primary {
    /* Keep green button vibrant — just darken slightly */
    background: #02a037;
    color: white;
}
html.dark .action-btn-primary:hover {
    background: #028a30;
}

html.dark .action-btn-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}
html.dark .action-btn-danger:hover {
    background: rgba(220, 38, 38, 0.2);
}

html.dark .action-btn-success {
    background: rgba(5, 150, 105, 0.15);
    color: #4ade80;
    border-color: rgba(5, 150, 105, 0.3);
}
html.dark .action-btn-success:hover {
    background: rgba(5, 150, 105, 0.25);
}

/* ---- Company avatar — darken light backgrounds ---- */
html.dark .company-avatar {
    filter: brightness(0.7) saturate(1.2);
}

/* ---- User name in assigned column ---- */
html.dark .user-name {
    color: var(--text-secondary);
}

/* ---- Deals table specifics ---- */
html.dark .deals-table th {
    color: var(--text-tertiary);
    background: linear-gradient(180deg, var(--surface-secondary) 0%, var(--surface-tertiary) 100%);
    border-bottom-color: var(--border-secondary);
}

html.dark .deals-table td {
    color: var(--text-secondary);
}

html.dark .deals-table tbody tr {
    border-bottom-color: var(--border-primary);
}

html.dark .deals-table tbody tr:hover {
    background: rgba(2, 160, 55, 0.04);
}

html.dark .sortable-header:hover {
    color: var(--text-primary);
}

html.dark .sortable-header.sort-active {
    color: #4ade80;
}

/* ---- Row actions — increase idle opacity for visibility ---- */
html.dark .row-actions {
    opacity: 0.7;
}

/* ---- Quick chips ---- */
html.dark .quick-chip-purple {
    background: var(--surface-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}
html.dark .quick-chip-purple:hover {
    background: var(--surface-elevated);
    border-color: #4a4a65;
}

html.dark .quick-chip-orange {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.25);
}
html.dark .quick-chip-orange:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.35);
}

html.dark .quick-chip-green {
    background: rgba(2, 160, 55, 0.1);
    color: #4ade80;
    border-color: rgba(2, 160, 55, 0.25);
}
html.dark .quick-chip-green:hover {
    background: rgba(2, 160, 55, 0.15);
    border-color: rgba(2, 160, 55, 0.35);
}

/* ---- Modals ---- */
html.dark .modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

html.dark .modal-enter {
    background: var(--surface-primary) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---- Toggle switch — improve inactive state visibility ---- */
html.dark .toggle-switch:not(.active) {
    background: #3a3a55;
}

/* ---- Stat card number/label in neutral card ---- */
html.dark .stat-card-neutral .stat-number {
    color: var(--text-primary) !important;
}

html.dark .stat-card-neutral .stat-label {
    color: var(--text-secondary) !important;
}

html.dark .stat-card-neutral .stat-icon-wrap {
    background: rgba(2, 160, 55, 0.12);
}

html.dark .stat-card-neutral .stat-icon-wrap svg {
    color: #4ade80;
}

/* ---- Stat card neutral ---- */
html.dark .stat-card.stat-card-neutral {
    background: var(--surface-primary);
    border-color: var(--border-secondary);
}

/* ---- Bulk action bar — already dark, just tweak ---- */
html.dark #bulk-action-bar {
    background: var(--surface-elevated) !important;
    border: 1px solid var(--border-secondary);
}
