.accounting-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.accounting-metric-card {
    min-width: 0;
    min-height: 116px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(32, 57, 48, .04);
}

.accounting-metric-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 17px;
}

.accounting-metric-card span,
.accounting-metric-card strong,
.accounting-metric-card small {
    display: block;
}

.accounting-metric-card span {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.accounting-metric-card strong {
    color: var(--ink);
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.accounting-metric-card small {
    margin-top: 6px;
    color: #89938f;
    font-size: 10.5px;
    line-height: 1.35;
}

.accounting-toolbar-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.accounting-search {
    max-width: 560px;
}

.accounting-status-filter {
    height: 42px;
    display: flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.accounting-status-filter-btn {
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #74807b;
    font-size: 11px;
    font-weight: 700;
}

.accounting-status-filter-btn:hover {
    color: var(--brand);
    background: #f6f9f7;
}

.accounting-status-filter-btn.active {
    color: var(--brand);
    background: var(--brand-soft);
}

.accounting-clear-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
}

.accounting-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.accounting-ledger-card {
    min-width: 0;
}

.accounting-table td:nth-child(3) {
    min-width: 210px;
    color: #53605a;
}

.accounting-entry-cell,
.accounting-account-cell {
    min-width: 145px;
}

.accounting-entry-cell strong,
.accounting-entry-cell small,
.accounting-account-cell strong,
.accounting-account-cell small {
    display: block;
}

.accounting-entry-cell strong,
.accounting-account-cell strong {
    color: var(--ink);
    font-size: 12.5px;
}

.accounting-entry-cell small,
.accounting-account-cell small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
}

.accounting-money {
    min-width: 105px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.accounting-table-footer {
    gap: 16px;
}

.accounting-side-card {
    padding: 18px;
}

.accounting-side-head {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.accounting-side-head h3 {
    margin: 4px 0 3px;
    font-size: 16px;
    font-weight: 750;
}

.accounting-side-head p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.accounting-status-list {
    padding: 4px 0;
}

.accounting-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #edf0ee;
}

.accounting-status-row:last-child {
    border-bottom: 0;
}

.accounting-status-row > span:last-child {
    min-width: 0;
}

.accounting-status-row strong,
.accounting-status-row small {
    display: block;
}

.accounting-status-row strong {
    font-size: 12px;
}

.accounting-status-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.35;
}

.accounting-status-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
}

.accounting-status-icon.success {
    background: #e6f4ed;
    color: #2b7f5c;
}

.accounting-status-icon.warning {
    background: #fff5dd;
    color: #a97615;
}

.accounting-status-icon.neutral {
    background: #eef1ef;
    color: #6f7975;
}

.accounting-side-actions {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.accounting-side-actions button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 6px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.accounting-side-actions button:hover {
    background: #f8faf9;
}

.accounting-side-actions button > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.accounting-side-actions strong,
.accounting-side-actions small {
    display: block;
}

.accounting-side-actions strong {
    font-size: 11.5px;
}

.accounting-side-actions small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
}

.accounting-side-actions > button > .bi-chevron-right {
    color: #9ba49f;
    font-size: 11px;
}

.accounting-side-action-icon {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid !important;
    place-items: center;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
}

.accounting-state,
.accounting-empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.accounting-state {
    gap: 8px;
}

.accounting-state h3,
.accounting-state p {
    margin: 0;
}

.accounting-state h3 {
    margin-top: 4px;
    font-size: 17px;
}

.accounting-state p,
.accounting-state span,
.accounting-empty-state span {
    max-width: 430px;
    color: var(--muted);
    font-size: 11.5px;
}

.accounting-state-icon,
.accounting-empty-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    border-radius: 13px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 19px;
}

.accounting-empty-state {
    gap: 7px;
    padding: 42px 24px;
}

.accounting-empty-state strong {
    font-size: 14px;
}

.accounting-empty-state .btn {
    margin-top: 6px;
}

