/* Shared palette: Mini Bank is the default for every application module. */
:root, html[data-theme] {
    color-scheme: light;
    --theme-primary: #3456cf;
    --theme-primary-rgb: 52,86,207;
    --theme-primary-hover: #2542ad;
    --theme-accent: #137e7b;
    --theme-accent-dark: #125c65;
    --theme-sidebar-start: #152d52;
    --theme-sidebar-end: #11676a;
    --theme-hero-start: #293a93;
    --theme-hero-mid: #3d58ca;
    --theme-hero-end: #217d9c;
    --theme-bg: #f0f5fb;
    --theme-soft: #edf2ff;
    --theme-soft-alt: #eee9ff;
    --theme-soft-accent: #e2f6f1;
    --theme-alt-ink: #5a3e92;
    --theme-accent-ink: #115f4e;
    --theme-border: #dce5f1;
    --theme-ink: #20304f;
    --theme-muted: #586b83;
    --theme-table-head: #f1f5fb;
    --theme-focus: #0284c7;
    --theme-surface: #fff;
    --theme-radius: 20px;
    --theme-shadow: 0 5px 24px #183f6510;
    --navy: var(--theme-sidebar-start);
    --blue: var(--theme-primary);
    --sky: var(--theme-soft);
    --line: var(--theme-border);
    --muted: var(--theme-muted);
    --primary: var(--theme-primary);
    --ink: var(--theme-ink);
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: var(--theme-primary-rgb);
    --bs-link-color: var(--theme-primary);
    --bs-link-color-rgb: var(--theme-primary-rgb);
    --bs-link-hover-color: var(--theme-primary-hover);
    --bs-link-hover-color-rgb: var(--theme-primary-rgb);
    --bs-border-color: var(--theme-border);
    --bs-body-color: var(--theme-ink);
}
html[data-theme="emerald"] {
    --theme-primary:#15734f; --theme-primary-rgb:21,115,79; --theme-primary-hover:#0c573a;
    --theme-accent:#217d70; --theme-accent-dark:#165b50;
    --theme-sidebar-start:#123e31; --theme-sidebar-end:#236854;
    --theme-hero-start:#13543b; --theme-hero-mid:#187553; --theme-hero-end:#247f7a;
    --theme-bg:#f0f7f3; --theme-soft:#e5f4ec; --theme-soft-alt:#edf3dd; --theme-soft-accent:#e1f3ee;
    --theme-alt-ink:#486129; --theme-accent-ink:#17594c; --theme-border:#d4e5dc;
    --theme-ink:#203d32; --theme-muted:#536e61; --theme-table-head:#edf5f0; --theme-focus:#147a60;
}
html[data-theme="ocean"] {
    --theme-primary:#126b9d; --theme-primary-rgb:18,107,157; --theme-primary-hover:#0b527d;
    --theme-accent:#117e89; --theme-accent-dark:#145c68;
    --theme-sidebar-start:#12334e; --theme-sidebar-end:#16637c;
    --theme-hero-start:#164e79; --theme-hero-mid:#176e9e; --theme-hero-end:#16818e;
    --theme-bg:#eff7fb; --theme-soft:#e1f2fb; --theme-soft-alt:#e4ecfc; --theme-soft-accent:#dff5f4;
    --theme-alt-ink:#375891; --theme-accent-ink:#16616a; --theme-border:#d2e5ee;
    --theme-ink:#203d50; --theme-muted:#526d7e; --theme-table-head:#edf5fa; --theme-focus:#087aab;
}
html[data-theme="violet"] {
    --theme-primary:#7243bb; --theme-primary-rgb:114,67,187; --theme-primary-hover:#593093;
    --theme-accent:#5555ad; --theme-accent-dark:#3f438c;
    --theme-sidebar-start:#302048; --theme-sidebar-end:#4c4185;
    --theme-hero-start:#512a81; --theme-hero-mid:#7449b6; --theme-hero-end:#5268ac;
    --theme-bg:#f5f2fb; --theme-soft:#eee7fb; --theme-soft-alt:#f8e8f3; --theme-soft-accent:#e9edfc;
    --theme-alt-ink:#8b4276; --theme-accent-ink:#454e8f; --theme-border:#e2d9ef;
    --theme-ink:#392d4c; --theme-muted:#6b5d7e; --theme-table-head:#f3eef9; --theme-focus:#8150c1;
}
html[data-theme="sunset"] {
    --theme-primary:#aa4b28; --theme-primary-rgb:170,75,40; --theme-primary-hover:#84371c;
    --theme-accent:#92631f; --theme-accent-dark:#775019;
    --theme-sidebar-start:#492d26; --theme-sidebar-end:#7d4f2b;
    --theme-hero-start:#7b3426; --theme-hero-mid:#ad512e; --theme-hero-end:#976a28;
    --theme-bg:#fbf5ef; --theme-soft:#fbeade; --theme-soft-alt:#f9e4e8; --theme-soft-accent:#fff1df;
    --theme-alt-ink:#8b4357; --theme-accent-ink:#7a561f; --theme-border:#ecddd0;
    --theme-ink:#483329; --theme-muted:#796456; --theme-table-head:#faf1e9; --theme-focus:#b05129;
}

