/*
 * Admin redesign (2026-11-22): Client billing only. The shared parts are in
 * css/admin-redesign.css. Colours come from the admin tokens. Spacing uses the
 * 4pt scale.
 */

/* The status line of Client billing and the lines about calls that are not invoiced. */
.rd-billing-status { margin: 0 0 12px; }
.rd-billing-status:empty { display: none; }
.rd-billing-error { color: var(--status-danger-text); }
.rd-billing-empty { padding: 24px; color: var(--color-text-3); text-align: center; }

.rd-billing-attention { margin: 0 0 16px; }
.rd-billing-filters { align-items: center; gap: 12px; }
.rd-billing-search { flex: 1 1 200px; min-width: 0; }

/* "More actions": a closed list of the actions that are not used each day. */
.rd-billing-more { position: relative; display: inline-block; }
.rd-billing-more > summary { list-style: none; cursor: pointer; }
.rd-billing-more > summary::-webkit-details-marker { display: none; }
.rd-billing-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 5;
    display: grid;
    gap: 4px;
    min-width: 220px;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-1);
}
.rd-billing-menu > .btn { justify-content: flex-start; width: 100%; text-align: left; }
.rd-billing-option { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; }

/* A wide table scrolls inside its card; a name does not break into three lines. */
#billing-tab [data-billing-panel="receivables"] .table-container { overflow-x: auto; }
#billing-tab [data-billing-panel="receivables"] td:first-child strong { white-space: nowrap; }

/* The run bar: how many are ticked, then the two buttons. */
.rd-billing-runbar { padding: 12px 16px; }

/* One Billing Profile: two columns of cards, one Save bar. */
.rd-billing-profile { display: grid; gap: 16px; }
.rd-billing-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.rd-billing-column { display: grid; gap: 16px; min-width: 0; }
.rd-billing-other > summary { padding: 12px 16px; cursor: pointer; }
.rd-billing-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rd-billing-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--color-surface-2);
    overflow-wrap: anywhere;
}
.rd-billing-chip > button {
    min-width: 24px;
    min-height: 24px;
    border: 0;
    background: none;
    color: var(--color-text-2);
    font: inherit;
    cursor: pointer;
}
.rd-billing-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.rd-billing-add > input { flex: 1 1 160px; min-width: 0; }
.rd-billing-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-action-primary);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

/* Smaller screens: the columns stack, the filters wrap, a menu stays on the page. */
@media (max-width: 820px) {
    .rd-billing-columns { grid-template-columns: minmax(0, 1fr); }
    .rd-billing-menu { right: auto; left: 0; }
}
@media (max-width: 390px) {
    .rd-billing-menu { min-width: 0; width: calc(100vw - 32px); }
    .rd-billing-runbar { flex-wrap: wrap; }
}