@media (max-width: 1199.98px) {
    .accounting-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .accounting-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .accounting-summary-grid {
        grid-template-columns: 1fr;
    }

    .accounting-toolbar-main {
        align-items: stretch;
        flex-direction: column;
    }

    .accounting-search {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .accounting-status-filter {
        width: 100%;
    }

    .accounting-status-filter-btn {
        flex: 1;
    }

    .accounting-clear-btn,
    .accounting-reports-btn {
        width: 100%;
    }

    .accounting-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Accounting consistency pass: follow Members page interaction and type scale. */
.accounting-back-btn {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid #d9e2de;
    border-radius: 12px;
    background: #fff;
    color: var(--brand);
}

.accounting-back-btn:hover,
.accounting-back-btn:focus-visible {
    color: var(--brand);
    background: #f7faf8;
    border-color: #b7cbc2;
}

.accounting-side-card {
    padding: 20px;
}

.accounting-side-head h3 {
    margin: 5px 0 5px;
    font-size: 18px;
}

.accounting-side-head p {
    font-size: 13px;
    line-height: 1.5;
}

.accounting-status-row {
    gap: 12px;
    padding: 14px 0;
}

.accounting-status-row strong {
    font-size: 13.5px;
    line-height: 1.35;
}

.accounting-status-row small {
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.4;
}

.accounting-side-actions button {
    gap: 11px;
    min-height: 58px;
    padding: 10px 7px;
}

.accounting-side-actions strong {
    font-size: 13.5px;
    line-height: 1.3;
}

.accounting-side-actions small {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
}

.accounting-side-actions > button > .bi-chevron-right {
    font-size: 13px;
}

.accounting-side-action-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.accounting-entry-cell strong,
.accounting-account-cell strong {
    font-size: 13.5px;
}

.accounting-entry-cell small,
.accounting-account-cell small {
    font-size: 12px;
}

.accounting-metric-card span {
    font-size: 12px;
}

.accounting-metric-card small {
    font-size: 12px;
    line-height: 1.4;
}

.accounting-date-filter {
    min-width: 238px;
    height: 46px;
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 7px;
    border: 1px solid #d9e2de;
    border-radius: 12px;
    background: #fff;
}

.accounting-date-filter-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #eef5f1;
    color: var(--brand);
}

.accounting-date-filter span:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.accounting-date-filter small {
    color: #89958f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.accounting-date-filter strong {
    color: #25342e;
    font-size: 14px;
}

.accounting-date-filter input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .accounting-back-btn {
        width: 100%;
        flex-basis: auto;
    }

    .accounting-date-filter {
        width: 100%;
    }
}

.financial-print-header {
    display: none;
}

.financial-report-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    /* Keep print behavior non-destructive. Other modules (member statements,
       receipts, IDs, etc.) own their own print targets and must not be hidden
       by Accounting's stylesheet. */
    body .sidebar,
    body .topbar,
    body .sidebar-backdrop,
    body .toast-container {
        display: none !important;
    }

    body .main-content {
        margin-left: 0 !important;
        min-height: 0 !important;
    }

    body .content-wrap {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    /* These controls belong only to the Financial Statements screen. */
    body:has(.financial-print-report) .app-page-intro,
    body:has(.financial-print-report) .section-toolbar {
        display: none !important;
    }

    .financial-print-report {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #111 !important;
        background: #fff !important;
        font-size: 10pt;
    }

    .financial-print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-end;
        gap: 24px;
        margin-bottom: 18px;
        padding-bottom: 12px;
        border-bottom: 2px solid #222;
    }

    .financial-print-header span {
        font-size: 8.5pt;
        font-weight: 700;
        letter-spacing: .06em;
    }

    .financial-print-header h1 {
        margin: 3px 0 1px;
        font-size: 18pt;
    }

    .financial-print-header p,
    .financial-print-generated {
        margin: 0;
        color: #444 !important;
        font-size: 9pt;
    }

    .financial-print-report .panel-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #bbb !important;
    }

    .financial-print-report .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }

    .financial-print-report table {
        font-size: 9pt;
    }
}



/* Finance dialog standardization */
.finance-standard-dialog .modal-body {
    background: #f8faf9;
}

.finance-standard-dialog .modal-footer {
    align-items: center;
}

