/* ==========================================================================
   THE FLOORIST — design system (brand navy #142b4c)
   One theme layer over Bootstrap 5.3 (data-bs-theme dark|light), loaded AFTER bootstrap.css and Site.css so
   every existing view picks it up. App shell = navy sidebar + slim top bar; flat tinted surfaces, soft status colours.
   ========================================================================== */
:root {
    --brand: #142b4c;
    --fx-font: "Plus Jakarta Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
    --fx-r: 16px;
    --fx-r-sm: 12px;
    --fx-side-w: 248px;
}
[data-bs-theme="dark"] {
    --fx-bg: #0a1424; --fx-surface: #0f1d34; --fx-surface-2: #16294a; --fx-line: #223a5c;
    --fx-ink: #eaf0fa; --fx-muted: #8fa3c0; --fx-accent: #7aa7ff; --fx-accent-ink: #08162b; --fx-accent-soft: #16305a;
    --fx-hero: linear-gradient(135deg, #1f4580 0%, #142b4c 70%);
    --fx-ok: #4ad99a; --fx-ok-soft: #0f3121; --fx-ok-fill: #2fc47f;
    --fx-hold: #ffbf52; --fx-hold-soft: #36270b; --fx-hold-fill: #f2a326;
    --fx-po: #bba5ff; --fx-po-soft: #2a2150; --fx-po-fill: #9b74ff;
    --fx-transit: #5fd0f0; --fx-transit-soft: #0d3140; --fx-transit-fill: #2bb7e2;
    --fx-crit: #ff7a7e; --fx-crit-soft: #3d1618;
    --fx-shadow: 0 1px 2px rgba(0,0,0,.35);
    --bs-body-bg: var(--fx-bg); --bs-body-color: var(--fx-ink); --bs-border-color: var(--fx-line);
    --bs-primary: #7aa7ff; --bs-primary-rgb: 122,167,255; --bs-link-color: #8db4ff; --bs-link-hover-color: #b5cdff;
    --bs-secondary-color: var(--fx-muted);
    color-scheme: dark;
}
[data-bs-theme="light"] {
    --fx-bg: #f1f4f9; --fx-surface: #ffffff; --fx-surface-2: #eaf0f8; --fx-line: #dbe3ef;
    --fx-ink: #142b4c; --fx-muted: #5f7292; --fx-accent: #142b4c; --fx-accent-ink: #ffffff; --fx-accent-soft: #e3ebf8;
    --fx-hero: linear-gradient(135deg, #1d4278 0%, #142b4c 70%);
    --fx-ok: #0f8a57; --fx-ok-soft: #e0f6ec; --fx-ok-fill: #2fc47f;
    --fx-hold: #a96300; --fx-hold-soft: #fdf0d6; --fx-hold-fill: #f2a326;
    --fx-po: #6a45d6; --fx-po-soft: #ece6ff; --fx-po-fill: #9b74ff;
    --fx-transit: #0b7fa3; --fx-transit-soft: #dff4fb; --fx-transit-fill: #2bb7e2;
    --fx-crit: #c8323a; --fx-crit-soft: #fde6e7;
    --fx-shadow: 0 1px 2px rgba(20,43,76,.08);
    --bs-body-bg: var(--fx-bg); --bs-body-color: var(--fx-ink); --bs-border-color: var(--fx-line);
    --bs-primary: #142b4c; --bs-primary-rgb: 20,43,76; --bs-link-color: #1d4278; --bs-link-hover-color: #142b4c;
}

/* ---- Base --------------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
body { font-family: var(--fx-font); font-size: 14px; background: var(--fx-bg); color: var(--fx-ink); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { text-underline-offset: 3px; }
hr { border-color: var(--fx-line); opacity: 1; }
h1, h2, h3, h4, h5 { font-weight: 800; letter-spacing: -.02em; }
.pageHeaders { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.text-primary { color: var(--bs-link-color) !important; }
.text-secondary { color: var(--fx-muted) !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background-color: var(--fx-line); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
.svg-inline--fa { color: inherit !important; }

/* ---- App shell: sidebar + top bar ---------------------------------------------------------- */
.fx-shell { display: grid; grid-template-columns: var(--fx-side-w) minmax(0, 1fr); min-height: 100vh; }
.fx-side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
    background: var(--brand); color: #e8eefb; border-right: 1px solid rgba(255,255,255,.06);
}
.fx-brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; text-decoration: none; color: #fff; }
.fx-brand-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.12); flex: none; }
.fx-brand-tile img { width: 26px; height: 26px; object-fit: contain; }
.fx-brand strong { display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.1; }
.fx-brand small { display: block; font-size: .72rem; color: rgba(255,255,255,.62); font-weight: 500; }
.fx-side .navbar-nav { flex-direction: column; gap: 2px; width: 100%; --bs-nav-link-color: rgba(255,255,255,.78); }
.fx-side li { list-style: none; }
.fx-side .nav-link, .fx-side .nav-item a.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px !important; border-radius: var(--fx-r-sm);
    color: rgba(255,255,255,.78); font-weight: 600; font-size: .92rem; transition: background .15s, color .15s;
}
.fx-side .nav-link::before { /* icon (Font Awesome 6 solid) picked by menu id, see list below */
    content: "\f111"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .9rem; width: 20px; text-align: center; opacity: .85;
}
.fx-side .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.fx-side .nav-link.active, .fx-side .nav-link.show { background: rgba(255,255,255,.14); color: #fff; font-weight: 700; }
.fx-side .nav-link.dropdown-toggle::after { margin-left: auto; opacity: .6; }
.fx-side .nav-link.active::after { content: none; }
.fx-side .dropdown-menu {
    position: static !important; transform: none !important; inset: auto !important; float: none; min-width: 0;
    margin: 2px 0 6px 14px; padding: 2px 0 2px 10px; background: transparent; border: 0; border-left: 1px solid rgba(255,255,255,.14);
    border-radius: 0; box-shadow: none; animation: none;
}
.fx-side .dropdown-item { color: rgba(255,255,255,.72) !important; border-radius: 10px; padding: 8px 12px; font-size: .88rem; font-weight: 500; }
.fx-side .dropdown-item:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.fx-side .dropdown-item.active { background: rgba(255,255,255,.14) !important; color: #fff !important; font-weight: 700; }
.fx-side-foot { margin-top: auto; padding: 12px 8px 0; font-size: .72rem; color: rgba(255,255,255,.5); }
/* Menu icons — by element id used in the existing menu partials */
#dashboardMenu::before { content: "\f015"; } #clientsMenu::before { content: "\f0c0"; } #masterMenuButton::before { content: "\f1c0"; }
#productsMenu::before { content: "\f1b2"; } #projectProductsMenu::before { content: "\f5fd"; } #blocksMenu::before { content: "\f023"; }
#purchaseOrderMenu::before { content: "\f570"; } #transitMenu::before { content: "\f0d1"; } #userMenu::before { content: "\f007"; }
#requestsMenu::before { content: "\f0ae"; } #projectsMenu::before { content: "\f07b"; } #scheduleMenu::before { content: "\f073"; }
#consumablesMenu::before { content: "\f49e"; } #resourcesMenu::before { content: "\f0ad"; } #subContractMenu::before { content: "\f0b1"; }

.fx-main { min-width: 0; display: flex; flex-direction: column; }
.fx-top {
    position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
    background: color-mix(in srgb, var(--fx-bg) 88%, transparent); backdrop-filter: blur(10px);
}
.fx-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--fx-accent-soft); color: var(--fx-accent); flex: none; }
.fx-greet small { display: block; color: var(--fx-muted); font-size: .75rem; line-height: 1.1; }
.fx-greet strong { font-size: 1rem; font-weight: 800; }
.fx-pill { font-size: .72rem; font-weight: 700; padding: .32rem .7rem; border-radius: 999px; background: var(--fx-accent-soft); color: var(--fx-accent); }
.fx-icon-btn {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
    background: var(--fx-surface); border: 1px solid var(--fx-line); color: var(--fx-ink); transition: background .15s;
}
.fx-icon-btn:hover { background: var(--fx-surface-2); }
[data-bs-theme="dark"] .fx-theme-toggle .fa-sun, [data-bs-theme="light"] .fx-theme-toggle .fa-moon { display: none; }
.fx-top .dropdown-menu { --bs-dropdown-bg: var(--fx-surface); }
.fx-top form { margin: 0; } .fx-top li { list-style: none; }
.fx-top .nav-link { display: flex; align-items: center; gap: 8px; padding: 6px 12px !important; border-radius: 12px; border: 1px solid var(--fx-line); background: var(--fx-surface); color: var(--fx-ink) !important; font-weight: 600; }
.fx-top .nav-link::before, .fx-top .nav-link.active::after { content: none; }
.fx-content { padding: 8px 28px 28px; max-width: 1680px; width: 100%; margin-inline: auto; animation: fx-rise .35s ease both; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(6px); } }
footer p { color: var(--fx-muted); font-size: .75rem; margin: 0; }
#fxSideToggle { display: grid; }
/* Desktop: the menu can be collapsed to a narrow icon rail, which gives the page more width but keeps every menu item one click away.
   The choice is remembered (see floorist.js) and applied from an inline script in <head>, so there is no flash on the next page.
   Item names are hidden (font-size 0) and shown as a tooltip instead; a menu with sub-items opens as a flyout beside its icon. */
