﻿/* Bridge variables into Bootstrap/AdminLTE without overriding classes directly. */

/* Apply body/base from tokens */
html, body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Navbar surfaces use variables only; AdminLTE/Bootstrap classes define layout */
.app-header.navbar,
.navbar {
    background-color: var(--app-navbar-bg) !important;
    color: var(--app-navbar-fg) !important;
}

/* Sidebar uses surface tokens; we avoid changing paddings/margins/classes */
.app-sidebar {
    background-color: var(--app-sidebar-bg) !important;
    color: var(--app-sidebar-fg) !important;
}

    .app-sidebar .nav-link,
    .app-sidebar .nav-link p,
    .app-sidebar .bi {
        color: var(--app-sidebar-fg) !important;
    }

        .app-sidebar .nav-link:hover,
        .app-sidebar .nav-link.active {
            background-color: var(--app-sidebar-active-bg) !important;
            color: var(--app-sidebar-active-fg) !important;
        }

/* Generic surfaces & borders */
.card,
.table,
.modal-content,
.dropdown-menu,
.list-group,
.form-control,
.form-select {
    background-color: var(--app-surface-2);
    color: var(--app-text);
    border-color: var(--app-border);
}

/* Links and accents stay in sync with theme brand */
a {
    color: var(--bs-link-color);
}

    a:hover {
        color: color-mix(in srgb, var(--bs-link-color) 85%, black);
    }

/* Headings: neutralize legacy hardcodes */
h1, h2, h3, h4, h5, h6 {
    color: var(--app-text);
}

/* Datatables / tables: borders with theme token */
table,
.table,
.table thead th,
.table td,
.table th {
    border-color: var(--app-border) !important;
}

/* --- Theme bridge hard overrides (win against site.css) --- */
.app-sidebar,
.sidebar-wrapper {
    background-color: var(--app-sidebar-bg) !important;
    color: var(--app-sidebar-fg) !important;
}

    /* Sidebar links & active state */
    .app-sidebar .nav-link,
    .sidebar-wrapper .nav-link,
    .app-sidebar .nav-link p,
    .sidebar-wrapper .nav-link p,
    .app-sidebar .bi,
    .sidebar-wrapper .bi {
        color: var(--app-sidebar-fg) !important;
    }

        .app-sidebar .nav-link:hover,
        .sidebar-wrapper .nav-link:hover,
        .app-sidebar .nav-link.active,
        .sidebar-wrapper .nav-link.active,
        .nav-sidebar > .nav-item > .nav-link.active {
            background-color: var(--app-sidebar-active-bg) !important;
            color: var(--app-sidebar-active-fg) !important;
            border-color: transparent !important;
        }

/* Cards / tables should use surface-2 */
.card,
.table,
.modal-content,
.dropdown-menu,
.list-group,
.form-control,
.form-select {
    background-color: var(--app-surface-2) !important;
    color: var(--app-text) !important;
    border-color: var(--app-border) !important;
}
