/*
   CraftGrid Finance & Accounting - mobile polish
   Presentation only. No accounting, posting, reporting, or workflow logic changes.
   Desktop layouts remain unchanged; mobile screens switch dense accounting tables to
   readable card-like rows so users never need horizontal scrolling for core data.
*/

.cg-accounting-page { min-width: 0; }

@media (max-width: 767.98px) {
    .cg-accounting-page,
    .cg-accounting-page .card,
    .cg-accounting-page .card-body,
    .gl-page,
    .tb-page,
    .bs-page,
    .pnl-page { min-width: 0; }

    /* Page headings / actions */
    .cg-accounting-page > .d-flex:first-child,
    .cg-accounting-reconciliation > .d-flex:first-child,
    .cg-accounting-posting-profiles > .d-flex:first-child,
    .cg-accounting-cost-centers > .d-flex:first-child {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .7rem !important;
    }

    .cg-accounting-page > .d-flex:first-child > div:first-child,
    .cg-accounting-reconciliation > .d-flex:first-child > div:first-child {
        min-width: 0;
    }

    .cg-accounting-page h2,
    .cg-accounting-reconciliation h2 {
        font-size: 1.45rem;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .cg-accounting-page > .d-flex:first-child > .btn,
    .cg-accounting-posting-profiles > .d-flex:first-child > .btn,
    .cg-accounting-cost-centers > .d-flex:first-child > .btn {
        width: 100%;
        min-height: 44px;
    }

    /* Filter cards: one comfortable field per row. */
    .cg-accounting-page form .row > [class*="col-md-"],
    .cg-accounting-page form .row > [class*="col-lg-"],
    .cg-accounting-reconciliation form .row > [class*="col-md-"] {
        width: 100%;
        flex: 0 0 100%;
    }

    .cg-accounting-page form .row > [class*="col-md-"] .btn,
    .cg-accounting-page form .row > [class*="col-lg-"] .btn,
    .cg-accounting-reconciliation form .row > [class*="col-md-"] .btn {
        min-height: 44px;
    }

    .cg-accounting-page form .row > .d-flex,
    .cg-accounting-reconciliation form .row > .d-flex {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: .55rem !important;
    }

    /* Generic accounting table -> mobile cards. */
    .cg-accounting-mobile-table {
        width: 100% !important;
        min-width: 0 !important;
        display: block;
        border-collapse: separate !important;
        border-spacing: 0;
    }

    .cg-accounting-mobile-table thead { display: none; }

    .cg-accounting-mobile-table tbody,
    .cg-accounting-mobile-table tbody tr {
        display: block;
        width: 100%;
    }

    .cg-accounting-mobile-table tbody tr {
        padding: .7rem .8rem;
        border-bottom: 1px solid #e3e8ee;
        background: #fff;
    }

    .cg-accounting-mobile-table tbody tr:last-child { border-bottom: 0; }

    .cg-accounting-mobile-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
        gap: .55rem;
        align-items: start;
        width: 100%;
        min-width: 0;
        padding: .4rem 0;
        border: 0 !important;
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .cg-accounting-mobile-table tbody td::before {
        content: attr(data-label);
        display: block;
        color: #64788b;
        font-size: .68rem;
        font-weight: 750;
        letter-spacing: .035em;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .cg-accounting-mobile-table tbody td[data-label=""]::before,
    .cg-accounting-mobile-table tbody td[colspan]::before { content: none; }

    .cg-accounting-mobile-table tbody td > * { min-width: 0; max-width: 100%; }

    .cg-accounting-mobile-table tbody td[data-label="Account"],
    .cg-accounting-mobile-table tbody td[data-label="Journal"],
    .cg-accounting-mobile-table tbody td[data-label="Code"] {
        font-weight: 600;
    }

    .cg-accounting-mobile-table tbody td[data-label="Actions"],
    .cg-accounting-mobile-table tbody td[data-label="Action"] {
        grid-template-columns: 1fr;
        margin-top: .35rem;
        padding-top: .65rem;
        border-top: 1px solid #e6ebef !important;
    }

    .cg-accounting-mobile-table tbody td[data-label="Actions"]::before,
    .cg-accounting-mobile-table tbody td[data-label="Action"]::before {
        margin-bottom: .35rem;
    }

    .cg-accounting-mobile-table tbody td[data-label="Actions"] .btn,
    .cg-accounting-mobile-table tbody td[data-label="Action"] .btn {
        min-height: 40px;
    }

    .cg-accounting-mobile-table tbody td[data-label="Actions"] > .btn + .btn {
        margin-left: .35rem !important;
    }

    /* Financial amounts stay visually aligned to the value side of the card. */
    .cg-accounting-mobile-table tbody td.text-end[data-label] > * {
        text-align: right;
    }

    /* Chart of Accounts: keep hierarchy compact but readable. */
    .cg-accounting-coa .craftgrid-coa-account {
        min-width: 0;
        width: 100%;
        padding-left: calc(var(--coa-depth) * .7rem);
        align-items: flex-start;
        overflow-wrap: anywhere;
    }

    .cg-accounting-coa .craftgrid-coa-table tbody td[data-label="Account"] > .craftgrid-coa-account {
        grid-column: 1 / -1;
    }

    /* Reconciliation: exactly the layout shown in the requested mobile design. */
    .cg-accounting-reconciliation .table-responsive {
        overflow: visible !important;
    }

    .cg-accounting-reconciliation .cg-accounting-mobile-table tbody tr {
        border: 1px solid #e3e8ee;
        border-radius: 12px;
        margin-bottom: .65rem;
        box-shadow: 0 2px 8px rgba(15,23,42,.035);
    }

    .cg-accounting-reconciliation .cg-accounting-mobile-table tbody tr:last-child { margin-bottom: 0; }

    /* GL / Trial Balance: remove their table wrappers' horizontal scroll on mobile. */
    .gl-table-wrap,
    .tb-table-wrap { overflow: visible !important; }

    .gl-table tbody tr,
    .tb-table tbody tr { box-shadow: 0 2px 8px rgba(15,23,42,.03); }

    .gl-table tbody td[data-label="Account"] .gl-account-link,
    .tb-table tbody td[data-label="Account"] a { overflow-wrap: anywhere; }

    .gl-table tbody td[data-label="Action"] a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        min-height: 40px;
    }

    /* Journal page already has its own mature mobile treatment; only constrain width. */
    .journal-page,
    .journal-grid-card,
    .journal-filter-card { min-width: 0; }

    /* Report hero/filter blocks */
    .gl-hero,
    .tb-hero,
    .bs-hero,
    .pnl-card,
    .gl-card,
    .tb-card { max-width: 100%; }

    .gl-hero,
    .tb-hero,
    .bs-hero { padding: 16px !important; }

    .gl-card-body,
    .tb-card-body { padding: 14px !important; }

    .gl-hero .row > [class*="col-"],
    .tb-hero .row > [class*="col-"],
    .bs-hero .row > [class*="col-"],
    .pnl-hero .row > [class*="col-"] {
        width: 100%;
        flex: 0 0 100%;
    }

    .gl-hero .btn,
    .tb-hero .btn,
    .bs-hero .btn,
    .pnl-hero .btn { width: 100%; min-height: 44px; }

    /* Financial statement summary rows wrap instead of squeezing. */
    .bs-line,
    .pnl-line,
    .bs-section-header,
    .pnl-section-header {
        gap: .65rem;
        flex-wrap: wrap;
    }

    .bs-line > span:first-child,
    .pnl-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }

    /* Pagination should never overflow the viewport. */
    .cg-accounting-page .pagination,
    .cg-accounting-page nav .pagination,
    .cg-accounting-reconciliation .pagination {
        flex-wrap: wrap;
        gap: .25rem;
    }
}