@media (min-width: 992px) {
    html.fx-side-hidden { --fx-side-w: 72px; }
    html.fx-side-hidden .fx-content { max-width: none; }
    html.fx-side-hidden .fx-side { padding-inline: 12px; overflow: visible; z-index: 1030; }
    html.fx-side-hidden .fx-brand { justify-content: center; padding-inline: 0; }
    html.fx-side-hidden .fx-brand > span:not(.fx-brand-tile), html.fx-side-hidden .fx-side-foot { display: none; }
    html.fx-side-hidden .fx-side .nav-link, html.fx-side-hidden .fx-side .nav-item a.nav-link {
        font-size: 0; justify-content: center; gap: 0; padding: 12px 0 !important;
    }
    html.fx-side-hidden .fx-side .nav-link::before { font-size: 1.05rem; width: auto; opacity: 1; }
    html.fx-side-hidden .fx-side .nav-link.dropdown-toggle::after { content: none; }
    html.fx-side-hidden .fx-side .nav-item { position: relative; }
    html.fx-side-hidden .fx-side .dropdown-menu { display: none; }
    html.fx-side-hidden .fx-side .dropdown-menu.show {
        display: block; position: absolute !important; inset: 0 auto auto 100% !important; margin: 0 0 0 10px; min-width: 210px; padding: 6px;
        background: var(--brand); border: 1px solid rgba(255,255,255,.16); border-radius: var(--fx-r-sm); box-shadow: 0 10px 28px rgba(0,0,0,.35); z-index: 1060;
    }
}
@media (max-width: 991px) {
    .fx-shell { grid-template-columns: 1fr; }
    .fx-side { position: fixed; z-index: 1040; width: 270px; transform: translateX(-100%); transition: transform .25s ease; }
    body.fx-side-open .fx-side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
    #fxSideToggle { display: grid; }
    .fx-top, .fx-content { padding-inline: 16px; }
}

