/*
 * Admin redesign (2026-11-22): the Billing block of the client editor and its
 * dialogs (vrs-admin-client-billing.js). The shared parts (.rd-bill, .rd-need,
 * .rd-seg, input.rd-switch) are in css/admin-redesign.css. Tokens only.
 */

/* The block: the state and History on one line. */
.rd-cb { min-width: 0; }
.rd-cb-head { justify-content: space-between; }
.rd-cb-link { color: var(--color-action-primary); text-decoration: none; }
.rd-cb-link:hover { text-decoration: underline; }
.rd-cb-list { margin: 0; padding-left: 16px; }
.rd-cb-list > li { padding: 4px 0; overflow-wrap: anywhere; }
.rd-cb .field-error,
.rd-cb-layer .field-error { color: var(--status-danger-text); }
.rd-cb-scroll { overflow-x: auto; }
.rd-cb-scroll td, .rd-cb-scroll th { white-space: nowrap; }

/* A dialog over the open editor (the shell modal is z-index 1000). */
.rd-cb-layer { z-index: 1010; }
.rd-cb-layer .modal-panel { width: min(520px, 100%); }
.rd-cb-body { display: grid; gap: 16px; }
.rd-cb-body textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 64px;
    padding: 8px 12px;
    border: 1px solid var(--color-control-border);
    border-radius: 8px;
    background: var(--color-field);
    color: var(--color-text-1);
    font: inherit;
    resize: vertical;
}
.rd-cb-field { display: grid; gap: 4px; min-width: 0; }
.rd-cb-needs { display: grid; gap: 8px; }
.rd-cb-needs:empty { display: none; }
.rd-cb-layer .modal-footer .rd-cb-anyway { margin-right: auto; }

/* "Billed to": the choice, then the search and the list. */
.rd-cb-picker { display: grid; gap: 4px; min-width: 0; }
.rd-cb-choice,
.rd-cb-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-1);
    color: var(--color-text-1);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.rd-cb-choice > span:first-child,
.rd-cb-option > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-cb-choice:disabled { opacity: 0.45; cursor: default; }
.rd-cb-chevron { margin-left: auto; color: var(--color-text-2); }
.rd-cb-search {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-bg);
    color: var(--color-text-1);
    font: inherit;
}
.rd-cb-menu {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-1);
}
.rd-cb-option { border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; background: none; }
.rd-cb-option:last-child { border-bottom: 0; }
.rd-cb-option:hover,
.rd-cb-option[aria-pressed="true"] { background: var(--color-surface-2); }
.rd-cb-option[aria-pressed="true"] { font-weight: 600; }
.rd-cb-new { color: var(--color-action-primary); }
.rd-cb-empty { padding: 12px; }
.rd-cb-choice:focus-visible,
.rd-cb-option:focus-visible,
.rd-cb-search:focus-visible { outline: 2px solid var(--color-action-primary); outline-offset: 2px; }

@media (max-width: 480px) {
    .rd-cb-layer .modal-footer { flex-wrap: wrap; }
    .rd-cb-layer .modal-footer .rd-cb-anyway { flex: 1 1 100%; margin-right: 0; }
}
