/* :::::::::: NAVBAR SEARCH :::::::::: */
.navbar-search-wrap {
    width: 40%;
    max-width: 480px;
}

.search-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-input-wrap .search-input {
    padding-right: 36px;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    z-index: 10;
}

.search-clear-btn:hover {
    color: rgba(0, 0, 0, 0.75);
}

/* :::::::::: PAGE HEADINGS :::::::::: */
h2.content-block {
    font-size: 26px;
    font-weight: normal;
    margin: 0 0 1rem;
}

/* :::::::::: DX CARD (DevExtreme widget container) :::::::::: */
.dx-card {
    box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);
    border-radius: 4px;
    background-color: #fff;
    margin: 2px 2px 3px;
    padding: 16px;
}

.dx-card.wide-card {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    border-right: 0;
    border-left: 0;
}

.responsive-paddings {
    padding: 20px;
}

@media screen and (min-width: 1280px) {
    .responsive-paddings {
        padding: 40px;
    }
}

/* :::::::::: TRANSACTIONS PAGE HEADER / BALANCE BOX :::::::::: */
.page-transactions .main-div {
    padding: 0 !important;
}

.page-reports .main-div,
.page-planning .main-div {
    padding: 0 !important;
    max-width: none !important;
}

/* Fallback: targets the layout directly without relying on the body class */
.main-div:has(> .transactions-layout) {
    padding: 0 !important;
    max-width: none !important;
}

.reports-content {
    overflow-y: auto !important;
    padding: 20px;
}

.reports-content.no-scroll {
    overflow-y: hidden !important;
}

.transactions-page-header {
    padding: 12px 20px 8px;
    margin-bottom: 0;
}

.transactions-page-header .balance-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 260px;
    padding: 10px 16px;
}

.balance-label {
    font-size: 20px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.6);
}

.balance-value {
    font-size: 20px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.87);
}

#transactionsGrid .dx-datagrid-total-footer {
    display: none !important;
}

#transactionsGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#transactionsGrid .dx-datagrid-headers,
#transactionsGrid .dx-datagrid-headers .dx-datagrid-table .dx-row > td,
#transactionsGrid .dx-group-row,
#transactionsGrid .dx-group-row > td {
    background-color: #f0f5f2 !important;
}

#transactionsGrid .dx-command-edit {
    padding-right: 0 !important;
}

#transactionsGrid .dx-row-focused.dx-data-row > td,
#transactionsGrid .dx-row-focused.dx-data-row > td.dx-focused,
#transactionsGrid .dx-selection.dx-row > td,
#transactionsGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#transactionsGrid .dx-datagrid-focus-overlay::after {
    background-color: #1B7436;
}

#transactionsGrid .dx-data-row > .dx-command-expand,
#transactionsGrid .dx-datagrid-headers .dx-command-expand {
    visibility: hidden;
    pointer-events: none;
}

/* :::::::::: ACCOUNTS GRID (Settings page) — mirrors transactions grid :::::::::: */
.transactions-grid-wrapper #accountsGrid {
    height: 100% !important;
}

#accountsGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#accountsGrid .dx-datagrid-headers,
#accountsGrid .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
    background-color: #f0f5f2 !important;
}

#accountsGrid .dx-row-focused.dx-data-row > td,
#accountsGrid .dx-row-focused.dx-data-row > td.dx-focused,
#accountsGrid .dx-selection.dx-row > td,
#accountsGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#accountsGrid .dx-datagrid-focus-overlay::after {
    background-color: #1B7436;
}

/* :::::::::: CATEGORIES GRID (Settings page) — mirrors accounts grid :::::::::: */
.transactions-grid-wrapper #categoriesGrid {
    height: 100% !important;
}

#categoriesGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#categoriesGrid .dx-treelist-headers,
#categoriesGrid .dx-treelist-headers .dx-treelist-table .dx-row > td {
    background-color: #f0f5f2 !important;
}

#categoriesGrid .dx-row-focused.dx-data-row > td,
#categoriesGrid .dx-row-focused.dx-data-row > td.dx-focused,
#categoriesGrid .dx-selection.dx-row > td,
#categoriesGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#categoriesGrid .dx-treelist-focus-overlay::after {
    background-color: #1B7436;
}

/* :::::::::: CATEGORY RULES GRID (Settings page) — mirrors categories grid :::::::::: */
.transactions-grid-wrapper #categoryRulesGrid {
    height: 100% !important;
}

#categoryRulesGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#categoryRulesGrid .dx-datagrid-headers,
#categoryRulesGrid .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
    background-color: #f0f5f2 !important;
}

#categoryRulesGrid .dx-row-focused.dx-data-row > td,
#categoryRulesGrid .dx-row-focused.dx-data-row > td.dx-focused,
#categoryRulesGrid .dx-selection.dx-row > td,
#categoryRulesGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#categoryRulesGrid .dx-datagrid-focus-overlay::after {
    background-color: #1B7436;
}

/* :::::::::: CURRENCY RATES GRID (Settings page) — mirrors accounts grid :::::::::: */
.transactions-grid-wrapper #currencyRatesGrid {
    height: 100% !important;
}

#currencyRatesGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#currencyRatesGrid .dx-datagrid-headers,
#currencyRatesGrid .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
    background-color: #f0f5f2 !important;
}

#currencyRatesGrid .dx-row-focused.dx-data-row > td,
#currencyRatesGrid .dx-row-focused.dx-data-row > td.dx-focused,
#currencyRatesGrid .dx-selection.dx-row > td,
#currencyRatesGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#currencyRatesGrid .dx-datagrid-focus-overlay::after {
    background-color: #1B7436;
}

/* :::::::::: DEPENDENTS GRID (Settings page) — mirrors categories/categoryRules grid :::::::::: */
.transactions-grid-wrapper #dependentsGrid {
    height: 100% !important;
}

#dependentsGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#dependentsGrid .dx-datagrid-headers,
#dependentsGrid .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
    background-color: #f0f5f2 !important;
}

#dependentsGrid .dx-row-focused.dx-data-row > td,
#dependentsGrid .dx-row-focused.dx-data-row > td.dx-focused,
#dependentsGrid .dx-selection.dx-row > td,
#dependentsGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#dependentsGrid .dx-datagrid-focus-overlay::after {
    background-color: #1B7436;
}

/* :::::::::: TRANSACTIONS PAGE - FILTER SIDEBAR :::::::::: */
.transactions-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    height: calc(100vh - 58px);
    overflow: hidden;
}

.transactions-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background-color: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-scroll-area {
    flex: 1 1 0%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
}

.transactions-grid-container {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transactions-grid-wrapper {
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.transactions-grid-wrapper #transactionsGrid {
    height: 100% !important;
}

.account-filter-item {
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    margin: 2px 6px;
    transition: background-color 0.15s;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-filter-item:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.account-filter-item.account-filter-item-active {
    background-color: #1B7436;
    color: #fff;
}

.account-filter-item.account-filter-item-active span.account-owner-label {
    color: rgba(255, 255, 255, 0.65) !important;
}

.account-filter-item.account-filter-item-active:hover {
    background-color: #165d2b;
}

.account-filter-balance {
    font-size: 1.05em;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 8px;
}

.transactions-sidebar .dx-accordion {
    box-shadow: none;
    background: transparent;
}

.transactions-sidebar .dx-accordion .dx-accordion-item {
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.transactions-sidebar .dx-accordion-item-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    color: rgba(0, 0, 0, 0.75);
    min-height: auto;
}

.transactions-sidebar .dx-accordion-item-body {
    padding: 4px 0;
}

.account-filter-list {
    padding: 2px 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    min-height: 46px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 4px;
}

.sidebar-header-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.87);
}

.sidebar-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    color: rgba(0, 0, 0, 0.54);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-header-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.87);
}

/* :::::::::: TRANSACTIONS SIDEBAR - NET WORTH :::::::::: */
.sidebar-net-worth {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin: 6px 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.10);
}

.sidebar-net-worth-label {
    font-size: 13px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.60);
}

.sidebar-net-worth-value {
    font-size: 14px;
    font-weight: 700;
}

/* :::::::::: MAIN CONTENT BACKGROUND :::::::::: */
body {
    background-color: #F0F5F2;
}

.main-div {
    background-color: #F0F5F2;
    min-height: calc(100vh - 58px);
}

/* :::::::::: FULL WIDTH LAYOUT :::::::::: */
@media (min-width: 992px) {
    .main-div {
        max-width: 100%;
    }
}

/* :::::::::: SIDEBAR NAV ICONS :::::::::: */
.sidebar .nav-icon.nav-dashboard {
    background-image: url('../images/theme/dashboard.svg');
}

