/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

.tb2b-ledger-content {
    position: relative;
    transition: opacity 0.3s ease;
    min-height: 400px;
}

.tb2b-ledger-content.tb2b-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tb2b-ledger-content.tb2b-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    margin-left: -25px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: #007cba;
    border-radius: 50%;
    animation: tb2b-spin 0.8s linear infinite;
    z-index: 999;
}

@keyframes tb2b-spin {
    to { transform: rotate(360deg); }
}

.tb2b-ledger-content .tb2b-ledger-grid {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}
.tb2b-ledger-content .tb2b-stat-card {
    flex: 1;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #eee;
}
.tb2b-ledger-content .tb2b-stat-card.outstanding .value{
    color: #e74c3c;
}
.tb2b-ledger-content .tb2b-stat-card.paid .value{
    color: #2ecc71;
}
.tb2b-ledger-content .tb2b-stat-card .label { 
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #777;
}
.tb2b-ledger-content .tb2b-stat-card .value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.tb2b-ledger-content .tb2b-ledger-filters-form {
    background: #fafafa;
    padding: 20px;
    border: 1px solid #eee;
    margin-bottom: 30px;
}
.tb2b-ledger-content .tb2b-ledger-filters-form .form-row {
    margin-bottom: 15px;
}

.tb2b-ledger-content .order-status.status-paid {
    color: #2ecc71;
}
.tb2b-ledger-content .order-status.status-unpaid {
    color: #e74c3c;
}

.tb2b-ledger-filters-form .tb2b-filter-action,
.tb2b-ledger-filters-form .tb2b-filter-row{
    display: flex;
    gap: 15px;
}
#tb2b-customer-balance{
    margin-bottom: 15px;
}
.tb2b-ledger-entry__container{
    position: relative;
}
.tb2b-ledger-entry__container.tb2b-loading {
    opacity: 0.6;
    pointer-events: none;
}
.tb2b-ledger-entry__container.tb2b-loading::after {
    content: "";
    position: absolute;
    top: 2px;
    right: -50px;
    width: 30px;
    height: 30px;

    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: #007cba;
    border-radius: 50%;
    animation: tb2b-spin 0.8s linear infinite;
    z-index: 999;
}
.tb2b-ledger-entry table{
    width: 100%;
    margin: 0;
}

.tb2b-ledger-entry dl{
    margin: 0;
}

.tb2b-ledger-entry td,
.tb2b-ledger-entry dd{
    margin: 0;
}

.entry__top-table{
    margin-bottom: calc(var(--spacing) * 8);
}
.entry__top-table>tr>td,
.entry__top-table>tbody>tr>td{
    padding:1em;
}
.tb2b-ledger-entry .entry__head-table td,
.tb2b-ledger-entry .entry__head-table th{
    padding: 5px;
}
.tb2b-ledger-entry .entry__head-table .td-empty{
    width: 100%;
}
.tb2b-ledger-entry .entry__desc-td{
    vertical-align: bottom;
    width: 50%;
}
.tb2b-ledger-entry .entry__head-td{
    vertical-align: top;
    width: 50%;
}
.tb2b-ledger-entry .entry__head{
    float: right;
}
.tb2b-ledger-entry .entry__head .field-label{
    font-weight: 600;
}
.tb2b-ledger-entry .entry__head .field-label,
.tb2b-ledger-entry .entry__head .field-value{
    white-space: nowrap;
}

.tb2b-ledger-entry .entry__desc .field-label{
    display: none;
}
.entry__items-table td{
    font-size: 0.8rem;
}
.entry__items-table.tb2b-table th,
.entry__items-table.tb2b-table td{
    padding: 1em 1.2em;
}
.tb2b-ledger-entry .entry__totals-table{
    /*margin-top: 50px;*/
    margin-top: calc(var(--spacing) * 10);
}

.tb2b-ledger-entry .entry__totals-table .td-empty{
    width: 100%;
}
.entry__totals-table>tr>td,
.entry__totals-table>tbody>tr>td{
    padding:1em;
}
.tb2b-ledger-entry .entry__totals-td-left{
    width: 100%;
}
.tb2b-ledger-entry .entry__totals-td-right{
    width: auto;
}
.tb2b-ledger-entry .entry__totals .entry__field{
}
.tb2b-ledger-entry .entry__totals .field-label{
    font-weight: 600;
}
.tb2b-ledger-entry .entry__totals .field-label,
.tb2b-ledger-entry .entry__totals .field-value{
    white-space: nowrap;
}

.tb2b-ledger-inline-list{
    list-style: none;
    margin: 0;
    display: flex;
    list-style: none;
    gap: 15px;
}
.tb2b-ledger-entry-actions{
    margin-bottom: 15px;
}
.tb2b-ledger-entry-actions .tb2b-ledger-inline-list li:first-child{
    margin-left: auto;
}

@media screen {
    .tb2b-ledger-entry-print {
        display: none;
    }
}
@media print {
    body.tb2b-ledger-printing>* {
        display: none !important;
    }

    body.tb2b-ledger-printing .tb2b-ledger-entry-print{
        display: block !important;
    }
    body.tb2b-ledger-printing {
        margin: 0;
        padding: 0;
    }
}

#tb2b-ledger-table-wrapper th.sortable {
    cursor: pointer;
    transition: background 0.2s;
}

#tb2b-ledger-table-wrapper th.sortable:hover {
    background: #f0f0f0 !important;
}

#tb2b-ledger-table-wrapper th.sortable::after {
    content: ' \2195';
    opacity: 0.2;
    font-size: 0.8em;
}

#tb2b-ledger-table-wrapper th.active-sort.sort-desc::after {
    content: ' \2193';
    opacity: 1;
}

#tb2b-ledger-table-wrapper th.active-sort.sort-asc::after {
    content: ' \2191';
    opacity: 1;
}

.tb2b-ledger-customer-card h1,
.tb2b-ledger-customer-card h2,
.tb2b-ledger-customer-card h3{
    font-weight: 700;
}
.tb2b-ledger-customer-card .customer-card__company h1,
.tb2b-ledger-customer-card .customer-card__ssn h2{
    margin-top: 0;
}
.tb2b-ledger-customer-card .customer-card__boxes,
.tb2b-ledger-customer-card .customer-card__boxes-bottom{
    text-align: center;
}
.tb2b-ledger-customer-card .tb2b-box{
    margin-bottom: calc(var(--spacing) * 8);
}
@media (min-width: 48rem) {
    .tb2b-ledger-customer-card .tb2b-box{
        margin-bottom: 0;
    }
}
.tb2b-ledger-customer-card .tb2b-box .field-label{
    font-size: 1rem;
    display: block;
    margin-bottom: calc(var(--spacing) * 8);
}
.tb2b-ledger-customer-card .tb2b-box{
    border: 2px solid oklch(92.8% .006 264.531);
    background: #fff;
    padding: calc(var(--spacing) * 8);
    border-radius: var(--radius);
/*    margin: calc(var(--spacing) * 8);*/
}
.tb2b-ledger-customer-card .tb2b-box-container{
/*    margin-bottom: calc(var(--spacing) * 8);*/
}
@media (min-width: 48rem) {
    .customer-card__boxes{
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: calc(var(--spacing) * 8);
    }
    .tb2b-ledger-customer-card .tb2b-box-container{
         flex: 1 1 auto;
    }
}