/* =========================================================
   FINANCE PAGE — Professional Agro Insights Style
   ========================================================= */

/* ── Group-by dropdown ── */

/* ── Date range picker ── */
.finance-date-range .DateRangePicker,
.finance-date-range .DateRangePickerInput {
    height: 34px !important;
    border-radius: 6px !important;
}

.finance-date-range .DateInput,
.finance-date-range .DateInput_input {
    height: 34px !important;
    line-height: 34px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.85rem !important;
}

/* ── Accumulated switch ── */

/* ── Tabs ── */
#finance-tabs .nav-tabs {
    border-bottom: 2px solid #dde2ea;
}

#finance-tabs .nav-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.5rem 1.25rem;
    transition: color 0.15s ease, border-color 0.15s ease;
    margin-bottom: -2px;
}

#finance-tabs .nav-link:hover {
    color: #177da5;
    border-bottom-color: #177da5;
    background: transparent;
}

#finance-tabs .nav-link.active {
    color: #177da5 !important;
    border-bottom: 2px solid #177da5 !important;
    font-weight: 600 !important;
    background: transparent !important;
}

/* ── Graph cards ── */
#finance-tabs .card {
    border: 1px solid #dde2ea !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(15,23,42,0.07) !important;
}

#finance-tabs .card-body {
    padding: 0.75rem !important;
}

/* ── Finance inline toolbar (inside tab, not a Navbar) ── */

/* agro-toolbar-section-label, agro-toolbar-pill, agro-toolbar-divider
   → defined globally in app.css */

/* ── Sales metric toggle (Hectares / $) ── */

/* Graph controls match the other improved pages. */
#finance-tabs .js-plotly-plot .plotly .modebar {
    opacity: 1;
    background: rgba(255,255,255,0.96) !important;
    border: 1px solid #dbe5df;
    border-radius: 6px;
}
#finance-tabs .js-plotly-plot .plotly .modebar-group {
    background: transparent !important;
}
#finance-tabs .js-plotly-plot .plotly .modebar-btn path { fill: #52665b !important; }
#finance-tabs .js-plotly-plot .plotly .modebar-btn:hover path,
#finance-tabs .js-plotly-plot .plotly .modebar-btn.active path { fill: #2d7a46 !important; }

#finance-kpi-accordion .finance-kpi-grid { margin: 0; }
#finance-kpi-accordion .finance-kpi-card {
    border: 1px solid #dbe5df;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
#finance-kpi-accordion .finance-kpi-card .card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    padding: 14px;
}
#finance-kpi-accordion .finance-kpi-card-label {
    color: #29463b;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
}

#finance-kpi-accordion > .accordion-item > .accordion-collapse > .accordion-body {
    max-height: 65vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.finance-kpi-usage-layout > .finance-kpi-chart-card {
    margin-bottom: 1rem;
}

.finance-kpi-chart-card {
    border-color: #d4e2dc;
    box-shadow: 0 1px 4px rgba(34, 72, 56, 0.08);
}

.finance-kpi-chart-title {
    color: #29463b;
    background: #f3f8f5;
    font-weight: 600;
}

.finance-kpi-chart {
    width: 100%;
}

.finance-kpi-delay-note {
    margin: 0 0 0.5rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1.25;
}

