/* ==========================================================================
   Accounts.css — styles specific to the Accounts module screens.
   ========================================================================== */

.acct-report-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden
}

.acct-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px
}

    .acct-report-table thead th {
        font-weight: 700;
        font-size: 10.5px;
        letter-spacing: .04em;
        color: var(--text-3);
        padding: 11px 16px;
        background: var(--surface-2);
        text-align: left
    }

        .acct-report-table thead th.num {
            text-align: right
        }

    .acct-report-table tbody td {
        padding: 10px 16px
    }

        .acct-report-table tbody td.num {
            text-align: right
        }

    .acct-report-table tbody tr {
        border-top: 1px solid var(--border)
    }

        .acct-report-table tbody tr.section td {
            background: var(--surface-2)
        }

        .acct-report-table tbody tr.total td {
            border-top: 1.5px solid var(--border-strong)
        }

.erp-c18 {
    grid-column: span 18
}

/* ---------- Report : Cash / Bank radio row ---------- */
.acct-radio-row {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    margin-bottom: 5px
}

.acct-radio {
    display: flex !important;
    align-items: center;
    gap: 7px;
    margin-bottom: 0 !important;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text)
}

    .acct-radio input[type=radio] {
        width: 15px;
        height: 15px;
        accent-color: var(--primary);
        cursor: pointer;
        margin: 0
    }

/* ---------- Date Range : from [To] to ---------- */
.acct-daterange {
    display: flex;
    align-items: center;
    gap: 8px
}

    .acct-daterange .erp-ctl {
        flex: 1 1 0;
        min-width: 0
    }

.acct-daterange-sep {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    padding-bottom: 5px;
    flex: 0 0 auto
}

/* ---------- Find button sits on the field baseline ---------- */
.acct-find-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end
}

    .acct-find-cell .app-btn-primary {
        height: 42px;
        margin-bottom: 5px
    }

/* ---------- grand total / closing row of the report table ---------- */
.acct-report-table tbody tr.grand td {
    background: var(--surface-2);
    border-top: 2px solid var(--border-strong)
}

/* ==========================================================================
   Trial Balance additions
   ========================================================================== */

/* checkbox shares the radio row styling (Non Zero) */
.acct-radio input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0
}

/* 9-column trial balance grid: keep cells on one line, let the wrapper scroll */
.acct-tb-table {
    min-width: 1180px
}

    .acct-tb-table thead th {
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 1
    }

    .acct-tb-table tbody td {
        white-space: nowrap;
        padding: 8px 14px
    }

/* the "--------" placeholders in the TOTAL rows */
.acct-tb-dash {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: -.5px
}

/* ==========================================================================
   Bootstrap 5.3 accordion, restyled to the existing ss-acc-* look.
   Bootstrap's own chrome is neutralised via its CSS variables, so the panels
   keep the app's border, radius, surface and typography exactly as before.
   ========================================================================== */
.ss-accordion.accordion {
    --bs-accordion-bg: var(--surface);
    --bs-accordion-color: var(--text);
    --bs-accordion-border-color: var(--border);
    --bs-accordion-border-width: 1px;
    --bs-accordion-border-radius: var(--r-lg, 14px);
    --bs-accordion-inner-border-radius: var(--r-lg, 14px);
    --bs-accordion-btn-padding-x: 18px;
    --bs-accordion-btn-padding-y: 14px;
    --bs-accordion-btn-color: var(--text);
    --bs-accordion-btn-bg: transparent;
    --bs-accordion-btn-focus-box-shadow: none;
    --bs-accordion-active-color: var(--text);
    --bs-accordion-active-bg: transparent;
    --bs-accordion-body-padding-x: 18px;
    --bs-accordion-body-padding-y: 18px;
    gap: 10px
}

    /* each item stays a separate rounded card, not a stacked group */
    .ss-accordion.accordion .accordion-item {
        border-radius: var(--r-lg, 14px);
        overflow: hidden
    }

        .ss-accordion.accordion .accordion-item + .accordion-item {
            border-top-width: 1px;
            margin-top: 10px
        }

    /* kill Bootstrap's built-in caret — the bi-chevron-down span is used instead */
    .ss-accordion.accordion .accordion-button::after {
        display: none
    }

    .ss-accordion.accordion .accordion-button {
        font-family: var(--font-body);
        box-shadow: none
    }

        .ss-accordion.accordion .accordion-button:not(.collapsed) {
            box-shadow: none
        }

    .ss-accordion.accordion .accordion-body {
        padding-top: 4px;
        border-top: 1px solid var(--border)
    }

/* chevron rotation now keys off the collapsed state, not the old .open class */
.accordion-button.ss-acc-header .ss-acc-chevron {
    transform: rotate(180deg)
}

.accordion-button.ss-acc-header.collapsed .ss-acc-chevron {
    transform: rotate(0deg)
}


.am-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0
}

.am-collapsible {
    display: none
}

.am-toggle:checked ~ .am-collapsible {
    display: block;
    background: var(--surface-2);
    border-color: var(--border-strong, var(--border))
}

/* ---------- round + button ---------- */
.am-plus-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start
}

.am-plus-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 5px;
    flex: 0 0 auto;
    transition: background .15s ease
}

    .am-plus-btn:hover {
        background: var(--primary-2, var(--primary));
        color: #fff
    }

/* + turns into an × once the section is open, so it reads as a toggle */
.am-toggle:checked ~ .modal-box .am-plus-btn {
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border)
}

    .am-toggle:checked ~ .modal-box .am-plus-btn i::before {
        content: "\f659" /* bi-dash-lg */
    }

/* ---------- input with a button glued to its right ---------- */
.am-inline-action {
    display: flex;
    align-items: stretch;
    gap: 0
}

    .am-inline-action .erp-ctl {
        flex: 1;
        min-width: 0;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0
    }

.am-ok-btn {
    height: auto;
    min-width: 46px;
    padding: 0 14px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 5px
}

.am-cancel-btn {
    height: 34px;
    margin-bottom: 5px
}

/* ---------- checkboxes ---------- */
.am-check {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px !important;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2)
}

    .am-check input[type=checkbox] {
        width: 15px;
        height: 15px;
        accent-color: var(--primary);
        cursor: pointer;
        margin: 0;
        flex: 0 0 auto
    }

.am-check-cell {
    display: flex;
    flex-direction: column;
    justify-content: flex-end
}

/* ---------- Account Assigned row ---------- */
.am-assign-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 34px;
    padding: 2px 12px
}

.am-assign-label {
    margin-bottom: 5px;
    flex: 1 1 auto
}

/* ---------- small screens ---------- */
@media (max-width: 700px) {
    .am-assign-row {
        gap: 8px 18px
    }

    .am-inline-action {
        flex-wrap: nowrap
    }
}