/* PMF DBI - Theme tokens
 * Built on Bootstrap 5.3 native theming via [data-bs-theme]
 * Brand color #0078C9 is preserved across both themes.
 * Light theme is the default (no attribute or [data-bs-theme="light"]).
 * Dark theme activates via <html data-bs-theme="dark">.
 */

:root,
[data-bs-theme="light"] {
    /* Brand */
    --pmf-brand: #0078C9;
    --pmf-brand-strong: #195889;
    --pmf-brand-deep: #105080;
    --pmf-brand-soft: #E1F0FA;

    /* Surface */
    --pmf-bg: #ffffff;
    --pmf-bg-subtle: #f7f8fa;
    --pmf-bg-elevated: #ffffff;
    --pmf-surface-muted: #f2f2f2;

    /* Borders / dividers */
    --pmf-border: #e5e5e5;
    --pmf-border-strong: #c8c8c8;

    /* Text */
    --pmf-text: #212529;
    --pmf-text-muted: #6c757d;
    --pmf-text-on-brand: #ffffff;

    /* Header / Nav */
    --pmf-nav-bg: #ffffff;
    --pmf-nav-border: var(--pmf-border);
    --pmf-sidebar-bg: var(--pmf-bg-subtle);
    --pmf-card-header-bg: var(--pmf-brand);
    --pmf-card-header-color: #ffffff;

    /* Action accents */
    --pmf-link: #0366d6;
    --pmf-row-stripe: #f6f8fa;

    /* Status accents (kept for dashboards) */
    --pmf-status-ok: #4cff00;
    --pmf-status-warn: #ffd166;
    --pmf-status-error: #e14b4b;
    --pmf-status-info: lightskyblue;

    /* Shadows */
    --pmf-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .05);
    --pmf-shadow-nav: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

[data-bs-theme="dark"] {
    /* Keep brand color but lift saturation slightly for contrast on dark */
    --pmf-brand: #2aa3ec;
    --pmf-brand-strong: #1f86c7;
    --pmf-brand-deep: #1a6fa8;
    --pmf-brand-soft: #0e2a3d;

    --pmf-bg: #1b1f24;
    --pmf-bg-subtle: #15181c;
    --pmf-bg-elevated: #23272d;
    --pmf-surface-muted: #2a2f36;

    --pmf-border: #2f343b;
    --pmf-border-strong: #3a4049;

    --pmf-text: #e6e8eb;
    --pmf-text-muted: #a8adb4;
    --pmf-text-on-brand: #ffffff;

    --pmf-nav-bg: #1f242a;
    --pmf-nav-border: var(--pmf-border);
    --pmf-sidebar-bg: #1f242a;
    --pmf-card-header-bg: var(--pmf-brand-strong);
    --pmf-card-header-color: #ffffff;

    --pmf-link: #6ab9ff;
    --pmf-row-stripe: #20252b;

    --pmf-status-ok: #2ecc71;
    --pmf-status-warn: #f0b429;
    --pmf-status-error: #ef6464;
    --pmf-status-info: #5bb6ea;

    --pmf-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .35);
    --pmf-shadow-nav: 0 .25rem .75rem rgba(0, 0, 0, .35);
}

/* Modernized navbar surface that follows the theme without page edits.
 * .nav-main is added on every shared layout.
 * Bootstrap will treat the navbar as light/dark via the html-level data-bs-theme.
 */
.nav-main {
    background-color: var(--pmf-nav-bg) !important;
    border-bottom-color: var(--pmf-nav-border) !important;
    box-shadow: var(--pmf-shadow-nav);
}

/* Make Bootstrap card headers honor the brand */
.card-header {
    background-color: var(--pmf-card-header-bg);
    color: var(--pmf-card-header-color);
}

/* Reusable theme-aware focus ring */
.pmf-focus-ring:focus-visible {
    outline: 2px solid var(--pmf-brand);
    outline-offset: 2px;
}
