#view-customers:has([data-customers-panel="invoices"]:not([hidden])) { max-width: none; }
#customerInvoicesListPanel { min-width: 0; container-type: inline-size; }
#customerInvoicesListPanel * { box-sizing: border-box; letter-spacing: 0; }
#customerInvoicesListPanel .toolbar { flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
#customerInvoicesListPanel :is(.toolbar-left, .toolbar-actions) { min-width: 0; flex-wrap: wrap; gap: 8px; }
#customerInvoicesListPanel .toolbar-left { flex: 1 1 300px; }
#customerInvoicesListPanel .search-wrap { min-width: 140px; max-width: 480px; width: 100%; flex: 1 1 220px; }
#customerInvoicesListPanel .invoice-status-filter { flex: 0 1 165px; }
#customerInvoicesListPanel :is(input, select) { min-height: 30px; min-width: 0; max-width: 100%; font-size: 12px; }
#customerInvoicesListPanel .invoice-payment-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; width: 100%; }
.invoice-payment-filters label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-transform: none; min-width: 0; }
.invoice-payment-filters select { width: 155px; padding: 5px; }
.invoice-payment-filters [data-invoice-filter=customer] { width: 250px; }
.invoice-payment-summary { margin: 0 0 12px; }
.invoice-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: white; border: 1px solid var(--line); border-radius: 4px; padding: 14px 4px; margin-bottom: 6px; }
.invoice-summary-strip > div { padding: 0 14px; min-width: 0; border-right: 1px solid var(--line); }
.invoice-summary-strip > div:last-child { border: 0; }
.invoice-summary-strip span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; margin-bottom: 6px; }
.invoice-summary-strip strong { font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.invoice-summary-scope { margin: 6px 0; font-size: 11px; text-align: right; color: var(--muted); }
#customerInvoicesListPanel .table-scroll { overflow: visible; min-width: 0; }
#customerInvoicesListPanel .customer-invoice-table { width: 100%; min-width: 0; table-layout: fixed; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td) { padding: 8px 5px; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; font-size: 12px; }
#customerInvoicesListPanel .customer-invoice-table th { color: var(--muted); font-size: 10px; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(1) { width: 10%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(2) { width: 7%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(3) { width: 24%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(4) { width: 8%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(5) { width: 7%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(6) { width: 8%; text-align: right; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(7) { width: 12%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(8) { width: 8%; text-align: right; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(9) { width: 9%; }
#customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(10) { width: 7%; }
#customerInvoicesListPanel .customer-invoice-table small { display: block; font-size: 11px; line-height: 1.4; color: var(--muted); margin-top: 4px; }
#customerInvoicesListPanel .invoice-number > div { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
#customerInvoicesListPanel .po-pdf-button { padding: 2px 4px; margin: 0; min-height: 22px; font-size: 10px; }
.invoice-link { padding: 0; border: 0; background: transparent; color: #42627c; text-align: left; cursor: pointer; overflow-wrap: anywhere; white-space: normal; font-size: inherit; }
.invoice-link:hover { text-decoration: underline; }
.invoice-number .invoice-link { font-weight: 700; color: var(--ink); }
#customerInvoicesListPanel .inline-status-select { width: 100%; min-width: 0; padding: 4px 2px; font-size: 11px; }
.invoice-action-strip { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 64px; }
.invoice-action-strip .icon-only { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 30px; height: 30px; min-height: 30px; flex: 0 0 30px; border-radius: 4px; }
.invoice-action-strip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.invoice-overdue, #customerInvoicesListPanel .invoice-overdue small { color: #b63e51; }
.invoice-settled { color: var(--muted); font-weight: 400; }
.invoice-total, .invoice-balance { font-variant-numeric: tabular-nums; }
.invoice-overdue-tag { display: inline-block; color: #b63e51; background: #fff0f2; font-size: 11px; font-weight: 600; border-radius: 3px; padding: 5px 7px; margin-left: 12px; }
.invoice-account-total { margin: 18px 0; display: grid; gap: 12px; }
.invoice-account-total > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.invoice-account-total strong { color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.invoice-account-total small { font-size: 11px; }
.invoice-payment-drawer .invoice-link { text-decoration: underline; }
.invoice-payment-drawer .po-payment-form [data-ip-legacy-note] { font-size: 12px; }
.invoice-payment-drawer .invoice-qb-balance { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.invoice-payment-drawer .invoice-qb-balance strong { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-payment-drawer [data-ip-clear-override] { margin-top: 10px; }
.invoice-payment-drawer [data-ip-status] { display: flex; flex-wrap: wrap; gap: 6px; }
.invoice-payment-drawer [data-ip-status] .invoice-overdue-tag { margin-left: 0; }
.invoice-payment-drawer:has([data-ip-override]) .po-drawer-content { padding-bottom: 80px; }
@container (max-width: 1100px) {
  #customerInvoicesListPanel .customer-invoice-table :is(thead, tbody) { display: block; width: 100%; }
  #customerInvoicesListPanel .customer-invoice-table tr { display: grid; width: 100%; grid-template-columns: 106px 72px minmax(100px,1fr) 76px 90px 119px 90px 68px; }
  #customerInvoicesListPanel .customer-invoice-table :is(th, td):nth-child(n) { width: auto; min-width: 0; height: auto; }
  #customerInvoicesListPanel .customer-invoice-table tbody tr { border-bottom: 1px solid var(--line); }
  #customerInvoicesListPanel .customer-invoice-table tbody td { border: 0; }
  #customerInvoicesListPanel .customer-invoice-table td.empty-state { grid-column: 1 / -1; }
  #customerInvoicesListPanel .customer-invoice-table th:is(:nth-child(5), :nth-child(9)) { display: none; }
  #customerInvoicesListPanel .invoice-number { grid-area: 1/1; }
  #customerInvoicesListPanel .invoice-order { grid-area: 2/1; padding-top: 0; font-size: 11px; }
  #customerInvoicesListPanel .invoice-due { grid-area: 1/2/3/3; }
  #customerInvoicesListPanel .invoice-distributor { grid-area: 1/3/3/4; }
  #customerInvoicesListPanel .invoice-status { grid-area: 1/4; }
  #customerInvoicesListPanel .invoice-qb { grid-area: 2/4; font-size: 11px; padding-top: 0; }
  #customerInvoicesListPanel .invoice-total { grid-area: 1/5/3/6; }
  #customerInvoicesListPanel .invoice-payment { grid-area: 1/6/3/7; }
  #customerInvoicesListPanel .invoice-balance { grid-area: 1/7/3/8; }
  #customerInvoicesListPanel .invoice-actions { grid-area: 1/8/3/9; }
  #customerInvoicesListPanel .invoice-qb::before { content: "QB: "; color: var(--muted); }
}
@container (max-width: 800px) {
  #customerInvoicesListPanel .customer-invoice-table thead { display: none; }
  #customerInvoicesListPanel .customer-invoice-table tr { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr) 68px; border-bottom: 1px solid var(--line); padding: 6px 0; }
  #customerInvoicesListPanel .customer-invoice-table td { border: 0; text-align: left; }
  #customerInvoicesListPanel .invoice-number { grid-area: 1/1; }
  #customerInvoicesListPanel .invoice-distributor { grid-area: 1/2/2/4; }
  #customerInvoicesListPanel .invoice-actions { grid-area: 1/4; }
  #customerInvoicesListPanel .invoice-due { grid-area: 2/1; }
  #customerInvoicesListPanel .invoice-status { grid-area: 2/2; }
  #customerInvoicesListPanel .invoice-order { grid-area: 3/1; }
  #customerInvoicesListPanel .invoice-qb { grid-area: 3/2; }
  #customerInvoicesListPanel .invoice-total { grid-area: 4/1; }
  #customerInvoicesListPanel .invoice-payment { grid-area: 4/2; }
  #customerInvoicesListPanel .invoice-balance { grid-area: 4/3/5/5; }
  #customerInvoicesListPanel :is(.invoice-total, .invoice-balance, .invoice-due)::before { display: block; content: attr(data-label); color: var(--muted); font-size: 10px; margin-bottom: 4px; }
  .invoice-summary-strip strong { font-size: 18px; }
  .invoice-summary-strip > div { padding: 0 8px; }
}
.invoice-qb-sync-strip { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding: 8px 0; color: var(--muted); font-size: 12px; }
.invoice-qb-sync-strip > span { min-width: 0; overflow-wrap: anywhere; }
.invoice-qb-sync-strip button { font-size: 12px; }
.invoice-payment-drawer [data-invoice-qb-sync] { margin-bottom: 12px; }
@media (max-width: 560px) {
  .app-shell:has(#view-customers.active) { grid-template-columns: minmax(0,1fr); }
  .app-shell:has(#view-customers.active) .app-sidebar { width: 100%; }
  #view-customers .sub-tabs { display: flex; flex-wrap: wrap; }
  #view-customers .sub-tab { flex: 1 1 auto; min-width: 0; }
  #customerInvoicesListPanel .toolbar-actions { width: 100%; }
  #customerInvoicesListPanel :is(.toolbar-left, .search-wrap) { flex-basis: auto; }
  #customerInvoicesListPanel .invoice-payment-filters { display: grid; grid-template-columns: minmax(0,1fr); }
  .invoice-payment-filters label { justify-content: space-between; }
  .invoice-payment-filters select { width: 70%; max-width: 70%; }
  .invoice-summary-strip { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 0; }
  .invoice-summary-strip strong { font-size: 20px; }
}
