/* Pounce Billing additions on top of pounce-brand.css (the shared Pounce theme). */

body { min-height: 100vh; display: flex; flex-direction: column; }
main.container { flex: 1 0 auto; }

.text-brand { color: var(--pounce-orange-deep, #B85A00); }
.pre-line { white-space: pre-line; }

.page-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
    gap: 12px; margin-bottom: 1.25rem;
}
.page-head form { margin: 0; }

.billing-footer {
    border-top: 1px solid var(--pounce-border, #E7E2DB);
    color: var(--pounce-muted, #6E675F);
    font-size: 0.8rem; padding: 14px 0; background: var(--pounce-surface, #FFF);
}

/* Stat cards */
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; opacity: 0.8; }
.stat-value { font-family: var(--pounce-font-display, 'Exo 2', sans-serif); font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin: 4px 0; }
.stat-sub { font-size: 0.8rem; opacity: 0.75; }

/* Status badges */
.status-badge { font-weight: 600; letter-spacing: 0.01em; }
.status-DRAFT { background: #ECE7E0; color: #3A3740; }
.status-ISSUED { background: #FEF3E6; color: #7A3D00; }
.status-ACCEPTED, .status-PAID { background: #E3F4E8; color: #1D6B35; }
.status-PARTIALLY_PAID { background: #FFF4CC; color: #6B5300; }
.status-DECLINED, .status-VOID { background: #EEE; color: #6E675F; text-decoration: line-through; }
.status-CONVERTED { background: #E6EEF9; color: #234A84; }
.status-OVERDUE { background: #FBE3E1; color: #9B1C12; }

/* Definition lists */
.dl-compact { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.dl-compact dt { font-weight: 500; color: var(--pounce-muted, #6E675F); }
.dl-compact dd { margin: 0; }

/* Totals */
.totals-table td { padding: 3px 0 3px 24px; }
.totals-table td:first-child { padding-left: 0; color: var(--pounce-muted, #6E675F); }
.totals-table tr.fw-bold td { color: inherit; border-top: 1px solid var(--pounce-border, #E7E2DB); padding-top: 6px; }

/* Line editor */
.lines-table td { vertical-align: top; }
.lines-table textarea { min-height: 31px; resize: vertical; }
.lines-table .js-amount { padding-top: 0.6rem; font-variant-numeric: tabular-nums; }

/* WhatsApp button */
.btn-whatsapp { --bs-btn-color: #fff; --bs-btn-bg: #1F8F4E; --bs-btn-border-color: #1F8F4E;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #187A42; --bs-btn-hover-border-color: #187A42; }

/* Settings asset previews */
.asset-preview { min-height: 90px; display: flex; align-items: center; justify-content: center;
    background: repeating-conic-gradient(#F3F0EC 0% 25%, #FFF 0% 50%) 50% / 16px 16px;
    border: 1px solid var(--pounce-border, #E7E2DB); border-radius: 8px; padding: 8px; }
.asset-preview img { max-height: 90px; max-width: 100%; }
.asset-preview--wide img { max-height: 110px; }
.is-pending::placeholder { color: #9B6A00; font-weight: 600; }

/* Login and simple pages */
.login-page { background: var(--pounce-bg, #F6F4F1); align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 32px 28px;
    border: 1px solid var(--pounce-border, #E7E2DB); box-shadow: 0 8px 30px rgba(31, 30, 34, 0.06); }

/* Public share page (uses the tenant's colours, set inline as --doc-*) */
.public-doc { background: #F6F4F1; font-family: 'DM Sans', system-ui, sans-serif; color: var(--doc-dark, #1F1E22);
    align-items: center; padding: 24px 16px; }
.public-card { width: 100%; max-width: 520px; background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 40px rgba(31, 30, 34, 0.08); }
.public-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 4px solid var(--doc-primary, #F08A12); }
.public-logo { max-height: 52px; max-width: 120px; }
.public-issuer { font-family: 'Exo 2', sans-serif; font-weight: 700; font-size: 1.15rem; }
.public-body { padding: 24px; }
.public-title { font-family: 'Exo 2', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
    color: var(--doc-accent, #B85A00); font-size: 0.85rem; }
.public-number { font-family: 'Exo 2', sans-serif; font-weight: 700; font-size: 1.6rem; }
.public-amount { background: var(--doc-dark, #1F1E22); color: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.public-amount-value { font-family: 'Exo 2', sans-serif; font-size: 2rem; font-weight: 700; color: var(--doc-primary, #F08A12); }
.public-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.btn-doc { background: var(--doc-primary, #F08A12); color: var(--doc-dark, #1F1E22); font-weight: 600; border: 0; }
.btn-doc:hover { filter: brightness(0.95); color: var(--doc-dark, #1F1E22); }
.public-bank { background: #FAF8F5; border: 1px solid #EEE9E2; border-radius: 10px; padding: 14px 16px; }
.public-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 24px; border-top: 1px solid #EEE9E2; }

@media (max-width: 575.98px) {
    .page-head { align-items: flex-start; }
    .stat-value { font-size: 1.35rem; }
}

/* Subscription statuses */
.status-ACTIVE { background: #E3F4E8; color: #1D6B35; }
.status-PAUSED { background: #FFF4CC; color: #6B5300; }
.status-ENDED, .status-CANCELLED { background: #EEE; color: #6E675F; }

/* Unpaid invoices by age: neutral for "not yet due", then one orange ramp getting darker with age.
   Every bucket is also labelled with its name and amount below the bar. */
.aging-bar { display: flex; gap: 2px; height: 14px; }
.aging-seg { position: relative; min-width: 6px; }
.aging-seg:first-child { border-radius: 4px 0 0 4px; }
.aging-seg:last-child { border-radius: 0 4px 4px 0; }
.aging-seg:only-child { border-radius: 4px; }
.aging-seg:hover { filter: brightness(0.92); }
.aging-0 { background: #A8A29B; }
.aging-1 { background: #EF912D; }
.aging-2 { background: #CC6C13; }
.aging-3 { background: #A6501A; }
.aging-4 { background: #80361B; }
.aging-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* Client portal (tenant colours set inline as --doc-*) */
.portal { background: #F6F4F1; font-family: 'DM Sans', system-ui, sans-serif; color: var(--doc-dark, #1F1E22); }
.portal-bar { background: #fff; border-bottom: 4px solid var(--doc-primary, #F08A12); padding: 12px 0; }
.portal-brand { display: flex; align-items: center; gap: 10px; font-family: 'Exo 2', sans-serif; font-weight: 700;
    font-size: 1.1rem; color: var(--doc-dark, #1F1E22); text-decoration: none; }
.portal-brand img { max-height: 36px; max-width: 90px; }
.portal a { color: var(--doc-accent, #B85A00); }
.portal-card { background: #fff; border: 1px solid #EEE9E2; border-radius: 12px; padding: 16px 18px; }
.portal-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #F1EDE8;
    color: inherit !important; text-decoration: none; }
.portal-row:first-of-type { border-top: 0; }
a.portal-row:hover { background: #FAF8F5; }
.portal .btn-link { color: var(--doc-accent, #B85A00); }
