/* Billing Page Styles - Dashboard Theme */

.billing-container {
    max-width: 1100px;
    margin: 100px auto 40px;
    padding: 0 20px;
}

.billing-header {
    text-align: center;
    margin-bottom: 40px;
}

.billing-header h2 {
    font-size: 2rem;
    color: var(--text-primary, #ffffff);
    margin-bottom: 10px;
}

.billing-header p {
    color: var(--text-secondary, #b0b0b0);
    font-size: 1.1rem;
}

.ios-billing-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(56, 177, 237, 0.1);
    border: 1px solid rgba(56, 177, 237, 0.3);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 28px;
    color: var(--text-secondary, #e0e0e0);
    font-size: 0.92rem;
    line-height: 1.5;
}

.ios-billing-notice .wi {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--primary-color, #38b1ed);
    margin-top: 1px;
}

.ios-billing-notice p {
    margin: 0;
}

.ios-billing-notice a {
    color: var(--primary-color, #38b1ed);
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    padding-bottom: 0;
}

.tab {
    background: transparent;
    border: none;
    padding: 15px 25px;
    font-size: 1rem;
    color: var(--text-secondary, #b0b0b0);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary-color, #38b1ed);
}

.tab.active {
    color: var(--primary-color, #38b1ed);
    border-bottom-color: var(--primary-color, #38b1ed);
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-top-color: var(--primary-color, #38b1ed);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: var(--text-secondary, #b0b0b0);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-primary, #ffffff);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-secondary, #b0b0b0);
}

/* Subscriptions Grid */
.subscriptions-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.subscription-card {
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    border-color: var(--primary-color, #38b1ed);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 177, 237, 0.15);
}

.subscription-info {
    flex: 1;
}

.subscription-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.subscription-title h3 {
    font-size: 1.3rem;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

.subscription-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.9rem;
}

.subscription-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.subscription-actions {
    display: flex;
    gap: 10px;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-past_due {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-suspended {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-cancelled {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-expired {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-unclaimed {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.status-depleted {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-locked {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Invoices Table */
.invoices-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.invoices-table thead {
    background: rgba(56, 177, 237, 0.1);
}

.invoices-table th {
    padding: 18px 20px;
    text-align: start;
    color: var(--primary-color, #38b1ed);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoices-table td {
    padding: 18px 20px;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-secondary, #b0b0b0);
}

.invoices-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.invoice-number {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.invoice-amount {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background: var(--primary-color, #38b1ed);
    color: #ffffff;
}

.btn:hover {
    background: #2a9fd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 177, 237, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.giftcard-tx-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #ffffff);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay .modal {
    position: relative;
    background: #0B1E3D;
    border: 1px solid rgba(56, 177, 237, 0.3);
    border-radius: 16px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    animation: modalIn 0.3s ease;
    z-index: 10000;
    /* Override dashboard-theme.css defaults */
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-overlay .modal > * {
    flex-shrink: 0;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-overlay .modal h3 {
    color: #ffffff !important;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: block;
    width: 100%;
    text-align: start;
}

.modal-overlay .modal p {
    color: #b0b0b0 !important;
    line-height: 1.6;
    margin-bottom: 25px;
    display: block;
    width: 100%;
    text-align: start;
}

.modal-overlay .modal .modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    width: 100%;
    margin-top: 20px;
}

/* Error Text */
.error-text {
    color: #ef4444;
    text-align: center;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .billing-container {
        margin-top: 80px;
    }

    .billing-header h2 {
        font-size: 1.5rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        border-bottom: none;
        border-inline-start: 3px solid transparent;
        text-align: start;
    }

    .tab.active {
        border-inline-start-color: var(--primary-color, #38b1ed);
        border-bottom-color: transparent;
    }

    .subscription-card {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .subscription-actions {
        width: 100%;
    }

    .subscription-actions .btn {
        width: 100%;
    }

    /* Horizontal-scroll table on a narrow screen means small hit targets and content that's easy
       to miss off-screen — a stacked card per invoice (each td labelled via data-label, set in
       scripts/billing.js) reads far better than scrolling a 6-column table sideways. */
    .invoices-table,
    .invoices-table tbody {
        display: block;
        width: 100%;
    }

    .invoices-table thead {
        display: none;
    }

    .invoices-table tr {
        display: block;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    }

    .invoices-table tr:last-child {
        border-bottom: none;
    }

    .invoices-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border-top: none;
        text-align: end;
    }

    .invoices-table td[data-label]::before {
        content: attr(data-label);
        color: var(--primary-color, #38b1ed);
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        text-align: start;
        flex-shrink: 0;
    }

    .invoices-table td[data-label="Action"] {
        justify-content: flex-end;
        padding-top: 10px;
    }

    .invoices-table td[data-label="Action"]::before {
        display: none;
    }

    .invoices-table td[data-label="Action"] .btn {
        width: 100%;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Payment modal
   --------------------------------------------------------------------------
   Three choices, one visible at a time. Stacked, they ran past the viewport and the action
   buttons at the bottom were never seen — hence tabs, a scroll region that is only the pane,
   and a footer pinned outside it.

   Money gets its own treatment: tabular figures so amounts line up column-wise, and a clear
   size jump so "what will I be charged" is the first thing read on each card.
   ========================================================================== */

.modal-overlay .modal.modal-wide {
    max-width: 620px;
    width: 92%;
    max-height: min(88vh, 760px);
    padding: 0;
    overflow: hidden;
}

.modal-overlay .modal.modal-wide > h3 {
    padding: 24px 28px 18px;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#payment-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 28px 4px;
}

.modal-overlay .modal.modal-wide .modal-actions {
    flex-shrink: 0;
    padding: 16px 28px 20px;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0B1E3D;
}

/* --- context strip -------------------------------------------------------- */

.pay-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.pay-summary-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 3px;
}

.pay-summary-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    text-transform: capitalize;
}

/* --- tabs ----------------------------------------------------------------- */

.pay-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 22px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.pay-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.87rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.pay-tab:hover {
    color: var(--text-primary, #ffffff);
}

.pay-tab.active {
    background: var(--primary-color, #38b1ed);
    color: #ffffff;
}

.pay-pane {
    display: none;
}

.pay-pane.active {
    display: block;
}

/* --- prepay cards --------------------------------------------------------- */

.pay-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.pay-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px 14px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.pay-plan:hover {
    border-color: rgba(56, 177, 237, 0.55);
}

.pay-plan:has(input:checked) {
    border-color: var(--primary-color, #38b1ed);
    background: rgba(56, 177, 237, 0.1);
}

.pay-plan:focus-within {
    outline: 2px solid var(--primary-color, #38b1ed);
    outline-offset: 2px;
}

/* The radio still owns selection and keyboard focus; it's just not what you look at. */
.pay-plan input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.pay-plan-term {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted, #9ca3af);
}

.pay-plan-total {
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary, #ffffff);
    font-variant-numeric: tabular-nums;
}

.pay-plan-rate {
    font-size: 0.78rem;
    color: var(--text-secondary, #e0e0e0);
    font-variant-numeric: tabular-nums;
}

.pay-plan-was {
    font-size: 0.72rem;
    color: var(--text-muted, #9ca3af);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.pay-plan-best {
    border-color: rgba(16, 185, 129, 0.45);
}

.pay-plan-ribbon {
    position: absolute;
    top: -9px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #10b981;
    color: #04231a;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* --- gift card balance toggle (prepay pane) -------------------------------- */

.pay-giftcard-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-primary, #e0e0e0);
    cursor: pointer;
    margin-bottom: 8px;
}

.pay-giftcard-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color, #38b1ed);
    cursor: pointer;
}

/* --- credits split -------------------------------------------------------- */

.credit-split {
    margin-bottom: 18px;
}

.credit-split-bar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    /* The track is the cash share; the filled part is what credits absorb. */
    background: var(--primary-color, #38b1ed);
    margin-bottom: 12px;
}

.credit-split-credits {
    display: block;
    height: 100%;
    background: #10b981;
}

.credit-split-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.86rem;
    color: var(--text-secondary, #e0e0e0);
    font-variant-numeric: tabular-nums;
}

.credit-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-inline-end: 7px;
    vertical-align: 1px;
}

.credit-dot.credits { background: #10b981; }
.credit-dot.cash { background: var(--primary-color, #38b1ed); }

/* --- method picker -------------------------------------------------------- */

.pay-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

/* Which provider bills this subscription today, so the change reads as a move from A to B. */
.pay-method-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 14px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
}

.pay-method-current-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #9ca3af);
}

/* Picker cards, matching the prepay pane. The radio still owns selection and keyboard focus —
   a bare native radio next to a label was the one thing in this modal that looked unstyled. */
.pay-method {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 12px;
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.pay-method:hover {
    border-color: rgba(56, 177, 237, 0.55);
}

.pay-method:has(input:checked) {
    border-color: var(--primary-color, #38b1ed);
    background: rgba(56, 177, 237, 0.1);
}

.pay-method:focus-within {
    outline: 2px solid var(--primary-color, #38b1ed);
    outline-offset: 2px;
}

.pay-method input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.pay-method-logo {
    height: 22px;
    width: auto;
    justify-self: start;
    /* The logos are dark-on-transparent artwork; on the navy panel they need lifting. */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.pay-method:has(input:checked) .pay-method-logo {
    opacity: 1;
}

.pay-method-name {
    color: var(--text-primary, #ffffff);
    font-size: 0.93rem;
    font-weight: 600;
}

.pay-method-blurb {
    grid-column: 1;
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
}

.pay-method-check {
    grid-row: 1 / span 2;
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: transparent;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pay-method:has(input:checked) .pay-method-check {
    background: var(--primary-color, #38b1ed);
    border-color: var(--primary-color, #38b1ed);
    color: #ffffff;
}

/* --- shared copy ---------------------------------------------------------- */

.pay-explain {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary, #e0e0e0);
    margin-bottom: 14px;
}

/* Caveats the customer has to read before paying, not after. Quiet, never hidden. */
.pay-note {
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 16px;
}

.pay-unavailable {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-muted, #9ca3af);
    background: rgba(255, 255, 255, 0.04);
    border-inline-start: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 0 8px 8px 0;
    padding: 13px 15px;
    margin-bottom: 6px;
}

.pay-pane .btn {
    width: 100%;
}

@media (max-width: 520px) {
    .modal-overlay .modal.modal-wide > h3 { padding: 18px 18px 14px; }
    #payment-modal-body { padding: 16px 18px 4px; }
    .modal-overlay .modal.modal-wide .modal-actions { padding: 14px 18px 16px; }
    .pay-summary { grid-template-columns: 1fr 1fr; }
    .pay-plans { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .pay-tab, .pay-plan, .pay-method { transition: none; }
}

/* ==========================================================================
   Pay what you eat usage tab
   ========================================================================== */

.usage-card {
    padding: 20px 22px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.usage-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.usage-card-head h3 {
    font-size: 1rem;
    color: var(--text-primary, #ffffff);
    margin-bottom: 6px;
}

.usage-card-spend {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.usage-spent {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary, #ffffff);
}

.usage-cap {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
}

.usage-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 12px;
}

.usage-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--primary-color, #38b1ed);
    transition: width 0.4s ease;
}

/* The colour is the warning: amber approaching the limit, red once it stops the server. */
.usage-bar-fill.warn { background: #f59e0b; }
.usage-bar-fill.over { background: #ef4444; }

.usage-cap-edit {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.usage-cap-edit label {
    font-size: 0.84rem;
    color: var(--text-secondary, #e0e0e0);
}

.usage-cap-edit input {
    width: 104px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary, #ffffff);
    font-family: inherit;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.usage-cap-edit input:focus {
    outline: none;
    border-color: var(--primary-color, #38b1ed);
}

.usage-cap-edit span {
    color: var(--text-muted, #9ca3af);
    margin-inline-start: -4px;
}

@media (prefers-reduced-motion: reduce) {
    .usage-bar-fill { transition: none; }
}

/* How a Pay what you eat plan gets settled, on its usage card. */
.usage-collection {
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.usage-collection-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.usage-collection-mode {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #9ca3af);
}

.usage-collection-figure {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #ffffff);
}

/* Amber, not red: a low balance or a missing card is something to do, not something broken. */
.usage-collection-figure.low {
    color: #f59e0b;
}

.usage-collection .btn-small {
    margin-top: 4px;
}

/* What the customer still owes. Amber and above the method's detail, because it is the only
   thing on this card that leads to a suspended server. */
.usage-owing {
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 9px;
    background: rgba(245, 158, 11, 0.08);
}

.usage-owing .pay-note {
    margin-bottom: 10px;
}

/* Spending referral credits on a top-up. A checkbox rather than an amount field: the share they
   can cover is fixed by the cash floor, so there is nothing for the customer to decide. */
.usage-credits {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted, #9ca3af);
}

.usage-credits input {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary-color, #38b1ed);
}
