/* Premium company billing operations workspace */
.company-billing-page {
    --cb-ink: #10213d;
    --cb-muted: #657792;
    --cb-line: #e4eaf3;
    --cb-soft: #f6f8fc;
    --cb-blue: #3167ed;
    --cb-navy: #101d3b;
    max-width: 1540px;
    margin: 0 auto;
    padding: 28px 26px 46px;
    color: var(--cb-ink);
}

.cb-page-header,
.cb-header-actions,
.cb-hero,
.cb-hero__signals,
.cb-metric,
.cb-ledger__header,
.cb-ledger__count,
.cb-filter-bar,
.cb-filter-insights,
.cb-company,
.cb-badges,
.cb-payment-method,
.cb-row-actions,
.cb-ledger__footer,
.cb-button,
.cb-action,
.cb-action-complete,
.cb-modal__header,
.cb-audit-note {
    display: flex;
    align-items: center;
}

.cb-page-header {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.cb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    color: #8a9ab2;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cb-breadcrumb i { font-size: .55rem; }
.cb-breadcrumb strong { color: var(--cb-blue); }

.cb-page-header h1 {
    margin: 0;
    color: #0b1830;
    font-size: clamp(1.85rem, 2.4vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -.045em;
}

.cb-page-header p,
.cb-ledger__header p {
    margin: 6px 0 0;
    color: var(--cb-muted);
    font-size: .96rem;
}

.cb-header-actions { gap: 10px; flex-wrap: wrap; }

.cb-button,
.cb-icon-button,
.cb-action {
    border: 0;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.cb-button {
    min-height: 42px;
    justify-content: center;
    gap: 9px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: .84rem;
    font-weight: 750;
}

.cb-button:hover,
.cb-action:hover,
.cb-icon-button:hover { transform: translateY(-1px); }
.cb-button--primary { background: linear-gradient(135deg, #3975f5, #2559df); color: #fff; box-shadow: 0 8px 18px rgba(49, 103, 237, .2); }
.cb-button--primary:hover { color: #fff; box-shadow: 0 10px 24px rgba(49, 103, 237, .28); }
.cb-button--quiet { background: #fff; color: #334762; border: 1px solid #dce4ef; }
.cb-button--quiet:hover { color: var(--cb-blue); border-color: #adc3f6; }
.cb-button--danger { background: #e74957; color: #fff; }
.cb-button--danger:hover { color: #fff; background: #d93a48; }

.cb-hero {
    position: relative;
    overflow: hidden;
    justify-content: space-between;
    gap: 32px;
    min-height: 210px;
    margin-bottom: 16px;
    padding: 34px 38px;
    border: 1px solid rgba(116, 147, 207, .24);
    border-radius: 22px;
    background:
        radial-gradient(circle at 85% 10%, rgba(73, 118, 255, .28), transparent 34%),
        linear-gradient(125deg, #0d1830 0%, #15264d 56%, #18326b 100%);
    color: #fff;
    box-shadow: 0 18px 45px rgba(17, 35, 75, .16);
}

.cb-hero::after {
    position: absolute;
    right: 31%;
    bottom: -105px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 50%;
    content: "";
}

.cb-hero__glow {
    position: absolute;
    top: -80px;
    right: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(95, 143, 255, .18);
    filter: blur(10px);
}

.cb-hero__content,
.cb-hero__amount { position: relative; z-index: 1; }
.cb-hero__content { max-width: 690px; }

.cb-eyebrow,
.cb-section-kicker {
    color: #8fb1ff;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.cb-eyebrow span {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: #45e39a;
    box-shadow: 0 0 0 5px rgba(69, 227, 154, .12);
}

.cb-hero h2 {
    margin: 10px 0 7px;
    color: #fff;
    font-size: clamp(1.55rem, 2.1vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.cb-hero__content > p { margin: 0; color: #aebcda; font-size: .94rem; }
.cb-hero__signals { gap: 18px; flex-wrap: wrap; margin-top: 25px; color: #dce5f8; font-size: .78rem; font-weight: 650; }
.cb-hero__signals > div { display: flex; align-items: center; gap: 8px; }
.cb-hero__signals i { color: #79a0ff; }
.cb-signal { width: 8px; height: 8px; border-radius: 50%; }
.cb-signal--danger { background: #ff7181; box-shadow: 0 0 0 5px rgba(255, 113, 129, .12); }
.cb-signal--good { background: #45e39a; box-shadow: 0 0 0 5px rgba(69, 227, 154, .12); }

.cb-hero__amount {
    min-width: 310px;
    padding: 20px 22px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    background: rgba(255,255,255,.075);
    backdrop-filter: blur(12px);
}

.cb-hero__amount > span { display: block; color: #9eafd0; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.cb-hero__amount > strong { display: block; margin-top: 6px; font-size: clamp(1.85rem, 2.5vw, 2.55rem); font-weight: 800; letter-spacing: -.04em; }
.cb-hero__amount > small { display: block; color: #a9b8d4; font-size: .72rem; }
.cb-collection-progress { margin-top: 18px; }
.cb-collection-progress__meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: #bdc9e0; font-size: .72rem; }
.cb-collection-progress__meta strong { color: #fff; }
.cb-collection-progress__track { overflow: hidden; height: 6px; border-radius: 999px; background: rgba(255,255,255,.12); }
.cb-collection-progress__track span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #5a8eff, #51dfa5); }

.cb-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.cb-metric {
    min-width: 0;
    gap: 13px;
    padding: 17px;
    border: 1px solid var(--cb-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(21, 42, 81, .045);
}

.cb-metric__icon { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border-radius: 12px; font-size: .96rem; }
.cb-metric > div:last-child { min-width: 0; }
.cb-metric span { display: block; color: #71819a; font-size: .65rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.cb-metric strong { display: block; overflow: hidden; margin: 2px 0 1px; color: #12213a; font-size: 1.22rem; font-weight: 800; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.cb-metric small { display: block; overflow: hidden; color: #94a1b4; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.cb-metric--blue .cb-metric__icon { color: #2d68ef; background: #edf3ff; }
.cb-metric--green .cb-metric__icon { color: #0c9d65; background: #eafaf2; }
.cb-metric--amber .cb-metric__icon { color: #ce8200; background: #fff7e4; }
.cb-metric--red .cb-metric__icon { color: #e14353; background: #fff0f1; }
.cb-metric--violet .cb-metric__icon { color: #7756db; background: #f2efff; }

.cb-ledger {
    overflow: hidden;
    border: 1px solid var(--cb-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(24, 44, 79, .07);
}

.cb-ledger__header { justify-content: space-between; gap: 18px; padding: 23px 24px 17px; }
.cb-section-kicker { color: var(--cb-blue); }
.cb-ledger__header h2 { margin: 3px 0 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.cb-ledger__header p { margin-top: 3px; font-size: .8rem; }
.cb-ledger__count { gap: 10px; padding: 9px 12px; border-radius: 11px; color: #667792; background: #f3f6fb; font-size: .73rem; }
.cb-ledger__count i { color: var(--cb-blue); }
.cb-ledger__count strong { color: #152743; font-size: .92rem; }

.cb-filter-bar {
    gap: 10px;
    margin: 0 24px;
    padding: 10px;
    border: 1px solid #e0e7f1;
    border-radius: 14px;
    background: #f8fafd;
}

.cb-search-field { position: relative; flex: 1 1 330px; }
.cb-search-field > i { position: absolute; top: 50%; left: 14px; color: #92a2ba; transform: translateY(-50%); }
.cb-search-field input { width: 100%; height: 43px; padding: 0 54px 0 39px; border: 1px solid #dbe4ef; border-radius: 10px; outline: none; background: #fff; color: #20334f; font-size: .8rem; }
.cb-search-field input:focus { border-color: #7ea6ff; box-shadow: 0 0 0 3px rgba(49, 103, 237, .1); }
.cb-search-field kbd { position: absolute; top: 50%; right: 10px; padding: 3px 6px; border: 1px solid #dfe6f0; border-radius: 5px; background: #f7f9fc; color: #94a2b6; font: 600 .62rem inherit; box-shadow: none; transform: translateY(-50%); }

.cb-select-field { flex: 0 1 190px; margin: 0; }
.cb-select-field > span { display: block; margin: 0 0 3px 2px; color: #7e8da3; font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cb-select-field select { width: 100%; height: 43px; padding: 0 34px 0 11px; border: 1px solid #dbe4ef; border-radius: 10px; outline: 0; background-color: #fff; color: #243752; font-size: .76rem; }
.cb-filter-apply { align-self: flex-end; min-height: 43px; }
.cb-icon-button { display: grid; align-self: flex-end; flex: 0 0 43px; height: 43px; place-items: center; border: 1px solid #dbe4ef; border-radius: 10px; background: #fff; color: #6c7b91; }

.cb-filter-insights { justify-content: space-between; gap: 12px; min-height: 40px; padding: 8px 25px; color: #8795a9; font-size: .68rem; }
.cb-filter-insights i { margin-right: 5px; color: #6486d4; }
.cb-active-filter { padding: 5px 8px; border-radius: 999px; background: #edf3ff; color: #315fca; font-weight: 700; }

.cb-table-wrap { overflow-x: auto; border-top: 1px solid #edf1f6; }
.cb-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.cb-table th { padding: 11px 15px; border-bottom: 1px solid #dde5ef; background: #f6f8fb; color: #63748d; font-size: .61rem; font-weight: 850; letter-spacing: .075em; text-transform: uppercase; }
.cb-table td { padding: 15px; border-bottom: 1px solid #edf1f6; color: #32445e; font-size: .76rem; vertical-align: middle; }
.cb-table tbody tr { position: relative; transition: background .16s ease; }
.cb-table tbody tr:hover { background: #fafcff; }
.cb-table tbody tr:last-child td { border-bottom: 0; }
.cb-row--attention td:first-child { box-shadow: inset 3px 0 #ef5262; }
.cb-row--paid td:first-child { box-shadow: inset 3px 0 #24b47e; }
.cb-table__actions { text-align: right; }

.cb-company { gap: 11px; min-width: 190px; }
.cb-company__avatar { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border: 1px solid #d9e5fb; border-radius: 12px; background: linear-gradient(145deg, #edf4ff, #e4edff); color: #2f66e8; font-size: .72rem; font-weight: 850; }
.cb-company strong, .cb-company span, .cb-invoice strong, .cb-invoice span, .cb-money strong, .cb-money span { display: block; }
.cb-company strong { color: #142640; font-size: .8rem; }
.cb-company div span { max-width: 180px; overflow: hidden; margin-top: 2px; color: #7d8da4; font-size: .68rem; text-overflow: ellipsis; }
.cb-invoice { min-width: 175px; }
.cb-invoice strong { max-width: 200px; overflow-wrap: anywhere; color: #273d5e; font-size: .73rem; }
.cb-invoice span { margin-top: 5px; color: #7c8ba0; font-size: .68rem; }
.cb-invoice i { margin-right: 6px; color: #7898dc; }
.cb-money strong { color: #11233e; font-size: .86rem; }
.cb-money span { margin-top: 3px; color: #8795a9; font-size: .64rem; }
.cb-discount, .cb-arrears { display: block; margin-top: 5px; font-size: .62rem; }
.cb-discount { color: #159360; }
.cb-discount i { margin-right: 4px; }
.cb-arrears { color: #c47800; }
.cb-due { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; color: #5f718b; font-size: .7rem; font-weight: 700; }
.cb-due i { color: #8da0bb; }
.cb-due--late, .cb-due--late i { color: #d63f50; }
.cb-badges { gap: 5px; flex-wrap: wrap; }
.cb-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid transparent; border-radius: 999px; font-size: .59rem; font-weight: 800; line-height: 1; }
.cb-status > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cb-status--success { border-color: #b8eed7; background: #ecfbf5; color: #0b8e5c; }
.cb-status--warning { border-color: #f7dda1; background: #fff8e8; color: #b66e00; }
.cb-status--danger { border-color: #ffc4ca; background: #fff0f2; color: #d93648; }
.cb-status--neutral { border-color: #dbe3ec; background: #f2f5f8; color: #66758b; }
.cb-status--review { border-color: #cfccff; background: #f2f0ff; color: #6551cc; }
.cb-remarks { display: block; max-width: 170px; overflow: hidden; margin-top: 7px; color: #8492a6; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.cb-remarks i { margin-right: 5px; }
.cb-payment-method { gap: 9px; min-width: 125px; }
.cb-payment-method > i { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: #edf3ff; color: #376be5; }
.cb-payment-method strong, .cb-payment-method span { display: block; }
.cb-payment-method strong { color: #31445f; font-size: .7rem; }
.cb-payment-method span { max-width: 145px; overflow: hidden; color: #8a98ab; font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.cb-not-recorded { color: #9aa6b7; font-size: .67rem; }
.cb-not-recorded i { margin-right: 5px; }
.cb-proof-link { display: inline-block; margin-top: 6px; color: #2f64df; font-size: .63rem; font-weight: 700; text-decoration: none; }
.cb-proof-link i { margin-right: 5px; }
.cb-row-actions { justify-content: flex-end; gap: 6px; min-width: 140px; }
.cb-row-actions form { margin: 0; }
.cb-action { min-height: 32px; justify-content: center; gap: 6px; padding: 0 9px; border: 1px solid #dbe4ef; border-radius: 9px; background: #fff; color: #53657d; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.cb-action--primary { border-color: #b8cdfb; background: #eef4ff; color: #285edc; }
.cb-action--approve { border-color: #aee6ce; background: #ebfaf4; color: #078653; }
.cb-action--reject { border-color: #fac0c7; background: #fff2f3; color: #d83b4c; }
.cb-action--quiet { color: #6e7d91; }
.cb-action-complete { justify-content: center; gap: 6px; color: #8593a6; font-size: .65rem; font-weight: 700; }

.cb-empty { padding: 58px 20px; text-align: center; }
.cb-empty > span { display: grid; width: 54px; height: 54px; margin: 0 auto 13px; place-items: center; border-radius: 16px; background: #edf3ff; color: #3a6ee6; font-size: 1.25rem; }
.cb-empty h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.cb-empty p { margin: 5px 0 15px; color: #7b8ba2; font-size: .76rem; }
.cb-empty .cb-button { display: inline-flex; }
.cb-ledger__footer { justify-content: space-between; gap: 15px; padding: 12px 24px; border-top: 1px solid #edf1f6; background: #fafbfd; color: #8492a6; font-size: .66rem; }
.cb-ledger__footer i { margin-right: 6px; color: #4a75d8; }

.cb-modal .modal-content { overflow: hidden; border: 0; border-radius: 20px; box-shadow: 0 25px 70px rgba(10, 25, 55, .3); }
.cb-modal__header { position: relative; gap: 14px; padding: 22px 24px; background: linear-gradient(125deg, #101e3d, #1b3979); color: #fff; }
.cb-modal__header--danger { background: linear-gradient(125deg, #361922, #762b38); }
.cb-modal__header .btn-close { position: absolute; top: 18px; right: 18px; }
.cb-modal__icon { display: grid; flex: 0 0 43px; height: 43px; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; background: rgba(255,255,255,.09); color: #8eb1ff; }
.cb-modal__header--danger .cb-modal__icon { color: #ffabb5; }
.cb-modal__header > div > span { color: #94addc; font-size: .61rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.cb-modal__header h2 { margin: 2px 0 0; color: #fff; font-size: 1.08rem; font-weight: 800; }
.cb-modal__header p { margin: 3px 35px 0 0; color: #afbeda; font-size: .7rem; }
.cb-modal__body { padding: 22px 24px; }
.cb-modal__context { padding: 13px 15px; margin-bottom: 17px; border: 1px solid #e1e8f2; border-radius: 12px; background: #f7f9fc; }
.cb-modal__context span, .cb-modal__context strong, .cb-modal__context small { display: block; }
.cb-modal__context span { color: #8a98ac; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cb-modal__context strong { margin-top: 3px; color: #1e314e; font-size: .83rem; }
.cb-modal__context small { color: #72819a; font-size: .68rem; }
.cb-modal__label, .cb-form-grid label { color: #30445f; font-size: .7rem; font-weight: 750; }
.cb-modal__label em, .cb-form-grid label em { float: right; color: #98a4b5; font-size: .59rem; font-style: normal; font-weight: 600; }
.cb-modal textarea.form-control, .cb-form-grid .form-control, .cb-form-grid .form-select { border-color: #dbe4ef; border-radius: 10px; font-size: .76rem; }
.cb-modal textarea.form-control:focus, .cb-form-grid .form-control:focus, .cb-form-grid .form-select:focus { border-color: #7da5ff; box-shadow: 0 0 0 3px rgba(49, 103, 237, .09); }
.cb-modal__hint { margin: 9px 0 0; color: #8996a9; font-size: .65rem; }
.cb-modal__hint i { margin-right: 5px; color: #6889d4; }
.cb-modal__footer { justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid #e9edf3; background: #fafbfd; }
.cb-payment-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.cb-payment-summary > div { min-width: 0; padding: 11px 12px; border: 1px solid #e0e7f1; border-radius: 11px; background: #f7f9fc; }
.cb-payment-summary span, .cb-payment-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-payment-summary span { color: #8694a8; font-size: .58rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cb-payment-summary strong { margin-top: 4px; color: #1e334f; font-size: .72rem; }
.cb-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.cb-form-grid label { margin: 0; }
.cb-form-grid label > span { display: block; margin-bottom: 6px; }
.cb-form-grid__wide { grid-column: 1 / -1; }
.cb-audit-note { gap: 11px; margin-top: 20px; padding: 12px 14px; border: 1px solid #cfe0ff; border-radius: 11px; background: #f0f5ff; color: #43618e; }
.cb-audit-note > i { color: #3268e5; }
.cb-audit-note strong, .cb-audit-note span { display: block; }
.cb-audit-note strong { color: #284976; font-size: .7rem; }
.cb-audit-note span { font-size: .64rem; }

@media (max-width: 1199.98px) {
    .company-billing-page { padding: 24px 20px 40px; }
    .cb-metrics { grid-template-columns: repeat(3, 1fr); }
    .cb-filter-bar { flex-wrap: wrap; }
    .cb-search-field { flex-basis: 100%; }
    .cb-select-field { flex: 1 1 180px; }
}

@media (max-width: 767.98px) {
    .company-billing-page { padding: 18px 12px 32px; }
    .cb-page-header { align-items: flex-start; flex-direction: column; }
    .cb-header-actions { width: 100%; }
    .cb-header-actions .cb-button { flex: 1; }
    .cb-hero { align-items: stretch; flex-direction: column; padding: 26px 22px; }
    .cb-hero__amount { min-width: 0; }
    .cb-metrics { grid-template-columns: repeat(2, 1fr); }
    .cb-metric:last-child { grid-column: 1 / -1; }
    .cb-ledger__header { align-items: flex-start; }
    .cb-filter-bar { margin-inline: 12px; }
    .cb-select-field { flex-basis: 100%; }
    .cb-filter-apply { flex: 1; }
    .cb-filter-insights, .cb-ledger__footer { align-items: flex-start; flex-direction: column; }
    .cb-payment-summary { grid-template-columns: repeat(2, 1fr); }
    .cb-form-grid { grid-template-columns: 1fr; }
    .cb-form-grid__wide { grid-column: auto; }
}

@media (max-width: 479.98px) {
    .cb-metrics { grid-template-columns: 1fr; }
    .cb-metric:last-child { grid-column: auto; }
    .cb-payment-summary { grid-template-columns: 1fr; }
    .cb-modal__header, .cb-modal__body, .cb-modal__footer { padding-inline: 17px; }
}
