/* Two-column operational layout: vendor ranking left, PO detail right. */
#shipReport{display:grid;grid-template-columns:minmax(270px,320px) minmax(0,1fr);gap:12px;align-items:start}
#shipReport>.ship-kpis{grid-column:1/-1;margin-bottom:0}
#shipReport>.ship-card{margin:0;min-width:0}
#shipReport>.ship-card:first-of-type{grid-column:1;position:sticky;top:12px;padding:12px}
#shipReport>.ship-card:last-of-type{grid-column:2}
#shipReport>.ship-card:first-of-type .ship-section-head{margin-bottom:8px}
#shipReport>.ship-card:first-of-type .ship-section-head h2{font-size:18px}
#shipReport>.ship-card:first-of-type .ship-vendors{display:grid;grid-template-columns:1fr;gap:6px;max-height:690px;overflow:auto;padding-right:4px}
#shipReport>.ship-card:first-of-type .ship-vendors button{min-height:0;padding:8px 10px;border-radius:9px}
#shipReport>.ship-card:first-of-type .ship-vendors button b{font-size:12px;line-height:1.2}
#shipReport>.ship-card:first-of-type .ship-vendors button span{font-size:10px;line-height:1.25}
#shipReport>.ship-card:last-of-type .ship-table-wrap{max-height:690px}
@media(max-width:1050px){#shipReport{grid-template-columns:1fr}#shipReport>.ship-kpis,#shipReport>.ship-card:first-of-type,#shipReport>.ship-card:last-of-type{grid-column:1}#shipReport>.ship-card:first-of-type{position:static}#shipReport>.ship-card:first-of-type .ship-vendors{grid-template-columns:repeat(auto-fill,minmax(230px,1fr));max-height:360px}}

/* Wider right panel for the additional FS report fields. */
.ship-page{width:min(96vw,1900px);max-width:1900px}
.ship-table-expanded{min-width:1780px}
.ship-table-expanded th,.ship-table-expanded td{padding:7px 8px}
.ship-table-expanded th:nth-child(4){min-width:190px}
.ship-table-expanded th:nth-child(6){min-width:125px}
.ship-table-expanded th:nth-child(13){min-width:105px}
.ship-detail article{grid-template-columns:1.1fr 1.5fr .8fr 1.2fr 1fr}
.ship-detail article.shortage{background:#fff6e8;border:1px solid #f0d29d}
.ship-detail article.shortage strong{color:#8d5700}
.ship-status.shortage_not_shipping{background:#fff0d9;color:#8d5700}

/* Left-aligned full-width screen with a fitted, wrapping table. */
.ship-page{width:calc(100vw - 32px);max-width:none;margin-left:16px;margin-right:16px}
#shipReport{grid-template-columns:300px minmax(0,1fr)}
#shipReport>.ship-card:last-of-type .ship-table-wrap{overflow-x:hidden}
.ship-table-expanded{width:100%;min-width:0;table-layout:fixed;font-size:10px}
.ship-table-expanded th,.ship-table-expanded td{min-width:0!important;padding:5px 4px;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
.ship-table-expanded th:nth-child(1){width:8%}
.ship-table-expanded th:nth-child(2){width:5%}
.ship-table-expanded th:nth-child(3){width:7%}
.ship-table-expanded th:nth-child(4){width:10%}
.ship-table-expanded th:nth-child(5){width:4%}
.ship-table-expanded th:nth-child(6){width:7%}
.ship-table-expanded th:nth-child(7){width:5%}
.ship-table-expanded th:nth-child(8){width:6%}
.ship-table-expanded th:nth-child(9),.ship-table-expanded th:nth-child(10){width:6%}
.ship-table-expanded th:nth-child(11){width:7%}
.ship-table-expanded th:nth-child(12){width:6%}
.ship-table-expanded th:nth-child(13){width:6%}
.ship-table-expanded th:nth-child(14){width:8%}
.ship-table-expanded th:nth-child(15){width:4%}
.ship-table-expanded th:nth-child(16){width:9%}
@media(max-width:1050px){.ship-page{width:calc(100vw - 20px);margin-left:10px;margin-right:10px}#shipReport{grid-template-columns:1fr}.ship-table-wrap{overflow-x:auto!important}.ship-table-expanded{min-width:1350px}}

/* Compact desktop correction: stay inside the application shell and remove
   percentage widths whose total exceeded the available table width. */
@media(min-width:1051px){
  .ship-page{width:auto;max-width:none;margin-left:12px;margin-right:12px;box-sizing:border-box}
  #shipReport{grid-template-columns:270px minmax(0,1fr);gap:10px}
  #shipReport>.ship-card:last-of-type{min-width:0}
  #shipReport>.ship-card:last-of-type .ship-table-wrap{width:100%;max-width:100%;overflow-x:hidden}
  .ship-table-expanded{width:100%;max-width:100%;min-width:0;table-layout:auto;font-size:9px}
  .ship-table-expanded th,.ship-table-expanded td{width:auto!important;min-width:0!important;max-width:none;padding:4px 3px;line-height:1.1;vertical-align:top}
  .ship-table-expanded th:nth-child(1),.ship-table-expanded td:nth-child(1){width:74px!important;white-space:nowrap}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){width:52px!important;white-space:nowrap}
  .ship-table-expanded th:nth-child(3),.ship-table-expanded td:nth-child(3){width:88px!important}
  .ship-table-expanded th:nth-child(4),.ship-table-expanded td:nth-child(4){width:130px!important;max-width:130px}
  .ship-table-expanded th:nth-child(5),.ship-table-expanded td:nth-child(5),
  .ship-table-expanded th:nth-child(9),.ship-table-expanded td:nth-child(9),
  .ship-table-expanded th:nth-child(10),.ship-table-expanded td:nth-child(10),
  .ship-table-expanded th:nth-child(15),.ship-table-expanded td:nth-child(15){width:1%!important;white-space:nowrap}
  .ship-table-expanded th:nth-child(n+6),.ship-table-expanded td:nth-child(n+6){padding-left:2px;padding-right:2px}
  .ship-table-expanded th:nth-child(6),.ship-table-expanded td:nth-child(6){max-width:95px}
  .ship-table-expanded th:nth-child(7),.ship-table-expanded td:nth-child(7){max-width:65px}
  .ship-table-expanded th:nth-child(8),.ship-table-expanded td:nth-child(8){max-width:78px}
  .ship-table-expanded th:nth-child(11),.ship-table-expanded td:nth-child(11){max-width:80px}
  .ship-table-expanded th:nth-child(12),.ship-table-expanded td:nth-child(12){max-width:72px}
  .ship-table-expanded th:nth-child(13),.ship-table-expanded td:nth-child(13){max-width:84px}
  .ship-table-expanded th:nth-child(14),.ship-table-expanded td:nth-child(14){max-width:98px}
  .ship-table-expanded th:nth-child(16),.ship-table-expanded td:nth-child(16){max-width:105px}
}

/* User-resizable shipping columns. Pixel widths from the colgroup intentionally
   replace all earlier percentage maps; the table scrolls only when necessary. */
.ship-table-wrap{overflow:auto!important}
.ship-table-expanded{table-layout:fixed!important;width:auto;min-width:100%;font-size:11px}
.ship-table-expanded col{width:auto}
.ship-table-expanded th,.ship-table-expanded td{width:auto!important;min-width:0!important;max-width:none!important;padding:5px 5px;font-size:11px;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.ship-table-expanded th{position:relative;padding-right:10px}
.ship-resizer{position:absolute;z-index:4;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;border-right:2px solid transparent;touch-action:none}
.ship-resizer:hover,.ship-resizing .ship-resizer{border-right-color:#8b0a7e}
.ship-resizing{cursor:col-resize!important;user-select:none!important}
.ship-resize-help{margin:0 0 6px;color:#60716b;font-size:11px}
#shipResetColumns{white-space:nowrap}
@media(min-width:1051px){
  .ship-table-expanded th:nth-child(n),.ship-table-expanded td:nth-child(n){width:auto!important;min-width:0!important;max-width:none!important}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){border-left:1px solid #d4e1dd}
}

/* Final desktop distribution: 20% Vendor and tighter operational columns. */
@media(min-width:1051px){
  .ship-table-expanded th,.ship-table-expanded td{padding-left:2px;padding-right:2px}
  .ship-table-expanded th:nth-child(1),.ship-table-expanded td:nth-child(1){width:20%!important;padding-left:4px;padding-right:12px}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){width:7%!important;padding-left:10px}
  .ship-table-expanded th:nth-child(3),.ship-table-expanded td:nth-child(3){width:7%!important}
  .ship-table-expanded th:nth-child(4),.ship-table-expanded td:nth-child(4){width:8%!important}
  .ship-table-expanded th:nth-child(5),.ship-table-expanded td:nth-child(5){width:3%!important}
  .ship-table-expanded th:nth-child(6),.ship-table-expanded td:nth-child(6){width:4%!important}
  .ship-table-expanded th:nth-child(7),.ship-table-expanded td:nth-child(7){width:4%!important}
  .ship-table-expanded th:nth-child(8),.ship-table-expanded td:nth-child(8){width:3.5%!important}
  .ship-table-expanded th:nth-child(9),.ship-table-expanded td:nth-child(9){width:4.5%!important}
  .ship-table-expanded th:nth-child(10),.ship-table-expanded td:nth-child(10){width:4.5%!important}
  .ship-table-expanded th:nth-child(11),.ship-table-expanded td:nth-child(11){width:7%!important}
  .ship-table-expanded th:nth-child(12),.ship-table-expanded td:nth-child(12){width:4%!important}
  .ship-table-expanded th:nth-child(13),.ship-table-expanded td:nth-child(13){width:4%!important}
  .ship-table-expanded th:nth-child(14),.ship-table-expanded td:nth-child(14){width:4%!important}
  .ship-table-expanded th:nth-child(15),.ship-table-expanded td:nth-child(15){width:3.5%!important}
  .ship-table-expanded th:nth-child(16),.ship-table-expanded td:nth-child(16){width:11%!important}
}

/* Vendor/PO separation and sortable table headers. */
@media(min-width:1051px){
  .ship-table-expanded th:nth-child(1),.ship-table-expanded td:nth-child(1){width:10%!important;padding-right:8px}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){width:7%!important;padding-left:7px}
  .ship-table-expanded th:nth-child(4),.ship-table-expanded td:nth-child(4){width:8%!important}
  .ship-table-expanded th:nth-child(16),.ship-table-expanded td:nth-child(16){width:13%!important}
}
.ship-table-expanded th[data-ship-sort]{cursor:pointer;user-select:none}
.ship-table-expanded th[data-ship-sort]:hover{background:#dfece8;color:#164f43}
.ship-sort-mark{display:inline-block;min-width:10px;margin-left:3px;color:#145c4d;font-size:9px}
.ship-filters{grid-template-columns:minmax(280px,1.4fr) minmax(170px,.85fr) minmax(190px,.85fr) auto auto}
#shipExport{border-color:#1e6a5a;color:#145c4d;font-weight:700;white-space:nowrap}
#shipExport:hover{background:#e5f2ee}
@media(max-width:1250px){.ship-filters{grid-template-columns:1fr 1fr 1fr}.ship-filters button{width:100%}}

/* Keep long vendor names inside column 1 and visibly separate PO column 2. */
@media(min-width:1051px){
  .ship-table-expanded th:nth-child(1),.ship-table-expanded td:nth-child(1){width:15%!important;padding-right:12px;overflow-wrap:anywhere;word-break:normal}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){width:7%!important;padding-left:12px;border-left:1px solid #d4e1dd}
  .ship-table-expanded th:nth-child(3),.ship-table-expanded td:nth-child(3){width:7%!important}
  .ship-table-expanded th:nth-child(4),.ship-table-expanded td:nth-child(4){width:9%!important}
  .ship-table-expanded th:nth-child(5),.ship-table-expanded td:nth-child(5){width:3%!important}
  .ship-table-expanded th:nth-child(6),.ship-table-expanded td:nth-child(6){width:5%!important}
  .ship-table-expanded th:nth-child(7),.ship-table-expanded td:nth-child(7){width:4%!important}
  .ship-table-expanded th:nth-child(8),.ship-table-expanded td:nth-child(8){width:4%!important}
  .ship-table-expanded th:nth-child(9),.ship-table-expanded td:nth-child(9){width:5%!important}
  .ship-table-expanded th:nth-child(10),.ship-table-expanded td:nth-child(10){width:5%!important}
  .ship-table-expanded th:nth-child(11),.ship-table-expanded td:nth-child(11){width:8%!important}
  .ship-table-expanded th:nth-child(12),.ship-table-expanded td:nth-child(12){width:5%!important}
  .ship-table-expanded th:nth-child(13),.ship-table-expanded td:nth-child(13){width:5%!important}
  .ship-table-expanded th:nth-child(14),.ship-table-expanded td:nth-child(14){width:5%!important}
  .ship-table-expanded th:nth-child(15),.ship-table-expanded td:nth-child(15){width:4%!important}
  .ship-table-expanded th:nth-child(16),.ship-table-expanded td:nth-child(16){width:9%!important}
  .ship-table-expanded td:nth-child(1)>b{display:block;max-width:100%;white-space:normal}
  .ship-table-expanded td:nth-child(2)>b{display:block;white-space:nowrap}
  .ship-table-expanded td:nth-child(16) .ship-status{white-space:normal;line-height:1.15}
}

/* Final compact column map requested after desktop review. The widths total
   100%, so Fabric cat through Units start earlier without page overflow. */
@media(min-width:1051px){
  .ship-table-expanded{table-layout:fixed;font-size:11px}
  .ship-table-expanded th,.ship-table-expanded td{font-size:11px;padding:4px 3px;white-space:normal;overflow-wrap:anywhere;word-break:normal}
  .ship-table-expanded th:nth-child(1),.ship-table-expanded td:nth-child(1){width:8%!important}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){width:7%!important}
  .ship-table-expanded th:nth-child(3),.ship-table-expanded td:nth-child(3){width:7%!important}
  .ship-table-expanded th:nth-child(4),.ship-table-expanded td:nth-child(4){width:9%!important;max-width:none}
  .ship-table-expanded th:nth-child(5),.ship-table-expanded td:nth-child(5){width:3%!important;white-space:normal}
  .ship-table-expanded th:nth-child(6),.ship-table-expanded td:nth-child(6){width:5%!important;max-width:none}
  .ship-table-expanded th:nth-child(7),.ship-table-expanded td:nth-child(7){width:5%!important;max-width:none}
  .ship-table-expanded th:nth-child(8),.ship-table-expanded td:nth-child(8){width:4%!important;max-width:none}
  .ship-table-expanded th:nth-child(9),.ship-table-expanded td:nth-child(9){width:5%!important;white-space:normal}
  .ship-table-expanded th:nth-child(10),.ship-table-expanded td:nth-child(10){width:5%!important;white-space:normal}
  .ship-table-expanded th:nth-child(11),.ship-table-expanded td:nth-child(11){width:9%!important;max-width:none;overflow-wrap:anywhere}
  .ship-table-expanded th:nth-child(12),.ship-table-expanded td:nth-child(12){width:5%!important;max-width:none}
  .ship-table-expanded th:nth-child(13),.ship-table-expanded td:nth-child(13){width:5%!important;max-width:none}
  .ship-table-expanded th:nth-child(14),.ship-table-expanded td:nth-child(14){width:5%!important;max-width:none}
  .ship-table-expanded th:nth-child(15),.ship-table-expanded td:nth-child(15){width:4%!important;white-space:normal}
  .ship-table-expanded th:nth-child(16),.ship-table-expanded td:nth-child(16){width:14%!important;max-width:none}
}

/* Final resizable-column override. */
.ship-table-wrap{overflow:auto!important}
.ship-table-expanded{table-layout:fixed!important;width:auto;min-width:100%;font-size:11px}
.ship-table-expanded col{width:auto}
.ship-table-expanded th,.ship-table-expanded td{width:auto!important;min-width:0!important;max-width:none!important;padding:5px 5px;font-size:11px;line-height:1.2;white-space:normal;overflow-wrap:anywhere}
.ship-table-expanded th{position:relative;padding-right:10px}
.ship-resizer{position:absolute;z-index:4;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;border-right:2px solid transparent;touch-action:none}
.ship-resizer:hover,.ship-resizing .ship-resizer{border-right-color:#8b0a7e}
.ship-resizing{cursor:col-resize!important;user-select:none!important}
.ship-resize-help{margin:0 0 6px;color:#60716b;font-size:11px}
#shipResetColumns{white-space:nowrap}
@media(min-width:1051px){
  .ship-table-expanded th:nth-child(n),.ship-table-expanded td:nth-child(n){width:auto!important;min-width:0!important;max-width:none!important}
  .ship-table-expanded th:nth-child(2),.ship-table-expanded td:nth-child(2){border-left:1px solid #d4e1dd}
}