/* ---- Surfaces ------------------------------------------------------------------------------ */
.card {
    --bs-card-bg: var(--fx-surface); --bs-card-border-color: var(--fx-line); --bs-card-cap-bg: transparent; --bs-card-border-radius: var(--fx-r);
    background: var(--fx-surface); border: 1px solid var(--fx-line); border-radius: var(--fx-r); box-shadow: var(--fx-shadow); color: var(--fx-ink);
}
.card.shadow { box-shadow: var(--fx-shadow) !important; }
.card-header { border-bottom: 1px solid var(--fx-line); background: transparent; }
.card a { color: inherit; }
.fx-title { font-size: 1rem; font-weight: 800; margin: 0; }
.fx-link { color: var(--fx-accent); font-weight: 700; font-size: .82rem; text-decoration: none; }

/* Hero ("Today") card */
.fx-hero { position: relative; border-radius: 20px; padding: 20px; color: #fff; background: var(--fx-hero); overflow: hidden; }
.fx-hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 190px; height: 190px; opacity: .12;
    background: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 14px); border-radius: 24px; pointer-events: none; }
.fx-hero h2 { font-size: 1.15rem; margin: 0; } .fx-hero small { color: rgba(255,255,255,.72); }
.fx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; padding: 14px; border-radius: 16px; background: rgba(8,18,38,.45); }
.fx-tile { border-radius: 14px; padding: 12px 14px; border: 1px solid transparent; text-decoration: none; display: block; color: inherit; transition: transform .15s; }
a.fx-tile:hover { transform: translateY(-2px); }
.fx-tile .v { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fx-tile .l { font-size: .72rem; font-weight: 700; margin-top: 4px; opacity: .95; line-height: 1.25; }
.fx-t-ok { background: #0f3121; color: #4ad99a; border-color: rgba(74,217,154,.25); }
.fx-t-hold { background: #36270b; color: #ffbf52; border-color: rgba(255,191,82,.25); }
.fx-t-po { background: #2a2150; color: #bba5ff; border-color: rgba(187,165,255,.25); }
.fx-t-transit { background: #0d3140; color: #5fd0f0; border-color: rgba(95,208,240,.25); }

/* KPI tiles on light/dark pages (installation dashboard) */
.fx-kpi { display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 112px; padding: 16px 18px; border-radius: var(--fx-r);
    background: var(--tint-soft); color: var(--tint) !important; border: 1px solid color-mix(in srgb, var(--tint) 22%, transparent); text-decoration: none !important; position: relative; transition: transform .15s; }
a.fx-kpi:hover { transform: translateY(-3px); }
.fx-kpi .fx-kpi-label { font-size: .74rem; font-weight: 700; line-height: 1.3; }
.fx-kpi .fx-kpi-value { font-size: 2.2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fx-kpi .fx-kpi-icon { position: absolute; right: 16px; bottom: 14px; font-size: 1.35rem; opacity: .85; }
.fx-c-success { --tint: var(--fx-ok); --tint-soft: var(--fx-ok-soft); } .fx-c-warning { --tint: var(--fx-hold); --tint-soft: var(--fx-hold-soft); }
.fx-c-info { --tint: var(--fx-transit); --tint-soft: var(--fx-transit-soft); } .fx-c-primary { --tint: var(--fx-po); --tint-soft: var(--fx-po-soft); }
.fx-section-title { display: flex; align-items: center; gap: .6rem; font-size: 1rem; margin: 1.5rem 0 .9rem; }
.fx-section-title::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--fx-accent); }

/* stacked stock bar */
.fx-stack { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: var(--fx-line); min-width: 120px; }
.fx-stack i { display: block; height: 100%; }
.fx-stack .a { background: var(--fx-ok-fill); } .fx-stack .b { background: var(--fx-hold-fill); } .fx-stack .p { background: var(--fx-po-fill); } .fx-stack .t { background: var(--fx-transit-fill); }
.fx-stack .s { background: repeating-linear-gradient(135deg, var(--fx-crit) 0 3px, color-mix(in srgb, var(--fx-crit) 45%, transparent) 3px 6px); }
.fx-stack { gap: 2px; }
.fx-stack-lg { height: 9px; max-width: 320px; margin-top: 6px; }

/* ---- Inventory home (dashboard) ---------------------------------------------------------------
   Phones: one column. Desktop: hero + quick actions + most in demand on the left, expiring + data checks on the right. */
.fx-home { display: grid; gap: 18px; }
@media (min-width: 992px) {
    .fx-home { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "hero att" "quick att" "items chk"; align-items: start; }
    .fx-home-hero { grid-area: hero; } .fx-quick { grid-area: quick; } .fx-home-items { grid-area: items; }
    .fx-home-att { grid-area: att; } .fx-home-chk { grid-area: chk; }
}
.fx-home-hero { display: grid; gap: 14px; }
.fx-home-hero > * { position: relative; }
.fx-hero-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fx-hero-top h2 { font-size: 1.25rem; font-weight: 800; }
.fx-hpanel { background: var(--fx-surface); color: var(--fx-ink); border-radius: 14px; padding: 12px; display: grid; gap: 12px; }
.fx-hstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 575px) { .fx-hstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fx-hstat { border-radius: 10px; padding: 9px 10px; display: grid; gap: 2px; min-width: 0; border-top: 4px solid var(--c-fill); background: var(--c-soft); }
.fx-hstat.ok { --c: var(--fx-ok); --c-fill: var(--fx-ok-fill); --c-soft: var(--fx-ok-soft); }
.fx-hstat.hold { --c: var(--fx-hold); --c-fill: var(--fx-hold-fill); --c-soft: var(--fx-hold-soft); }
.fx-hstat.po { --c: var(--fx-po); --c-fill: var(--fx-po-fill); --c-soft: var(--fx-po-soft); }
.fx-hstat.tr { --c: var(--fx-transit); --c-fill: var(--fx-transit-fill); --c-soft: var(--fx-transit-soft); }
.fx-hstat b { color: var(--c); font-size: clamp(1.05rem, 2.2vw, 1.45rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.fx-hero .fx-hstat small { color: var(--c); font-size: .72rem; font-weight: 700; opacity: .9; }
.fx-hbar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--fx-surface-2); }
.fx-hbar i, .fx-hleg i { display: block; height: 100%; }
.fx-hleg { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .76rem; font-weight: 600; color: var(--fx-muted); }
.fx-hleg span { display: flex; gap: 5px; align-items: center; }
.fx-hleg i { width: 11px; height: 11px; border-radius: 3px; }
.fx-hleg b { color: var(--fx-ink); font-weight: 800; }
.fx-hbar .a, .fx-hleg .a { background: var(--fx-ok-fill); } .fx-hbar .b, .fx-hleg .b { background: var(--fx-hold-fill); }
.fx-hbar .p, .fx-hleg .p { background: var(--fx-po-fill); } .fx-hbar .t, .fx-hleg .t { background: var(--fx-transit-fill); }
.fx-hact { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .76rem; color: var(--fx-muted); border-top: 1px solid var(--fx-line); padding-top: 10px; }
.fx-hact b { color: var(--fx-ink); font-weight: 800; }
.fx-hfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid rgba(255,255,255,.24); padding-top: 12px;
    color: #fff !important; font-weight: 600; font-size: .82rem; text-decoration: none; }
.fx-hfoot.is-muted { color: rgba(255,255,255,.72) !important; }
.fx-hfoot .pill { background: #fff; color: #142b4c; font-weight: 800; border-radius: 10px; padding: 2px 8px; font-size: .75rem; margin-right: 6px; }

.fx-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 575px) { .fx-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fx-qbtn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--fx-line); background: var(--fx-surface); border-radius: 14px;
    padding: 12px 10px; font-weight: 700; color: var(--fx-ink) !important; box-shadow: var(--fx-shadow); white-space: nowrap; text-decoration: none; min-width: 0; transition: border-color .12s; }
.fx-qbtn:hover { border-color: var(--fx-accent); }
.fx-qbtn .pc { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--fx-accent-soft); color: var(--fx-accent); flex: none; font-size: .78rem; }

.fx-sec { display: grid; gap: 10px; align-content: start; min-width: 0; }
.fx-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fx-list { display: grid; gap: 8px; }
.fx-empty { background: var(--fx-surface); border: 1px dashed var(--fx-line); border-radius: var(--fx-r); padding: 16px; color: var(--fx-muted); font-size: .85rem; }
.fx-arow, .fx-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--fx-surface); border-radius: var(--fx-r);
    padding: 12px; box-shadow: var(--fx-shadow); border: 1px solid transparent; color: var(--fx-ink) !important; text-decoration: none; transition: border-color .12s; }