/* The CDA review has a long four-column table; only its body scrolls. */
body:has(.coa-reconciliation-overlay.modal.show) {
    overflow: hidden;
}

.modal.coa-reconciliation-overlay.show {
    overflow: hidden;
}

.coa-reconciliation-dialog {
    width: min(1200px, calc(100vw - 32px));
    max-width: 1200px;
    height: calc(100dvh - 32px);
    min-height: 0;
    margin: 16px auto;
}

.coa-reconciliation-dialog .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.coa-reconciliation-dialog .modal-header,
.coa-reconciliation-dialog .modal-footer {
    flex: 0 0 auto;
}

.coa-reconciliation-dialog .modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.coa-reconciliation-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.coa-reconciliation-table {
    min-width: 950px;
    table-layout: fixed;
    overflow-wrap: anywhere;
}

.coa-reconciliation-code { width: 9%; }
.coa-reconciliation-name { width: 29%; }
.coa-reconciliation-installed { width: 28%; }
.coa-reconciliation-status { width: 34%; }

@media (max-width: 575.98px) {
    .coa-reconciliation-dialog {
        width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
        margin: 8px auto;
    }

    .coa-reconciliation-dialog .modal-header,
    .coa-reconciliation-dialog .modal-body,
    .coa-reconciliation-dialog .modal-footer {
        padding: 12px;
    }

    .coa-reconciliation-dialog .modal-footer {
        flex-wrap: wrap;
    }
}

.finance-mapping-card,
.receipt-series-preview {
    padding: 14px 16px;
    border: 1px solid #dce6e0;
    border-radius: 12px;
    background: #f6faf7;
}

.finance-mapping-card > span,
.finance-mapping-card > strong,
.finance-mapping-card > small,
.receipt-series-preview > span,
.receipt-series-preview > strong,
.receipt-series-preview > small {
    display: block;
}

.finance-mapping-card > span,
.receipt-series-preview > span {
    color: #748078;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.finance-mapping-card > strong {
    margin-top: 3px;
    color: #263c31;
    font-size: 15px;
}

.finance-mapping-card > small,
.receipt-series-preview > small {
    margin-top: 4px;
    color: #748078;
    line-height: 1.4;
}

.receipt-series-preview {
    background: #f1f8f4;
}

.receipt-series-preview > strong {
    margin-top: 5px;
    color: #1f6c43;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: clamp(1.55rem, 2.3vw, 2rem);
    line-height: 1.1;
}

.opening-balance-metadata {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 24px;
    margin-bottom: 0;
}

.opening-balance-metadata > div {
    min-width: 0;
}

.opening-balance-metadata dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
}

