/* ─────────────────────────────────────────────────────────────────
   style.css — Household Expense Manager
   Mobile-first custom overrides on Bootstrap 5
   ───────────────────────────────────────────────────────────────── */

/* ── Base ── */
:root {
    --primary: #1565c0;
    --primary-lt: #e3f2fd;
    --secondary: #263238;
    --success: #2e7d32;
    --danger: #c62828;
    --border-r: 12px;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --font-base: 'Segoe UI', system-ui, -apple-system, sans-serif;
    /* ── Theme CSS variables (Ocean Blue — default) ── */
    --theme-nav-from: #0d47a1;
    --theme-nav-to: #1565c0;
    --theme-primary: #1565c0;
    --theme-primary-lt: #e3f2fd;
    --theme-day-bg: #1565c0;
    --theme-day-text: #ffffff;
    --theme-amount-color: #ffd600;
}

html,
body {
    font-family: var(--font-base);
    font-size: 15px;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Scrollbar slim ── */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cfd8dc;
    border-radius: 4px;
}

/* ── Navbar ── */
#mainNavbar {
    background: linear-gradient(90deg, var(--theme-nav-from) 0%, var(--theme-nav-to) 100%);
    /* viewport-fit=cover lets env() be non-zero on Android & iOS */
    padding-top: max(env(safe-area-inset-top), 36px);
    padding-bottom: 8px;
    padding-left: max(env(safe-area-inset-left), 0px);
    padding-right: max(env(safe-area-inset-right), 0px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    z-index: 1030;
}

#mainNavbar .navbar-brand {
    font-weight: 700;
    letter-spacing: .3px;
    font-size: 1.1rem;
}

/* All icon buttons in the navbar share the same size and alignment */
.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: none;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 8px;
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, .18);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .6);
}

.user-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}

/* ── Main layout ── */
#appBody {
    /* JS in app.html sets this dynamically to match actual navbar height */
    padding-top: 90px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    min-height: 100dvh;
}

.app-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0.75rem 0.75rem;
}

/* ── View toggle (Admin radio bar) ── */
.view-toggle-bar {
    background: #fff;
    border-radius: var(--border-r);
    padding: 6px 8px;
    display: flex;
    gap: 6px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.view-toggle-bar .btn {
    flex: 1;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    transition: all .15s;
}

[data-bs-theme="dark"] .view-toggle-bar {
    background: #1e2a35;
}

/* ── Cards ── */
.card {
    border-radius: var(--border-r) !important;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, .06) !important;
}

.card-header {
    border-radius: var(--border-r) var(--border-r) 0 0 !important;
}

/* ── Expense cards ── */
.expense-card {
    border-left: 4px solid var(--theme-primary) !important;
    transition: transform .12s, box-shadow .12s;
    cursor: default;
}

.expense-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12) !important;
}

/* ── Expense search bar ───────────────────────────────────────── */
#expenseSearchBar .form-control {
    box-shadow: none;
}

#expenseSearchBar .form-control:focus {
    box-shadow: none;
    border-color: var(--bs-primary);
}

#expenseSearchBar .input-group-text {
    border-right: none;
}

/* Highlight matching text in search results */
mark.search-match {
    background: rgba(var(--bs-warning-rgb), .35);
    padding: 0 2px;
    border-radius: 2px;
    color: inherit;
}

.expense-date-header {
    background: var(--theme-day-bg);
    color: var(--theme-day-text);
    font-size: .88rem;
    font-weight: 400;
    padding-top: .35rem;
    padding-bottom: .35rem;
}

.expense-date-header .day-date {
    font-size: var(--font-day-date-sz, 0.88rem);
    font-weight: var(--font-day-date-wt, 400);
    letter-spacing: .3px;
}

.expense-date-header .day-total {
    font-size: var(--font-day-total-sz, 1rem);
    font-weight: 400;
    letter-spacing: .2px;
    color: var(--theme-amount-color);
}

/* Expense card typography — driven by font theme vars */
.exp-title {
    font-size: var(--font-exp-title-sz, 0.90rem);
    font-weight: var(--font-exp-title-wt, 600);
}

.exp-amount {
    font-size: var(--font-exp-amount-sz, 0.95rem) !important;
    font-weight: var(--font-exp-amount-wt, 700) !important;
}

.exp-badge {
    font-size: var(--font-exp-badge-sz, 0.74rem) !important;
}

/* ── Btn icon (small square icon buttons) ── */
.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    font-size: .85rem;
}

.btn-icon:active {
    transform: scale(.93);
}

/* ── Summary cards (admin) ── */
.summary-card {
    border-radius: var(--border-r) !important;
    border: none !important;
    box-shadow: var(--card-shadow);
    text-align: center;
    padding: .9rem .5rem;
}