.fx-item { grid-template-columns: 48px minmax(0, 1fr) auto; }
a.fx-arow:hover, .fx-item:hover { border-color: var(--fx-line); }
.fx-arow-main { min-width: 0; display: grid; gap: 2px; }
.fx-arow-main > b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-arow-main > small { color: var(--fx-muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-glyph { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: .7rem; font-weight: 800; letter-spacing: .02em; color: var(--fx-ink);
    background: var(--fx-surface-2) repeating-linear-gradient(90deg, transparent 0 7px, color-mix(in srgb, var(--fx-ink) 8%, transparent) 7px 8px); }
.fx-item .fx-glyph { width: 48px; height: 48px; border-radius: 12px; }
.fx-rico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.fx-rico.crit { background: var(--fx-crit-soft); color: var(--fx-crit); } .fx-rico.warn { background: var(--fx-hold-soft); color: var(--fx-hold); }
.fx-cdv { font-size: .75rem; font-weight: 800; padding: 4px 10px; border-radius: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-cdv.crit { background: var(--fx-crit-soft); color: var(--fx-crit); } .fx-cdv.warn { background: var(--fx-hold-soft); color: var(--fx-hold); }
.fx-cdv.ok { background: var(--fx-ok-soft); color: var(--fx-ok); }
.fx-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.fx-chip { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 7px; white-space: nowrap; }
.fx-chip::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; }
.fx-chip.crit { background: var(--fx-crit-soft); color: var(--fx-crit); } .fx-chip.hold { background: var(--fx-hold-soft); color: var(--fx-hold); }
.fx-chip.po { background: var(--fx-po-soft); color: var(--fx-po); } .fx-chip.tr { background: var(--fx-transit-soft); color: var(--fx-transit); }
.fx-it-num { text-align: right; display: grid; }
.fx-it-num b { color: var(--fx-ok); font-weight: 800; font-size: 1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-it-num b.neg { color: var(--fx-crit); } .fx-it-num b.zero { color: var(--fx-muted); }
.fx-it-num small { font-size: .7rem; color: var(--fx-muted); white-space: nowrap; }

.fx-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--fx-muted); }
.fx-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); }
.fx-status { display: inline-flex; align-items: center; gap: .5rem; font-size: .76rem; font-weight: 600; color: var(--fx-muted); }
.fx-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fx-ok-fill); }

