/*
 * Dark Theme Fixes
 * Centralized overrides for dark mode using [data-bs-theme="dark"] selectors.
 * Loaded after htmx-custom.css in base.html.
 */

/* ── Table header: remove forced light background ── */
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: var(--bs-tertiary-bg);
    --bs-table-color: var(--bs-body-color);
    --bs-table-border-color: var(--bs-border-color);
}

/* ── Accent icon color (purple) — lighter for dark mode ── */
.icon-accent {
    color: #6610f2;
}
[data-bs-theme="dark"] .icon-accent {
    color: #a78bfa;
}

/* ── Settings accent purple — for role cards, site_settings dashboard ── */
.border-accent {
    border-color: #6610f2 !important;
}
[data-bs-theme="dark"] .border-accent {
    border-color: #a78bfa !important;
}

.text-accent {
    color: #6f42c1;
}
[data-bs-theme="dark"] .text-accent {
    color: #b392f0;
}

/* ── Aging 60-day orange badge (accounting) ── */
.badge-aging-60 {
    background: rgba(255, 165, 0, 0.2);
    color: #e67e00;
}
[data-bs-theme="dark"] .badge-aging-60 {
    background: rgba(255, 165, 0, 0.25);
    color: #ffb347;
}

/* ── Aging 60-day stat block (accounting dashboard) ── */
.bg-aging-60 {
    background: rgba(255, 165, 0, 0.1);
}
[data-bs-theme="dark"] .bg-aging-60 {
    background: rgba(255, 165, 0, 0.15);
}

.text-aging-60 {
    color: #e67e00;
}
[data-bs-theme="dark"] .text-aging-60 {
    color: #ffb347;
}

/* ── Followup response background tints ── */
.bg-info-tint {
    background-color: rgba(13, 110, 253, 0.05);
}
[data-bs-theme="dark"] .bg-info-tint {
    background-color: rgba(13, 110, 253, 0.12);
}

.bg-muted-tint {
    background-color: rgba(0, 0, 0, 0.03);
}
[data-bs-theme="dark"] .bg-muted-tint {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ── Notification icon background (settings dashboard) ── */
.bg-purple-tint {
    background-color: rgba(111, 66, 193, 0.1);
}
[data-bs-theme="dark"] .bg-purple-tint {
    background-color: rgba(111, 66, 193, 0.2);
}

/* ── Quick stats border accent (settings dashboard) ── */
.border-color-accent {
    border-color: #6610f2 !important;
}
[data-bs-theme="dark"] .border-color-accent {
    border-color: #a78bfa !important;
}

/* ── Code elements in tables ── */
[data-bs-theme="dark"] code {
    color: var(--bs-body-color);
}

/* ── Layout depth: separate sidebar/header from main content in dark mode ── */
/* Bootstrap dark body is #212529. We make the content area slightly lighter
   so the sidebar and header feel recessed/distinct. */
[data-bs-theme="dark"] main {
    background-color: #2b3035;
}

[data-bs-theme="dark"] .navbar.bg-dark {
    background-color: #191c20 !important;
}

[data-bs-theme="dark"] nav.bg-dark:not(.navbar) {
    background-color: #191c20 !important;
}