.summary-card .sc-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.summary-card .sc-label {
    font-size: .72rem;
    color: #607d8b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.summary-card.primary {
    background: #e3f2fd;
}

.summary-card.success {
    background: #e8f5e9;
}

.summary-card.warning {
    background: #fff8e1;
}

.summary-card.info {
    background: #e1f5fe;
}

[data-bs-theme="dark"] .summary-card.primary {
    background: #0d47a1;
}

[data-bs-theme="dark"] .summary-card.success {
    background: #1b5e20;
}

[data-bs-theme="dark"] .summary-card.warning {
    background: #5d4037;
}

[data-bs-theme="dark"] .summary-card.info {
    background: #006064;
}

/* ── Tab bar ── */
.exp-tabs .nav-link {
    font-size: .8rem;
    font-weight: 600;
    padding: .4rem .7rem;
    border-radius: 8px !important;
    color: #546e7a;
}

.exp-tabs .nav-link.active {
    background: var(--primary) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .exp-tabs .nav-link {
    color: #b0bec5;
}

/* ── Chart container ── */
.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

.chart-container canvas {
    max-height: 260px;
}

/* ── Admin filter bar ── */
.filter-card .form-label {
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: #607d8b;
}

.filter-card .form-select,
.filter-card .form-control {
    font-size: .82rem;
    border-radius: 8px;
}

/* ── Expense table (admin) ── */
.admin-table {
    font-size: .82rem;
}

.admin-table thead th {
    background: #f1f5f9;
    font-weight: 700;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .4px;
}

[data-bs-theme="dark"] .admin-table thead th {
    background: #263238;
}

.admin-table tr {
    transition: background .1s;
}

.admin-table tr:hover {
    background: var(--primary-lt);
}

.pagination-bar {
    font-size: .82rem;
}

.pagination-bar .btn {
    padding: .25rem .5rem;
    font-size: .78rem;
}

/* ── LLM Modal ── */
#llmModal .modal-dialog {
    max-width: 640px;
}

#llmOutput {
    font-size: .88rem;
    line-height: 1.65;
    max-height: 55vh;
    overflow-y: auto;
}

#llmOutput h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 1rem;
    color: var(--primary);
}

#llmOutput ul {
    padding-left: 1.2rem;
}

#llmOutput li {
    margin-bottom: .25rem;
}

#llmOutput strong {
    color: #263238;
}

[data-bs-theme="dark"] #llmOutput strong {
    color: #eceff1;
}

/* ── Settings offcanvas ── */
#settingsOffcanvas .offcanvas-header {
    background: linear-gradient(90deg, #0d47a1, #1565c0);
    color: #fff;
}

#settingsOffcanvas .user-row {
    font-size: .85rem;
}

/* ── Toasts ── */
.toast {
    border-radius: 12px !important;
    font-size: .88rem;
}

/* ── Form improvements ── */
.form-control,
.form-select {
    border-radius: 10px !important;
    font-size: .88rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .15);
}

.input-group-text {
    border-radius: 10px 0 0 10px !important;
    font-size: .88rem;
}

.input-group .form-control {
    border-radius: 0 10px 10px 0 !important;
}

/* ── Badges ── */
.badge {
    font-size: .72rem;
}

/* ── Responsive ── */
@media (max-width: 575px) {
    .app-container {
        padding: 0.5rem 0.5rem;
    }

    #appBody {
        padding-top: 58px;
    }

    .sc-value {
        font-size: 1.1rem !important;
    }

    .admin-table {
        font-size: .77rem;
    }

    .chart-container {
        height: 210px;
    }

    .chart-container canvas {
        max-height: 210px;
    }
}

@media (min-width: 768px) {
    .app-container {
        padding: 1rem 1rem;
    }
}

/* ── Date picker overlay ── */
.date-picker-wrap {
    position: relative;
}

.date-picker-wrap input[type="date"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.date-picker-wrap input[type="text"] {
    position: relative;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E") no-repeat right 8px center;
    padding-right: 28px;
    cursor: pointer;
}

/* ── Location autocomplete ── */
.loc-autocomplete {
    position: relative;
}

.loc-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1055;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    max-height: 220px;
    overflow-y: auto;
}

.loc-dropdown.show {
    display: block;
}

.loc-dropdown-item {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    cursor: pointer;
    font-size: .85rem;
    border-bottom: 1px solid #f3f4f6;
    gap: 6px;
}

.loc-dropdown-item:last-child {
    border-bottom: none;
}

.loc-dropdown-item:hover {
    background: #e3f2fd;
}

.loc-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
}

#expLocation {
    text-transform: uppercase;
}

.loc-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 2px 4px;
    color: #bbb;
    cursor: pointer;
    font-size: .75rem;
    border-radius: 4px;
    line-height: 1;
}

.loc-delete:hover {
    color: #c62828;
    background: #fdecea;
}