.sidebar .nav-item.active .nav-icon.nav-dashboard {
    background-image: url('../images/theme/dashboard-active.svg');
}

.sidebar .nav-icon.nav-account {
    background-image: url('../images/theme/account.svg');
}

.sidebar .nav-item.active .nav-icon.nav-account {
    background-image: url('../images/theme/account-active.svg');
}

.sidebar .nav-icon.nav-budget {
    background-image: url('../images/theme/budget.svg');
}

.sidebar .nav-item.active .nav-icon.nav-budget {
    background-image: url('../images/theme/budget-active.svg');
}

.sidebar .nav-icon.nav-planning {
    background-image: url('../images/theme/planning.svg');
}

.sidebar .nav-item.active .nav-icon.nav-planning {
    background-image: url('../images/theme/planning-active.svg');
}

.sidebar .nav-icon.nav-reports {
    background-image: url('../images/theme/reports.svg');
}

.sidebar .nav-item.active .nav-icon.nav-reports {
    background-image: url('../images/theme/reports-active.svg');
}

.sidebar .nav-icon.nav-help {
    background-image: url('../images/theme/help.svg');
}

.sidebar .nav-item.active .nav-icon.nav-help {
    background-image: url('../images/theme/help-active.svg');
}

.sidebar .nav-icon.nav-settings {
    background-image: url('../images/theme/settings.svg');
}

.sidebar .nav-item.active .nav-icon.nav-settings {
    background-image: url('../images/theme/settings-active.svg');
}

.sidebar .nav-icon.nav-investment {
    background-image: url('../images/theme/investment.svg');
}

.sidebar .nav-item.active .nav-icon.nav-investment {
    background-image: url('../images/theme/investment-active.svg');
}

.search-input {
    background-image: url('../images/theme/search-light.svg');
}

/* :::::::::: AUTH PAGES (Login / Register) :::::::::: */
body.login {
    background-image: url('../images/login-bg.min.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* :::::::::: BUDGET PAGE :::::::::: */
#budgetPeriodToggle .btn {
    border-radius: 4px !important;
}

#budgetPeriodToggle .btn:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#budgetPeriodToggle .btn:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

#budgetGrid {
    background-color: #f0f5f2 !important;
    border-top: none !important;
    padding-top: 0 !important;
    box-shadow: none !important;
}

#budgetGrid .dx-datagrid-headers,
#budgetGrid .dx-datagrid-headers .dx-datagrid-table .dx-row > td,
#budgetGrid .dx-group-row,
#budgetGrid .dx-group-row > td {
    background-color: #f0f5f2 !important;
}

#budgetGrid .dx-row-focused.dx-data-row > td,
#budgetGrid .dx-row-focused.dx-data-row > td.dx-focused,
#budgetGrid .dx-selection.dx-row > td,
#budgetGrid .dx-selection.dx-row:hover > td {
    background-color: transparent !important;
}

#budgetGrid .dx-datagrid-focus-overlay::after {
    background-color: #1B7436;
}

.page-budgets .main-div {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 58px);
    overflow: hidden;
}

.budget-page-header {
    flex-shrink: 0;
}

#monthlyDateBox .dx-texteditor-input-container,
#yearlyDateBox .dx-texteditor-input-container {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

#monthlyDateBox .dx-texteditor-input,
#yearlyDateBox .dx-texteditor-input {
    font-size: 1.5rem;
    font-weight: 700;
    background: transparent !important;
    text-align: center;
    min-width: 0;
    flex: 1 1 auto;
}

#monthlyDateBox .dx-texteditor-container,
#yearlyDateBox .dx-texteditor-container {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}

#monthlyDateBox,
#yearlyDateBox,
#monthlyDateBox .dx-texteditor,
#yearlyDateBox .dx-texteditor,
#monthlyDateBox .dx-texteditor.dx-state-hover,
#yearlyDateBox .dx-texteditor.dx-state-hover,
#monthlyDateBox .dx-texteditor.dx-state-focused,
#yearlyDateBox .dx-texteditor.dx-state-focused,
#monthlyDateBox .dx-dropdowneditor,
#yearlyDateBox .dx-dropdowneditor,
#monthlyDateBox .dx-dropdowneditor.dx-state-hover,
#yearlyDateBox .dx-dropdowneditor.dx-state-hover,
#monthlyDateBox .dx-dropdowneditor.dx-state-focused,
#yearlyDateBox .dx-dropdowneditor.dx-state-focused,
#monthlyDateBox .dx-dropdowneditor-button,
#yearlyDateBox .dx-dropdowneditor-button,
#monthlyDateBox .dx-dropdowneditor-button .dx-button-content,
#yearlyDateBox .dx-dropdowneditor-button .dx-button-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

