.shipment-filter-popover[popover] {
  position:fixed; inset:auto; margin:0; box-sizing:border-box;
  width:280px; max-width:calc(100vw - 16px); max-height:calc(100vh - 16px);
  padding:12px; border:1px solid #b8c4ce; border-radius:4px;
  background:#fff; color:#243746; box-shadow:0 4px 16px #0003;
  font:13px/1.5 Arial,sans-serif; overflow:auto;
}
.shipment-filter-popover::backdrop { background:transparent; }
.invoice-match-dialog { width:780px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; border:1px solid #acbeca; border-radius:6px; padding:16px; color:#243746; }
.invoice-match-dialog::backdrop { background:#152d4355; }
.invoice-match-dialog header,.invoice-match-dialog footer { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.invoice-match-dialog footer { justify-content:flex-end; border-top:1px solid #ced8df; padding-top:12px; }
.invoice-match-dialog dl { display:grid; grid-template-columns:160px minmax(0,1fr); gap:8px; }
.invoice-match-dialog dd { margin:0; overflow-wrap:anywhere; }
.invoice-match-dialog label { display:block; margin:12px 0; }
.invoice-match-dialog :is(input,select) { display:block; width:100%; box-sizing:border-box; margin-top:6px; }
.invoice-match-dialog select { height:220px; }
.invoice-match-dialog .table-scroll { max-height:50dvh; overflow:auto; scrollbar-width:auto!important; }
.invoice-match-dialog .table-scroll table { min-width:900px; }
.invoice-match-dialog .table-scroll th { position:sticky; top:0; background:#edf3f7; }
.invoice-review > [data-quantity-review] { margin:8px 0; min-height:32px; }
.invoice-review-categories { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:8px; padding:10px 0; }
.invoice-review-categories button { display:flex; align-items:center; gap:8px; padding:12px; text-align:left; background:#fff; border:1px solid #cbd7df; border-radius:4px; }
.invoice-review-categories button span { margin-left:auto; color:#1e527d; }
.invoice-category-dialog { width:1200px; }
.invoice-category-dialog .table-scroll { max-height:60dvh; }
.invoice-category-dialog table { table-layout:fixed; }
.invoice-category-dialog th:nth-child(1) { width:52px; }
.invoice-category-dialog th:nth-child(2) { width:220px; }
.invoice-category-dialog th:nth-child(3) { width:420px; }
.invoice-category-dialog td { vertical-align:top; white-space:normal; overflow-wrap:anywhere; padding:8px; }
.invoice-category-dialog .invoice-review-candidate { display:flex; gap:8px; margin:0; padding:6px 0; border-bottom:1px solid #e0e7ed; }
.invoice-category-dialog input[type=checkbox] { display:inline-block; width:18px; height:18px; flex:0 0 18px; margin:2px 0; }
.invoice-category-dialog .invoice-category-actions { padding:8px 0; }
.invoice-category-dialog .invoice-category-actions label { display:flex; gap:8px; align-items:center; margin:0; }
.invoice-category-dialog [data-review-difference] { display:block; margin-top:8px; color:#805000; }
.invoice-category-dialog .table-scroll::-webkit-scrollbar { display:block!important; width:14px!important; height:14px!important; }
.invoice-match-options { max-height:280px; overflow:auto; scrollbar-width:auto!important; border:1px solid #ced8df; }
.invoice-match-options label[data-match-option] { display:flex; align-items:flex-start; gap:10px; padding:8px; margin:0; border-bottom:1px solid #e3e9ee; cursor:pointer; }
.invoice-match-options label[data-match-option][hidden] { display:none; }
.invoice-match-options label:has(:checked) { background:#edf5f2; }
.invoice-match-options input[type=checkbox] { flex:0 0 18px; width:18px; height:18px; margin:2px 0; }
.invoice-match-options span { overflow-wrap:anywhere; }
.invoice-match-dialog button { min-height:30px; }
.invoice-match-dialog :is(button,input,select):focus-visible { outline:2px solid #32769e; outline-offset:2px; }
.invoice-manual-mark { background:#fff2d6; color:#805000; border:0; font-size:11px; padding:1px 3px; }
@media(max-width:600px) { .invoice-match-dialog dl { grid-template-columns:1fr; gap:4px; } }
.content[data-rendered-module="financeShipmentInvoices"] .invoice-virtual-grid .table-scroll,
.invoice-virtual-grid .table-scroll { max-height:none; overflow:auto; overflow-anchor:none; }
.invoice-virtual-grid tbody tr:not(.invoice-virtual-spacer) { height:34px; }
.invoice-virtual-grid tbody tr:not(.invoice-virtual-spacer) > td { height:34px; max-height:34px; padding:3px 8px; box-sizing:border-box; }
.invoice-virtual-grid .invoice-virtual-spacer > td { padding:0!important; border:0!important; background:transparent!important; position:static!important; }
/* Shared presentation for the source shipment and monthly invoice workspaces. */
:is(.finance-shipment-summary,.monthly-invoices) .panel-head { gap:8px; flex-wrap:wrap; padding:6px 10px; }
:is(.finance-shipment-summary,.monthly-invoices) .panel-head .action-row { margin:0; gap:6px; flex-wrap:wrap; }
:is(.finance-shipment-summary,.monthly-invoices) > .panel-body { padding:4px 6px 6px; }
:is(.finance-shipment-summary,.monthly-invoices) :is(button,input,summary):focus-visible { outline:2px solid #32769e; outline-offset:2px; }
:is(.finance-shipment-summary,.monthly-invoices) button { min-height:28px; border-radius:3px; }
:is(.finance-shipment-summary,.monthly-invoices) button:disabled { cursor:default; opacity:.45; }
.finance-shipment-summary .shipment-month,
.monthly-invoices [data-monthly-invoice-section] { margin-bottom:8px; }
.finance-shipment-summary .shipment-month > summary,
.monthly-invoices [data-monthly-invoice-section] > summary { position:relative; box-sizing:border-box; min-height:42px; padding:10px 180px 10px 10px; background:#edf2f5; border-bottom:1px solid #ced8df; cursor:pointer; }
.monthly-invoices [data-monthly-invoice-section] > summary { padding-right:76px; }
.finance-shipment-summary .shipment-month > summary:hover,
.monthly-invoices [data-monthly-invoice-section] > summary:hover { background:#e5edf2; }
.finance-shipment-summary .shipment-month > summary > button,
.monthly-invoices [data-monthly-invoice-section] > summary > button { position:absolute; right:8px; top:50%; transform:translateY(-50%); float:none; margin:0; }
.finance-shipment-summary .shipment-month > summary > [data-delete-shipment-month] { right:66px; margin:0; background:#fff; color:#9c3636; border:1px solid #d8b7b7; }
.finance-shipment-summary .shipment-month > summary > [data-delete-shipment-month]:hover { background:#fff0f0; }
.monthly-invoice-grid .table-scroll { scrollbar-gutter:stable; overscroll-behavior:contain; }
.monthly-invoice-grid table { border-collapse:separate; border-spacing:0; }
.monthly-invoice-grid th { height:36px; padding:5px 8px; box-sizing:border-box; white-space:normal; overflow-wrap:anywhere; }
.monthly-invoice-grid td { height:34px; padding:4px 8px; box-sizing:border-box; }
.monthly-invoice-grid th:nth-child(7) { width:auto; }
.monthly-invoice-grid th:nth-child(14) { width:300px; }
.monthly-invoice-grid td:is(:nth-child(15),:nth-child(n+17)) { text-align:right; font-variant-numeric:tabular-nums; }
.monthly-invoice-grid th:nth-child(n+24) { background:#edf5f2; color:#28534b; }
.monthly-invoice-grid :is(th,td):nth-child(24) { border-left:2px solid #9dbbb5; }
.monthly-invoice-grid td:first-child { position:sticky; left:0; z-index:1; background:#fff; border-right:1px solid #aabdc9; text-align:left; }
.monthly-invoice-grid tr:nth-child(even) td:first-child { background:#f7fafc; }
.monthly-invoice-grid th:first-child { left:0; z-index:3; border-right:1px solid #aabdc9; }
:is(.monthly-invoice-grid,.shipment-data-grid) tbody tr:hover td { background:#eef5fa; }
.monthly-invoices [data-monthly-invoice-body] > .action-row,
.finance-shipment-summary .finance-workbook-pagination { justify-content:flex-end; gap:8px; padding:6px 2px; margin:0; font-variant-numeric:tabular-nums; }
.finance-shipment-summary .shipment-month-body > details { margin-top:4px; border-top:1px solid #d7e0e7; }
.finance-shipment-summary .shipment-month-body > details > summary { padding:8px 4px; cursor:pointer; }
.finance-shipment-summary .shipment-month-body > details td { vertical-align:top; }
.finance-shipment-summary .shipment-month-body > details td details[open] { max-height:260px; overflow:auto; overscroll-behavior:contain; text-align:left; }
.finance-shipment-summary .shipment-month-body > details td details p { margin:0; padding:6px 8px; border-top:1px solid #e3e9ee; overflow-wrap:anywhere; }
.finance-shipment-summary .shipment-month-body > details td details summary { position:sticky; top:0; padding:6px 8px; background:#fff7e8; cursor:pointer; }
.invoice-source-grid .table-scroll { max-height:max(240px, calc(100dvh - 190px)); overflow:auto; }
.content[data-rendered-module="financeShipmentInvoices"] { padding:6px; }
.content[data-rendered-module="financeShipmentInvoices"] > .panel { margin:0; }
.content[data-rendered-module="financeShipmentInvoices"] .panel-head { padding:6px 10px; min-height:0; }
.content[data-rendered-module="financeShipmentInvoices"] .panel-body { padding:4px 6px 6px; }
.content[data-rendered-module="financeShipmentInvoices"] [data-invoice-summary-section] > summary { padding:4px 0; }
.content[data-rendered-module="financeShipmentInvoices"] .invoice-source-grid .table-scroll { max-height:max(240px, calc(100dvh - 180px)); }
.invoice-source-grid table { table-layout:fixed; width:1700px; min-width:1700px; }
.monthly-invoice-grid table { width:4600px; min-width:4600px; }
.monthly-invoices > .panel-body > details > summary { padding:10px; background:#edf3f7; cursor:pointer; }
.invoice-source-grid th { position:sticky; top:0; background:#edf3f7; z-index:1; }
.invoice-source-grid th:nth-child(7) { width:300px; }
.shipment-invoice-grid th:nth-child(2), .shipment-invoice-grid th:nth-child(3) { width:72px; }
.shipment-invoice-grid th { white-space:nowrap; }
.shipment-invoice-grid table { width:100%; min-width:1400px; }
.invoice-review { margin-top:8px; border-top:1px solid #cbd5df; padding-top:8px; }
.invoice-review > summary { cursor:pointer; color:#934b10; padding:4px 0; }
.invoice-review .table-scroll { max-height:min(300px,35dvh); overflow:auto; overscroll-behavior:contain; scrollbar-width:auto!important; scrollbar-gutter:stable; }
.invoice-review .table-scroll::-webkit-scrollbar,
.invoice-virtual-grid .table-scroll::-webkit-scrollbar { display:block!important; width:14px!important; height:14px!important; }
.invoice-review .table-scroll::-webkit-scrollbar-thumb,
.invoice-virtual-grid .table-scroll::-webkit-scrollbar-thumb { background:#8da3b3; border:3px solid #edf3f7; border-radius:7px; }
.invoice-virtual-grid .table-scroll { scrollbar-width:auto!important; }
.invoice-review th { position:sticky; top:0; z-index:2; background:#edf3f7; }
.invoice-review th:last-child,.invoice-review td:last-child { position:sticky; right:0; background:#fff; }
.invoice-review th:last-child { z-index:3; background:#edf3f7; }
.invoice-review [data-review-invoice] { min-height:32px; min-width:56px; }
.shipment-invoice-grid th:nth-child(1) { width:118px; }
.shipment-invoice-grid th:nth-child(4) { width:105px; }
.shipment-invoice-grid th:nth-child(5) { width:88px; }
.shipment-invoice-grid th:nth-child(6) { width:72px; }
.shipment-invoice-grid th:nth-child(7) { width:160px; }
.shipment-type-editor { display:flex; align-items:center; gap:4px; min-width:0; }
.shipment-type-editor input { width:100%; min-width:0; height:26px; padding:2px 4px; box-sizing:border-box; font:inherit; }
.shipment-type-editor button { flex:none; border:0; background:#fff2d6; color:#805000; padding:2px 4px; font:inherit; cursor:pointer; white-space:nowrap; }
.content[data-rendered-module="financeShipmentInvoices"] [data-invoice-summary-section] > summary { position:relative; box-sizing:border-box; min-height:40px; padding:10px 120px 10px 4px; }
[data-shipment-type-import] { position:absolute; right:8px; top:50%; transform:translateY(-50%); float:none; margin:0; }
.shipment-invoice-grid .shipment-filter { display:inline-block; min-width:14px; padding:0 3px; }
/* Compact invoice workspace; keep the shared shipment and invoice views unchanged. */
.content[data-rendered-module="financeShipmentInvoices"] .panel-head { gap:8px; flex-wrap:wrap; }
.content[data-rendered-module="financeShipmentInvoices"] .panel-head .action-row { margin:0; gap:6px; }
.content[data-rendered-module="financeShipmentInvoices"] [data-invoice-summary-section] { margin-bottom:8px; }
.content[data-rendered-module="financeShipmentInvoices"] [data-invoice-summary-section] > summary { padding:11px 130px 11px 10px; min-height:44px; background:#edf2f5; border-bottom:1px solid #ced8df; color:#233e50; font-weight:600; cursor:pointer; }
.content[data-rendered-module="financeShipmentInvoices"] [data-invoice-summary-section] > summary:hover { background:#e5edf2; }
.shipment-invoice-grid .table-scroll { border-radius:0 0 4px 4px; scrollbar-gutter:stable; overscroll-behavior:contain; }
.shipment-invoice-grid table { min-width:1380px; width:100%; border-collapse:separate; border-spacing:0; }
.shipment-invoice-grid th:nth-child(8) { width:150px; }
.shipment-invoice-grid th:nth-child(9) { width:100px; }
.shipment-invoice-grid th:nth-child(10) { width:72px; }
.shipment-invoice-grid th:nth-child(11) { width:110px; }
.shipment-invoice-grid th:nth-child(12) { width:140px; }
.shipment-invoice-grid th { height:36px; padding:5px 8px; box-sizing:border-box; }
.shipment-invoice-grid td { height:34px; padding:3px 8px; box-sizing:border-box; }
.shipment-invoice-grid td:nth-child(1), .shipment-invoice-grid td:nth-child(4), .shipment-invoice-grid td:nth-child(8) { text-align:left; }
.shipment-invoice-grid td:is(:nth-child(5),:nth-child(9),:nth-child(11),:nth-child(12)) { text-align:right; font-variant-numeric:tabular-nums; }
.shipment-invoice-grid :is(th,td):nth-child(8) { border-left:2px solid #9dbbb5; }
.shipment-invoice-grid th:nth-child(n+8) { background:#edf5f2; color:#28534b; }
.shipment-invoice-grid td:first-child { position:sticky; left:0; z-index:1; background:#fff; border-right:1px solid #aabdc9; }
.shipment-invoice-grid tr:nth-child(even) td:first-child { background:#f7fafc; }
.shipment-invoice-grid th:first-child { left:0; z-index:3; border-right:1px solid #aabdc9; }
.shipment-invoice-grid tbody tr:hover td, .shipment-invoice-grid tbody tr:focus-within td { background:#eef5fa; }
.shipment-invoice-grid .shipment-filter { width:24px; height:24px; min-height:24px; margin-left:3px; border-radius:3px; vertical-align:middle; }
.shipment-invoice-grid .shipment-filter:hover { background:#dbe7ee; }
.shipment-invoice-grid .shipment-filter.active { background:#22567b; color:#fff; }
.shipment-type-editor input { background:#fff; border:1px solid #d4dfe7; border-radius:3px; }
.shipment-type-editor input:hover { border-color:#8ca8bb; }
.shipment-type-editor input:focus-visible { outline:2px solid #32769e; outline-offset:-1px; }
.shipment-type-editor button { border-radius:3px; min-height:26px; }
.content[data-rendered-module="financeShipmentInvoices"] :is(button,summary):focus-visible { outline:2px solid #32769e; outline-offset:2px; }
.content[data-rendered-module="financeShipmentInvoices"] [data-invoice-source-body] > .action-row { justify-content:flex-end; gap:8px; padding:6px 2px; margin:0; font-variant-numeric:tabular-nums; }
.content[data-rendered-module="financeShipmentInvoices"] .invoice-review > summary { background:#fff7e8; padding:12px 76px 12px 12px; min-height:44px; box-sizing:border-box; border-left:3px solid #b87919; }
@media (max-width:600px) {
  .content[data-rendered-module="financeShipmentInvoices"] .panel-head .action-row { flex-wrap:wrap; }
  .shipment-invoice-grid table { min-width:1380px; }
}
.invoice-source-cell > summary { display:block; list-style:none; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; cursor:pointer; }
.invoice-source-cell > summary::-webkit-details-marker { display:none; }
.invoice-source-cell > summary::marker { content:''; }
.invoice-source-grid td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.invoice-source-cell { min-width:0; max-width:100%; text-align:left; }
.invoice-cell-collapse { display:none; color:#1e527d; }
.invoice-source-cell[open] .invoice-cell-preview { display:none; }
.invoice-source-cell[open] .invoice-cell-collapse { display:inline; }
.invoice-source-cell > div { white-space:pre-wrap; overflow-wrap:anywhere; border-top:1px solid #cbd5df; margin-top:5px; padding-top:6px; }
.shipment-filter-popover > input[type=search] { box-sizing:border-box; width:100%; min-width:0; margin-bottom:10px; }
.shipment-filter-popover label { display:flex; align-items:flex-start; gap:8px; line-height:20px; padding:4px; white-space:normal; overflow-wrap:anywhere; }
.shipment-filter-popover input[type=checkbox] { flex:0 0 14px; width:14px; height:14px; margin:3px 0 0; }
.shipment-filter-popover .shipment-filter-options { max-height:240px; overflow-y:auto; margin:8px 0; border-block:1px solid #dde3e8; padding:5px 0; }
.shipment-filter-popover label[hidden] { display:none; }
.shipment-filter-popover .form-actions { display:flex; justify-content:flex-end; gap:6px; margin:0; padding:8px 0 0; }
.shipment-filter-popover .form-actions button { padding:5px 8px; font-size:12px; }
.shipment-month > summary > button { float:right; margin-top:-5px; }
.shipment-month > summary > [data-delete-shipment-month] { margin-right:8px; }
.shipment-filter { padding:0 5px; margin-left:5px; border:0; background:transparent; cursor:pointer; }
.shipment-data-grid .table-scroll > table { width:3080px; min-width:3080px; table-layout:fixed; }
.shipment-data-grid .table-scroll > table > :is(thead,tbody) > tr > :is(th,td) { width:120px; white-space:normal; overflow-wrap:anywhere; }
.shipment-data-grid .table-scroll > table > :is(thead,tbody) > tr > :is(th,td):is(:nth-child(5),:nth-child(19)) { width:230px; }
.shipment-data-grid .table-scroll > table > :is(thead,tbody) > tr > :is(th,td):nth-child(11) { width:340px; }
.shipment-long-text { display:flex; align-items:baseline; gap:5px; max-width:100%; min-width:0; text-align:left; }
.shipment-text-preview { display:block; flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; line-height:1.5; }
.shipment-long-text.expanded .shipment-text-preview { white-space:pre-wrap; overflow-wrap:anywhere; }
.shipment-long-text > .shipment-text-toggle { flex:none; white-space:nowrap; }
.shipment-text-toggle { border:0; background:transparent; color:#1e527d; padding:2px 0; cursor:pointer; font:inherit; }
.shipment-text-toggle[hidden] { display:none; }
body:has(.finance-shipment-summary) .content { padding:8px; }
.finance-shipment-summary > .panel-head { padding:8px 12px; min-height:0; }
.finance-shipment-summary > .panel-body { padding:8px; }
.finance-shipment-summary .shipment-month > summary { padding:10px 180px 10px 10px; }
.finance-shipment-summary .shipment-month-body { padding:6px 0; }
.finance-shipment-summary [data-shipment-totals] { padding:4px 0!important; }
.finance-shipment-summary .shipment-data-grid .table-scroll > table > tbody > tr > td { padding:5px 8px; line-height:1.4; }
.finance-shipment-summary.shipment-workspace-expanded { position:fixed; inset:52px 8px 8px; z-index:50; margin:0; overflow:auto; background:#fff; }
.finance-shipment-summary .shipment-data-grid .table-scroll { max-height:max(240px, calc(100dvh - 220px)); overflow:auto; overscroll-behavior:contain; }
.finance-shipment-summary .shipment-data-grid .table-scroll > table > thead > tr > th { position:sticky; top:0; z-index:2; background:#edf3f7; }
.finance-shipment-summary .finance-workbook-pagination { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:8px 0; }
.finance-shipment-summary [data-shipment-jump] { width:68px; min-width:0; height:30px; box-sizing:border-box; text-align:center; }
.finance-shipment-summary .shipment-data-grid .table-scroll > table > :is(thead,tbody) > tr > :is(th,td):nth-child(5) { width:180px; }
.shipment-address-popover[popover] { position:fixed; inset:auto; margin:0; width:360px; max-width:calc(100vw - 16px); box-sizing:border-box; padding:16px; border:1px solid #b8c4ce; border-radius:4px; background:#fff; color:#243746; box-shadow:0 4px 16px #0003; }
.shipment-address-popover p { margin:0 0 12px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:50vh; overflow:auto; line-height:1.6; }
.finance-shipment-summary .shipment-data-grid .table-scroll > table > thead > tr > th { white-space:nowrap; overflow-wrap:normal; padding-left:6px; padding-right:6px; }
.finance-shipment-summary .shipment-data-grid th .shipment-filter { display:inline-block; vertical-align:middle; margin-left:3px; padding:0 3px; width:14px; min-width:14px; }
.invoice-unmatched-dialog .table-scroll table { width:100%; table-layout:fixed; }
.invoice-unmatched-dialog .table-scroll :is(th,td) { width:auto!important; overflow-wrap:anywhere; }
.invoice-unmatched-dialog .table-scroll :is(th,td):nth-child(1) { width:85px!important; white-space:nowrap; }
.invoice-unmatched-dialog .table-scroll :is(th,td):nth-child(8) { width:220px!important; }
