/* Issue #8905 — admin Billing page styling. */

/* Full-bleed wrapper — same pattern as admin-credit-cards (Sergey 2026-05-08). */
.cw-admin-fullbleed {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.cw-admin-fullbleed .card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}
body.page article > .cw-admin-fullbleed,
.entry-content > .cw-admin-fullbleed {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

#cw-admin-billing-wrap .dms-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    line-height: 1;
}
.cw-bill-status-paid       { background: #198754; color: #fff; }
.cw-bill-status-pending    { background: #ffc107; color: #212529; }
.cw-bill-status-overdue    { background: #d63638; color: #fff; }
.cw-bill-status-refunded   { background: #6c757d; color: #fff; }
.cw-bill-status-cancelled  { background: #495057; color: #fff; }
.cw-bill-status-unknown    { background: #6c757d; color: #fff; }

#cw-bill-table td { vertical-align: middle; font-size: 13px; }
#cw-bill-table .amount { font-family: 'Courier New', monospace; font-weight: 600; text-align: right; }
#cw-bill-table .invoice-num { font-family: 'Courier New', monospace; font-weight: 600; }

/* Status badges (mirror cc page tokens) */
.cw-bill-status-completed { background: #198754; color: #fff; }
.cw-bill-status-pending   { background: #ffc107; color: #212529; }
.cw-bill-status-failed    { background: #d63638; color: #fff; }
.cw-bill-status-refunded  { background: #6c757d; color: #fff; }
.cw-bill-status-unknown   { background: #6c757d; color: #fff; }
.cw-bill-ifs-ok       { background: #198754; color: #fff; }
.cw-bill-ifs-error    { background: #d63638; color: #fff; }
.cw-bill-ifs-pending  { background: #ffc107; color: #212529; }
.cw-bill-ifs-unknown  { background: #6c757d; color: #fff; }

/* KPIs */
#cw-bill-kpis .cw-kpi-num { font-size: 28px; font-weight: 700; line-height: 1.1; }
#cw-bill-kpis .cw-kpi-lbl { font-size: 11px; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.05em; }
#cw-bill-hero .cw-bill-hero-icon { font-size: 48px; }

/* DataTables.net tweaks */
#cw-bill-table_wrapper { padding: 0 8px; }
#cw-bill-table_wrapper .dataTables_info { font-size: 12px; color: #666; }
#cw-bill-table_wrapper .pagination { margin-bottom: 0; }

/* ─────────── #8909 — 2-tab UI (Invoices + Payments) ─────────── */
#cw-bill-tabs .nav-link {
    font-weight: 600;
    color: #495057;
    border: 1px solid transparent;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}
#cw-bill-tabs .nav-link.active {
    color: #198754;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}
#cw-bill-tabs .nav-link:hover:not(.active) {
    border-color: #e9ecef #e9ecef #dee2e6;
    background-color: #f8f9fa;
}
#cw-bill-invoices-table_wrapper { padding: 0 8px; }
#cw-bill-invoices-table_wrapper .dataTables_info { font-size: 12px; color: #666; }
#cw-bill-invoices-table_wrapper .pagination { margin-bottom: 0; }
#cw-bill-invoices-table td { vertical-align: middle; font-size: 13px; }
#cw-bill-invoices-table .amount { font-family: 'Courier New', monospace; font-weight: 600; }

/* Mobile: tab labels stay clear, table scrolls horizontally */
@media (max-width: 768px) {
    #cw-bill-tabs .nav-link { padding: 0.4rem 0.6rem; font-size: 13px; }
    #cw-bill-invoices-table_wrapper, #cw-bill-table_wrapper { overflow-x: auto; }
}

/* ─────────── #8910 — Cross-check KPI cohort row ─────────── */
#cw-bill-cohort-kpis .card { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
#cw-bill-cohort-kpis .card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
#cw-bill-cohort-kpis .card.cohort-active { box-shadow: 0 0 0 3px rgba(13,110,253,0.5); transform: translateY(-2px); }
#cw-bill-cohort-kpis .cw-cohort-icon { font-size: 24px; line-height: 1; margin-bottom: 4px; }
#cw-bill-cohort-kpis .cw-kpi-num { font-size: 28px; font-weight: 700; line-height: 1.1; }
#cw-bill-cohort-kpis .cw-kpi-lbl { font-size: 11px; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.05em; }
#cw-bill-cohort-kpis .cw-kpi-sub { font-size: 11px; }

/* Match badge variants for tables (purple = unrecognized cohort) */
.dms-badge-purple { background: #7e57c2; color: #fff; }

/* #8912 — Select2 chip alignment with the other small selects in the filters card */
#cw-admin-billing-wrap .select2-container .select2-selection--single {
    height: calc(1.5em + .5rem + 2px);
    padding: 1px 4px;
    font-size: .875rem;
}
#cw-admin-billing-wrap .select2-container .select2-selection__rendered { line-height: calc(1.5em + .5rem); padding-left: 6px; }
#cw-admin-billing-wrap .select2-container .select2-selection__arrow { height: calc(1.5em + .5rem); }
#cw-bill-table td .dms-badge.dms-badge-primary { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }

/* #9552 D3.5 — Loading skeletons for reconciliation KPI cards
   Renders a shimmering grey block while AJAX in flight.
   JS removes .cw-loading class on data arrival (loadReconciliationKpis success path). */
#cw-bill-reconciliation-kpis .cw-loading .cw-kpi-num,
#cw-bill-reconciliation-kpis .cw-loading .cw-kpi-sub {
    background: linear-gradient(90deg, #eaeaea 0%, #f4f4f4 50%, #eaeaea 100%);
    background-size: 200% 100%;
    animation: cw-skeleton-shimmer 1.4s linear infinite;
    color: transparent;
    border-radius: 4px;
}
@keyframes cw-skeleton-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