#monthlyDateBox .dx-texteditor::after,
#monthlyDateBox .dx-texteditor::before,
#yearlyDateBox .dx-texteditor::after,
#yearlyDateBox .dx-texteditor::before {
    display: none !important;
}

.budget-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
}

.budget-layout .table-sum {
    flex-shrink: 0;
}

.budget-grid-wrapper {
    flex: 1 1 0%;
    min-height: 0;
}

#monthNavScroll .month-nav-item .btn {
    color: #1B7436;
}

#monthNavScroll .month-nav-item .btn.active {
    color: #fff;
}

/* :::::::::: DASHBOARD :::::::::: */
.dash-page {
    padding: 20px;
    max-width: 1440px;
    margin: 0 auto;
}

.dash-greeting {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.dash-greeting h1 {
    font-size: 22px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.87);
    margin: 0;
}

.dash-greeting-month {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.50);
}

/* 2-column grid: left cards wider, right cards narrower */
.dash-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
}

@media (max-width: 991px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card shell ── */
.dash-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.dash-card-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.87);
    margin-bottom: 2px;
}

.dash-card-subtitle {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.50);
}

.dash-card-body {
    padding: 16px 18px;
    flex: 1;
}

.dash-budget-scroll {
    overflow-y: auto;
    max-height: 300px;
}

/* ── Status chips ── */
.dash-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dash-chip-positive {
    background-color: #E8F5ED;
    color: #1B7436;
}

.dash-chip-negative {
    background-color: #FDECEA;
    color: #d32f2f;
}

.dash-chip-neutral {
    background-color: rgba(0, 0, 0, 0.07);
    color: rgba(0, 0, 0, 0.60);
}

/* ── Investment stats row ── */
.dash-invest-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dash-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(0, 0, 0, 0.50);
    margin-bottom: 2px;
}

.dash-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.87);
    line-height: 1.2;
}

.dash-stat-positive { color: #1B7436; }
.dash-stat-negative { color: #d32f2f; }

/* ── Budget progress bars ── */
.budget-progress-item {
    margin-bottom: 14px;
}

.budget-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.budget-progress-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.87);
}

.budget-progress-amounts {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.54);
    white-space: nowrap;
}

.budget-progress-bar {
    height: 7px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.budget-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.65s cubic-bezier(.4, 0, .2, 1);
}

/* ── Empty / error state ── */
.dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    text-align: center;
    color: rgba(0, 0, 0, 0.38);
}

.dash-empty-icon {
    font-size: 30px;
    margin-bottom: 8px;
    line-height: 1;
}

.dash-empty-text {
    font-size: 13px;
    line-height: 1.5;
}

.dash-empty-text a {
    color: #1B7436;
    text-decoration: underline;
}

/* ── Skeleton loader ── */
.dash-skeleton {
    background: linear-gradient(90deg, #ebebeb 25%, #d9d9d9 50%, #ebebeb 75%);
    background-size: 200% 100%;
    animation: dashSkeletonWave 1.4s infinite;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 10px;
}

@keyframes dashSkeletonWave {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* :::::::::: CUSTOMIZE PANEL :::::::::: */
.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dash-customize-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border: 1.5px solid #1B7436;
    border-radius: 6px;
    background: #fff;
    color: #1B7436;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.dash-customize-btn:hover {
    background: #1B7436;
    color: #fff;
}

/* ── Overlay backdrop ── */
.dash-customize-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
}

.dash-customize-overlay.open {
    display: block;
}

/* ── Slide-in drawer ── */
.dash-customize-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.28s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}

.dash-customize-drawer.open {
    right: 0;
}

.dash-customize-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.dash-customize-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.87);
}

.dash-customize-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.54);
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
}

.dash-customize-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.dash-customize-hint {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    padding: 10px 20px 4px;
    margin: 0;
    flex-shrink: 0;
}

.dash-customize-list {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

/* ── Panel list items (draggable inside the drawer only) ── */
.dash-customize-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    cursor: grab;
    user-select: none;
    transition: background 0.12s;
    margin-bottom: 2px;
}

