.invoice-payments-page .invoice-navigation { display: none; }
.invoice-payments-page .main { min-width: 0; }
.invoice-payments-page .topbar { height: auto; min-height: 64px; flex-shrink: 0; flex-wrap: wrap; gap: 10px; }
.invoice-payments-page .mod-overview { height: auto; min-height: 124px; flex-shrink: 0; }
.invoice-payments-page .client-filter-bar { flex-wrap: wrap; gap: 10px; }
.invoice-payments-page .focus-tabs { flex: 1 1 100%; }
.invoice-payments-page .focus-search-box { flex: 1 1 220px; min-width: 180px; }
.invoice-payments-page .focus-dropdowns { flex-wrap: wrap; }
.invoice-payments-page .table-wrapper { overflow-x: auto; }
.invoice-payments-page .data-table { min-width: 1100px; }
.invoice-payments-page #mainTable { min-width: 1400px; }
.invoice-payments-page .row-actions:focus-within { opacity: 1; }
.invoice-payments-page #tableBody tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.invoice-payments-page .client-drawer { height: 100dvh; }
.invoice-payments-page .client-drawer-body { min-height: 0; }
.invoice-payments-page .modal-overlay .modal { max-height: calc(100dvh - 32px) !important; overflow: hidden !important; }
.invoice-payments-page .modal-overlay .modal-body { min-height: 0; overscroll-behavior: contain; }
.invoice-payments-page .modal-header,.invoice-payments-page .modal-footer { flex-shrink: 0; }
.invoice-payments-page .modal-footer { flex-wrap: wrap; background: var(--surface); }
.invoice-payments-page .form-group { min-width: 0; }
.invoice-payments-page #f_vat_rate { width: 100%; }
.invoice-payments-page input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.invoice-payments-page input::-webkit-inner-spin-button,.invoice-payments-page input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