@media (max-width: 379.98px) {
    .cg-accounting-mobile-table tbody td {
        grid-template-columns: minmax(78px, 40%) minmax(0, 1fr);
        gap: .45rem;
        font-size: .84rem;
    }

    .cg-accounting-mobile-table tbody td::before { font-size: .64rem; }

    .cg-accounting-coa .craftgrid-coa-account { padding-left: calc(var(--coa-depth) * .5rem); }
}

/* -------------------------------------------------------------
   Accounting contextual help
   A small lightbulb is deliberately placed beside the section
   heading. It opens a plain-language explanation without taking
   permanent space on the page.
   ------------------------------------------------------------- */
.cg-accounting-help-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    margin: 0 0 0 .45rem;
}

.cg-accounting-help-button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d9e3ea;
    border-radius: 50%;
    background: #fff8df;
    color: #b17b00;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s ease;
}

.cg-accounting-help-button:hover,
.cg-accounting-help-button:focus-visible,
.cg-accounting-help-button[aria-expanded="true"] {
    background: #fff1b8;
    border-color: #d8b15a;
    color: #8a6100;
    outline: none;
    box-shadow: 0 0 0 3px rgba(216,177,90,.18);
}

.cg-accounting-help-popover {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 9px);
    left: 0;
    width: min(360px, calc(100vw - 40px));
    padding: 13px 14px;
    border: 1px solid #dbe4ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15,23,42,.14);
    color: #30465b;
    font-size: .86rem;
    line-height: 1.5;
}

