/* Vận hành · Brief 1: danh sách lệnh, gọi xe, lượt và Phiếu giao nhận. */
.operations { display: grid; gap: 16px; }
.workspace-v2 #operations-workspace { border:0; background:transparent; padding:0; box-shadow:none; }
.operations .ops-row { --order-cols: 132px minmax(0, 1.6fr) 110px 80px minmax(150px, 190px) 130px; }
.ops-next { box-shadow: inset 3px 0 0 var(--ui-accent); }
.ops-next-truck { margin: 0; font-weight: 600; }
.ops-ticket-form > .action-buttons { grid-column: 1 / -1; }
.ops-trips { display: grid; gap: 12px; }
.ops-trip { display: grid; gap: 8px; padding: 12px 16px; border: 1px solid var(--ui-border); border-radius: 12px; }
.ops-trip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ops-trip > .muted { margin: 0; }
.ops-ticket-preview { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; }
.ops-ticket-dialog .delivery-ticket { max-width: 100%; }
.ops-ticket-dialog-actions { display: flex; flex-shrink: 0; gap: 8px; }
/* Same breakpoint as the Điều phối list (rows stack, header hidden): values keep their label. */
@media (max-width: 1199px) {
  .ops-row > .ops-quantity::before { content: "Lệnh "; }
}
/* Phiếu giao nhận (19/11/2026): Phiếu thường and Phiếu kèm cấp phối model, the paper forms on screen and in print,
   one A5 landscape page (210 × 148 mm; 794 px wide on screen). */