.opening-balance-metadata dd {
    margin-bottom: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.opening-balance-metadata .opening-balance-metadata-wide {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .opening-balance-metadata {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .opening-balance-metadata {
        grid-template-columns: 1fr;
    }
}

/* Journal entry: intentionally broad and compact so the line grid reads like a ledger. */
.journal-entry-dialog {
    width: min(96vw, 1380px);
    max-width: 1380px;
}

.journal-entry-dialog .modal-body {
    padding-top: 16px;
    padding-bottom: 16px;
}

.journal-entry-dialog .registration-banner {
    margin-bottom: 14px;
}

.journal-header-card,
.journal-lines-card {
    padding: 16px;
}

.journal-lines-heading {
    margin-bottom: 12px;
}

.journal-entry-grid {
    border: 1px solid #dce5e0;
    border-radius: 10px;
    overflow: visible;
}

.journal-entry-grid table {
    table-layout: fixed;
    min-width: 1040px;
}

.journal-entry-grid .journal-account-col { width: 31%; }
.journal-entry-grid .journal-money-col { width: 17%; }
.journal-entry-grid .journal-memo-col { width: 31%; }
.journal-entry-grid .journal-action-col { width: 4%; }

.journal-entry-grid thead th,
.journal-entry-grid tbody td,
.journal-entry-grid tfoot td {
    padding: 5px 4px;
    vertical-align: middle;
}

.journal-entry-grid thead th {
    background: #f3f7f5;
    color: #64756c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.journal-entry-grid tbody tr + tr td {
    border-top-color: #edf1ef;
}

.journal-entry-grid .form-control,
.journal-entry-grid .form-select {
    min-height: 38px;
    padding-top: 6px;
    padding-bottom: 6px;
    border-radius: 7px;
}

.journal-entry-grid .journal-treasury-select {
    margin-top: 5px;
}

.journal-remove-line {
    width: 34px;
    height: 34px;
    padding: 0;
}

.journal-entry-grid tfoot td {
    background: #fbfcfb;
    border-top: 1px solid #dce5e0;
}

.journal-view-grid {
    border: 1px solid #e0e7e3;
    border-radius: 10px;
    overflow: hidden;
}

.journal-view-grid table {
    table-layout: fixed;
}

.journal-view-grid .journal-view-account-col {
    width: 40%;
}

.journal-view-grid .journal-view-memo-col {
    width: 32%;
}

.journal-view-grid .journal-view-money-col {
    width: 14%;
}

.journal-view-grid thead th,
.journal-view-grid tbody td {
    padding-top: 9px;
    padding-bottom: 9px;
}

@media (max-width: 991.98px) {
    .journal-entry-dialog {
        width: auto;
        max-width: calc(100% - 1rem);
        margin-left: .5rem;
        margin-right: .5rem;
    }
}

.journal-entry-grid .journal-account-menu {
    min-width: 360px;
}

/* Standard Finance checkbox: never fall back to the browser/Bootstrap blue state. */
.coa-show-all-option > .finance-standard-checkbox,
.finance-standard-dialog .app-checkbox-card > .finance-standard-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
    border: 1px solid #9fb2aa;
    border-radius: 4px;
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.coa-show-all-option > .finance-standard-checkbox:checked,
.finance-standard-dialog .app-checkbox-card > .finance-standard-checkbox:checked {
    border-color: var(--brand);
    background-color: var(--brand);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M3 8.5 6.3 12 13 4.5'/%3e%3c/svg%3e");
}

.coa-show-all-option > .finance-standard-checkbox:focus-visible,
.finance-standard-dialog .app-checkbox-card > .finance-standard-checkbox:focus-visible {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(23, 75, 59, .14);
}

.coa-reference-note {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 12px;
    color: #687a72;
    font-size: .78rem;
}

.coa-reference-note > i {
    color: var(--brand);
}

.coa-reference-note a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.coa-reference-note a:hover,
.coa-reference-note a:focus-visible {
    text-decoration: underline;
}

.coa-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.coa-type-card {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 104px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    text-align: left;
    box-shadow: 0 8px 22px rgba(35, 58, 48, .035);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.coa-type-card:hover,
.coa-type-card:focus-visible {
    border-color: #8db5a5;
    box-shadow: 0 10px 26px rgba(35, 58, 48, .08);
    transform: translateY(-1px);
}

.coa-type-card:focus-visible {
    outline: 3px solid rgba(23, 75, 59, .13);
    outline-offset: 2px;
}

.coa-type-card.selected {
    border-color: var(--brand);
    background: #f5faf7;
}

.coa-type-card-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin-right: 14px;
    border-radius: 12px;
    background: #edf6f1;
    color: var(--brand);
    font-size: 1.05rem;
}

.coa-type-card-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.coa-type-card-copy small {
    color: #65776f;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.coa-type-card-copy strong {
    margin-top: 2px;
    font-size: 1.28rem;
    line-height: 1.2;
}

.coa-type-card-copy span {
    margin-top: 4px;
    overflow: hidden;
    color: #7a8a83;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coa-type-card-chevron {
    margin-left: 10px;
    color: #8ca098;
    font-size: .78rem;
}

.coa-show-all-option {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: .5rem;
    min-height: 38px;
    padding: 0 .65rem;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.coa-show-all-option > .finance-standard-checkbox {
    margin-top: 0;
}

@media (max-width: 767.98px) {
    .coa-type-grid {
        grid-template-columns: 1fr;
    }

    .coa-reference-note {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}