.loc-dropdown-empty {
    padding: 8px 12px;
    color: #adb5bd;
    font-size: .82rem;
    font-style: italic;
}

[data-bs-theme="dark"] .loc-dropdown {
    background: #1e2a35;
    border-color: rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .loc-dropdown-item {
    border-bottom-color: rgba(255, 255, 255, .06);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .loc-dropdown-item:hover {
    background: #0d47a1;
}

[data-bs-theme="dark"] .loc-delete:hover {
    background: rgba(198, 40, 40, .25);
}

/* ── Category typeahead ───────────────────────────────────────── */
.cat-typeahead {
    position: relative;
}

.cat-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1055;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    max-height: 200px;
    overflow-y: auto;
}

.cat-dropdown.show {
    display: block;
}

.cat-dropdown-item {
    padding: 7px 12px;
    cursor: pointer;
    font-size: .85rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
}

.cat-dropdown-item:last-child {
    border-bottom: none;
}

.cat-dropdown-item:hover,
.cat-dropdown-item.active {
    background: #e3f2fd;
    color: #1565c0;
}

.cat-dropdown-empty {
    padding: 8px 12px;
    color: #adb5bd;
    font-size: .82rem;
    font-style: italic;
}

[data-bs-theme="dark"] .cat-dropdown {
    background: #1e2a35;
    border-color: rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .cat-dropdown-item {
    border-bottom-color: rgba(255, 255, 255, .06);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .cat-dropdown-item:hover,
[data-bs-theme="dark"] .cat-dropdown-item.active {
    background: #0d47a1;
    color: #fff;
}

/* ── User name pill (all-users mode expense cards) ───────────── */
.user-name-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.6;
    color: #fff;
}

/* ── Category icon picker (settings) ─────────────────────────── */
.cat-icon-btn {
    width: 38px;
    height: 38px;
    background: var(--bs-body-bg, #fff);
    border: 1px solid rgba(0, 0, 0, .13);
    border-radius: 8px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s, border-color .12s, background .12s;
    padding: 0;
}

.cat-icon-btn:hover {
    transform: scale(1.12);
    border-color: var(--theme-primary, #1565c0);
    background: var(--theme-primary-lt, #e3f2fd);
}

.cat-icon-btn.selected {
    border-color: var(--theme-primary, #1565c0);
    background: var(--theme-primary-lt, #e3f2fd);
    box-shadow: 0 0 0 2px var(--theme-primary, #1565c0);
}

[data-bs-theme="dark"] .cat-icon-btn {
    background: #1e2a35;
    border-color: rgba(255, 255, 255, .15);
    color: #e0e0e0;
}

[data-bs-theme="dark"] .cat-icon-btn:hover,
[data-bs-theme="dark"] .cat-icon-btn.selected {
    background: #0d47a1;
    border-color: #42a5f5;
}

/* ───────────────────────────────────────────────────────────────
   COLOUR THEMES
   Var reference per theme:
     --theme-nav-from/to   = navbar gradient
     --theme-primary       = button / card-border accent
     --theme-primary-lt    = light tint (hover, badge bg)
     --theme-day-bg        = day-group header background
     --theme-day-text      = day-group header text & amount
─────────────────────────────────────────────────────────────── */
/* 1 — Ocean Blue (default, defined in :root above) */
[data-theme="ocean"] {
    --theme-nav-from: #0d47a1;
    --theme-nav-to: #1565c0;
    --theme-primary: #1565c0;
    --theme-primary-lt: #e3f2fd;
    --theme-day-bg: #1565c0;
    --theme-day-text: #ffffff;
    --theme-amount-color: #ffd600;
    /* shining yellow */
}

/* 2 — Forest Green  • day: dark-green bg / amber text */
[data-theme="forest"] {
    --theme-nav-from: #1b5e20;
    --theme-nav-to: #2e7d32;
    --theme-primary: #2e7d32;
    --theme-primary-lt: #e8f5e9;
    --theme-day-bg: #1b5e20;
    --theme-day-text: #f9a825;
    --theme-amount-color: #ffeb3b;
    /* bright lemon */
}

/* 3 — Royal Purple  • day: deep-purple bg / pale-yellow text */
[data-theme="purple"] {
    --theme-nav-from: #4a148c;
    --theme-nav-to: #7b1fa2;
    --theme-primary: #7b1fa2;
    --theme-primary-lt: #f3e5f5;
    --theme-day-bg: #4a148c;
    --theme-day-text: #ffe082;
    --theme-amount-color: #ffd600;
    /* gold */
}

/* 4 — Sunset Orange • day: burnt-orange bg / cream text */
[data-theme="sunset"] {
    --theme-nav-from: #bf360c;
    --theme-nav-to: #e64a19;
    --theme-primary: #e64a19;
    --theme-primary-lt: #fbe9e7;
    --theme-day-bg: #bf360c;
    --theme-day-text: #fff9c4;
    --theme-amount-color: #ffe57f;
    /* pale amber */
}

/* 5 — Deep Teal     • day: dark-teal bg / pale-teal text */
[data-theme="teal"] {
    --theme-nav-from: #004d40;
    --theme-nav-to: #00796b;
    --theme-primary: #00796b;
    --theme-primary-lt: #e0f2f1;
    --theme-day-bg: #004d40;
    --theme-day-text: #b2dfdb;
    --theme-amount-color: #00e5ff;
    /* electric cyan */
}

/* 6 — Crimson Red   • day: dark-red bg / amber text */
[data-theme="crimson"] {
    --theme-nav-from: #b71c1c;
    --theme-nav-to: #d32f2f;
    --theme-primary: #d32f2f;
    --theme-primary-lt: #ffebee;
    --theme-day-bg: #b71c1c;
    --theme-day-text: #ffe082;
    --theme-amount-color: #ffd600;
    /* gold yellow */
}

/* 7 — Slate Gray    • day: charcoal bg / cyan text */
[data-theme="slate"] {
    --theme-nav-from: #263238;
    --theme-nav-to: #455a64;
    --theme-primary: #455a64;
    --theme-primary-lt: #eceff1;
    --theme-day-bg: #263238;
    --theme-day-text: #80deea;
    --theme-amount-color: #00e5ff;
    /* bright cyan */
}

/* 8 — Deep Indigo   • day: midnight-indigo bg / gold text */
[data-theme="indigo"] {
    --theme-nav-from: #1a237e;
    --theme-nav-to: #303f9f;
    --theme-primary: #303f9f;
    --theme-primary-lt: #e8eaf6;
    --theme-day-bg: #1a237e;
    --theme-day-text: #ffe082;
    --theme-amount-color: #ffd600;
    /* gold */
}

/* 9 — Rose Gold     • day: deep-rose bg / champagne text */
[data-theme="rose"] {
    --theme-nav-from: #880e4f;
    --theme-nav-to: #c2185b;
    --theme-primary: #c2185b;
    --theme-primary-lt: #fce4ec;
    --theme-day-bg: #880e4f;
    --theme-day-text: #fff9c4;
    --theme-amount-color: #ffd600;
    /* gold */
}

/* 10 — Midnight Dark • day: navy bg / electric-cyan text */
[data-theme="midnight"] {
    --theme-nav-from: #0a0a0a;
    --theme-nav-to: #1a1a2e;
    --theme-primary: #7c4dff;
    --theme-primary-lt: #ede7f6;
    --theme-day-bg: #16213e;
    --theme-day-text: #00d4ff;
    --theme-amount-color: #00e5ff;
    /* electric cyan */
}

/* ── Bootstrap primary colour override (picks up active theme) ── */
.btn-primary,
.btn-primary:focus {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-nav-from) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--theme-nav-from) !important;
    border-color: var(--theme-nav-from) !important;
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--theme-primary) !important;
    color: #fff !important;
}

.bg-primary {
    background-color: var(--theme-primary) !important;
}

.text-primary {
    color: var(--theme-primary) !important;
}

.border-primary {
    border-color: var(--theme-primary) !important;
}

/* ── Theme picker panel ── */
.theme-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1059;
    background: rgba(0, 0, 0, .4);
}

.theme-picker-overlay.show {
    display: block;
}

.theme-picker-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 28px rgba(0, 0, 0, .18);
    padding: 1rem 1.25rem 1.75rem;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.theme-picker-panel.show {
    transform: translateY(0);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: .75rem;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
}

.theme-swatch-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border-color .15s, transform .15s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

.theme-swatch.active .theme-swatch-circle {
    border-color: #111;
    transform: scale(1.15);
}

.theme-swatch-circle::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    opacity: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}

.theme-swatch.active .theme-swatch-circle::after {
    opacity: 1;
}

.theme-swatch-name {
    font-size: .62rem;
    color: #555;
    text-align: center;
    line-height: 1.2;
}

[data-bs-theme="dark"] .theme-picker-panel {
    background: #1e2a35;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .theme-swatch-name {
    color: #aaa;
}

[data-bs-theme="dark"] .theme-swatch.active .theme-swatch-circle {
    border-color: #fff;
}

/* ── Dark mode overrides ── */
[data-bs-theme="dark"] .card {
    border-color: rgba(255, 255, 255, .08) !important;
}

[data-bs-theme="dark"] body {
    background-color: #0a1929 !important;
}

/* ── Loading overlay ── */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loader .loader-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}

[data-bs-theme="dark"] .page-loader .loader-box {
    background: #1e2a35;
    color: #fff;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp .25s ease both;
}

.expense-card {
    animation: fadeInUp .2s ease both;
}