.cg-accounting-help-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    color: #173f35;
    font-weight: 750;
}

.cg-accounting-help-title .bi {
    color: #b17b00;
}

.cg-accounting-help-text {
    color: #536b7f;
}

/* The Account field is a stacked identity block on narrow screens.
   This prevents the account code from being squeezed into the label
   column while the account name wraps underneath it. */
@media (max-width: 767.98px) {
    .cg-accounting-reconciliation .cg-accounting-mobile-table tbody td[data-label="Account"],
    .cg-accounting-coa .cg-accounting-mobile-table tbody td[data-label="Account"] {
        display: block;
        padding-top: .35rem;
    }

    .cg-accounting-reconciliation .cg-accounting-mobile-table tbody td[data-label="Account"]::before,
    .cg-accounting-coa .cg-accounting-mobile-table tbody td[data-label="Account"]::before {
        margin-bottom: .25rem;
    }

    .cg-accounting-reconciliation .cg-accounting-mobile-table tbody td[data-label="Account"] strong,
    .cg-accounting-coa .cg-accounting-mobile-table tbody td[data-label="Account"] strong {
        display: inline-block;
        margin-right: .15rem;
        font-size: .98rem;
    }

    .cg-accounting-help-popover {
        position: fixed;
        top: auto;
        left: 20px;
        right: 20px;
        bottom: 18px;
        width: auto;
        max-width: none;
    }
}

/* -------------------------------------------------------------
   Accounting column help
   Small info icons explain accounting table columns without adding
   permanent text or changing any accounting/reporting logic.
   ------------------------------------------------------------- */
.cg-accounting-column-help-table th {
    position: relative;
}

.cg-accounting-column-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: .3rem;
    vertical-align: middle;
}

.cg-accounting-column-help-button {
    width: 19px;
    height: 19px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b8193;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-size: .72rem;
    line-height: 1;
}

.cg-accounting-column-help-button:hover,
.cg-accounting-column-help-button:focus-visible {
    color: #174d43;
    background: #eef6f3;
    outline: none;
    box-shadow: 0 0 0 2px rgba(23,77,67,.12);
}

.cg-accounting-column-help-tooltip {
    position: absolute;
    z-index: 1090;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    width: min(290px, 70vw);
    padding: 9px 11px;
    border: 1px solid #d8e2e8;
    border-radius: 9px;
    background: #fff;
    color: #445b6e;
    box-shadow: 0 8px 22px rgba(15,23,42,.14);
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease, visibility .12s ease;
}

.cg-accounting-column-help-tooltip::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    width: 9px;
    height: 9px;
    background: #fff;
    border-left: 1px solid #d8e2e8;
    border-top: 1px solid #d8e2e8;
    transform: translateX(-50%) rotate(45deg);
}

.cg-accounting-column-help:hover .cg-accounting-column-help-tooltip,
.cg-accounting-column-help:focus-within .cg-accounting-column-help-tooltip {
    visibility: visible;
    opacity: 1;
}

