/* Scoped billing follow-up layout: no wide tables or global button overrides. */
#billing-followup-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid var(--border-color, #dce0d5);
  border-radius: 18px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #20251d);
  box-sizing: border-box;
}
.billing-followup *, .billing-followup *::before, .billing-followup *::after { box-sizing: border-box; min-width: 0; }
.billing-followup p, .billing-followup h3, .billing-followup h4, .billing-followup h5 { margin: 0; }
.billing-followup .bf-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.billing-followup .bf-eyebrow { display: block; margin-bottom: 5px; color: var(--color-brand, #5b7c2c); font: 700 10px/1.4 var(--font-sans, sans-serif); letter-spacing: .13em; text-transform: uppercase; }
.billing-followup .bf-header h3 { font-size: clamp(23px, 3vw, 29px); line-height: 1.2; letter-spacing: -.02em; }
.billing-followup .bf-intro { margin: 10px 0 20px; color: var(--text-secondary, #697061); font-size: 13px; line-height: 1.55; }
.billing-followup .bf-refresh { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 7px; width: auto; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border-color, #dce0d5); border-radius: 10px; background: var(--bg-card, #fff); color: var(--text-secondary, #697061); font: 600 12px/1.3 var(--font-sans, sans-serif); cursor: pointer; }
.billing-followup .bf-refresh svg { width: 16px; height: 16px; flex: 0 0 16px; }
.billing-followup .bf-picker, .billing-followup .bf-field { display: flex; flex-direction: column; gap: 7px; }
.billing-followup .bf-picker > span, .billing-followup .bf-field > span { font-size: 11px; font-weight: 700; color: var(--text-secondary, #697061); }
.billing-followup select, .billing-followup input { display: block; width: 100%; max-width: 100%; min-height: 46px; padding: 11px 34px 11px 12px; border: 1px solid var(--border-color, #dce0d5); border-radius: 10px; background-color: var(--bg-card, #fff); color: var(--text-primary, #20251d); font: 400 14px/1.4 var(--font-sans, sans-serif); }
.billing-followup input { padding-right: 12px; }
.billing-followup .bf-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0 12px; padding: 15px 0; border-top: 1px solid var(--border-color, #dce0d5); border-bottom: 1px solid var(--border-color, #dce0d5); }
.billing-followup .bf-metrics > div { padding: 0 14px; border-left: 1px solid var(--border-color, #dce0d5); }
.billing-followup .bf-metrics > div:first-child { border-left: 0; padding-left: 0; }
.billing-followup .bf-metrics strong { display: block; font-size: clamp(17px, 2vw, 23px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.billing-followup .bf-metrics span { display: block; max-width: 130px; margin-top: 5px; color: var(--text-secondary, #697061); font-size: 10px; line-height: 1.4; }
.billing-followup .bf-help { margin-bottom: 24px; color: var(--text-secondary, #697061); font-size: 12px; line-height: 1.6; }
.billing-followup .bf-help > summary, .billing-followup .bf-invoice-details > summary { cursor: pointer; padding: 9px 0; font-weight: 600; }
.billing-followup .bf-help p { margin: 6px 0; max-width: 75ch; }
.billing-followup .bf-section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 13px; }
.billing-followup .bf-section-title h4 { font-family: var(--font-sans, sans-serif); font-size: 15px; font-weight: 700; line-height: 1.4; }
.billing-followup .bf-section-title > span { color: var(--text-secondary, #697061); font-size: 11px; }
.billing-followup .bf-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.billing-followup .bf-account, .billing-followup .bf-invoice { border: 1px solid var(--border-color, #dce0d5); border-radius: 14px; background: var(--bg-card, #fff); }
.billing-followup .bf-account { padding: 18px; }
.billing-followup .bf-account-person { display: flex; align-items: center; gap: 10px; }
.billing-followup .bf-avatar { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: var(--color-brand-light, #eef2e6); color: var(--color-brand, #5b7c2c); font-size: 12px; font-weight: 700; }
.billing-followup .bf-account-person h5, .billing-followup .bf-invoice h5 { font: 600 14px/1.45 var(--font-sans, sans-serif); overflow-wrap: anywhere; }
.billing-followup .bf-account-person p { margin-top: 3px; color: var(--text-secondary, #697061); font-size: 11px; line-height: 1.5; }
.billing-followup .bf-account-balance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.billing-followup .bf-account-balance > div > span { display: block; margin-bottom: 5px; color: var(--text-secondary, #697061); font-size: 10px; }
.billing-followup .bf-account-balance strong { display: block; font-size: 25px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.billing-followup .bf-account-note { margin: 10px 0 16px; color: var(--text-secondary, #697061); font-size: 11px; line-height: 1.5; }
.billing-followup .bf-pill { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: 5px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; line-height: 1.4; white-space: normal; }
.billing-followup .bf-pill-attention { color: #7d5a15; background: #fbf2dc; }
.billing-followup .bf-pill-overdue { color: #9a4238; background: #faeae6; }
.billing-followup .bf-pill-positive { color: #45632c; background: #edf3e6; }
.billing-followup .bf-pill-neutral { color: var(--text-secondary, #697061); background: var(--bg-app, #f4f5ef); }
.billing-followup .bf-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-height: 44px; padding: 11px 14px; border: 1px solid transparent; border-radius: 9px; font: 600 12px/1.4 var(--font-sans, sans-serif); text-transform: none; letter-spacing: 0; text-align: center; cursor: pointer; transition: background-color .15s ease; }
.billing-followup .bf-button-primary { background: var(--color-brand, #5b7c2c); color: var(--text-on-brand, #fff); }
.billing-followup .bf-button-primary:hover:not(:disabled) { background: var(--color-brand-hover, #486324); }
.billing-followup .bf-button-secondary { border-color: var(--border-color, #dce0d5); background: var(--bg-card, #fff); color: var(--text-primary, #20251d); }
.billing-followup .bf-button-secondary:hover { background: var(--bg-app, #f4f5ef); }
.billing-followup .bf-button:disabled { opacity: .4; cursor: not-allowed; }
.billing-followup .bf-account > .bf-button { display: flex; width: 100%; justify-content: space-between; }
.billing-followup .bf-text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; width: auto; padding: 5px 0; border: 0; background: transparent; color: var(--color-brand, #5b7c2c); font: 600 11px/1.5 var(--font-sans, sans-serif); cursor: pointer; text-align: left; }
.billing-followup .bf-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 16px; margin: 0 0 15px; padding: 13px 15px; border: 1px solid #e8dcbf; border-radius: 10px; background: #fcf8ee; color: #6c5325; font-size: 12px; line-height: 1.6; }
.billing-followup .bf-alert strong { font-size: 12px; font-weight: 600; }
.billing-followup .bf-alert p { margin-top: 3px; font-size: 11px; }
.billing-followup .bf-alert-error { border-color: #eac9c2; background: #fcf0ed; color: #8b4036; }
.billing-followup .bf-invoice-list { display: grid; gap: 12px; }
.billing-followup .bf-invoice { padding: 17px; }
.billing-followup .bf-invoice-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.billing-followup .bf-due { color: var(--text-secondary, #697061); font-size: 11px; line-height: 1.4; text-align: right; }
.billing-followup .bf-invoice-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-top: 15px; }
.billing-followup .bf-invoice-main > div:first-child { flex: 1; }
.billing-followup .bf-reference { margin-top: 5px; color: var(--text-secondary, #697061); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.billing-followup .bf-amount { flex: 0 0 auto; max-width: 45%; text-align: right; }
.billing-followup .bf-amount strong { display: block; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.billing-followup .bf-amount span { display: block; margin-top: 5px; color: var(--text-secondary, #697061); font-size: 10px; }
.billing-followup .bf-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.billing-followup .bf-blocked { margin-top: 9px; color: var(--text-secondary, #697061); font-size: 11px; line-height: 1.5; }
.billing-followup .bf-invoice-details { margin-top: 13px; padding-top: 4px; border-top: 1px solid var(--border-color, #dce0d5); font-size: 12px; line-height: 1.6; color: var(--text-secondary, #697061); }
.billing-followup .bf-invoice-details > summary { font-size: 11px; }
.billing-followup .bf-invoice-details p { margin: 6px 0; overflow-wrap: anywhere; }
.billing-followup .bf-invoice-details ul { margin: 8px 0; padding-left: 18px; }
.billing-followup .bf-invoice-details .bf-field { margin: 12px 0 0; }
.billing-followup .bf-breakdown { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 10px 0; }
.billing-followup .bf-breakdown dt { font-size: 10px; }
.billing-followup .bf-breakdown dd { margin: 3px 0 0; color: var(--text-primary, #20251d); font-size: 13px; font-weight: 600; }
.billing-followup .bf-matching { margin-top: 20px; border: 1px solid var(--border-color, #dce0d5); border-radius: 12px; }
.billing-followup .bf-matching > summary { cursor: pointer; padding: 16px; font-size: 13px; font-weight: 600; line-height: 1.5; }
.billing-followup .bf-matching > summary > span { display: block; margin: 3px 0 0 15px; color: var(--text-secondary, #697061); font-size: 10px; font-weight: 400; }
.billing-followup .bf-matching-body { padding: 0 16px 16px; }
.billing-followup .bf-matching-body > p { color: var(--text-secondary, #697061); font-size: 11px; line-height: 1.6; }
.billing-followup .bf-match-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px; margin-top: 15px; }
.billing-followup .bf-match-history { margin-top: 20px; }
.billing-followup .bf-match-history > h5 { font: 600 12px/1.5 var(--font-sans, sans-serif); }
.billing-followup .bf-match-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 13px 0; border-top: 1px solid var(--border-color, #dce0d5); }
.billing-followup .bf-match-row:first-of-type { margin-top: 8px; }
.billing-followup .bf-match-row strong { font-size: 13px; }
.billing-followup .bf-match-row p { margin-top: 3px; font-size: 10px; line-height: 1.6; color: var(--text-secondary, #697061); overflow-wrap: anywhere; }
.billing-followup .bf-loading, .billing-followup .bf-empty { padding: 25px 16px; border: 1px dashed var(--border-color, #dce0d5); border-radius: 12px; text-align: center; font-size: 13px; line-height: 1.6; }
.billing-followup .bf-empty p { margin-top: 5px; color: var(--text-secondary, #697061); font-size: 12px; }
.billing-followup button:focus-visible, .billing-followup summary:focus-visible, .billing-followup select:focus-visible, .billing-followup input:focus-visible { outline: 2px solid var(--color-brand, #5b7c2c); outline-offset: 3px; }
@media (max-width: 620px) {
  .billing-followup .bf-account-grid { grid-template-columns: minmax(0, 1fr); }
  .billing-followup select, .billing-followup input { font-size: 16px; }
  .billing-followup .bf-text-button { min-height: 44px; }
  .billing-followup .bf-metrics > div { padding: 0 9px; }
  .billing-followup .bf-metrics > div:first-child { padding-left: 0; }
  .billing-followup .bf-invoice, .billing-followup .bf-account { padding: 14px; }
  .billing-followup .bf-match-form { grid-template-columns: minmax(0, 1fr); }
  .billing-followup .bf-header h3 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { .billing-followup .bf-button { transition: none; } }
[data-theme="dark"] .billing-followup .bf-pill-attention, [data-theme="dark"] .billing-followup .bf-alert { background: #302a1b; border-color: #4a3e24; color: #e4c67f; }
[data-theme="dark"] .billing-followup .bf-pill-overdue, [data-theme="dark"] .billing-followup .bf-alert-error { background: #34231f; border-color: #52322b; color: #efada1; }
[data-theme="dark"] .billing-followup .bf-pill-positive { background: #24311e; color: #b6d69b; }