body.theme-app { background:var(--theme-bg); color:var(--theme-ink); }
.theme-app .sidebar, .theme-app .offcanvas { background:linear-gradient(165deg,var(--theme-sidebar-start),var(--theme-sidebar-end)); }
.theme-app .topbar { background:var(--theme-surface); border-color:var(--theme-border); gap:.7rem; }
.theme-app .menu-caption { color:#c2e4ee; }
.theme-app .side-link { color:#e0e8f4; }
.theme-app .side-link:hover, .theme-app .side-link.active { background:#ffffff20; color:#fff; }
.theme-app .side-link.active { box-shadow:inset 3px 0 0 #ffffffa6; }
.theme-app .panel, .theme-app .card-app, .theme-app .stat-card, .theme-app .recap-card { border-color:var(--theme-border); border-radius:var(--theme-radius); background:var(--theme-surface); box-shadow:var(--theme-shadow); }
.theme-app .panel { height:auto; }
.theme-app .row > :nth-child(4n+1) > .stat-card { background:linear-gradient(120deg,var(--theme-soft-accent),var(--theme-surface)); }
.theme-app .row > :nth-child(4n+2) > .stat-card { background:linear-gradient(120deg,var(--theme-soft-alt),var(--theme-surface)); }
.theme-app .row > :nth-child(4n+3) > .stat-card { background:linear-gradient(120deg,var(--theme-soft),var(--theme-surface)); }
.theme-app .row > :nth-child(4n) > .stat-card { background:linear-gradient(120deg,var(--theme-table-head),var(--theme-surface)); }
.theme-app .stat-card .stat-icon { background:var(--theme-soft)!important; color:var(--theme-primary)!important; }
.theme-app .card.bg-primary { background:linear-gradient(115deg,var(--theme-hero-start),var(--theme-hero-mid),var(--theme-hero-end))!important; border-color:transparent; }
.theme-app .content h1, .theme-app .content h2 { color:inherit; font-weight:800; letter-spacing:-.035em; }
.theme-app .content :is(.welcome,.bank-hero,.inv-hero,.recap-hero), .theme-app .brand-panel { background:linear-gradient(115deg,var(--theme-hero-start),var(--theme-hero-mid) 55%,var(--theme-hero-end)); color:#fff; border-radius:24px; }
.theme-app .brand-panel { border-radius:0; }
.theme-app .content :is(.welcome,.bank-hero,.inv-hero,.recap-hero) p { color:#edf4ff; }
.theme-app .welcome { padding:2rem; }
.theme-app .inv-hero-icon { color:#dbeefa; }
.theme-app .inventory-app { --inv-ink:var(--theme-ink); --inv-teal:var(--theme-accent); }
.theme-app .psb-recap { --recap-accent:var(--theme-accent); }
.theme-app .btn { border-radius:11px; font-weight:600; }
html[data-theme] .theme-app .btn-primary {
    --bs-btn-bg:var(--theme-primary); --bs-btn-border-color:var(--theme-primary);
    --bs-btn-hover-bg:var(--theme-primary-hover); --bs-btn-hover-border-color:var(--theme-primary-hover);
    --bs-btn-active-bg:var(--theme-primary-hover); --bs-btn-active-border-color:var(--theme-primary-hover);
    --bs-btn-disabled-bg:var(--theme-primary); --bs-btn-disabled-border-color:var(--theme-primary);
    --bs-btn-focus-shadow-rgb:var(--theme-primary-rgb);
    background:var(--theme-primary); border-color:var(--theme-primary); color:#fff;
}
html[data-theme] .theme-app .btn-primary:hover, html[data-theme] .theme-app .btn-primary:active { background:var(--theme-primary-hover); border-color:var(--theme-primary-hover); }
.theme-app .btn-outline-primary { --bs-btn-color:var(--theme-primary); --bs-btn-border-color:var(--theme-primary); --bs-btn-hover-bg:var(--theme-primary); --bs-btn-hover-border-color:var(--theme-primary); --bs-btn-active-bg:var(--theme-primary); --bs-btn-active-border-color:var(--theme-primary); --bs-btn-disabled-color:var(--theme-primary); --bs-btn-disabled-border-color:var(--theme-primary); --bs-btn-focus-shadow-rgb:var(--theme-primary-rgb); }
.theme-app :is(.form-control,.form-select) { border-color:var(--theme-border); border-radius:11px; background-color:#fcfdff; color:var(--theme-ink); }
.theme-app :is(.form-control,.form-select):focus { border-color:var(--theme-primary); box-shadow:0 0 0 .2rem rgba(var(--theme-primary-rgb),.14); }
.theme-app .form-check-input:checked { background-color:var(--theme-primary); border-color:var(--theme-primary); }
.theme-app .form-control:disabled, .theme-app .form-select:disabled { background-color:var(--theme-table-head); }
.theme-app label { color:var(--theme-ink); }
.theme-app .nav-pills { --bs-nav-pills-link-active-bg:var(--theme-primary); }
.theme-app .nav-tabs { --bs-nav-tabs-border-color:var(--theme-border); --bs-nav-tabs-link-active-color:var(--theme-primary); }
.theme-app .pagination { --bs-pagination-color:var(--theme-primary); --bs-pagination-active-bg:var(--theme-primary); --bs-pagination-active-border-color:var(--theme-primary); --bs-pagination-hover-color:var(--theme-primary-hover); --bs-pagination-focus-color:var(--theme-primary); }
.theme-app .dropdown-menu { --bs-dropdown-link-active-bg:var(--theme-primary); }
.theme-app .table { --bs-table-border-color:var(--theme-border); --bs-table-color:var(--theme-ink); --bs-table-striped-bg:var(--theme-table-head); --bs-table-hover-bg:var(--theme-soft); }
.theme-app .table th { background:var(--theme-table-head); color:var(--theme-muted); border-color:var(--theme-border); }
.theme-app .table tbody tr:hover { background:var(--theme-table-head); }

.theme-app :is(.menu-card,.inv-nav a,.bank-shortcuts a) { background:var(--theme-surface); color:var(--theme-ink); border-color:var(--theme-border); border-radius:12px; }
.theme-app :is(.menu-card,.inv-nav a,.bank-shortcuts a):hover, .theme-app .inv-nav a.active { background:var(--theme-soft); border-color:var(--theme-primary); color:var(--theme-primary); }
.theme-app .menu-card i, .theme-app .activity-icon, .theme-app .admin-avatar, .theme-app .recap-icon { background:var(--theme-soft); color:var(--theme-primary); }
.theme-app .bank-stat.balance, .theme-app .inv-stat:nth-child(1) { background:linear-gradient(120deg,var(--theme-soft-accent),var(--theme-surface)); border-color:var(--theme-border); color:var(--theme-accent-ink); }
.theme-app .bank-stat.accounts, .theme-app .inv-stat:nth-child(2) { background:linear-gradient(120deg,var(--theme-soft-alt),var(--theme-surface)); border-color:var(--theme-border); color:var(--theme-alt-ink); }
.theme-app .bank-balance-card { background:linear-gradient(115deg,var(--theme-accent-dark),var(--theme-accent)); color:#fff; }
.theme-app .bank-balance-card small { color:#f0f8fa; }
.theme-app .bank-transfer-panel { background:linear-gradient(135deg,var(--theme-soft-alt),var(--theme-surface) 65%); border-top-color:var(--theme-primary); }
.theme-app .inv-note { background:var(--theme-soft); color:var(--theme-ink); }
.theme-app .inv-audit pre { background:var(--theme-table-head); color:var(--theme-ink); }
.theme-app .recap-fill, .theme-app .recap-bar { background:linear-gradient(110deg,var(--theme-accent-dark),var(--theme-accent)); }
.theme-app .eyebrow { color:var(--theme-primary); }
.theme-app .form-title { color:var(--theme-ink); }
.theme-app.theme-public > nav { background:linear-gradient(115deg,var(--theme-sidebar-start),var(--theme-sidebar-end)); }
.theme-app.theme-public > nav a { color:#fff; }
.theme-public-tools { display:flex; justify-content:flex-end; padding:1rem 1rem 0; max-width:1200px; margin:auto; }
.theme-login-tools { display:flex; justify-content:flex-end; margin-bottom:1.5rem; }
/* Status colors, financial incoming/outgoing, charts and document contents retain their meaning. */
.theme-app :is(a,button,input,select,textarea,summary):focus-visible { outline:3px solid var(--theme-focus); outline-offset:3px; }
.theme-picker { position:relative; flex-shrink:0; color:var(--theme-ink); font-family:inherit; }
.theme-picker summary { display:flex; align-items:center; gap:.45rem; padding:.58rem .75rem; border:1px solid var(--theme-border); border-radius:12px; background:var(--theme-soft); color:var(--theme-primary); cursor:pointer; font-size:.78rem; font-weight:700; list-style:none; min-height:40px; }
.theme-picker summary::-webkit-details-marker { display:none; }
.theme-current-name { font-size:.68rem; font-weight:500; color:var(--theme-muted); }
.theme-picker-panel { position:absolute; right:0; top:calc(100% + .6rem); z-index:1060; width:330px; max-width:calc(100vw - 2rem); padding:1.1rem; background:var(--theme-surface); border:1px solid var(--theme-border); border-radius:18px; box-shadow:0 16px 48px #152d5229; max-height:calc(100dvh - 110px); overflow:auto; }
.theme-picker-panel h2 { font-size:.95rem; font-weight:800; margin:0 0 .35rem; color:var(--theme-ink); letter-spacing:normal; }
.theme-picker-panel p { font-size:.73rem; line-height:1.6; color:var(--theme-muted); margin:0 0 .8rem; }
.theme-options { display:grid; gap:.45rem; }
.theme-option { display:flex; align-items:center; gap:.7rem; width:100%; padding:.75rem .6rem; border:1px solid transparent; border-radius:11px; background:var(--theme-surface); color:var(--theme-ink); text-align:left; cursor:pointer; font-family:inherit; }
.theme-option:hover { background:var(--theme-table-head); }
.theme-option[aria-pressed="true"] { background:var(--theme-soft); border-color:var(--theme-primary); }
.theme-option:disabled { cursor:wait; opacity:.7; }
.theme-swatches { display:flex; flex-shrink:0; }
.theme-swatches span { display:block; width:15px; height:29px; }
.theme-swatches span:first-child { border-radius:7px 0 0 7px; }
.theme-swatches span:last-child { border-radius:0 7px 7px 0; }
.theme-option-copy { display:flex; flex:1; flex-direction:column; gap:.2rem; }
.theme-option-copy strong { font-size:.78rem; }
.theme-option-copy small { font-size:.69rem; color:var(--theme-muted); }
.theme-check { color:var(--theme-primary); font-size:1rem; visibility:hidden; }
.theme-option[aria-pressed="true"] .theme-check { visibility:visible; }
.theme-picker-panel .theme-save-status { margin:.7rem 0 0; min-height:1.2em; color:var(--theme-accent-ink); }
.theme-picker-panel .theme-save-error { color:#ad293b; }
@media(max-width:767.98px) { .theme-current-name { display:none; } .theme-app .welcome { padding:1.5rem; } }
@media(max-width:575.98px) { .theme-app .topbar { padding:.8rem; } .theme-app .topbar .mobile-brand { font-size:.75rem; } .theme-app .topbar .admin-avatar { display:none; } .theme-picker summary { padding:.5rem; } .theme-picker-panel { position:fixed; top:74px; right:1rem; } }
@media(max-width:359.98px) { .theme-app .topbar .mobile-brand { font-size:0; } }
@media(prefers-reduced-motion:reduce) { .theme-app *, .theme-app *::before, .theme-app *::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
@media print {
    .theme-picker, .theme-public-tools, .theme-login-tools { display:none!important; }
    body.theme-app { background:white!important; color:#000!important; }
    .theme-app :is(.panel,.card-app,.stat-card,.recap-card,.bank-stat,.inv-stat,.welcome,.bank-hero,.bank-balance-card,.inv-hero,.recap-hero) { box-shadow:none!important; background:white!important; color:#000!important; }
    .theme-app :is(.welcome,.bank-hero,.bank-balance-card,.inv-hero,.recap-hero) p, .theme-app .bank-balance-card small { color:#333!important; }
    .theme-app .table th { background:#f3f3f3!important; color:#000!important; }
}