.dash-customize-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.dash-customize-item.dragging {
    opacity: 0.45;
}

.dash-customize-handle {
    color: rgba(0, 0, 0, 0.30);
    flex-shrink: 0;
    line-height: 0;
}

.dash-customize-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

/* ── Green Save / primary-action buttons ───────────────────────────── */
.dx-button-mode-contained.dx-button-success,
.dx-popup-bottom .dx-button-mode-contained.dx-button-default {
    background-color: #1B7436 !important;
    border-color: #1B7436 !important;
    color: #fff !important;
}

.dx-button-mode-contained.dx-button-success:hover,
.dx-popup-bottom .dx-button-mode-contained.dx-button-default.dx-state-hover {
    background-color: #165d2b !important;
    border-color: #165d2b !important;
}

/* ── Toggle switch ── */
.dash-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.dash-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dash-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 20px;
    transition: background 0.2s;
    cursor: pointer;
}

.dash-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.dash-toggle input:checked + .dash-toggle-slider {
    background: #1B7436;
}

.dash-toggle input:checked + .dash-toggle-slider::before {
    transform: translateX(16px);
}

.dash-customize-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.dash-customize-reset {
    background: none;
    border: 1.5px solid rgba(0, 0, 0, 0.20);
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.60);
    cursor: pointer;
    width: 100%;
    transition: border-color 0.15s, color 0.15s;
}

.dash-customize-reset:hover {
    border-color: #1B7436;
    color: #1B7436;
}

/* ── Market Snapshot widget ── */
.dash-market-body {
    max-height: 320px;
}

.dash-market-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: rgba(0, 0, 0, 0.45);
    padding: 10px 18px 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dash-market-section:first-child {
    border-top: none;
    padding-top: 12px;
}

.dash-market-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dash-market-row:last-child {
    border-bottom: none;
    padding-bottom: 12px;
}

.dash-market-pair {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.80);
    flex: 0 0 auto;
    min-width: 120px;
}

.dash-market-symbol {
    font-size: 13px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.87);
    flex: 0 0 auto;
    min-width: 56px;
}

.dash-market-name {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-market-price {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.87);
    flex: 0 0 auto;
    text-align: right;
    min-width: 72px;
}

.dash-market-gl {
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
    min-width: 48px;
    text-align: right;
}

.dash-market-date {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.35);
    flex: 0 0 auto;
    text-align: right;
    min-width: 72px;
}

.dx-texteditor.dx-editor-outlined::before {
    border-bottom-color: #1B7436 !important;
}

/* -- Category picker dropdown (shared) ------------------------------------ */
.category-treelist-compact .dx-treelist-rowsview .dx-row > td {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    line-height: 1.4;
    font-size: 0.92em;
}

.category-treelist-compact .dx-treelist-rowsview .dx-row {
    height: auto !important;
}

.category-treelist-compact .dx-toolbar {
    padding: 4px 8px !important;
    background: transparent !important;
}

.category-treelist-compact .dx-toolbar-items-container {
    width: 100% !important;
}

.category-treelist-compact .dx-toolbar-after {
    width: 100% !important;
    position: static !important;
}

.category-treelist-compact .dx-toolbar-item {
    max-width: 100% !important;
    width: 100% !important;
}

.category-treelist-compact .dx-treelist-header-panel {
    overflow: hidden;
}

.category-treelist-compact .dx-searchbox,
.category-treelist-compact .dx-treelist-search-panel {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.cat-picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.cat-picker-footer-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ══════════════════════════════════════════════════════════════════════════
   NEW DASHBOARD WIDGETS
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Shared: full-width spanning card ── */
.dash-card-full {
    grid-column: 1 / -1;
}

/* ── Account Balances widget ── */
.dash-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.dash-account-tile {
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s;
}

.dash-account-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.dash-account-type-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 2px 7px;
    border-radius: 100px;
    display: inline-block;
    width: fit-content;
}