/* ---- Buttons -------------------------------------------------------------------------------
   Every variant sets the complete Bootstrap --bs-btn-* set (normal, hover, active, disabled), so each state keeps a readable
   text/background pair in BOTH themes. (The old rules mixed hard-coded navy from installation/Site.css with theme colours,
   which left navy text on a navy background in dark mode and borderless pale buttons in light mode.)
   --fx-v = the variant colour, --fx-v-ink = text on a filled variant; both come from the theme tokens above.            */
:root, [data-bs-theme="light"] { --fx-hover-mix: #000; --fx-accent-hover: #1d4278; --fx-btn-line: #b9c6da; }
[data-bs-theme="dark"] { --fx-hover-mix: #fff; --fx-accent-hover: #a3c3ff; --fx-btn-line: #35557f; }

.btn { border-radius: var(--fx-r-sm); font-weight: 700; transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
    --bs-btn-disabled-opacity: .5; --bs-btn-focus-shadow-rgb: 122,167,255; }
.btn:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-v, var(--fx-accent)) 40%, transparent) !important; outline: 0; }

.btn-primary, .btn-outline-primary { --fx-v: var(--fx-accent); --fx-v-ink: var(--fx-accent-ink); }
.btn-success, .btn-outline-success { --fx-v: var(--fx-ok);     --fx-v-ink: var(--fx-accent-ink); }
.btn-danger,  .btn-outline-danger  { --fx-v: var(--fx-crit);   --fx-v-ink: var(--fx-accent-ink); }
.btn-warning, .btn-outline-warning { --fx-v: var(--fx-hold);   --fx-v-ink: var(--fx-accent-ink); }
.btn-info,    .btn-outline-info    { --fx-v: var(--fx-transit); --fx-v-ink: var(--fx-accent-ink); }
.btn-outline-secondary             { --fx-v: var(--fx-ink);    --fx-v-ink: var(--fx-bg); }

