/* The Receivables page. The cards at the top and the booking cards below are the
   Bills page's own (.payments-balance-card, .payments-booking-group); only the
   aging strip, the section heads and the two lines inside a card live here. */

.bookings-receivables-read-at {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.bookings-receivables-aging {
    margin: var(--spacing-sm) 0 var(--spacing-lg);
}

.bookings-receivables-aging__bar {
    display: flex;
    gap: var(--spacing-2xs);
    height: var(--spacing-smd);
    overflow: hidden;
    border-radius: var(--radius-pill);
}

.bookings-receivables-aging__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-lg);
    margin-top: var(--spacing-smd);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.bookings-receivables-aging__legend strong {
    margin-left: var(--spacing-xs);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.bookings-receivables-aging__dot {
    display: inline-block;
    width: var(--spacing-sm);
    height: var(--spacing-sm);
    margin-right: var(--spacing-xsm);
    border-radius: var(--radius-pill);
}

.bookings-receivables-aging__seg--not_due {
    background: var(--color-success);
}

.bookings-receivables-aging__seg--late_1_30 {
    background: var(--color-warning);
}

.bookings-receivables-aging__seg--late_31_60 {
    background: color-mix(in srgb, var(--color-warning), var(--color-error));
}

.bookings-receivables-aging__seg--late_61_plus {
    background: var(--color-error);
}

.bookings-receivables-aging__seg--no_date {
    background: var(--color-text-muted);
}

.bookings-receivables-section {
    margin-bottom: var(--spacing-lg);
}

.bookings-receivables-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--spacing-smd);
}

.bookings-receivables-section__sum {
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
}

.bookings-receivables-section__sum strong {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* One order can pay for a wedding and a bridal session, so the header can carry
   two pills and has to be allowed to wrap. */
.bookings-receivables-card__header {
    flex-wrap: wrap;
}

/* Both lines sit above the card's own ::before background. */
.bookings-receivables-paid,
.bookings-receivables-row {
    position: relative;
    z-index: var(--z-raised);
    display: grid;
    align-items: center;
    gap: var(--spacing-smd);
}

.bookings-receivables-paid {
    grid-template-columns: 15rem minmax(0, 1fr) auto;
    padding: var(--spacing-xs) var(--spacing-md) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.bookings-receivables-paid__sum {
    text-align: right;
}

.bookings-receivables-row {
    grid-template-columns: 15rem minmax(0, 1fr) 11rem 8rem 7rem;
    padding: var(--spacing-smd) var(--spacing-md);
    font-size: var(--font-size-md);
}

.bookings-receivables-row__when,
.bookings-receivables-row__card {
    color: var(--color-text-muted);
}

.bookings-receivables-row .global-badge {
    justify-self: start;
}

.bookings-receivables-row__amt {
    font-weight: var(--font-weight-medium);
    text-align: right;
}

@media (max-width: 860px) {
    .bookings-receivables-paid {
        grid-template-columns: 1fr;
    }

    .bookings-receivables-paid__sum {
        text-align: left;
    }

    .bookings-receivables-row {
        grid-template-columns: 1fr 1fr;
    }

    .bookings-receivables-row__amt {
        text-align: left;
    }

    /* The client's name is the end of the pill, so a long pill wraps here
       instead of cutting the name off. */
    .bookings-receivables-card__header .payments-booking-group__pill {
        white-space: normal;
        border-radius: var(--radius-lg);
    }
}