/* Budget transaction workspace */
.finance-budget-root,
.finance-budget-workspace { min-height: 0; }
.finance-budget-root { height: 100%; }
.finance-budget-workspace { display: flex; flex-direction: column; gap: .75rem; }
.finance-budget-hero {
    display: flex; align-items: center; gap: 14px; padding: 16px 20px;
    border: 1px solid #d9e6de; border-radius: 12px;
    background: linear-gradient(110deg, #f2f8f4 0%, #ffffff 72%);
}
.finance-budget-hero-icon {
    display: grid; place-items: center; flex: 0 0 46px; height: 46px;
    color: #197b50; background: #e0f1e7; border-radius: 12px; font-size: 1.2rem;
}
.finance-budget-hero h4 { color: #234b39; font-weight: 700; }
.finance-budget-tabs { min-height: 0; }
.finance-budget-tabs > .tab-content { padding-top: 12px; }
.finance-budget-config-tabs > .nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.finance-budget-config-tabs > .nav-tabs .nav-link { white-space: nowrap; }
.finance-budget-panel { min-height: 0; }
.finance-budget-card {
    border: 1px solid #dbe5df; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(28, 58, 42, .06);
}
.finance-budget-card > .card-body { padding: 16px; }
.finance-budget-heading h5 { color: #234b39; font-weight: 700; }
.finance-budget-heading { margin-bottom: 0.45rem; }
.finance-budget-controls-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.finance-budget-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.finance-budget-button-group { border: 1px solid #d5e2d9; border-radius: 8px; padding: 3px; background: #f7faf8; }
.finance-budget-filter-group { background: #f2f8fb; border-color: #c9dce5; }
.finance-budget-action {
    min-height: 38px; border-radius: 7px; white-space: nowrap; font-weight: 500; font-size: 0.86rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.finance-budget-action .bi { font-size: 1rem; line-height: 1; }
.finance-budget-action:not(:disabled):hover { box-shadow: 0 2px 6px rgba(35, 70, 50, .18); }
.finance-budget-action:not(:disabled):active { transform: translateY(1px); }
.finance-budget-action:disabled { opacity: .45; cursor: not-allowed; }
.finance-budget-button-group { box-shadow: 0 1px 2px rgba(35, 70, 50, .08); }
.finance-budget-actions { gap: 10px; }
#finance-budget-bank-import-modal .modal-footer .btn { min-width: 130px; border-radius: 7px; font-weight: 500; }
#finance-budget-bank-import-modal .modal-footer .bi,
#finance-budget-modal .modal-footer .bi { font-size: 1rem; vertical-align: -0.1em; }
.finance-budget-selection-summary { flex: 0 0 auto; margin-bottom: 0; }
.finance-budget-summary-content { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.finance-budget-summary-item {
    display: flex; flex-direction: column; justify-content: center; gap: 0.1rem;
    min-width: 145px; min-height: 58px; padding: 0.45rem 0.75rem;
    border: 1px solid #d7e3da; border-radius: 0.55rem; background: #f8fbf9;
}
.finance-budget-summary-label { color: #63756a; font-size: 0.76rem; line-height: 1.1; }
.finance-budget-summary-value { color: #173c2a; font-size: 1rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.finance-budget-table-wrap { display: flex; flex-direction: column; height: calc(100vh - 357px); min-height: 420px; max-height: none; overflow: hidden; border: 1px solid #e0e8e3; border-radius: 8px; }
.finance-budget-table-wrap .dash-table-container { display: flex; flex: 1 1 auto; height: 100%; min-width: 100%; min-height: 0; }
.finance-budget-table-wrap .dash-spreadsheet-container { flex: 1 1 auto; height: 100% !important; max-height: 100% !important; min-height: 0; overflow-y: auto !important; }
/* Dash scroller: trailing space so the last row can be scrolled fully into view */
.finance-budget-table-wrap .dt-table-container__row-1 { box-sizing: border-box; padding-bottom: 48px; }
.finance-budget-table-wrap .show-hide { display: none !important; }
.finance-budget-field { margin-bottom: 2px; }
.finance-budget-field-label { color: #334b40; font-weight: 600; font-size: .88rem; }
.finance-budget-field .form-control,
.finance-budget-field .Select-control,
.finance-budget-field .DateInput_input { min-height: 40px; border-color: #cbd8d0; border-radius: 7px; }
.finance-budget-select { width: 100%; }
.finance-budget-date .DateInput, .finance-budget-date .DateInput_input { width: 100%; }
.finance-budget-modal .modal-dialog { max-width: min(1140px, calc(100vw - 2rem)); }
.finance-budget-date .SingleDatePicker { position: relative; }
.finance-budget-date .SingleDatePicker_picker { left: auto !important; right: 0 !important; }
.finance-budget-modal .modal-body { max-height: 68vh; overflow-y: auto; }
/* An open dropdown menu must fit inside the scrolling body instead of being clipped by it */
.finance-budget-modal .modal-body:has(.Select.is-open) { min-height: min(400px, 68vh); }
.finance-budget-modal .Select-menu-outer { max-height: 220px; }
.finance-budget-modal .Select-menu { max-height: 216px; }
@media (max-width: 767px) {
    .finance-budget-modal .modal-dialog { max-width: calc(100vw - 1rem); margin: .5rem auto; }
    .finance-budget-hero { padding: 12px; }
    .finance-budget-controls-row { align-items: flex-start; flex-direction: column; }
    .finance-budget-actions { width: 100%; justify-content: flex-start; }
    .finance-budget-action { flex: 1 1 calc(50% - 8px); }
    .finance-budget-table-wrap { height: calc(100vh - 300px); min-height: 300px; max-height: none; }
    .finance-budget-table-wrap-sales,
    .finance-budget-table-wrap-payments { height: calc(100vh - 260px) !important; min-height: 340px !important; }
}

.finance-reports-workspace {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    padding-top: 0.75rem;
    overflow: visible;
}

.finance-report-filters-card,
.finance-report-content-card {
    border: 1px solid #d7e3da;
    border-radius: 0.65rem;
    box-shadow: 0 1px 3px rgba(31, 70, 48, 0.06);
}

.finance-report-filters-card {
    position: relative;
    z-index: 2;
    overflow: visible !important;
}

.finance-reports-workspace,
.finance-report-filters-card .card-body,
.finance-report-filters-card .row { overflow: visible !important; }
.finance-report-filter-dropdown-col { position: relative; z-index: 3; }
.finance-report-filter-dropdown-col:has(.Select.is-open) { z-index: 1300; }
.finance-report-filter-dropdown-col .Select.is-open { z-index: 1301; }
.finance-report-filters-card .Select-menu-outer {
    z-index: 1302 !important;
    max-height: min(45vh, 320px);
    overflow-y: auto;
}
.finance-report-content-card { position: relative; z-index: 1; }

.finance-report-date-range {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 10;
}

.finance-report-date-range .DateRangePicker,
.finance-report-date-range .DateRangePickerInput {
    width: 100%;
}

.finance-report-date-range .DateRangePicker_picker {
    z-index: 1100 !important;
}

.finance-report-currency {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
}

.finance-report-content-card {
    min-height: 300px;
}
.finance-report-content-card > .card-body,
#finance-report-content {
    width: 100%;
}
.finance-report-content-card > .card-body {
    max-height: calc(100vh - 380px);
    min-height: 300px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem 1.1rem;
    scrollbar-width: thin;
    scrollbar-color: #b9cdbf transparent;
}

.finance-report-balance-card {
    border: 1px solid #d7e3da;
    border-radius: 0.55rem;
    background: #f8fbf9;
}

.finance-report-balance { display: block; margin-top: 0.2rem; color: #173c2a; font-size: 1.4rem; }
.finance-report-component-balance { font-size: 1rem; overflow-wrap: anywhere; }
.finance-report-chart {
    display: block;
    width: 100%;
    min-width: 0;
}
.finance-report-chart > div,
.finance-report-chart .js-plotly-plot,
.finance-report-chart .plot-container,
.finance-report-chart .svg-container {
    display: block;
    width: 100% !important;
    min-width: 0;
}

.finance-report-empty-state {
    display: grid;
    min-height: 260px;
    place-items: center;
    color: #65766b;
    text-align: center;
}

/* Keep the existing Finance page usable inside the phone navigation shell. */
@media (max-width: 800px) {
    .finance-report-chart { height: 55vh !important; min-height: 420px !important; }
    .finance-report-content-card > .card-body { max-height: calc(100vh - 300px); }
    .finance-mobile {
        width: 100%;
        max-width: 100%;
        padding: 0.5rem 0.35rem 1rem !important;
        overflow: visible;
    }

    .finance-mobile > .row,
    .finance-mobile > .row > .col,
    .finance-mobile #finance-tabs,
    .finance-mobile #finance-tabs .tab-content,
    .finance-mobile #finance-tabs .tab-pane,
    .finance-mobile #finance-tabs .card,
    .finance-mobile #finance-tabs .card-body {
        min-width: 0;
        max-width: 100%;
    }

    .finance-mobile #finance-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .finance-mobile #finance-tabs .nav-link {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
    }

    .finance-mobile #finance-tabs .js-plotly-plot,
    .finance-mobile #finance-tabs .plot-container,
    .finance-mobile #finance-tabs .svg-container {
        max-width: 100%;
    }
}

/* ---- Reports tab: filters, summary cards and chart ---- */
.finance-report-filters-card { background: #fbfdfb; }
.finance-report-filters-card .card-body { padding: 0.9rem 1.1rem 0.8rem; }
.finance-report-filters-title {
    display: flex; align-items: center; margin-bottom: 0.7rem; padding-bottom: 0.55rem;
    border-bottom: 1px solid #e3ece6; color: #244b38; font-size: 0.95rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.finance-report-filters-title .bi { font-size: 1.15rem; color: #2e7d54; }
.finance-report-filters-card .form-label {
    margin-bottom: 0.3rem; color: #4f6357; font-size: 0.82rem; font-weight: 600;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.finance-report-filters-card .Select-control,
.finance-report-filters-card .Select--single > .Select-control .Select-value,
.finance-report-filters-card .DateRangePickerInput {
    min-height: 44px; height: 44px; border-radius: 7px; border-color: #cfdcd3; background: #fff;
}
.finance-report-filters-card .Select-control:hover,
.finance-report-filters-card .DateRangePickerInput:hover { border-color: #8fb79d; box-shadow: 0 1px 4px rgba(46, 125, 84, 0.12); }
.finance-report-filters-card .Select.is-focused > .Select-control { border-color: #2e7d54; box-shadow: 0 0 0 3px rgba(46, 125, 84, 0.15); }
.finance-report-filters-card .Select-placeholder,
.finance-report-filters-card .Select--single > .Select-control .Select-value { line-height: 42px; font-size: 1rem; }
.finance-report-filters-card .Select-input { height: 42px; }
.finance-report-filters-card .Select-menu-outer .Select-option { font-size: 0.98rem; padding: 9px 12px; }
.finance-report-filters-card .DateInput_input { height: 42px; padding: 0 10px; font-size: 1rem; line-height: 42px; border-bottom: 0; background: transparent; }
.finance-report-filters-card .DateRangePickerInput_arrow { color: #8fa398; }
.finance-report-description {
    margin-top: 0.7rem; padding: 0.4rem 0.7rem; border-radius: 6px; background: #f1f7f3;
    color: #4f6357; font-size: 0.92rem;
}
.finance-report-description::before { content: "\2139\00a0\00a0"; color: #2e7d54; font-weight: 700; }

.finance-report-balance-card {
    border: 1px solid #d9e6dd; border-left: 4px solid #2e7d54; border-radius: 0.6rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6faf7 100%);
    box-shadow: 0 1px 3px rgba(31, 70, 48, 0.07);
}
.finance-report-balance-card > .card-body { padding: 0.9rem 1.1rem 0.7rem; }
.finance-report-balance-card > .card-body > .text-muted.small:first-child {
    margin-bottom: 0.7rem !important; padding-bottom: 0.45rem; border-bottom: 1px solid #e3ece6;
    color: #244b38 !important; font-size: 0.85rem !important; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.finance-report-balance-card .row > [class*="col"] > .text-muted.small {
    display: flex; align-items: center; gap: 0.45rem; color: #596e60 !important; font-size: 0.88rem !important;
}
.finance-report-balance-card .row > [class*="col"] > .text-muted.small::before {
    content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #208454;
}
.finance-report-balance-card .row > [class*="col"]:nth-child(2) > .text-muted.small::before { background: #2878b5; }
.finance-report-balance-card .row > [class*="col"]:nth-child(3) > .text-muted.small::before { background: #d95f02; }
.finance-report-balance-card .row > [class*="col"]:nth-child(4) > .text-muted.small::before { background: #8e44ad; }
.finance-report-balance { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.finance-report-component-balance { font-size: 1.35rem; font-weight: 700; }

/* the chart fills the remaining viewport, so neither the card nor the chart needs a scrollbar */
.finance-report-chart {
    height: clamp(420px, calc(100vh - 570px), 820px) !important;
    margin: 0.5rem 0 1.25rem;
    padding: 0.35rem;
    border: 1px solid #d9e6dd;
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 70, 48, 0.08);
}
.finance-report-chart:last-child { margin-bottom: 0; }

.finance-report-content-card .alert { font-size: 0.98rem; }
.finance-report-chart .modebar { top: 4px !important; }
/* Sales: selected-sales cards and their payments cards are shown as two separate groups */
.finance-budget-summary-split { align-items: stretch; flex-wrap: wrap; gap: 0.9rem; }
.finance-budget-summary-group { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.finance-budget-summary-divider { width: 2px; align-self: stretch; min-height: 58px; background: #c9d8ce; border-radius: 2px; }
.finance-budget-summary-payments { display: flex; flex-direction: column; gap: 0.2rem; }
.finance-budget-summary-group-title { color: #1f5f8b; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.finance-budget-summary-item-payments { background: #f2f8fd; border-color: #c4dbed; }
.finance-budget-summary-item-payments .finance-budget-summary-value { color: #12496f; }
/* Linked payments dialog: show all rows when they fit, otherwise fill the window height and scroll inside */
#finance-budget-sale-payments-modal .modal-dialog { max-width: min(1400px, calc(100vw - 2rem)); }
#finance-budget-sale-payments-modal .modal-body { overflow-y: visible; }
#finance-budget-sale-payments-modal .modal-title { width: 100%; padding-inline-end: 1rem; }
#finance-budget-sale-payments-modal .modal-header { overflow: visible; }

/* System usage toolbar: labeled segmented controls */
.finance-usage-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f3f8f5;
    border: 1px solid #d4e2dc;
    border-radius: 0.4rem;
}
.finance-usage-control {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.finance-usage-control-title {
    color: #5b7a6c;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.finance-segmented {
    display: inline-flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #177da5;
    border-radius: 0.4rem;
    overflow: hidden;
}
.finance-segmented .form-check {
    margin: 0;
    padding: 0;
    min-height: 0;
}
.finance-segmented .form-check + .form-check {
    border-left: 1px solid #b9d8e6;
}
.finance-segmented .btn {
    min-width: 5rem;
    margin: 0;
    padding: 0.3rem 1rem;
    color: #177da5;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.finance-segmented .btn:hover {
    background: #e6f2f7;
}
.finance-segmented .btn.active,
.finance-segmented .btn-check:checked + .btn {
    color: #fff;
    background: #177da5;
}
.finance-segmented .btn-check:focus-visible + .btn {
    outline: 2px solid #177da5;
    outline-offset: -3px;
}
.finance-segmented .btn:focus,
.finance-segmented .btn:active,
.finance-segmented .btn-check:focus + .btn,
.finance-segmented .btn-check:active + .btn {
    border: 0 !important;
    box-shadow: none !important;
}
.finance-kpi-chart {
    min-height: 300px;
}

/* Info button + explanation modal */
.finance-usage-info {
    margin-left: auto;
    align-self: center;
}
.finance-info-btn {
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    color: #fff;
    background: #177da5;
    border: 0;
    border-radius: 50%;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-style: italic;
    font-weight: 700;
    line-height: 1.9rem;
    box-shadow: 0 1px 3px rgba(34, 72, 56, 0.25);
}
.finance-info-btn:hover,
.finance-info-btn:focus {
    color: #fff;
    background: #126282;
    box-shadow: 0 1px 3px rgba(34, 72, 56, 0.25);
}
.finance-info-body {
    color: #3d5a4c;
    font-size: 0.85rem;
    line-height: 1.55;
}
.finance-info-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f3f8f5;
    border: 1px solid #d4e2dc;
    border-radius: 0.4rem;
}
.finance-info-chip {
    padding: 0.1rem 0.6rem;
    color: #177da5;
    background: #fff;
    border: 1px solid #177da5;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.finance-info-label {
    color: #5b7a6c;
    font-weight: 600;
}
.finance-info-section {
    margin-bottom: 1rem;
}
.finance-info-section-title {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    color: #29463b;
    border-bottom: 2px solid #177da5;
    font-weight: 700;
}
.finance-info-item {
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: #fbfdfc;
    border: 1px solid #e1ece6;
    border-left: 3px solid #177da5;
    border-radius: 0.3rem;
}
.finance-info-item-title {
    color: #29463b;
    font-weight: 700;
}
.finance-info-footnote {
    color: #5b7a6c;
    font-size: 0.78rem;
}
.finance-info-intro {
    margin-bottom: 1rem;
    color: #3d5a4c;
}
.finance-info-mode {
    margin: 0.4rem 0 0;
    padding: 0.4rem 0.6rem;
    background: #fff;
    border: 1px solid #e1ece6;
    border-radius: 0.3rem;
    opacity: 0.75;
}
.finance-info-mode-active {
    background: #eef7fb;
    border-color: #177da5;
    opacity: 1;
}
.finance-info-mode-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}
.finance-info-mode-name {
    color: #177da5;
    font-weight: 700;
}
.finance-info-mode-badge {
    padding: 0 0.5rem;
    color: #fff;
    background: #177da5;
    border-radius: 1rem;
    font-size: 0.65rem;
    font-weight: 600;
}
.finance-info-example {
    margin-top: 0.2rem;
    color: #5b7a6c;
    font-size: 0.78rem;
    font-style: italic;
}
.finance-info-same {
    margin-top: 0.4rem;
    color: #5b7a6c;
}

.finance-report-description-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.7rem; }
.finance-report-description-row .finance-report-description { flex: 1 1 auto; margin-top: 0; }
.finance-report-description-row .finance-info-btn { flex: 0 0 auto; }

/* Undo / Redo: sit on the tab row, right-aligned, saturated colours */
.finance-budget-history-bar { position: relative; height: 0; z-index: 5; }
.finance-budget-history-buttons { position: absolute; right: 6px; top: 3px; display: flex; gap: 8px; }
.finance-history-btn { font-weight: 600; border-radius: 7px; padding: 3px 14px; color: #fff !important; border: 0 !important; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.finance-history-btn .bi { margin-right: .35rem !important; font-size: 1rem; vertical-align: -0.12em; }
.finance-undo-btn { background-color: #f08c00 !important; }
.finance-undo-btn:hover:not(:disabled) { background-color: #d97d00 !important; }
.finance-redo-btn { background-color: #1c7ed6 !important; }
.finance-redo-btn:hover:not(:disabled) { background-color: #1668b3 !important; }
.finance-history-btn:disabled { opacity: .4; box-shadow: none; }\n.finance-budget-history-buttons { align-items: center; }
.finance-budget-history-hint { max-width: min(640px, 48vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; color: #5b6b62; }
\n

/* Payment schedule: room and no clipping for the Event dropdown menu */
#finance-budget-payment-schedule-modal .modal-body { min-height: min(420px, 70vh); }
#finance-budget-payment-schedule-modal .dash-spreadsheet-container,
#finance-budget-payment-schedule-modal .dash-spreadsheet-inner,
#finance-budget-payment-schedule-modal .dash-table-container { overflow: visible !important; }

/* Customer payments report: visible vertical line between every two columns */
.finance-customer-payments-table th,
.finance-customer-payments-table td {
    border-left: 1px solid #5f7f6d !important;
    border-right: 1px solid #5f7f6d !important;
}
.finance-customer-payments-table .pay-group-start {
    border-left: 3px solid #2f5d44 !important;
}

.finance-budget-quick-filter { min-width: 38px; padding-left: 8px; padding-right: 8px; }
.finance-budget-quick-filter .bi { font-size: 1.05rem; margin: 0; }

.finance-budget-icon-only { min-width: 38px; padding-left: 8px; padding-right: 8px; }
.finance-budget-icon-only .bi { font-size: 1.05rem; margin: 0; }

/* Sales management table: no "Toggle Columns" button (the helper column "overdue" stays hidden) */
#sales-mgmt-table .show-hide {
    display: none;
}

/* Sales management modals: above the page header / side menu */
.sales-mgmt-modal.modal,
[id^="sales-mgmt-"][id$="-modal"] { z-index: 5000 !important; }
body:has([id^="sales-mgmt-"][id$="-modal"].show) .modal-backdrop { z-index: 4990 !important; }
.sales-mgmt-label-tall { min-height: 2.4em; display: flex; align-items: flex-end; }

/* Sales management tab: same look as the Budget tab */
.finance-sales-table-wrap { height: calc(100vh - 470px); min-height: 360px; }
.finance-sales-filters .Select-control { min-height: 38px; border-radius: 7px; }
.finance-sales-filters input.form-control { height: 38px; border-radius: 7px; }
.finance-sales-meetings-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.finance-sales-meetings-header h6 { color: #234b39; font-weight: 700; }
.finance-sales-meeting { border: 1px solid #d7e3da; border-radius: 8px; background: #f8fbf9; }
#sales-mgmt-table .show-hide { display: none !important; }