.dash-account-type-checking    { background: #E3F2FD; color: #1565C0; }
.dash-account-type-savings      { background: #E8F5ED; color: #1B7436; }
.dash-account-type-credit-card  { background: #FFF3E0; color: #E65100; }
.dash-account-type-cash         { background: #F3E5F5; color: #6A1B9A; }
.dash-account-type-investment   { background: #E0F2F1; color: #00695C; }
.dash-account-type-loan         { background: #FDECEA; color: #B71C1C; }

.dash-account-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.80);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.dash-account-balance {
    font-size: 17px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.87);
    line-height: 1.2;
}

.dash-account-balance-neg { color: #d32f2f; }

/* ── Recent Transactions widget ── */
.dash-tx-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dash-tx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dash-tx-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-tx-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.05);
}

.dash-tx-icon-income  { background: #E8F5ED; }
.dash-tx-icon-expense { background: #FDECEA; }

.dash-tx-info {
    flex: 1;
    min-width: 0;
}

.dash-tx-payee {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.87);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-tx-meta {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-tx-amount {
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

.dash-tx-amount-pos { color: #1B7436; }
.dash-tx-amount-neg { color: #d32f2f; }

/* ── Top Spending Categories widget ── */
.dash-cat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-cat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.dash-cat-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.80);
}

.dash-cat-amounts {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.50);
    white-space: nowrap;
}

.dash-cat-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 3px;
    overflow: hidden;
}

.dash-cat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.65s cubic-bezier(.4, 0, .2, 1);
}

/* ── Savings Rate widget ── */
.dash-savings-kpi {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 6px;
}

.dash-savings-rate-big {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    color: rgba(0, 0, 0, 0.87);
}

.dash-savings-rate-label {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    padding-bottom: 6px;
}

/* ── Debt Summary widget ── */
.dash-debt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-debt-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.dash-debt-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.80);
}

.dash-debt-owed {
    font-size: 13px;
    font-weight: 700;
    color: #d32f2f;
}

.dash-debt-util-bar {
    height: 7px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 3px;
    overflow: hidden;
}

.dash-debt-util-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.65s cubic-bezier(.4, 0, .2, 1);
}

.dash-debt-util-low  { background: #1B7436; }
.dash-debt-util-mid  { background: #F6AE2D; }
.dash-debt-util-high { background: #d32f2f; }

.dash-debt-util-label {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.40);
    margin-top: 2px;
    text-align: right;
}

/* ── Income vs Expenses KPI strip ── */
.dash-income-kpis {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.dash-income-kpi {
    display: flex;
    flex-direction: column;
}

.dash-income-kpi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 2px;
}

.dash-income-kpi-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

/* :::::::::: SAVINGS GOALS PAGE :::::::::: */

/* ── Nav icon ── */
.nav-goals { background-image: url('/images/theme/planning.svg'); }
.nav-item.active .nav-goals { background-image: url('/images/theme/planning-active.svg'); }

/* ── Summary stat chips ── */
.goal-stat-chip {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    min-width: 110px;
}
.goal-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0,0,0,0.45);
    margin-bottom: 2px;
}
.goal-stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}
.goal-stat-green { color: #1B7436; }

/* ── Goal cards ── */
.goal-card {
    flex: 1 1 300px;
    max-width: 420px;
    padding: 16px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.15s;
}
.goal-card:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.goal-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.goal-card-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.goal-card-info {
    flex: 1;
    min-width: 0;
}
.goal-card-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.goal-card-desc {
    font-size: 12px;
    color: rgba(0,0,0,0.54);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.goal-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.btn-goal-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    transition: background 0.12s;
}
.btn-goal-action:hover { background: rgba(0,0,0,.07); }
.btn-goal-contribute {
    font-size: 11px;
    font-weight: 700;
    color: #1B7436;
    border: 1px solid #1B7436 !important;
    padding: 2px 8px !important;
}
.btn-goal-contribute:hover { background: rgba(27,116,54,.08) !important; }

/* ── Amounts row ── */
.goal-card-amounts {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-size: 13px;
}
.goal-amount-saved  { font-size: 18px; font-weight: 700; color: #1B7436; }
.goal-amount-sep    { color: rgba(0,0,0,0.35); font-size: 14px; }
.goal-amount-target { color: rgba(0,0,0,0.54); }
.goal-amount-pct    { margin-left: auto; font-weight: 700; font-size: 14px; }

/* ── Progress bar ── */
.goal-progress-track {
    height: 7px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
}
.goal-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ── Date / monthly hints ── */
.goal-card-date   { font-size: 11px; color: #666; }
.goal-card-monthly { font-size: 11px; color: rgba(0,0,0,0.45); font-style: italic; }

/* ── Status badges ── */
.goal-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
}
.goal-badge-done   { background: #E8F5E9; color: #1B7436; }
.goal-badge-paused { background: #FFF3E0; color: #E65100; }

/* ── Icon picker ── */
.goal-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.goal-icon-btn {
    background: rgba(0,0,0,0.04);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 20px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    padding: 0;
}
.goal-icon-btn:hover  { background: rgba(0,0,0,0.08); }
.goal-icon-btn.selected {
    border-color: #1B7436;
    background: rgba(27,116,54,.1);
}

/* :::::::::: BILLS & SUBSCRIPTIONS PAGE :::::::::: */

/* ── Nav icon ── */
.nav-bills { background-image: url('/images/theme/calendar-day-regular.svg'); }
.nav-item.active .nav-bills { background-image: url('/images/theme/calendar.svg'); }

/* ── Bill row (upcoming panel) ── */
.bill-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.10);
    transition: box-shadow 0.14s;
}
.bill-row:hover { box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.bill-row-paid    { opacity: 0.55; }
.bill-row-overdue { border-left: 3px solid #F44336; }

.bill-row-icon {
    font-size: 26px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.bill-row-info    { flex: 1; min-width: 0; }
.bill-row-name    { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-row-meta    { font-size: 12px; margin-top: 2px; }
.bill-row-amount  { font-size: 16px; font-weight: 700; flex-shrink: 0; }
.bill-row-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Bill badges ── */
.bill-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
}
.bill-badge-auto { background: #E3F2FD; color: #1565C0; }
.bill-badge-paid { background: #E8F5E9; color: #1B7436; }

/* ── Pay button (bill row) ── */
.btn-bill-pay {
    font-size: 11px;
    font-weight: 700;
    color: #1B7436;
    border: 1px solid #1B7436 !important;
    padding: 2px 8px !important;
    border-radius: 4px;
}
.btn-bill-pay:hover { background: rgba(27,116,54,.08) !important; }

/* :::::::::: DASHBOARD — GOALS WIDGET :::::::::: */
.dash-goals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dash-goal-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dash-goal-info {
    flex: 1;
    min-width: 0;
}
.dash-goal-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.dash-goal-bar-wrap {
    height: 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.dash-goal-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.dash-goal-amounts {
    flex-shrink: 0;
    text-align: right;
    font-size: 12px;
}

/* :::::::::: DASHBOARD — FINANCIAL HEALTH SCORE WIDGET :::::::::: */
.dash-health-score {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.dash-health-grade {
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
}
.dash-health-score-num {
    font-size: 15px;
    font-weight: 700;
    color: rgba(0,0,0,0.45);
    margin-left: 4px;
}
.dash-health-dims {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.dash-health-dim {}
.dash-health-dim-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}
.dash-health-dim-name  { font-size: 11px; font-weight: 600; }
.dash-health-dim-score { font-size: 11px; font-weight: 700; }
.dash-health-dim-bar {
    height: 5px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.dash-health-dim-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.dash-health-dim-tip {
    font-size: 10px;
    color: rgba(0,0,0,0.45);
    margin-top: 2px;
    font-style: italic;
}

/* :::::::::: PLANNING — HEALTH SCORE DIMENSION BARS :::::::::: */
.health-dim-track {
    height: 8px;
    background: rgba(0,0,0,0.08);
    border-radius: 5px;
    overflow: hidden;
}
.health-dim-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* =====================================================================
   AI FINANCIAL ADVISOR CHAT
   ===================================================================== */

/* Remove main-div padding so the chat fills the full content area */
.page-aichat .main-div {
    padding: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
}
/* Fallback via :has() — works even without body class */
.main-div:has(> .aichat-layout) {
    padding: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
}

/* ── AI Advisor top-bar button ── */
.ai-advisor-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 8px;
    padding: 6px 14px 6px 10px;
    border-radius: 20px;
    background: #fff;
    border: 2px solid #fff;
    color: #1B7436;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
    white-space: nowrap;
}
.ai-advisor-btn svg {
    flex-shrink: 0;
    color: #1B7436;
    filter: none;
}
.ai-advisor-btn:hover {
    background: #d4edda;
    border-color: #d4edda;
    color: #145228;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
    text-decoration: none;
}
.ai-advisor-btn:hover svg {
    color: #145228;
}
.ai-advisor-btn-active {
    background: #99D800 !important;
    border-color: #99D800 !important;
    color: #1B7436 !important;
}
.ai-advisor-btn-active svg {
    filter: none;
    color: #1B7436;
}
/* Hide label on small screens, keep icon only */
@media (max-width: 767px) {
    .ai-advisor-btn-label { display: none; }
    .ai-advisor-btn { padding: 6px 9px; border-radius: 50%; }
}

/* ── Layout ── */
.aichat-layout {
    display: flex;
    height: calc(100vh - 58px);
    overflow: hidden;
    width: 100%;
}

.aichat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f0f5f2;
    min-width: 0;
}

/* ── Messages scroll area ── */
.aichat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}
/* Thin green-tinted scrollbar — matches sidebar */
.aichat-messages::-webkit-scrollbar { width: 5px; }
.aichat-messages::-webkit-scrollbar-track { background: transparent; }
.aichat-messages::-webkit-scrollbar-thumb {
    background: rgba(27, 116, 54, 0.25);
    border-radius: 4px;
}
.aichat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(27, 116, 54, 0.45);
}

/* ── Message rows ── */
.aichat-msg {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 820px;
}
.aichat-msg-user {
    flex-direction: row-reverse;
    align-self: flex-end;
    max-width: 680px;
}
.aichat-msg-assistant {
    align-self: flex-start;
}

/* ── Avatars ── */
.aichat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B7436, #165d2b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(27,116,54,0.3);
}
.aichat-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B7436, #165d2b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 6px rgba(27,116,54,0.3);
}
.aichat-avatar-user {
    background: linear-gradient(135deg, #2d9e5a, #1B7436);
    box-shadow: 0 1px 4px rgba(27,116,54,0.25);
}

/* ── Bubbles ── */
.aichat-bubble {
    background: #fff;
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(0,0,0,0.87);
    max-width: 100%;
    word-break: break-word;
    border: 1px solid rgba(27,116,54,0.08);
}
.aichat-bubble ul { margin: 0; padding-left: 1.2rem; }
.aichat-bubble li { margin-bottom: 2px; }
.aichat-bubble code {
    background: #edf5f0;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.85em;
    color: #165d2b;
}
.aichat-bubble strong { color: #165d2b; }

.aichat-bubble-user {
    background: linear-gradient(135deg, #1B7436, #165d2b);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    border: none;
    box-shadow: 0 2px 6px rgba(27,116,54,0.35);
}
.aichat-bubble-user strong { color: #c8f5d8; }
.aichat-bubble-user code { background: rgba(255,255,255,0.18); color: #fff; }

/* ── Page header ── */
.aichat-main .transactions-page-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

/* ── Typing indicator ── */
.aichat-typing {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 0 28px 8px;
}
.aichat-bubble-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
}
.aichat-bubble-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1B7436;
    opacity: 0.5;
    display: inline-block;
    animation: aichat-bounce 1.4s infinite ease-in-out;
}
.aichat-bubble-typing span:nth-child(1) { animation-delay: 0s; }
.aichat-bubble-typing span:nth-child(2) { animation-delay: 0.2s; }
.aichat-bubble-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aichat-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Input area ── */
.aichat-input-area {
    padding: 12px 20px 14px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.aichat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #f0f5f2;
    border: 1.5px solid rgba(27,116,54,0.2);
    border-radius: 14px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.aichat-input-row:focus-within {
    border-color: #1B7436;
    box-shadow: 0 0 0 3px rgba(27,116,54,0.12);
    background: #fff;
}
.aichat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 0.92rem;
    line-height: 1.5;
    outline: none;
    max-height: 160px;
    padding: 2px 0;
    color: #212529;
}
.aichat-input::placeholder { color: rgba(0,0,0,0.35); }
.aichat-send-btn {
    background: #1B7436;
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.aichat-send-btn:hover { background: #165d2b; }
.aichat-send-btn:active { transform: scale(0.95); }
.aichat-send-btn:disabled { background: rgba(27,116,54,0.35); cursor: not-allowed; transform: none; }
.aichat-input-footer {
    margin-top: 6px;
    padding: 0 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    color: rgba(0,0,0,0.45);
}

/* ── Sidebar quick prompts ── */
.aichat-tip-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(0,0,0,0.45);
}
.aichat-quick-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid rgba(27,116,54,0.15);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    color: rgba(0,0,0,0.75);
}
.aichat-quick-btn:hover {
    background: #edf5f0;
    border-color: #1B7436;
    color: #165d2b;
}

/* ── Status badge ── */
#aiStatusBadge {
    background-color: #1B7436 !important;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