.cg-accounting-column-help-tooltip strong {
    display: block;
    margin-bottom: 2px;
    color: #173f35;
    font-weight: 750;
}

.cg-reconciliation-summary {
    border-left-width: 4px;
}

.cg-reconciliation-summary-icon {
    margin-top: .1rem;
    font-size: 1.05rem;
}

@media (max-width: 767.98px) {
    .cg-accounting-column-help-tooltip {
        position: fixed;
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 18px;
        transform: none;
        width: auto;
        max-width: none;
        z-index: 1100;
    }

    .cg-accounting-column-help-tooltip::before {
        display: none;
    }
}

/* Posting Profiles: polished wide-screen table plus mobile/tablet summary cards. */
.cg-accounting-posting-profiles .cg-pp-heading-copy { min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-heading-copy p { max-width: 52rem; }
.cg-accounting-posting-profiles .cg-pp-filter-card .card-body { padding: 1rem; }
.cg-accounting-posting-profiles .cg-pp-filter-form .form-label {
    color: #334b60;
    font-size: .82rem;
    font-weight: 650;
    margin-bottom: .4rem;
}
.cg-accounting-posting-profiles .cg-pp-filter-form .form-control,
.cg-accounting-posting-profiles .cg-pp-filter-form .form-select,
.cg-accounting-posting-profiles .cg-pp-filter-form .btn { min-height: 44px; }
.cg-accounting-posting-profiles .cg-pp-filter-submit .btn { min-width: 44px; }
.cg-accounting-posting-profiles .cg-pp-clear-filter {
    color: #536a7f;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}
.cg-accounting-posting-profiles .cg-pp-clear-filter:hover,
.cg-accounting-posting-profiles .cg-pp-clear-filter:focus-visible {
    color: #0b5cab;
    text-decoration: underline;
}
.cg-accounting-posting-profiles .cg-pp-results-heading { gap: .75rem; min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-results-heading > * { min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-table-card { overflow: hidden; }
.cg-accounting-posting-profiles .cg-pp-desktop-table-wrap { overflow-x: hidden; }
.cg-accounting-posting-profiles .cg-pp-desktop-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-code { width: 18%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-name { width: 16%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-company { width: 20%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-event { width: 18%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-lines { width: 7%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-status { width: 8%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table .cg-pp-col-actions { width: 13%; }
.cg-accounting-posting-profiles .cg-pp-desktop-table thead th {
    background: #f4f8fb;
    border-bottom: 1px solid #dbe4ec;
    color: #52697d;
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .045em;
    padding: .85rem .7rem;
    text-transform: uppercase;
    vertical-align: middle;
}
.cg-accounting-posting-profiles .cg-pp-desktop-table tbody td {
    border-bottom: 1px solid #e7edf2;
    padding: .85rem .7rem;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.cg-accounting-posting-profiles .cg-pp-desktop-table tbody tr:last-child td { border-bottom: 0; }
.cg-accounting-posting-profiles .cg-pp-code-value {
    color: #213d55;
    display: block;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.cg-accounting-posting-profiles .cg-pp-name-value { display: block; font-weight: 600; color: #20394f; }
.cg-accounting-posting-profiles .cg-pp-company-value,
.cg-accounting-posting-profiles .cg-pp-event-value { display: block; color: #465e72; font-size: .87rem; }
.cg-accounting-posting-profiles .cg-pp-line-count {
    align-items: center;
    background: #edf4fa;
    border: 1px solid #d7e4ef;
    border-radius: 999px;
    color: #244c70;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 750;
    justify-content: center;
    min-height: 28px;
    min-width: 32px;
    padding: .15rem .5rem;
}
.cg-accounting-posting-profiles .cg-pp-status {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: .75rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    padding: .38rem .58rem;
    white-space: nowrap;
}
.cg-accounting-posting-profiles .cg-pp-status.is-active { background: #e7f6ed; color: #176b3b; }
.cg-accounting-posting-profiles .cg-pp-status.is-inactive { background: #f0f2f4; color: #5a6875; }
.cg-accounting-posting-profiles .cg-pp-row-actions { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.cg-accounting-posting-profiles .cg-pp-row-actions .btn { align-items: center; display: inline-flex; justify-content: center; min-height: 36px; padding: .35rem .55rem; }
.cg-accounting-posting-profiles .cg-pp-card-list { display: grid; gap: .75rem; min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-profile-card,
.cg-accounting-posting-profiles .cg-pp-empty-card { border: 1px solid #dfe7ee; border-radius: 14px; box-shadow: 0 3px 12px rgba(20, 42, 62, .045); min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-profile-card .card-body { padding: 1rem; min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-card-topline { align-items: flex-start; display: flex; gap: .7rem; justify-content: space-between; min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-card-title-wrap { flex: 1 1 auto; min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-card-code { color: #597188; font-size: .73rem; font-weight: 750; letter-spacing: .025em; overflow-wrap: anywhere; }
.cg-accounting-posting-profiles .cg-pp-card-title { color: #20394f; font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin: .2rem 0 0; overflow-wrap: anywhere; }
.cg-accounting-posting-profiles .cg-pp-card-details { display: grid; gap: .65rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1rem; }
.cg-accounting-posting-profiles .cg-pp-card-detail { display: flex; flex-direction: column; gap: .22rem; min-width: 0; }
.cg-accounting-posting-profiles .cg-pp-detail-label { color: #667c8e; font-size: .7rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.cg-accounting-posting-profiles .cg-pp-detail-value { color: #334e63; font-size: .88rem; overflow-wrap: anywhere; }
.cg-accounting-posting-profiles .cg-pp-card-line-detail { align-items: flex-start; }
.cg-accounting-posting-profiles .cg-pp-card-actions { border-top: 1px solid #e8edf2; display: grid; gap: .55rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1rem; padding-top: .85rem; }
.cg-accounting-posting-profiles .cg-pp-card-actions .btn { align-items: center; display: inline-flex; justify-content: center; min-height: 42px; white-space: normal; }
.cg-accounting-posting-profiles .cg-pp-pagination .pagination { align-items: center; gap: .25rem; flex-wrap: wrap; }
.cg-accounting-posting-profiles .cg-pp-pagination .page-link { border-radius: .55rem; }

@media (min-width: 992px) {
    .cg-accounting-posting-profiles .cg-pp-desktop-table-wrap { overflow-x: hidden !important; }
}

@media (max-width: 767.98px) {
    .cg-accounting-posting-profiles .cg-pp-results-heading { align-items: flex-start !important; flex-direction: column; }
    .cg-accounting-posting-profiles .cg-pp-filter-card .card-body { padding: .85rem; }
    .cg-accounting-posting-profiles .cg-pp-filter-submit .btn { width: 100%; }
    .cg-accounting-posting-profiles .cg-pp-card-details { grid-template-columns: minmax(0, 1fr); }
    .cg-accounting-posting-profiles .cg-pp-card-actions { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .cg-accounting-posting-profiles .cg-pp-desktop-table thead th,
    .cg-accounting-posting-profiles .cg-pp-desktop-table tbody td { padding-left: .5rem; padding-right: .5rem; }
    .cg-accounting-posting-profiles .cg-pp-row-actions .btn { padding-left: .4rem; padding-right: .4rem; }
}


/* -------------------------------------------------------------
   Customer Receipt allocation table and Trial Balance sizing
   Keep the tables inside the content card at every viewport width.
   ------------------------------------------------------------- */
.cg-customer-receipt-form,
.cg-customer-receipt-form .card,
.cg-customer-receipt-form .card-body,
.cg-customer-receipt-allocation-wrap {
    min-width: 0;
    max-width: 100%;
}

.cg-customer-receipt-allocation-wrap {
    overflow-x: hidden;
}

.cg-customer-receipt-allocation-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
}

.cg-customer-receipt-allocation-table th,
.cg-customer-receipt-allocation-table td {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: middle;
    padding-inline: .55rem;
}

.cg-customer-receipt-allocation-table .allocation-input {
    display: block;
    width: 100%;
    min-width: 0;
    padding-inline: .45rem;
}

.tb-page,
.tb-page .tb-card,
.tb-page .tb-table-wrap {
    min-width: 0;
    max-width: 100%;
}

.tb-mobile-totals { display: none; }

@media (max-width: 767.98px) {
    .cg-customer-receipt-form .cg-customer-receipt-allocation-wrap {
        overflow: visible !important;
    }

    .cg-customer-receipt-allocation-table {
        display: block;
        border-collapse: separate !important;
        border-spacing: 0;
    }

    .cg-customer-receipt-allocation-table thead { display: none; }

    .cg-customer-receipt-allocation-table tbody,
    .cg-customer-receipt-allocation-table tbody tr {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .cg-customer-receipt-allocation-table tbody tr {
        padding: .65rem .8rem;
        border-bottom: 1px solid #e3e8ee;
        background: #fff;
    }

    .cg-customer-receipt-allocation-table tbody tr:last-child { border-bottom: 0; }

    .cg-customer-receipt-allocation-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
        gap: .55rem;
        align-items: start;
        width: 100%;
        padding: .4rem 0;
        border: 0 !important;
        text-align: left !important;
        overflow-wrap: anywhere;
    }

    .cg-customer-receipt-allocation-table tbody td::before {
        content: attr(data-label);
        display: block;
        color: #64788b;
        font-size: .68rem;
        font-weight: 750;
        letter-spacing: .035em;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .cg-customer-receipt-allocation-table tbody td[data-label=""]::before,
    .cg-customer-receipt-allocation-table tbody td[colspan]::before { content: none; }

    .cg-customer-receipt-allocation-table tbody td > * { min-width: 0; max-width: 100%; }

    .cg-customer-receipt-allocation-table tbody td[data-label="Apply Amount"] {
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    }

    .cg-customer-receipt-allocation-table .allocation-input { width: 100%; }

    .tb-table-wrap { overflow: visible !important; max-height: none; }
    .tb-table { display: block; width: 100% !important; min-width: 0 !important; border-collapse: separate !important; border-spacing: 0; }
    .tb-table thead { display: none; }
    .tb-table tbody, .tb-table tbody tr { display: block; width: 100%; min-width: 0; }
    .tb-table tbody tr { padding: .7rem .8rem; border-bottom: 1px solid #e3e8ee; background: #fff; }
    .tb-table tbody tr:last-child { border-bottom: 0; }
    .tb-table tbody td {
        display: grid;
        grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
        gap: .55rem;
        align-items: start;
        width: 100%;
        min-width: 0;
        padding: .38rem 0;
        border: 0 !important;
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        font-size: .84rem;
    }
    .tb-table tbody td::before {
        content: attr(data-label);
        display: block;
        color: #64788b;
        font-size: .68rem;
        font-weight: 750;
        letter-spacing: .035em;
        line-height: 1.25;
        text-transform: uppercase;
    }
    .tb-table tbody td[data-label="Account"] { display: block; padding-top: .2rem; }
    .tb-table tbody td[data-label="Account"]::before { margin-bottom: .25rem; }
    .tb-table tbody td[data-label="Account"] a { display: block; min-width: 0; overflow-wrap: anywhere; }
    .tb-table tbody td[data-label="Account"] .tb-account-code { display: inline; }
    .tb-table tbody td[data-label="Account"] .tb-account-name { overflow-wrap: anywhere; }
    .tb-table tbody td[colspan]::before { content: none; }
    .tb-table tfoot { display: none; }

    .tb-mobile-totals { display: block; padding: .85rem; border-top: 1px solid #e3e8ee; background: #f8fafc; }
    .tb-mobile-total-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .tb-mobile-total-grid > div { display: flex; flex-direction: column; gap: .25rem; min-width: 0; padding: .65rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
    .tb-mobile-total-grid span { color: #64788b; font-size: .66rem; font-weight: 750; text-transform: uppercase; line-height: 1.25; }
    .tb-mobile-total-grid strong { color: #152f45; font-size: .82rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
}
