/* Orders: distinct columns, one primary action and progressively disclosed details. */
.orders-table th{font:500 12px/1.5 var(--sans);letter-spacing:0;color:var(--muted);height:40px;padding:0 16px;vertical-align:middle}
.orders-table td{height:76px;padding:12px 16px;font-size:14px}
.orders-table th:first-child,.orders-table td:first-child{width:22%;padding-left:0}
.orders-table th:nth-child(2){width:auto}
.orders-table th:nth-child(3){width:80px}
.orders-table th:nth-child(4){width:172px}
.orders-table th:nth-child(5){width:88px}
.orders-table th:last-child,.orders-table td:last-child{width:172px;padding-right:0}
.orders-table th:nth-child(4),.orders-table td:nth-child(4){padding-left:24px}
.orders-table .service-name{font:400 14px/1.6 var(--sans);color:var(--muted);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-identity{display:grid;grid-template-columns:32px minmax(0,1fr);column-gap:8px;align-items:center;min-width:0}
.order-identity>.order-select{grid-column:1;grid-row:1/4;align-self:start}
.order-identity>:is(.order-name,.order-subline,.order-table-meta){grid-column:2;min-width:0}
.order-identity-no-select{grid-template-columns:minmax(0,1fr)}
.order-identity-no-select>:is(.order-name,.order-subline,.order-table-meta){grid-column:1}
.orders-table .order-name{min-height:44px;max-width:100%;align-items:center;font-size:14px}
.orders-table .order-name-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.orders-table .order-name.order-number{font-size:13px}
.orders-table .order-subline{margin:-5px 0 0;font-size:12px}
.order-table-meta{display:none}
.orders-table .order-select{float:none;width:32px;margin:0;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}
.orders-table th .order-select{min-height:32px;margin-right:8px}
.order-status-trigger{display:inline-flex;align-items:center;min-height:44px;padding:0;background:none;text-align:left;border:0}
.order-status-trigger .status{white-space:nowrap}
.order-status-trigger:hover .status{text-decoration:underline;text-underline-offset:4px}
.orders-table .order-eta{max-width:100%;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:18px}
.orders-table .status-cancelled,.order-drawer .status-cancelled{text-decoration:none}
.orders-table .order-status-trigger:hover .status-cancelled{text-decoration:underline}
.status-completed-empty{color:var(--st-neutral-t)}
.status-completed-empty::before{background:var(--st-neutral)}
.orders-table .order-row-actions>.text-link{font-size:13px;text-decoration:none;min-height:44px}
.orders-table .order-row-actions>.text-link:hover{text-decoration:underline;text-underline-offset:4px}
.orders-table .order-more{color:var(--muted)}
.table-controls .filter-button{font-size:14px;font-weight:400;border-bottom:2px solid transparent;border-radius:0;background:none;padding:12px 10px}
.table-controls .filter-button[aria-pressed="true"]{color:var(--ink);border-bottom-color:var(--forest);background:none;font-weight:500}
.table-controls .filter-count{font-size:12px;color:var(--muted);margin-left:5px}
.order-list-export{text-decoration:none;color:var(--muted)}
.order-list-export:hover{text-decoration:underline}
.order-menu{min-width:240px;width:max-content;max-width:min(320px,calc(100vw - 24px))}
.order-menu button{white-space:nowrap;align-items:center;min-height:44px}

/* These rules apply only to order drawers; invoice and edit dialogs keep their layout. */
.detail-dialog.order-drawer{width:560px;background:var(--surface)}
.detail-dialog.order-drawer[open]{animation-fill-mode:backwards}
.order-drawer .detail-content{padding:0 32px 32px}
.order-detail-header{position:static;padding:28px 0 24px;background:var(--surface)}
.order-drawer .detail-top{margin:0;gap:24px;align-items:flex-start}
.order-drawer .detail-top{padding-right:52px}
.order-drawer .detail-top>div{min-width:0}
.order-drawer .detail-top h2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;font:500 24px/1.25 var(--sans);letter-spacing:-.015em;margin:0;overflow:hidden;overflow-wrap:anywhere;word-break:normal}
.order-drawer .detail-top p{margin:8px 0 0;font:400 13px/1.5 var(--mono)}
.order-drawer .detail-top>.icon-button{position:fixed;top:20px;right:24px;z-index:4;width:44px;height:44px;margin:0;background:var(--surface);border-radius:var(--r-ctl);flex-shrink:0}
.order-detail-service{font-size:14px;line-height:1.6;color:var(--muted);margin:10px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-detail-context-wrap{display:flex;align-items:flex-start;gap:12px;margin-top:16px}
.order-detail-context{display:flex;flex:1;min-width:0;flex-wrap:wrap;align-items:center;gap:8px 12px;font-size:13px;line-height:1.6;color:var(--muted)}
.order-detail-context>.status{font-size:13px}
.order-detail-context>span{min-width:0;overflow-wrap:anywhere}
.order-detail-context>span+span{border:0;padding:0}
.order-detail-more{display:inline-flex;align-items:center;justify-content:center;flex:none;gap:6px;min-width:44px;min-height:44px;margin-top:-10px;padding:0 8px;border:0;background:none;font-size:13px;color:var(--muted)}
.order-detail-more:hover{color:var(--ink);background:var(--sunken)}
.order-detail-delivery{margin:12px 0 0;font-size:13px;line-height:1.6;color:var(--st-active-t)}
.order-detail-eta{margin:12px 0 0;font-size:13px;line-height:1.6;color:var(--muted)}
.order-detail-primary{display:flex;align-items:center;gap:12px;padding:0 0 24px}
.order-detail-primary>.button{min-height:44px;font-size:14px;justify-content:center;gap:8px;padding:0 18px}
.order-detail-primary>.button-dark{flex:1;justify-content:center}
.order-detail-primary>.button-outline{border-color:var(--line);background:transparent;gap:12px}
.order-drawer :is(.order-detail-section,.order-progress-panel){border-top:1px solid var(--line)}
.order-drawer :is(.order-detail-section,.order-progress-panel)>summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:64px;padding:16px 0;font-size:14px;font-weight:500;cursor:pointer}
.order-drawer :is(.order-detail-section,.order-progress-panel)>summary::-webkit-details-marker{display:none}
.order-drawer :is(.order-detail-section,.order-progress-panel)>summary>.ui-icon{color:var(--muted);transition:transform var(--t-ui) var(--ease)}
.order-drawer :is(.order-detail-section,.order-progress-panel)[open]>summary>.ui-icon{transform:rotate(180deg)}
.order-section-count{font-size:13px;font-weight:400;color:var(--muted);margin-left:8px}
.order-drawer .order-progress{margin:0 0 24px;font-size:12px;gap:12px}
.order-drawer .order-progress li{gap:8px;padding-top:10px}
.order-sample-list{padding-bottom:16px}
.order-sample-filter{display:flex;align-items:center;gap:8px;min-height:44px;border:1px solid var(--line);border-radius:var(--r-ctl);padding:0 12px;margin:0 0 16px;color:var(--muted)}
.order-sample-filter input{min-width:0;width:100%;min-height:44px;border:0;background:none;color:var(--ink);font-size:14px}
.order-sample-filter:focus-within{outline:2px solid var(--forest);outline-offset:2px}
.order-sample-filter input:focus-visible{outline:none}
.order-samples-toggle{min-height:44px;font-size:13px;margin-bottom:16px}
.order-sample-count{font-size:12px;color:var(--muted);margin:0 0 16px}
.order-sample-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 0;border-top:1px solid var(--line)}
.order-sample-row:first-child{border-top:0}
.order-sample-name{min-width:0;flex:1}
.order-sample-name strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;font-size:14px;font-weight:400;line-height:1.5;overflow:hidden;overflow-wrap:anywhere;word-break:normal}
.order-sample-name small{display:block;font-size:12px;color:var(--muted);line-height:1.5;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-sample-name .order-sample-id{display:flex;min-width:0;max-width:100%;font-family:var(--mono);font-size:12px;white-space:nowrap;overflow:hidden}
.order-sample-id-prefix{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-sample-id-tail{flex:none;white-space:nowrap}
.order-sample-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}
.order-sample-availability{display:inline-flex;align-items:center;min-height:44px}
.order-sample-pending{font-size:13px;line-height:1.5;color:var(--muted)}
.order-sample-actions>.sample-rename{height:40px;width:40px;color:var(--muted)}
.order-sample-actions .text-link{font-size:13px;text-decoration:none;min-width:44px;min-height:44px;gap:4px}
.order-sample-actions .text-link:hover{text-decoration:underline;text-underline-offset:4px}
.order-detail-facts{margin:0;padding:0 0 16px;font-size:14px;line-height:1.65}
.order-detail-facts>div{display:grid;grid-template-columns:128px minmax(0,1fr);gap:24px;padding:12px 0}
.order-detail-facts dt{font-size:13px;color:var(--muted);margin:0}
.order-detail-facts dd{margin:0;text-align:left;overflow-wrap:anywhere}
.order-detail-facts .text-link{font-size:14px}
.order-detail-projects{display:grid;grid-template-columns:128px minmax(0,1fr);gap:24px;padding:12px 0 24px;font-size:13px;color:var(--muted)}
.order-detail-projects .membership-chips{margin:0;min-width:0}
.order-detail-projects .membership-chip{white-space:normal;overflow-wrap:anywhere;text-align:left}
.order-detail-empty,.order-detail-note{font-size:13px;line-height:1.7;color:var(--muted);margin:0 0 16px}
.order-detail-note{border-top:1px solid var(--line);padding-top:20px}
.order-detail-notice,.order-sample-availability-note{margin:0 0 20px;font-size:13px;line-height:1.6;color:var(--muted)}
.order-detail-notice .text-link{font-size:inherit}
@media(min-width:701px){
  .table-controls{margin-bottom:12px;gap:24px}
  .order-table-tools .search-field{width:208px}
}
@media(min-width:701px) and (max-width:1120px){
  .table-controls{flex-wrap:wrap;gap:16px}
  .table-controls .filters{flex:1 1 100%;min-width:0;flex-wrap:wrap}
  .order-table-tools{flex:1 1 100%;width:100%;margin-left:0;justify-content:space-between}
  .order-table-tools .search-field{flex:1;max-width:320px;width:auto;min-width:0}
  .orders-table th:first-child,.orders-table td:first-child{width:auto}
  .orders-table th:nth-child(4){width:146px}
  .orders-table th:last-child,.orders-table td:last-child{width:150px}
  .orders-table th:nth-child(4),.orders-table td:nth-child(4){padding-left:16px}
}
@media(max-width:1120px){
  .orders-table th:nth-child(3),.orders-table td:nth-child(3),.orders-table th:nth-child(5),.orders-table td:nth-child(5){display:none}
  .orders-table .order-table-meta{display:block;margin:0;color:var(--muted);font-size:12px;line-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(max-width:700px){
  .orders-table tr{min-height:112px;padding:12px 0;grid-template-columns:44px minmax(0,1fr) auto;grid-template-rows:44px 44px;gap:0 8px}
  .orders-table td,.orders-table th:first-child,.orders-table td:first-child,.orders-table td:last-child{height:auto;width:auto;padding:0}
  .orders-table td:first-child,.orders-table .order-identity{display:contents}
  .orders-table .order-select{grid-column:1;grid-row:1/3;align-self:start;width:44px;min-height:44px;margin:0}
  .orders-table .order-name{grid-column:2;grid-row:1;align-self:start;min-height:44px;font-size:14px;position:static;overflow:visible}
  .orders-table .order-table-meta{grid-column:2;grid-row:1;align-self:start;margin-top:36px}
  .orders-table .order-subline{grid-column:2;grid-row:1;align-self:start;font-size:12px;margin:36px 0 0}
  .orders-table tr:has(.order-subline) .order-table-meta{margin-top:58px}
  .orders-table .order-identity-no-select .order-name,.orders-table .order-identity-no-select .order-subline,.orders-table .order-identity-no-select .order-table-meta{grid-column:1/3}
  .orders-table td:nth-child(2){display:none}
  .orders-table td:nth-child(4){display:flex;flex-direction:column;align-items:flex-end;grid-column:3;grid-row:1;padding:0;min-width:0;max-width:120px;align-self:start}
  .orders-table td:last-child{grid-column:3;grid-row:2}
  .orders-table .service-name{display:none}
  .orders-table .order-name::after{display:block;content:'';position:absolute;inset:0;z-index:1}
  .orders-table td:first-child:has(.order-select) .order-name{max-width:100%}
  .orders-table .order-row-actions{gap:4px}
  .orders-table .order-row-actions>.text-link{padding:0;max-width:none;min-width:44px;font-size:13px}
  .orders-table .order-row-actions>.text-link>.ui-icon{display:none}
  .orders-table .order-status-trigger{position:relative;z-index:2;min-width:44px;min-height:44px;justify-content:flex-end}
  .orders-table .order-eta{max-width:100%;margin-top:-5px;font-size:11px;line-height:16px;text-align:right}
  .orders-table tr:has(.order-eta){grid-template-rows:56px 44px}
  .table-controls .filter-button{font-size:13px;padding:0 8px}
  .table-controls .filter-count{margin-left:4px}
  .detail-dialog.order-drawer{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;inset:0;margin:0;border:0;border-radius:0}
  .order-drawer .detail-content{padding:0 24px 24px}
  .order-detail-header{padding:24px 0 20px}
  .order-drawer .detail-top h2{font-size:20px}
  .order-detail-primary{gap:8px;padding-bottom:20px}
  .order-detail-primary>.button{padding:0 14px;font-size:14px}
  .order-detail-primary>.button-outline{gap:8px}
  .order-drawer :is(.order-detail-section,.order-progress-panel)>summary{min-height:60px}
  .order-detail-facts>div,.order-detail-projects{grid-template-columns:104px minmax(0,1fr);gap:16px}
  .order-sample-row{gap:12px}
  .order-sample-actions{gap:12px}
  .order-drawer .detail-top>.icon-button,.order-sample-actions>.sample-rename{width:44px;height:44px}
  .order-drawer .detail-top>.icon-button{top:16px;right:16px}
  .workspace-header .location-control{flex:1 1 auto;min-width:0;max-width:236px}
  .workspace-header .location-control select{flex:1 1 auto;min-width:0;max-width:100%;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
  .workspace-header .workspace-menu-toggle{flex:none}
}
@media(max-width:360px){
  .order-sample-name strong{-webkit-line-clamp:3;line-clamp:3}
}
@media(max-width:359px){
  .orders-table tr{grid-template-rows:56px 44px;row-gap:0}
  .orders-table .order-table-meta{grid-column:2/4}
  .orders-table td:last-child{grid-column:2/4;grid-row:2}
  .orders-table tr:has(.order-subline){grid-template-rows:78px 44px}
  .orders-table tr:has(.order-eta){grid-template-rows:56px 44px;padding-bottom:24px}
  .orders-table tr:has(.order-eta):has(.order-subline){grid-template-rows:78px 44px}
  .orders-table .order-eta{position:absolute;left:52px;right:0;bottom:8px;max-width:none;margin:0;text-align:left}
  .order-detail-primary{flex-wrap:wrap}
  .order-detail-primary>.button-dark{flex-basis:100%}
  .order-detail-primary>.button-outline{margin-left:auto}
  .order-drawer .detail-content{padding-inline:20px}
}
@media(pointer:coarse){
  .orders-table .order-select{width:44px;min-height:44px}
  .order-identity:not(.order-identity-no-select){grid-template-columns:44px minmax(0,1fr)}
  .orders-table .order-more,.order-drawer .detail-top>.icon-button,.order-sample-actions>.sample-rename{min-width:44px;min-height:44px;width:44px;height:44px}
}
@media(prefers-reduced-motion:reduce){
  .order-drawer :is(.order-detail-section,.order-progress-panel)>summary>.ui-icon{transition:none}
}