.delivery-ticket { display: grid; gap: 4px; width: 100%; max-width: 794px; padding: 14px 18px; border: 1px solid var(--ui-border); border-radius: 8px; background: white; color: #111; font-size: 12.5px; line-height: 1.3; box-sizing: border-box; overflow-x: auto; }
.delivery-ticket.is-preview { border-style: dashed; }
.delivery-ticket p { margin: 0; }
.ticket-red { color: #c0392b; }
.ticket-nation, .ticket-nation-sub { text-align: center; font-weight: 700; color: #1f3a93; }
.ticket-nation-sub { margin-bottom: 2px !important; }
.ticket-number { text-align: right; font-weight: 700; font-size: 13px; }
.ticket-title { margin: 0; text-align: center; font-size: 17px; letter-spacing: .02em; }
.ticket-phone { text-align: center; font-weight: 700; margin-bottom: 2px !important; }
.ticket-parties { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 16px; }
.ticket-column { display: grid; align-content: start; gap: 1px; }
.ticket-line { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); overflow-wrap: anywhere; }
/* Phiếu thường (mẫu 19/11/2026): the right block (times, plate) takes its content width and ends on the right content
   edge with Số phiếu and the table; the table columns are 18 · 15 · 12 · 15 · 15 · 25 %. */
.ticket-standard .ticket-parties { grid-template-columns: minmax(0, 1fr) max-content; }
.ticket-standard .ticket-column + .ticket-column .ticket-line { grid-template-columns: 12.5em max-content; }
.ticket-standard .ticket-table { table-layout: fixed; }
.ticket-standard .ticket-table :is(th, td) { overflow-wrap: anywhere; }
.ticket-standard .ticket-table th:nth-child(1) { width: 18%; } .ticket-standard .ticket-table th:nth-child(2) { width: 15%; }
.ticket-standard .ticket-table th:nth-child(3) { width: 12%; } .ticket-standard .ticket-table th:nth-child(4) { width: 15%; }
.ticket-standard .ticket-table th:nth-child(5) { width: 15%; } .ticket-standard .ticket-table th:nth-child(6) { width: 25%; }
.ticket-line .ticket-label { color: #111; }
.ticket-line.is-red .ticket-value, .delivery-ticket td.is-red { color: #c0392b; }
.ticket-line.is-bold .ticket-value { font-weight: 700; }
.ticket-table { width: 100%; min-width: 560px; border-collapse: collapse; margin-top: 2px; }
.ticket-table :is(th, td) { padding: 3px 6px; border: 1px solid #333; text-align: center; vertical-align: middle; }
.ticket-table td.is-red { font-weight: 700; }
.ticket-table td.ticket-note { text-align: left; }
.ticket-terms { font-style: italic; font-size: 11px; }
.ticket-sign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; text-align: center; }
.ticket-sign-box { display: grid; align-content: start; justify-items: center; gap: 1px; }
.ticket-date-line { font-style: italic; font-size: 13px; color: #c0392b; }
.ticket-date-line.is-spacer { visibility: hidden; }
.ticket-italic { font-style: italic; }
.ticket-signer { margin-top: 34px; min-height: 1.3em; font-weight: 600; }
/* Phiếu kèm cấp phối model: sheet C30-19 BEN. */
.ticket-model-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 8px; }
.ticket-logo { width: 44px; height: 44px; }
.ticket-model-titles { text-align: center; }
.ticket-company { font-size: 17px; font-weight: 700; }
.ticket-rule { font-size: 9px; line-height: 1.1; }
.ticket-model .ticket-title { font-size: 15px; }
.ticket-model-facts { display: grid; gap: 0; }
.ticket-pair { display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: 8px; }
.ticket-pair.is-number > p:last-child { text-align: right; }
.ticket-section-title { margin-top: 3px !important; text-align: center; font-weight: 700; }
.ticket-mix-table { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; }
.ticket-mix-table :is(th, td) { padding: 2px; border: 1px solid #333; text-align: center; overflow-wrap: anywhere; }
.ticket-mix-table th { font-weight: 400; }
.ticket-mix-table .ticket-mix-values td { height: 1.45em; font-weight: 700; }
.ticket-mix-table + .ticket-section-title + .ticket-mix-table .ticket-mix-values td { height: 2.2em; }
.ticket-model-tail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; margin-top: 4px; }
.ticket-tail-cell { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); }
.ticket-tail-cell:nth-child(2), .ticket-tail-cell:nth-child(3) { grid-template-columns: max-content minmax(3em, 1fr); gap: 4px; }
.ticket-tail-cell .is-strong { font-weight: 700; }
.ticket-model-sign { margin-top: 2px; }
.ticket-model-sign .ticket-signer { margin-top: 30px; }
@media (max-width: 560px) {
  .delivery-ticket { padding: 12px; font-size: 12px; }
  .ticket-parties, .ticket-standard .ticket-parties { grid-template-columns: minmax(0, 1fr); }
  .ticket-line, .ticket-standard .ticket-column + .ticket-column .ticket-line { grid-template-columns: 9.5em minmax(0, 1fr); }
  .ticket-pair, .ticket-model-tail { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ticket-pair.is-number > p:last-child { text-align: left; }
  .ticket-table, .ticket-mix-table { min-width: 0; }
  .ticket-table :is(th, td) { padding: 3px; overflow-wrap: anywhere; }
  .ticket-mix-table :is(th, td) { padding: 3px 1px; font-size: 10px; overflow-wrap: normal; }
}
.ops-ticket-template { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 0; border: 0; }
.ops-ticket-template legend { width: 100%; padding: 0; margin-bottom: 2px; font-weight: 600; }
.ops-template-choice { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.ops-template-choice:has(input:disabled) { color: var(--ui-muted); }
/* Mẫu phiếu: one choice, drawn as the small square tick box of the app's forms (18px). */
.ops-template-choice input[type=radio] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-width: 0; min-height: 0; margin: 0; flex: 0 0 18px;
  border: 1.5px solid var(--ui-border-strong, #8a9a90); border-radius: 3px; background: var(--ui-surface, #fff) center / 12px 12px no-repeat; cursor: pointer; }
.ops-template-choice input[type=radio]:checked { border-color: var(--ui-primary); background-color: var(--ui-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6 9.6 3.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ops-template-choice input[type=radio]:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
.ops-template-choice input[type=radio]:disabled { cursor: not-allowed; opacity: .45; }
.ticket-print-holder { display: none; }
@page delivery-ticket { size: A5 landscape; margin: 7mm 8mm; }
@media print {
  body.printing-ticket > :not(.ticket-print-holder) { display: none !important; }
  body.printing-ticket > .ticket-print-holder { display: block; page: delivery-ticket; color: #111; background: white; }
  html:has(body.printing-ticket), body.printing-ticket { background: white !important; }
  body.printing-ticket .delivery-ticket { border: 0; max-width: none; padding: 0; overflow: visible; font-size: 10pt; break-inside: avoid; }
  body.printing-ticket .ticket-model { font-size: 9.5pt; }
  /* One A5 landscape page even with a long Ghi chú: slightly tighter type and spacing on paper. */
  body.printing-ticket .delivery-ticket { line-height: 1.22; gap: 3px; }
  body.printing-ticket .ticket-standard { font-size: 9.5pt; }
  body.printing-ticket .ticket-table :is(th, td) { padding: 2px 5px; }
  body.printing-ticket .ticket-signer { margin-top: 26px; }
  body.printing-ticket .ticket-table, body.printing-ticket .ticket-mix-table { min-width: 0; }
}

.ops-detail-main { display: grid; gap: 16px; min-width: 0; }
.ops-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ops-instruction-text { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.ops-instruction > .muted, .ops-limits { margin: 0; }
.ops-progress-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 0; }
.ops-progress-facts dt { font-size: 13px; color: var(--ui-muted); }
.ops-progress-facts dd { margin: 0; font-weight: 600; }
@media (max-width: 560px) { .ops-progress-facts { grid-template-columns: minmax(0, 1fr); } }

/* Tiến độ xuất trạm (danh sách và chi tiết): value above, percentage inside the bar, readable at 0% and 100%. */
.ship-progress { display: grid; gap: 4px; min-width: 0; }
.ship-progress-value { font-weight: 600; }
.ship-progress-bar { position: relative; height: 20px; border-radius: 999px; background: var(--ui-surface-muted); overflow: hidden; }
.ship-progress-fill { position: absolute; inset: 0 auto 0 0; background: var(--ui-neutral-surface); border-radius: inherit; }
.ship-progress-percent { position: relative; display: block; text-align: center; font-size: 12px; line-height: 20px; font-weight: 700; color: var(--ui-accent); }
.ship-progress.is-compact .ship-progress-bar { height: 16px; }
.ship-progress.is-compact .ship-progress-percent { line-height: 16px; font-size: 11px; }
.ops-detail-main { container-type:inline-size; }
.ops-detail-main > .roster-panel { padding:12px 14px; gap:10px; }
#operations-workspace .ops-detail-main > .roster-panel { padding:14px; gap:12px; }

/* Order message stream: no per-message production state, quantity budget or progress. */
.production-notice-list { display: grid; gap: 10px; min-width: 0; }
.production-notice { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--ui-border); border-radius: 8px; min-width: 0; }
.production-notice.is-new { background: var(--ui-surface); border-color: var(--ui-border); }
.production-notice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.production-notice-meta, .production-ack { color: var(--ui-muted); font-size: 13px; }
.production-new { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ui-info-ink); }
.production-new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-info-solid); }
.production-notice-text, .production-ack { margin: 0; overflow-wrap: anywhere; }
.production-notice > button { justify-self: start; min-height: 40px; }
.workspace-v2 .master-data-form.instruction-form { max-width: 520px; grid-template-columns: minmax(90px,.65fr) minmax(155px,1fr) minmax(180px,1.5fr); align-items: start; gap: 12px; }
.workspace-v2 .instruction-form > .action-label { min-width: 0; display: grid; align-content: start; }
.workspace-v2 .instruction-form > .action-label > :first-child:not(input):not(select):not(textarea) { min-height: 20px; display: flex; align-items: flex-start; }
.workspace-v2 .master-data-form.instruction-form > .action-label:has(textarea) { grid-column: auto; }
.instruction-slump-inputs { width:100%; max-width:280px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 5px; align-items: center; }
.instruction-slump-inputs input { width: 100%; min-width: 0; }
.workspace-v2 .instruction-form .form-wide { grid-column: 1 / -1; }
.dispatch-chooser .preferred-search { display: flex; align-items: end; gap: 8px; max-width: 440px; }
.dispatch-chooser .preferred-search .action-label { flex: 1; min-width: 0; margin: 0; }
.dispatch-chooser .preferred-search input, .dispatch-chooser .preferred-search button { height: 44px; min-height: 44px; }
.dispatch-choices { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(175px,100%),1fr)); gap:4px; }
.workspace-v2 .dispatch-choices .dispatch-choice {
  display:flex; flex-direction:column; justify-content:center; gap:2px;
  min-height:44px; padding:4px 8px; line-height:1.25; overflow-wrap:anywhere;
}
.dispatch-board { container: dispatch-board / inline-size; }
.workspace-v2 .dispatch-board .slot-row {
  display:grid; grid-template-columns:32px minmax(0,1.2fr) minmax(66px,.5fr) minmax(94px,.65fr) minmax(90px,.7fr) 164px;
  align-items:center; width:100%; gap:6px 8px;
}
.workspace-v2 .dispatch-board .slot-head > :last-child { text-align:right; }
.workspace-v2 .dispatch-board .slot-vehicles { min-width:0; }
.workspace-v2 .dispatch-board .slot-preferred { display:block; overflow-wrap:anywhere; }
.workspace-v2 .dispatch-board .slot-actions { flex-wrap:nowrap; justify-content:flex-end; gap:4px; }
.workspace-v2 .dispatch-board .slot-actions > button {
  flex:0 0 38px; min-width:0; width:38px; min-height:44px; padding:6px;
}
@container dispatch-board (max-width:640px) {
  .workspace-v2 .dispatch-board .slot-row {
    grid-template-columns:26px minmax(0,1fr) 44px 94px;
    grid-template-areas:"index name name plate" "code status actions actions";
    column-gap:6px; font-size:13px;
  }
  .workspace-v2 .dispatch-board .slot-head { display:none; }
  .workspace-v2 .dispatch-board .slot-index { grid-area:index; }
  .workspace-v2 .dispatch-board .slot-name { grid-area:name; }
  .workspace-v2 .dispatch-board .slot-code { grid-area:code; }
  .workspace-v2 .dispatch-board .slot-vehicles { display:contents; }
  .workspace-v2 .dispatch-board .slot-plate { grid-area:plate; }
  .workspace-v2 .dispatch-board .slot-row.has-preferred {
    grid-template-areas:"index name name plate" "code status actions actions" "preferred preferred preferred preferred";
  }
  .workspace-v2 .dispatch-board .slot-preferred { grid-area:preferred; }
  .workspace-v2 .dispatch-board .roster-status { grid-area:status; justify-self:start; white-space:normal; }
  .workspace-v2 .dispatch-board .slot-actions { grid-area:actions; }
  .workspace-v2 .dispatch-board .slot-actions > button { flex-basis:32px; width:32px; }
}
@media (max-width: 1199px) {
  .workspace-v2 .master-data-form.instruction-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace-v2 .instruction-form .instruction-project { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .workspace-v2 .master-data-form.instruction-form { grid-template-columns: minmax(0,1fr); }
  .workspace-v2 .instruction-form > .action-label > :first-child:not(input):not(select):not(textarea) { min-height: 0; }
}

.production-notice-list { max-height: 480px; overflow-y: auto; }
.workspace-v2 .instruction-form textarea.action-input { max-height: 160px; overflow-y: auto; }
.instruction-slump > span:first-child { font-weight: 600; }

/* Whole-order overview immediately below the Dispatch header. */
.dispatch-progress-top, .dispatch-progress-bottom { display:grid; gap:10px; margin:0; }
.dispatch-progress-top { grid-template-columns:repeat(3,minmax(0,1fr)); }
.dispatch-progress-bottom { grid-template-columns:repeat(2,minmax(0,1fr)); }
.dispatch-progress :is(dt,dd) { margin:0; overflow-wrap:break-word; }
.dispatch-progress dt { color:var(--ui-muted); font-size:13px; }
.dispatch-progress dd { font-size:18px; font-weight:700; }
.dispatch-progress-bottom dd { font-size:16px; }
.ops-trip { display:block; padding:0; overflow:hidden; }
.ops-trip-row { display:grid; grid-template-columns:28px minmax(0,1.25fr) minmax(85px,.85fr) minmax(65px,.7fr) minmax(95px,1fr) minmax(90px,.9fr); gap:8px; align-items:center; padding:12px; }
.ops-trip-row > * { min-width:0; overflow-wrap:break-word; }
.ops-trip > summary { cursor:pointer; list-style:none; }
.ops-trip > summary::-webkit-details-marker { display:none; }
.ops-trip > summary:hover { background:var(--ui-hover); }
.ops-trip > summary:focus-visible { outline:2px solid var(--ui-focus); outline-offset:-2px; }
.ops-trip-columns { color:var(--ui-muted); font-size:13px; padding-block:0; }
.ops-trip-body { display:grid; gap:12px; padding:0 14px 14px; border-top:1px solid var(--ui-border); }
.ops-trip-body > p { margin:10px 0 0; }
.workspace-v2 .ops-trip-body > .ops-ticket-view { justify-self:start; width:auto; max-width:100%; }
.ops-trip-body .driver-checkpoints { margin:12px 0 0; }
.ops-trip-body .driver-step-heading { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-width:0; }
.ops-trip-body .driver-step-heading button { min-height:36px; padding:6px 10px; }
.ops-trip-body .driver-checkpoints .is-current .driver-step-heading > strong { color:var(--ui-info-ink); }
.ops-delivery-summary :is(h4,p) { margin:4px 0; overflow-wrap:anywhere; }
@container (max-width:640px) {
  .ops-trip-columns { display:none; }
  .ops-trip-row { grid-template-columns:28px minmax(0,1fr) minmax(0,1fr); gap:8px 10px; }
  .ops-trip-row > :first-child { grid-column:1; grid-row:1 / span 3; align-self:start; }
  .ops-trip-row > :nth-child(2) { grid-column:2 / -1; font-weight:600; }
  .ops-trip-row > :nth-child(n+3)::before { content:attr(data-label) ": "; display:block; font-size:12px; color:var(--ui-muted); }
}
.workspace-v2 .master-data-form.ops-ticket-form textarea.action-input {
  min-height:var(--ui-control); height:var(--ui-control); max-height:96px; resize:vertical;
}

/* Operations: two clear information columns, no repeated header metadata. */
.workspace-v2 .ops-order-head .compact-order-header { grid-template-columns:minmax(0,1fr); }
.workspace-v2 .ops-order-head .compact-order-body { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto; gap:12px 20px; padding-top:12px; }
.workspace-v2 .ops-order-head .compact-order-facts-group { grid-template-columns:minmax(0,1fr); grid-template-rows:none; grid-row:auto; gap:12px; }
.workspace-v2 .ops-order-head .compact-order-body > :last-child { border:0; padding:0; }
.ops-order-head .dispatch-cards { display:flex; flex-wrap:wrap; gap:8px; }
.ops-order-head .dispatch-cards > button { min-height:36px; padding:6px 12px; }
.ops-order-head .compact-order-card { border:0; padding:0; }

/* One write surface, two groups. Rows and inline forms share trip ids, never driver names. */
.ops-shipping, .ops-processing, .ops-call { min-width:0; }
.ops-shipping :is(h3,h4) { margin:0; }
.ops-processing, .ops-call { display:grid; gap:8px; }
.ops-shipping > .ops-call { padding-top:14px; border-top:1px solid var(--ui-border); }
/* Đang xử lý and Chờ gọi share the same column tracks, including their headings. */
.ops-shipping-row {
  display:grid; grid-template-columns:32px minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1fr) minmax(0,1.1fr) minmax(176px,1.1fr);
  gap:8px 16px; align-items:center; padding:10px 6px;
}
.ops-call-row > button { justify-self:start; }
.ops-shipping-row > * { min-width:0; overflow-wrap:break-word; }
.ops-shipping-row > button, .ops-shipping-actions > button { min-height:40px; padding:7px 10px; }
.ops-shipping-actions { display:flex; gap:8px; }
.ops-shipping-actions > button { flex:1 1 0; min-width:0; white-space:normal; }
.ops-cancel-dialog { width:min(520px, calc(100vw - 32px)); }
.ops-cancel-body p { margin:0; overflow-wrap:anywhere; }
.workspace-v2 .ops-cancel-form, .ops-cancel-form { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; margin:0; }
.ops-shipping-columns { color:var(--ui-muted); font-size:13px; padding-block:2px; }
.ops-shipping-trip, .ops-call-row { border-bottom:1px solid var(--ui-border); }
.ops-shipping-trip.is-editing > .ops-shipping-row { background:var(--ui-surface); }
.ops-shipping-form { padding:12px 6px; }
.workspace-v2 .ops-ticket-form { grid-template-columns:minmax(0,1fr); gap:10px; }
.ops-ticket-fields { display:flex; flex-wrap:wrap; align-items:start; gap:12px 16px; }
.ops-ticket-fields .action-label { min-width:0; }
.ops-ticket-fields .action-label:first-child { width:min(100%,23rem); }
.ops-ticket-fields input[name=quantity] { width:min(100%,9rem); }
.ops-ticket-note { width:min(100%,28rem); }
.ops-model-toggle { width:fit-content; max-width:100%; flex-wrap:wrap; }
.ops-model-toggle .field-error { order:1; flex-basis:100%; }
.ops-model-preview { min-width:0; }
.ops-model-preview h4 { margin:0 0 8px; }
.ops-model-table-scroll { overflow-x:auto; }
.ops-model-table-scroll table { width:100%; border-collapse:collapse; font-size:var(--ui-text); }
.ops-model-table-scroll :is(th,td) {
  padding:8px 5px; border:1px solid var(--ui-input-border); text-align:center; vertical-align:middle;
  white-space:pre-line; overflow-wrap:anywhere;
}
.ops-model-table-scroll thead th { min-width:3.25rem; background:var(--ui-surface); overflow-wrap:normal; }
.ops-model-table-scroll thead th:first-child[rowspan="2"] { min-width:2.5rem; }
.ops-model-table-scroll thead th[rowspan="2"]:nth-child(n+2):nth-child(-n+5) { min-width:6.5rem; }
.ops-model-table-scroll thead th[rowspan="2"]:nth-child(n+6):nth-child(-n+8) { min-width:5rem; }
.ops-model-table-scroll thead th:last-child[rowspan="2"] { min-width:8rem; }
.ops-model-table-scroll tbody td:is(:nth-child(2),:nth-child(3),:nth-child(4),:nth-child(5),:last-child):not([colspan]) { text-align:left; }
.ops-model-meta td, .ops-model-table-scroll tfoot td { font-weight:600; }
.ops-model-meta td:first-child { text-align:left; }
.ops-model-meta td:last-child { text-align:right; }
.ops-model-total th { color:var(--ui-danger-ink); }
.ops-model-table-scroll tfoot tr:last-child { height:54px; }
.ops-model-signatures {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
  padding-top:8px; text-align:center; font-weight:600;
}
.ops-model-signatures > div { min-width:0; min-height:80px; padding:0 4px; overflow-wrap:anywhere; }
.ops-no-room { margin:0; padding:0 6px 10px; }
.ops-call-rows { display:grid; }
.ops-call-pending { display:grid; gap:8px; }
.ops-call-pending p { margin:0; }
@container(max-width:740px) {
  .ops-shipping-columns { display:none; }
  .ops-shipping-row { grid-template-columns:22px minmax(0,1fr) minmax(0,1fr); gap:10px; padding:12px 4px; }
  .ops-shipping-row > :first-child { grid-column:1; grid-row:1 / span 4; align-self:start; }
  .ops-shipping-row > :nth-child(2) { grid-column:2 / -1; font-weight:600; }
  .ops-shipping-row > :nth-child(n+3):not(button,.ops-shipping-actions)::before { content:attr(data-label) ": "; display:block; font-size:13px; color:var(--ui-muted); }
  .ops-shipping-row > button, .ops-shipping-actions { grid-column:2 / -1; }
  .ops-call-row > button { justify-self:stretch; }
  .ops-shipping-row > button, .ops-shipping-actions > button { min-height:44px; }
}
.ops-jump-shipping { display:none; }
.ops-shipping { scroll-margin-top:176px; }
.ops-shipping h3:focus { outline:none; }
@media(max-width:560px) {
  .ops-trip-body .driver-step-heading button { min-height:44px; }
  .ops-jump-shipping { display:block; width:100%; min-height:44px; }
  .ops-order-head .dispatch-cards > button { min-height:44px; }
  .ops-progress .dispatch-progress-top { gap:8px; }
  .ops-progress .dispatch-progress-top dd { font-size:16px; }
}
/* Progress fills its card; figures keep their existing three/two-column reading order. */
.dispatch-progress > :is(.dispatch-progress-top,.dispatch-progress-bottom,.ship-progress) { width:100%; justify-self:start; }
.dispatch-progress-top { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.dispatch-progress-top.has-issued { grid-template-columns:repeat(4,minmax(0,1fr)); }
.dispatch-progress-bottom.has-three { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media(max-width:560px) { .dispatch-progress-top.has-issued, .dispatch-progress-bottom.has-three { grid-template-columns:repeat(2,minmax(0,1fr)); } }
.dispatch-progress-bottom { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.dispatch-progress dd { font-size:17px; }
.workspace-v2 .dispatch-compact-head .compact-order-body { grid-template-columns:repeat(2,minmax(0,1fr)); }
.workspace-v2 .dispatch-compact-head .compact-order-facts-group { grid-template-columns:minmax(0,1fr); grid-template-rows:none; grid-row:auto; }
.workspace-v2 .dispatch-compact-head .compact-order-body > :last-child { border:0; padding:0; }
.dispatch-compact-head .dispatch-cards { display:flex; flex-wrap:wrap; gap:8px; }
.dispatch-compact-head .dispatch-cards button { min-height:40px; padding:6px 12px; }
.ops-trip-state { display:inline-block; width:fit-content; padding:4px 8px; border-radius:6px; font-weight:600; background:var(--ui-surface); color:var(--ui-muted); }
.ops-trip-state.state-assigned { background:var(--ui-warning-surface); color:var(--ui-warning-ink); }
.ops-trip-state:is(.state-shipped,.state-loading,.state-departed,.state-arrived) { background:var(--ui-info-surface); color:var(--ui-info-ink); }
.ops-trip-state:is(.state-returned,.result-full) { background:var(--ui-success-surface); color:var(--ui-success-ink); }
.ops-trip-state.result-partial { background:var(--ui-warning-surface); color:var(--ui-warning-ink); }
.ops-trip-state.result-failed { background:var(--ui-danger-surface); color:var(--ui-danger-ink); }

/* Kết thúc đơn and Bảng điều phối chuyến xe: shared by Điều hành, Vận hành and the order's own page. */
.order-sections { display:grid; gap:8px; min-width:0; }
.order-sections[hidden], .order-section[hidden] { display:none; }
.order-section { min-width:0; border:1px solid var(--ui-border); border-radius:12px; background:var(--ui-surface); }
.order-section-head { margin:0; font-size:inherit; }
.workspace-v2 .order-section-toggle { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:48px; padding:10px 16px; border:0; border-radius:12px; background:transparent; color:var(--ui-ink); font-weight:600; font-size:16px; text-align:left; cursor:pointer; box-shadow:none; }
.workspace-v2 .order-section-toggle:hover { background:var(--ui-hover); }
.workspace-v2 .order-section-toggle:focus-visible { outline:2px solid var(--ui-focus); outline-offset:-2px; }
.order-section-toggle::after { content:""; flex:none; width:8px; height:8px; margin-right:4px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
.order-section.is-open > .order-section-head > .order-section-toggle::after { transform:rotate(-135deg); }
.order-section-body { display:grid; gap:12px; min-width:0; padding:4px 16px 16px; }
.order-section-body[hidden] { display:none; }
.order-section-body > div:not([hidden]) { display:grid; gap:12px; min-width:0; }
.order-section-body .action-panel, .order-section-body .roster-panel { border:0; padding:0; background:transparent; box-shadow:none; }
.order-section-body .order-closure { padding-bottom:12px; border-bottom:1px solid var(--ui-border); border-radius:0; }
.order-closure, .order-trip-board { display:grid; gap:12px; min-width:0; container-type:inline-size; }
.order-closure h3 { margin:0; }
.order-closure-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); gap:10px 16px; margin:0; }
.order-closure-facts dt { font-size:13px; color:var(--ui-muted); }
.order-closure-facts dd { margin:0; font-weight:600; overflow-wrap:anywhere; }
.order-closure-waiting { margin:0; }
.order-closure-actions { display:flex; flex-wrap:wrap; gap:8px; }
.trip-board-item { border:1px solid var(--ui-border); border-radius:12px; overflow:hidden; }
.trip-board-row { display:grid; grid-template-columns:28px minmax(0,1.3fr) minmax(90px,.8fr) minmax(62px,.5fr) minmax(62px,.5fr) minmax(120px,1fr); gap:8px; align-items:center; padding:12px; }
.trip-board-row > * { min-width:0; overflow-wrap:anywhere; }
.trip-board-item > summary { cursor:pointer; list-style:none; }
.trip-board-item > summary::-webkit-details-marker { display:none; }
.trip-board-item > summary:hover { background:var(--ui-hover); }
.trip-board-item > summary:focus-visible { outline:2px solid var(--ui-focus); outline-offset:-2px; }
.trip-board-columns { color:var(--ui-muted); font-size:13px; padding-block:0; border-inline:1px solid transparent; }
.trip-board-badge { display:inline-block; justify-self:start; max-width:100%; padding:3px 8px; border-radius:8px; background:var(--trip-badge-bg,var(--ui-neutral-surface)); color:var(--trip-badge-ink,var(--ui-neutral-ink)); font-size:12px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
.trip-board-badge[data-tone=info] { --trip-badge-bg:var(--ui-info-surface); --trip-badge-ink:var(--ui-info-ink); }
.trip-board-badge[data-tone=success] { --trip-badge-bg:var(--ui-success-surface); --trip-badge-ink:var(--ui-success-ink); }
.trip-board-badge[data-tone=warning] { --trip-badge-bg:var(--ui-warning-surface); --trip-badge-ink:var(--ui-warning-ink); }
.trip-board-badge[data-tone=danger] { --trip-badge-bg:var(--ui-danger-surface); --trip-badge-ink:var(--ui-danger-ink); }
.order-delivery-content:not([hidden]) { display:grid; gap:12px; }
.order-delivery-overview > .dispatch-progress { display:grid; gap:8px; min-width:0; }
.order-delivery-overview > .dispatch-progress,
.ops-progress > :is(.dispatch-progress-top,.dispatch-progress-bottom,.ship-progress) { width:min(100%,clamp(340px,58%,640px)); }
.order-delivery-overview .dispatch-progress h3, .order-delivery-empty { margin:0; }
.order-delivery-overview .order-trip-board { gap:6px; }
.order-delivery-overview .trip-board-row { padding-inline-end:32px; }
.order-delivery-overview .trip-board-columns { padding-block:8px; border-radius:8px; background:var(--ui-surface-muted); }
.order-delivery-overview .trip-board-item > summary { position:relative; }
.order-delivery-overview .trip-board-item > summary::after { content:""; position:absolute; inset-inline-end:14px; top:calc(50% - 4px); width:8px; height:8px; border:solid var(--ui-muted); border-width:0 2px 2px 0; transform:rotate(-45deg); }
.order-delivery-overview .trip-board-item[open] > summary::after { transform:rotate(45deg); }
@container (max-width:640px) {
  .trip-board-columns { display:none; }
  .trip-board-row { grid-template-columns:28px minmax(0,1fr) minmax(0,1fr); gap:8px 10px; }
  .trip-board-row > :first-child { grid-column:1; grid-row:1 / span 3; align-self:start; }
  .trip-board-row > :nth-child(2) { grid-column:2 / -1; font-weight:600; }
  .trip-board-row > :nth-child(n+3)::before { content:attr(data-label) ": "; display:block; font-size:12px; color:var(--ui-muted); }
}
/* Filter next to the search box of the Điều hành and Vận hành lists. */
.catalog-search:has(> .order-state-filter) { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:end; }
.catalog-search:has(> .order-state-filter) > * { flex:1 1 220px; min-width:0; }
.stop-production-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 16px; margin:0; }
.stop-production-facts dt { font-size:13px; color:var(--ui-muted); }
.stop-production-facts dd { margin:0; font-weight:600; }
.stop-production-dialog { width:min(560px, calc(100vw - 32px)); }
.stop-production-body p { margin:0; overflow-wrap:anywhere; }

.daily-recipe-dates { display:grid; gap:8px; margin-top:16px; }
.daily-recipe-controls { align-items:end; }
.daily-recipe-controls > button { flex:0 0 auto; align-self:end; }
.daily-recipe-controls > label { max-width:230px; }
.daily-recipe-controls select { width:auto; min-width:130px; }
.daily-recipe-day { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; text-align:left; overflow-wrap:anywhere; }
.daily-recipe-day::after { content:"›"; font-size:24px; flex-shrink:0; }
.daily-recipe-table { border-collapse:collapse; min-width:1900px; width:100%; }
.daily-recipe-table :is(th,td) { padding:8px; border:1px solid var(--ui-border); text-align:center; white-space:pre-line; }
.daily-recipe-table :is(thead,tfoot) { background:var(--ui-surface-muted); font-weight:600; }
.daily-recipe-table :is(th,td) { overflow-wrap:anywhere; }
.daily-recipe-table tbody td:first-child, .daily-recipe-table th[rowspan]:first-child { width:52px; min-width:52px; }
.daily-recipe-table tbody td:nth-child(2), .daily-recipe-table th[rowspan]:nth-child(2) { width:95px; min-width:95px; }
.daily-recipe-table tbody td:nth-child(3), .daily-recipe-table tbody td:nth-child(4),
.daily-recipe-table th[rowspan]:nth-child(3), .daily-recipe-table th[rowspan]:nth-child(4) { width:115px; min-width:115px; }
.daily-recipe-table tbody td:first-child, .daily-recipe-table tfoot td { white-space:nowrap; }
.daily-recipe-table tfoot th { text-align:left; }
/* 13/11/2026: Hạng mục, Mác / Độ sụt, Code, KL kế hoạch (m³) đủ rộng để tiêu đề chỉ xuống dòng giữa các từ. */
.daily-recipe-table tbody td:nth-child(5), .daily-recipe-table th[rowspan]:nth-child(5) { width:110px; min-width:110px; }
.daily-recipe-table tbody td:nth-child(6), .daily-recipe-table th[rowspan]:nth-child(6) { width:130px; min-width:130px; }
.daily-recipe-table tbody td:nth-child(7), .daily-recipe-table th[rowspan]:nth-child(7) { width:100px; min-width:100px; }
.daily-recipe-table tbody td:nth-child(8), .daily-recipe-table th[rowspan]:nth-child(8) { width:120px; min-width:120px; }
.daily-recipe-table th[rowspan] { overflow-wrap:normal; }
.daily-recipe-table thead tr:nth-child(2) th { min-width:74px; }
.daily-recipe-scroll { max-width:100%; overflow-x:auto; margin-top:16px; }
.pump-price-input { width:100%; min-width:110px; text-align:right; }
/* Danh sách lệnh sản xuất (14/11/2026): one line per instruction, STT · Nội dung · Trạng thái · Thao tác. */
.production-notice-scroll { max-width: 100%; overflow-x: auto; }
.production-notice-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.production-notice-table :is(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--ui-border); text-align: left; vertical-align: middle; }
.production-notice-table thead th { background: var(--ui-surface-muted); font-weight: 600; font-size: 13px; }
.production-notice-table tr.production-notice { display: table-row; padding: 0; border: 0; border-radius: 0; background: none; }
.production-notice-table .is-index { width: 56px; text-align: center; white-space: nowrap; }
.production-notice-table .is-text { min-width: 360px; overflow-wrap: anywhere; }
.production-notice-table .is-state { width: 140px; white-space: nowrap; }
.production-notice-table .is-action { width: 150px; }
.production-notice-table .production-notice-text { overflow-wrap: anywhere; }
.production-state { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.production-state.is-waiting { background: var(--ui-warning-surface); color: var(--ui-warning-ink); }
.production-state.is-accepted { background: var(--ui-success-surface); color: var(--ui-success-ink); }
.production-accept { min-height: 36px; }
.production-accept-reason { display: block; margin-top: 4px; color: var(--ui-muted); font-size: 12px; white-space: normal; }
.production-notice-list:has(.production-notice-table) { max-height: none; overflow: visible; }
/* Grid items start at min-width:auto; let the table frame shrink so the 640px table scrolls inside it on phones. */
.production-notice-list > * { min-width: 0; }

/* Tiến độ tổng quan (19/11/2026), Điều hành and Vận hành alike: three figures on top, four below, labels bold and the
   values in regular weight. */
.dispatch-progress.is-unified .dispatch-progress-top { grid-template-columns:repeat(3,minmax(0,1fr)); }
.dispatch-progress.is-unified .dispatch-progress-bottom { grid-template-columns:repeat(4,minmax(0,1fr)); }
.dispatch-progress.is-unified dt { color:var(--ui-ink); font-size:13px; font-weight:700; }
.dispatch-progress.is-unified dd { font-size:16px; font-weight:400; }
@media(max-width:560px) { .dispatch-progress.is-unified .dispatch-progress-bottom { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.ops-order-state { display:grid; gap:3px; justify-items:start; }