/* Filled */
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info {
    --bs-btn-color: var(--fx-v-ink); --bs-btn-bg: var(--fx-v); --bs-btn-border-color: var(--fx-v);
    --bs-btn-hover-color: var(--fx-v-ink); --bs-btn-hover-bg: color-mix(in srgb, var(--fx-v) 84%, var(--fx-hover-mix)); --bs-btn-hover-border-color: color-mix(in srgb, var(--fx-v) 84%, var(--fx-hover-mix));
    --bs-btn-active-color: var(--fx-v-ink); --bs-btn-active-bg: color-mix(in srgb, var(--fx-v) 72%, var(--fx-hover-mix)); --bs-btn-active-border-color: color-mix(in srgb, var(--fx-v) 72%, var(--fx-hover-mix));
    --bs-btn-disabled-color: var(--fx-v-ink); --bs-btn-disabled-bg: var(--fx-v); --bs-btn-disabled-border-color: var(--fx-v);
}
.btn-primary { --bs-btn-hover-bg: var(--fx-accent-hover); --bs-btn-hover-border-color: var(--fx-accent-hover); --bs-btn-active-bg: var(--fx-accent-hover); --bs-btn-active-border-color: var(--fx-accent-hover); }
a.btn-primary, a.btn-success, a.btn-danger, a.btn-warning, a.btn-info { color: var(--fx-v-ink); }

/* Outline: a surface fill and a visible border, so the button reads as a button on a white card and on a navy one */
.btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-secondary {
    --bs-btn-color: var(--fx-v); --bs-btn-bg: var(--fx-surface); --bs-btn-border-color: var(--fx-v);
    --bs-btn-hover-color: var(--fx-v-ink); --bs-btn-hover-bg: var(--fx-v); --bs-btn-hover-border-color: var(--fx-v);
    --bs-btn-active-color: var(--fx-v-ink); --bs-btn-active-bg: var(--fx-v); --bs-btn-active-border-color: var(--fx-v);
    --bs-btn-disabled-color: var(--fx-v); --bs-btn-disabled-bg: var(--fx-surface); --bs-btn-disabled-border-color: var(--fx-v);
    --bs-gradient: none;
}
.btn-outline-primary { --bs-btn-border-color: var(--fx-btn-line); --bs-btn-disabled-border-color: var(--fx-btn-line); }
.btn-outline-primary:hover, .btn-outline-primary:active, .btn-outline-primary.active { --bs-btn-border-color: var(--fx-accent); }
.btn-outline-secondary { --bs-btn-border-color: var(--fx-btn-line); --bs-btn-disabled-border-color: var(--fx-btn-line); }

