/* MS Shipments V2.6.0-C — premium shipment detail and auto-fit tables.
   Scoped overrides only; preserves v2.5.8 typography sizes and v2.6.0-B dashboard. */
:root { --shipment-tab-border: #2a6078; --shipment-tab-focus: #69e5e1; }
.page-view {width:100%;max-width:none;min-width:0;}
.shipment-workspace{min-width:0;width:100%;}
.shipment-tabbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:9px;background:#0d2b3f;border:1px solid #28576c;border-radius:14px;margin:12px 0 16px;}
.shipment-tab{min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 15px;border-radius:10px;border:1px solid transparent;color:#bfd9e7;text-decoration:none;font-size:16px;font-weight:700;white-space:nowrap;transition:background-color .15s,border-color .15s,color .15s;}
.shipment-tab:hover{border-color:#33728a;color:#efffff;background:#103f55;text-decoration:none;}
.shipment-tab[aria-selected="true"]{background:linear-gradient(115deg,#125066,#0c394b);border-color:#51b5c5;color:#ecffff;box-shadow:inset 0 -2px #69d6d7;}
.shipment-tab:focus-visible{outline:2px solid var(--shipment-tab-focus);outline-offset:3px;}
.shipment-tab .tab-count{display:inline-flex;align-items:center;justify-content:center;min-width:25px;padding:1px 7px;border-radius:12px;background:#124c5c;color:#95e8e6;font-size:13px;}
.shipment-tab-panel{min-width:0;scroll-margin-top:100px;}
.shipment-tab-panel[hidden]{display:none!important;}
.shipment-tab-panel .card,.shipment-tab-panel .tablewrap{max-width:none;min-width:0;}
.shipment-panel-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 14px;}
.shipment-panel-heading h2{margin:0;color:#edfaff;font-size:20px;line-height:1.4;}
.shipment-tab-panel>h2:first-of-type{display:none;} /* use section heading; keep anchor in DOM */
.shipment-overview-links{display:flex;flex-wrap:wrap;gap:9px;justify-content:flex-start;margin:16px 0;}
.shipment-preview-card{background:#102d42;border:1px solid #2d5a71;border-radius:14px;padding:16px;min-width:0;}
.shipment-preview-card p{margin:0;}
.page-view .fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,185px),1fr));}
.page-view .fields .f{text-align:center;}
.page-view .kpis{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}
.page-view .shipment-tab-panel .kpis{margin-top:16px;}
/* True browser-driven Auto Fit: table grows only when content needs room;
   horizontal overflow is owned by its scroll container, never the page. */
.tablewrap{max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;}
.tablewrap > table.grid{table-layout:auto!important;width:max-content!important;min-width:100%!important;max-width:none!important;}
.tablewrap > table.grid th,.tablewrap > table.grid td{min-width:0;max-width:clamp(160px,24vw,360px);padding:10px 12px;vertical-align:middle;text-align:center!important;}
.tablewrap > table.grid th{white-space:normal;overflow-wrap:normal;}
.tablewrap > table.grid td:not(.n):not(.datecell){overflow-wrap:anywhere;}
.tablewrap > table.grid td.n,.tablewrap > table.grid td.datecell{white-space:nowrap;direction:ltr;font-variant-numeric:tabular-nums;}
.tablewrap > table.grid td .badge,.tablewrap > table.grid td .tag{white-space:nowrap;}
.page-form .tablewrap > table.grid td{max-width:none;} /* keep edit inputs usable */
.page-form .grid.edit input{min-width:86px;}
/* Shipment item table has 12 columns; prefer readable scrolling over tiny fonts. */
.page-view .shipment-items-table th,.page-view .shipment-items-table td{padding:11px 13px;white-space:nowrap;}
.page-view .shipment-items-table th:first-child,.page-view .shipment-items-table td:first-child{position:sticky;right:0;z-index:2;background:#123448;max-width:300px;white-space:normal;overflow-wrap:anywhere;}
.page-view .shipment-items-table thead th:first-child{z-index:3;}
.page-view .shipment-items-table tbody tr:nth-child(even) td:first-child{background:#123044;}
@media(max-width:750px){
  .shipment-tabbar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;}
  .shipment-tab{font-size:15px;flex:0 0 auto;padding:9px 12px;}
  .shipment-panel-heading{align-items:flex-start;}
  .shipment-tab-panel .tablewrap > table.grid th,.shipment-tab-panel .tablewrap > table.grid td{padding:9px 11px;}
  .page-view .fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));}
}
@media(prefers-reduced-motion:reduce){.shipment-tab{transition:none;}}
@media print{
  .shipment-tabbar{display:none!important;}
  .shipment-tab-panel[hidden],.shipment-tab-panel{display:block!important;break-inside:auto;}
  .shipment-tab-panel:not(:first-of-type){break-before:page;}
  .page-view .shipment-items-table th:first-child,.page-view .shipment-items-table td:first-child{position:static!important;}
  .tablewrap{overflow:visible!important;}
  .tablewrap > table.grid{width:100%!important;min-width:0!important;}
  .tablewrap > table.grid td{white-space:normal!important;}
}