@media (max-width: 1000px) {
  .invoice-payments-page .sidebar { display: none; }
  .invoice-payments-page .main { overflow-y: auto; }
  .invoice-payments-page .invoice-navigation { display: block; flex-shrink: 0; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--border); }
  .invoice-payments-page .invoice-navigation summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
  .invoice-payments-page .invoice-navigation nav { display: flex; flex-wrap: wrap; gap: 8px; }
  .invoice-payments-page .invoice-navigation a,.invoice-payments-page .invoice-navigation button { min-height: 44px; display: inline-flex; align-items: center; padding: 10px; color: var(--text); border: 1px solid var(--border); border-radius: 4px; background: #fff; font: inherit; }
  .invoice-payments-page .topbar { padding: 12px; }
  .invoice-payments-page .topbar-title { min-width: 0; }
  .invoice-payments-page .topbar-actions { flex-wrap: wrap; }
  .invoice-payments-page .btn,.invoice-payments-page .focus-tab,.invoice-payments-page .focus-select { min-height: 44px; }
  .invoice-payments-page .mod-overview { margin: 12px; padding: 16px; gap: 12px; flex-direction: column; align-items: stretch; }
  .invoice-payments-page .mod-overview-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); flex: none; width: 100%; }
  .invoice-payments-page .mod-overview-metric { width: auto; min-width: 0; }
  .invoice-payments-page .mod-overview strong { overflow-wrap: anywhere; }
  .invoice-payments-page .table-panel { flex: none; margin: 0 12px 12px; overflow: visible; }
  .invoice-payments-page .client-filter-bar { padding: 10px; }
  .invoice-payments-page .focus-tabs { width: 100%; overflow-x: auto; }
  .invoice-payments-page .focus-tab { flex-shrink: 0; }
  .invoice-payments-page .focus-search-box { flex-basis: 100%; min-width: 0; }
  .invoice-payments-page .focus-search-box input { min-height: 44px; }
  .invoice-payments-page .focus-dropdowns { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .invoice-payments-page .focus-select { min-width: 0; max-width: 100%; width: 100%; }
  .invoice-payments-page .content-area,.invoice-payments-page .table-wrapper { overflow: visible; }
  .invoice-payments-page .data-table,.invoice-payments-page #mainTable { display: block; min-width: 0; width: 100%; }
  .invoice-payments-page .data-table thead { display: none; }
  .invoice-payments-page .data-table tbody { display: block; }
  .invoice-payments-page .data-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; padding: 12px; border-bottom: 1px solid var(--border); }
  .invoice-payments-page .data-table td { display: block; min-width: 0; border: 0; padding: 4px 0 !important; text-align: left !important; white-space: normal; overflow-wrap: anywhere; }
  .invoice-payments-page .data-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--text-muted); font-family: var(--font-body); font-size: 10px; font-weight: 400; }
  .invoice-payments-page .data-table td:empty { display: none; }
  .invoice-payments-page .data-table td[colspan],.invoice-payments-page .data-table td:last-child { grid-column: 1 / -1; }
  .invoice-payments-page .data-table td[colspan]::before { content: none; }
  .invoice-payments-page .group-subtotal { background: #f0ede6; }
  .invoice-payments-page .group-subtotal td { background: none; }
  .invoice-payments-page .data-table .overdue-row,.invoice-payments-page .data-table .row-overdue { background: rgba(220,38,38,.04); }
  .invoice-payments-page .data-table .overdue-row td,.invoice-payments-page .data-table .row-overdue td,
  .invoice-payments-page .data-table tbody tr:hover td { background: transparent; }
  .invoice-payments-page .row-actions { opacity: 1; flex-wrap: wrap; gap: 8px; }
  .invoice-payments-page .action-btn { min-width: 44px; min-height: 44px; }
  .invoice-payments-page .contractor-list-toggle button { min-height: 44px; }
  .invoice-payments-page .client-drawer { width: min(560px,100%); max-width: 100%; }
  .invoice-payments-page .client-drawer-header { flex-shrink: 0; padding: 12px; }
  .invoice-payments-page .client-drawer-header > div { min-width: 0; overflow-wrap: anywhere; }
  .invoice-payments-page .client-drawer-body { padding: 12px; }
  .invoice-payments-page .project-drawer-hero { grid-template-columns: minmax(0,1fr); }
  .invoice-payments-page .drawer-client-titleline { flex-wrap: wrap; }
  .invoice-payments-page .drawer-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .invoice-payments-page .drawer-action-btn { min-height: 44px; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .invoice-payments-page .drawer-activity-row > * { min-width: 0; overflow-wrap: anywhere; }
  .invoice-payments-page .drawer-figures strong { overflow-wrap: anywhere; }
  .invoice-payments-page .modal-overlay { padding: 8px; }
  .invoice-payments-page .modal-overlay .modal { max-width: 100%; max-height: calc(100dvh - 16px) !important; }
  .invoice-payments-page .modal-header,.invoice-payments-page .modal-footer { padding: 12px; }
  .invoice-payments-page .modal-body { padding: 12px !important; }
  .invoice-payments-page .modal-close { width: 44px; height: 44px; flex-shrink: 0; align-items: center; justify-content: center; }
  .invoice-payments-page .modal-overlay input:not([type=hidden]):not([type=checkbox]):not([type=radio]),.invoice-payments-page .modal-overlay select { min-height: 44px; max-width: 100%; }
  .invoice-payments-page #sectionPicker label { min-height: 44px; }
  .invoice-payments-page .modal-header h2,.invoice-payments-page .modal-header h3 { overflow-wrap: anywhere; min-width: 0; }
  .invoice-payments-page .modal-footer .btn { white-space: normal; }
}
@media (max-width: 600px) {
  .invoice-payments-page .mod-overview-metrics,.invoice-payments-page .focus-dropdowns { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .invoice-payments-page .pay-form-grid,.invoice-payments-page .payment-row,.invoice-payments-page .form-grid { grid-template-columns: minmax(0,1fr); }
  .invoice-payments-page input,.invoice-payments-page select,.invoice-payments-page textarea { font-size: 16px; }
  .invoice-payments-page .modal-footer { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .invoice-payments-page .modal-footer .btn { margin-right: 0 !important; }
}