/* Neutral */
.btn-secondary, .btn-outline-light, .btn-light {
    --bs-btn-color: var(--fx-ink); --bs-btn-bg: var(--fx-surface-2); --bs-btn-border-color: var(--fx-btn-line);
    --bs-btn-hover-color: var(--fx-ink); --bs-btn-hover-bg: color-mix(in srgb, var(--fx-surface-2) 80%, var(--fx-ink)); --bs-btn-hover-border-color: var(--fx-muted);
    --bs-btn-active-color: var(--fx-ink); --bs-btn-active-bg: color-mix(in srgb, var(--fx-surface-2) 70%, var(--fx-ink)); --bs-btn-active-border-color: var(--fx-muted);
    --bs-btn-disabled-color: var(--fx-ink); --bs-btn-disabled-bg: var(--fx-surface-2); --bs-btn-disabled-border-color: var(--fx-btn-line);
}
.btn-link { --bs-btn-color: var(--bs-link-color); --bs-btn-hover-color: var(--bs-link-hover-color); --bs-btn-active-color: var(--bs-link-hover-color); --bs-btn-disabled-color: var(--fx-muted); }
.btn .fa-file-excel { color: var(--fx-ok) !important; }
.btn-primary .fa-file-excel, .btn:hover .fa-file-excel { color: inherit !important; }

/* ---- Forms --------------------------------------------------------------------------------- */
.form-control, .form-select, .input-group-text { background-color: var(--fx-surface-2); border: 1px solid var(--fx-line); color: var(--fx-ink); border-radius: var(--fx-r-sm); }
.form-control::placeholder { color: var(--fx-muted); opacity: .7; }
.form-control:focus, .form-select:focus { background-color: var(--fx-surface-2); color: var(--fx-ink); border-color: var(--fx-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fx-accent) 20%, transparent); }
[data-bs-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238fa3c0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { opacity: .65; }
.form-label { font-size: .78rem; font-weight: 700; color: var(--fx-muted); }
.form-check-input:checked { background-color: var(--fx-accent); border-color: var(--fx-accent); }
.text-danger, .field-validation-error { color: var(--fx-crit) !important; }
.input-validation-error { border-color: var(--fx-crit) !important; }

/* ---- Tables / DataTables ------------------------------------------------------------------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--fx-ink); --bs-table-border-color: var(--fx-line); --bs-table-hover-bg: var(--fx-accent-soft); --bs-table-hover-color: var(--fx-ink); }
.table > thead > tr > th { font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--fx-muted); background: var(--fx-surface-2) !important; border-bottom: 1px solid var(--fx-line) !important; white-space: nowrap; }
.table > tbody > tr > td { vertical-align: middle; }
.table-bordered { border-color: var(--fx-line); border-collapse: separate; border-spacing: 0; border-radius: var(--fx-r); overflow: hidden; }
table.text-primary { color: var(--fx-ink) !important; }
.dataTables_wrapper, .dt-container { color: var(--fx-ink); }
.dataTables_wrapper .dataTables_filter input, .dt-container .dt-search input, .dt-container .dt-length select { background: var(--fx-surface-2); color: var(--fx-ink); border: 1px solid var(--fx-line); border-radius: 10px; padding: .35rem .7rem; }
.dataTables_wrapper .dataTables_info, .dt-container .dt-info, .dataTables_wrapper .dataTables_length { color: var(--fx-muted); font-size: .82rem; }
.page-link { background: var(--fx-surface); border-color: var(--fx-line); color: var(--fx-ink); }
.page-link:hover { background: var(--fx-surface-2); color: var(--fx-ink); }
.page-item.active .page-link { background: var(--fx-accent); border-color: var(--fx-accent); color: var(--fx-accent-ink); }
.page-item.disabled .page-link { background: transparent; color: var(--fx-muted); }
table.dataTable tbody tr { background: transparent !important; }

/* ---- Overlays ------------------------------------------------------------------------------ */
.dropdown-menu { --bs-dropdown-bg: var(--fx-surface); --bs-dropdown-border-color: var(--fx-line); --bs-dropdown-link-color: var(--fx-ink); --bs-dropdown-link-hover-bg: var(--fx-surface-2); --bs-dropdown-link-hover-color: var(--fx-ink);
    --bs-dropdown-link-active-bg: var(--fx-accent-soft); --bs-dropdown-link-active-color: var(--fx-ink); --bs-dropdown-divider-bg: var(--fx-line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .8rem; font-size: .9rem; color: var(--fx-ink); }
.modal-content { background: var(--fx-surface); color: var(--fx-ink); border: 1px solid var(--fx-line); border-radius: 20px; }
.modal-header, .modal-footer { border-color: var(--fx-line); }
.modal-title { font-weight: 800; }
.modal-backdrop.show { opacity: .6; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
#toast-container > div { border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: .98; }
.toast-success { background-color: #0f8a57 !important; } .toast-error { background-color: #c8323a !important; } .toast-info { background-color: #1d4278 !important; } .toast-warning { background-color: #b87400 !important; }
.selectize-input, .selectize-dropdown { background: var(--fx-surface-2) !important; color: var(--fx-ink) !important; border: 1px solid var(--fx-line) !important; border-radius: var(--fx-r-sm) !important; box-shadow: none !important; }
.selectize-dropdown .active { background: var(--fx-accent-soft) !important; color: var(--fx-ink) !important; }
.selectize-input > input { color: var(--fx-ink) !important; }
.datepicker table tr td, .datepicker table tr th { border-radius: 8px; color: var(--fx-ink); }
.datepicker table tr td.active, .datepicker table tr td.active:hover { background: var(--fx-accent) !important; color: var(--fx-accent-ink) !important; text-shadow: none; }
.datepicker table tr td.day:hover, .datepicker table tr th:hover { background: var(--fx-surface-2) !important; }
.alert { border-radius: var(--fx-r-sm); border-color: var(--fx-line); background: var(--fx-surface); color: var(--fx-ink); }
.badge { border-radius: 8px; }
#loadingDiv { position: fixed !important; inset: 0; width: 100%; height: 100%; z-index: 10000000; background: color-mix(in srgb, var(--fx-bg) 70%, transparent) !important; opacity: 1 !important; background-image: none !important; backdrop-filter: blur(4px); }
#loadingDiv::before { content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 4px solid var(--fx-line); border-top-color: var(--fx-accent); animation: fx-spin .9s linear infinite; }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.back-to-top { position: fixed; right: 20px; bottom: 20px; width: 42px; height: 42px; border-radius: 12px; background: var(--fx-accent); color: var(--fx-accent-ink) !important; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* ---- Auth screens -------------------------------------------------------------------------- */
.fx-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.fx-authhero { position: relative; padding: clamp(2rem, 6vw, 4.5rem); display: flex; flex-direction: column; justify-content: space-between; background: var(--fx-hero); color: #fff; overflow: hidden; }
.fx-authhero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 340px; height: 340px; opacity: .1; border-radius: 40px; background: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 18px); }
.fx-authhero h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.08; font-weight: 800; max-width: 13ch; }
.fx-authhero p { color: rgba(255,255,255,.75); max-width: 44ch; font-size: 1.02rem; }
.fx-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.fx-chip { font-size: .78rem; font-weight: 600; padding: .45rem .85rem; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; }
.fx-chip i, .fx-chip svg { margin-right: .4rem; }
.fx-login-wrap { display: grid; place-items: center; padding: 2rem 1.25rem; }
.fx-login-card { width: 100%; max-width: 440px; padding: 2rem; border-radius: 24px; background: var(--fx-surface); border: 1px solid var(--fx-line); box-shadow: 0 20px 50px rgba(0,0,0,.18); animation: fx-rise .45s ease both; }
.fx-modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.fx-module-tile input { position: absolute; opacity: 0; pointer-events: none; }
.fx-module-tile span { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; padding: .85rem .4rem; border-radius: 14px; border: 1px solid var(--fx-line); background: var(--fx-surface-2); cursor: pointer; font-size: .76rem; font-weight: 700; color: var(--fx-muted); transition: all .15s; }
.fx-module-tile span:hover { color: var(--fx-ink); }
.fx-module-tile input:checked + span { color: var(--fx-accent); border-color: var(--fx-accent); background: var(--fx-accent-soft); }
.fx-module-tile input:focus-visible + span { outline: 2px solid var(--fx-accent); outline-offset: 2px; }
.fx-center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.fx-center .fx-login-card { text-align: center; }
.fx-lock { font-size: 2.2rem; color: var(--fx-accent); }
@media (max-width: 900px) { .fx-auth { grid-template-columns: 1fr; } .fx-authhero { display: none; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
@media print {
    .fx-side, .fx-top, .back-to-top, .no-print { display: none !important; }
    .fx-shell { display: block; } body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
}
.actionColumn { font-size: 15px; }
.module-name { font-size: 18px }
.no-decoration-a { color: var(--bs-primary) }