.delivery-card { --delivery-border: #dbe3ec; }
.delivery-tools { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:12px 0; }
.delivery-tools input:not([type=file]) { min-width:225px; }
.delivery-card th, .delivery-card td { white-space:nowrap; }
.delivery-form { display:grid; grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:12px; margin:12px 0; }
.delivery-field { display:grid; gap:5px; align-content:start; font-size:13px; }
.delivery-field input, .delivery-field select, .delivery-grid-address textarea { width:100%; min-width:0; }
.delivery-field[hidden] { display:none; }
.delivery-grid th, .delivery-grid td { white-space:nowrap; }
.delivery-grid td { padding:4px; }
.delivery-grid td input { width:116px; min-width:90px; padding:6px 7px; }
.delivery-grid td input[data-key=customer_name], .delivery-grid td input[data-key=address] { width:170px; }
.delivery-form dd { margin:4px 0 0; overflow-wrap:anywhere; }
.delivery-preview { max-height:45vh; border:1px solid #dbe3ec; margin-top:10px; }
.delivery-message { margin:8px 0; color:#a32828; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:26vh; overflow:auto; }
.delivery-message:empty { display:none; }

.delivery-office-scroll { border:1px solid var(--delivery-border); border-radius:8px; max-height:68vh; }
.delivery-office table { border-collapse:separate; border-spacing:0; }
.delivery-office thead th { position:sticky; top:0; z-index:1; background:#eef3fa; }
.delivery-office td { vertical-align:middle; background:#fff; }
.delivery-office td small { display:block; margin-top:4px; color:#525f69; }
.delivery-office td small.red-txt { color:#a32828; }
.delivery-office tr.delivery-tint td { background:#f4f8fd; }
.delivery-office tr.delivery-ship-start td { border-top:1px solid #afbed1; }
.delivery-office tr.delivery-trip-start td { border-top:2px solid #7692b1; }
.delivery-office .delivery-trip-cell { min-width:92px; background:#edf4fc; border-right:1px solid var(--delivery-border); }
.delivery-office .delivery-ship-cell { border-right:1px solid var(--delivery-border); }
.delivery-office .delivery-ton { min-width:0; width:80px; }
.delivery-office [data-receipt-date] { width:132px; }
.delivery-segments { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:0; border:0; margin:0; min-width:0; }
.delivery-segments legend { font-size:13px; margin-bottom:5px; }
.delivery-segments[hidden], tr[data-route-category][hidden] { display:none; }
[data-route-category] td small { display:block; color:#536c80; margin-top:4px; }
.delivery-segment { position:relative; display:inline-flex; align-items:center; margin:0; }
.delivery-segment input { opacity:0; position:absolute; inset:0; cursor:pointer; width:100%; height:100%; margin:0; }
.delivery-segment span { display:inline-block; padding:4px 8px; border:1px solid #acbbcb; border-radius:5px; color:#254661; }
.delivery-segment input:checked + span { background:#125bab; border-color:#125bab; color:#fff; }
.delivery-segment input:focus-visible + span { outline:2px solid #183967; outline-offset:2px; }
.delivery-segment input:disabled + span { opacity:.48; }
.delivery-grid-shipment { border:1px solid #b8cadd; border-radius:8px; background:#f6f9fc; padding:8px 12px; margin:14px 0; }
.delivery-grid-shipment legend { color:#274463; padding:0 5px; font-weight:600; }
.delivery-grid-shipment:nth-child(even) { background:#edf4fb; border-color:#afc6dc; }
.delivery-office tr[data-select-row] { cursor:pointer; }
.delivery-office tr[data-delivery-line][hidden] { display:none; }
.delivery-office .delivery-fold { display:inline-flex; align-items:center; gap:6px; color:#15549a; }
.delivery-office .delivery-fold::before { content:""; width:6px; height:6px; border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(-45deg); }
.delivery-office .delivery-fold[aria-expanded="true"]::before { transform:rotate(45deg); }
.delivery-office tr.delivery-selected > td { background:#e7f2ff; }
.delivery-receipt-check{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;cursor:pointer}
.delivery-receipt-check input{width:16px;height:16px;margin:0;accent-color:var(--blue,#1565c0)}
.delivery-receipt-date{margin-top:4px;color:var(--sub,#536477);font-size:12px}
.delivery-receipt-date summary{cursor:pointer;white-space:nowrap}
.delivery-grid-address, .delivery-grid-route { grid-column:1/-1; min-width:0; }
.delivery-grid-address textarea { box-sizing:border-box; resize:vertical; min-height:55px; line-height:1.45; }
.delivery-grid-route select { box-sizing:border-box; text-overflow:ellipsis; }
.delivery-grid-route small { overflow-wrap:anywhere; }
.delivery-attach-existing input { min-width:min(100%,280px); }
.delivery-product-segments .delivery-segment { flex:0 0 auto; }
.delivery-grid-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:8px; background:#fff; border-top:1px solid #dce5ef; padding:10px 0; }
.delivery-terminal-grid { grid-column:1/-1; display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:8px; }
.delivery-terminal-grid[hidden] { display:none; }
@media (max-width:720px) {
  .delivery-office [data-filter] input,
  .delivery-office [data-filter] select { min-width:0; max-width:100%; }
  .delivery-grid-row { grid-template-columns:repeat(auto-fit,minmax(112px,1fr)); }
}

.delivery-workbench { --delivery-rule:#dce6ef; color:#1d3347; }
.delivery-workbench-title { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; padding-bottom:14px; }
.delivery-workbench-title h3 { font-size:24px; letter-spacing:.01em; margin:2px 0 0; color:#112b44; }
.delivery-workbench-type { color:#536c80; font-size:12px; font-weight:600; }
.delivery-workbench-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.delivery-project-select { display:flex; min-width:0; margin-top:4px; }
.delivery-workbench-filters { background:#f4f8fc; border:1px solid var(--delivery-rule,#dce6ef); padding:10px 12px; border-radius:8px; }
.delivery-workbench-filters input[aria-label="查询关键词"] { flex:1 0 180px; min-width:150px; }
.delivery-date-filter { display:flex; align-items:end; flex-wrap:wrap; gap:6px; min-width:0; }
.delivery-workbench-filters .delivery-date-filter input { min-width:0; width:auto; }
.delivery-summary { display:flex; flex-wrap:wrap; gap:8px 22px; margin:10px 0; padding:8px 12px; border-block:1px solid var(--delivery-rule,#dce6ef); }
.delivery-summary div { display:flex; align-items:baseline; gap:6px; white-space:nowrap; }
.delivery-summary dt { color:#536c80; font-size:12px; }
.delivery-summary dd { margin:0; color:#1d3347; font-weight:650; font-variant-numeric:tabular-nums; }
.delivery-batch-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; min-height:46px; padding:8px 12px; margin:0 0 8px; border-radius:8px; background:#e8f2fc; color:#193e63; }
.delivery-batch-actions[hidden] { display:none; }
.delivery-batch-actions [data-unselect] { margin-inline-start:auto; }
.delivery-workbench .delivery-office-scroll { border-color:var(--delivery-rule); }
.delivery-workbench table th,.delivery-workbench table td { padding:8px 7px; }
.delivery-workbench thead th { color:#324c61; font-weight:650; }
.delivery-workbench tbody tr:hover td { background:#eef5fb; }
.delivery-workbench :is(th[data-select-column],td[data-ship-column="select"]) { position:sticky; left:0; z-index:1; }
.delivery-workbench th[data-select-column] { z-index:2; }
.delivery-workbench tbody tr.delivery-ship-start td { border-top-color:#c9d7e4; }
.delivery-workbench tbody tr.delivery-trip-start td { border-top-color:#9ab1c5; }
.delivery-workbench td small.delivery-service { color:#28526d; }
.delivery-charge { display:grid; justify-items:start; row-gap:3px; }
.delivery-charge b { font-variant-numeric:tabular-nums; color:#193d5b; }
.delivery-charge .delivery-charge-status { margin:0; }
.delivery-charge small, .delivery-payment-date { max-width:185px; white-space:normal; }
.delivery-payment-date { color:#244866; font-variant-numeric:tabular-nums; }
.delivery-workbench th[data-log-column], .delivery-workbench td[data-ship-column="logs"] { position:sticky; right:0; z-index:1; border-left:1px solid var(--delivery-rule); }
.delivery-workbench th[data-log-column] { z-index:2; }
.delivery-history { max-height:60vh; }
.delivery-history td:last-child { min-width:245px; max-width:450px; overflow-wrap:anywhere; white-space:normal; }
.delivery-history td:nth-child(1), .delivery-history td:nth-child(4) { white-space:nowrap; }
.delivery-history td { vertical-align:top; }
.delivery-charge-status[data-state="待维护"], .delivery-charge-status[data-state="余额待核"] { color:#87430c; font-weight:600; }
.delivery-charge-status[data-state="付款批次中"] { color:#205690; font-weight:600; }
.delivery-charge-status[data-state="已结清"], .delivery-charge-status[data-state="内部结算"] { color:#206641; }
.delivery-charge .btn { padding:2px 5px; margin-top:2px; font-size:12px; }
.delivery-form-trip { background:#eef5fb; border:1px solid #dae7f1; padding:12px; border-radius:8px; align-items:end; }
.delivery-grid-shipment { padding:12px; background:#f8fafc; border-color:#c4d4e3; }
.delivery-grid-row { background:transparent; border-top-color:#d6e1ec; }
.delivery-grid-guided { grid-template-columns:minmax(0,1fr); gap:12px; }
.delivery-grid-identity, .delivery-grid-dispatch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; align-items:end; }
.delivery-grid-dispatch .delivery-product-segments { grid-column:1/-1; }
.delivery-grid-dispatch button { align-self:end; justify-self:start; margin-bottom:4px; }
@media (min-width:1040px) {
  .delivery-grid-identity { grid-template-columns:minmax(120px,1fr) minmax(125px,1fr) minmax(150px,1.5fr); }
  .delivery-grid-dispatch { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.delivery-customer-combo { position:relative; min-width:0; }
.delivery-customer-options { position:absolute; inset:100% auto auto 0; width:max(100%,270px); max-width:min(420px,76vw); z-index:5; max-height:218px; overflow:auto;
  background:#fff; border:1px solid #99adc0; border-radius:6px; box-shadow:0 8px 24px #183c5826; }
.delivery-customer-options[hidden] { display:none; }
.delivery-customer-options [role="option"] { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; padding:8px; cursor:pointer; border-block-end:1px solid #e4edf4; overflow-wrap:anywhere; }
.delivery-customer-options [role="option"]:hover,.delivery-customer-options [aria-selected="true"] { background:#ddebfb; }
.delivery-customer-options [role="option"] b { color:#134163; font-variant-numeric:tabular-nums; }
.delivery-customer-options [role="option"] small { flex-basis:100%; color:#496072; }
.delivery-combo-empty { font-size:13px; color:#496072; padding:8px; }
.delivery-workbench :where(input,select,button):focus-visible,.delivery-grid-shipment :where(input,select,textarea,button):focus-visible { outline:2px solid #1966ad; outline-offset:2px; }
@media (max-width:720px) {
  .delivery-workbench-title { align-items:flex-start; flex-direction:column; }
  .delivery-workbench-title h3 { font-size:20px; }
  .delivery-workbench-actions,.delivery-workbench-filters { gap:6px; }
  .delivery-batch-actions { gap:6px; }
  .delivery-batch-actions strong { flex-basis:100%; }
  .delivery-customer-options { width:max(100%,195px); }
}


/* Workbench filter, table and drawer layout */
.delivery-workbench { --delivery-rule:#d9e4ef; --delivery-pin:42px; }
.delivery-workbench-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; }
.delivery-workbench-heading .delivery-project-select { margin:0; }
.delivery-workbench-heading select { max-width:280px; }
.delivery-office .delivery-workbench-title { align-items:center; }
.delivery-workbench .delivery-workbench-filters { display:grid; gap:8px; padding:12px; }
.delivery-filter-group,.delivery-search-fields,.delivery-day-buttons,.delivery-filter-commands { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.delivery-filter-date { align-items:flex-end; }
.delivery-filter-query { padding-top:8px; border-top:1px solid var(--delivery-rule); }
.delivery-search-fields { flex:1 0 280px; flex-wrap:nowrap; }
.delivery-workbench-filters .delivery-search-fields input { min-width:0; flex:1 1 100px; }
.delivery-workbench-filters .delivery-date-filter input { min-width:0; width:auto; }
.delivery-day-buttons { gap:4px; }
.delivery-fulfillment-filter { display:inline-flex; align-items:center; flex-wrap:wrap; gap:6px; }
.delivery-fulfillment-filter select { max-width:200px; }
.delivery-pagination { justify-content:flex-end; }
.delivery-pagination span { margin-inline-end:auto; color:#4d6478; }
.delivery-workbench .delivery-summary { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; margin:10px 0; padding:0; border:1px solid var(--delivery-rule); border-radius:8px; background:#fff; }
.delivery-workbench .delivery-summary div { display:grid; justify-items:start; align-content:center; padding:9px 13px; gap:3px; border-inline-end:1px solid var(--delivery-rule); }
.delivery-workbench .delivery-summary div:last-child { border-inline-end:0; }
.delivery-workbench .delivery-summary dd { font-size:18px; line-height:1.2; }
.delivery-workbench .delivery-summary .delivery-metric-pending { background:#fffbf0; }
.delivery-workbench .delivery-summary .delivery-metric-pending dd { color:#8a480c; }
.delivery-workbench .delivery-batch-actions { border:1px solid #bfd4ed; background:#e8f2ff; }
.delivery-workbench :is(th[data-select-column],td[data-ship-column="select"]) { box-sizing:border-box; width:var(--delivery-pin); min-width:var(--delivery-pin); max-width:var(--delivery-pin); text-align:center; }
.delivery-workbench :is(th[data-shipment-column],td[data-ship-column="number"]) { position:sticky; left:var(--delivery-pin); z-index:2; min-width:166px; max-width:205px; border-right:1px solid #b9cce0; }
.delivery-workbench :is(th[data-select-column],th[data-shipment-column],th[data-log-column]) { z-index:4; }
.delivery-workbench .delivery-number-link { padding-inline:4px; text-align:left; color:#15549a; font-weight:650; white-space:normal; max-width:205px; overflow-wrap:anywhere; }
.delivery-workbench tbody tr.delivery-selected td { background:#e2eeff; }
.delivery-drawer-mask.show { justify-content:flex-end; align-items:stretch; padding:0; overflow:hidden; background:#0c284d66; }
.delivery-drawer-mask.show .modal { width:min(670px,96vw); max-height:100%; margin:0; border-radius:0; overflow-y:auto; overscroll-behavior:contain; box-shadow:-18px 0 45px #122f4c29; }
.delivery-drawer-mask.show .modal.lg { width:min(1020px,96vw); }
.delivery-drawer-mask .modal:focus { outline:none; }
.delivery-drawer-mask .modal [data-delivery-dialog] > h3 { font-size:21px; margin:0 0 14px; color:#183b5a; }
.delivery-drawer-mask .modal [data-delivery-dialog] > .modal-foot { position:sticky; bottom:-24px; background:#fff; padding-block:12px; z-index:4; border-top:1px solid var(--delivery-rule,#d9e4ef); }
@media (max-width:720px) {
  .delivery-workbench .delivery-summary { display:flex; flex-wrap:wrap; }
  .delivery-workbench .delivery-summary div { flex:1 0 110px; }
  .delivery-workbench .delivery-summary dd { font-size:16px; }
  .delivery-workbench :is(th[data-shipment-column],td[data-ship-column="number"]) { min-width:120px; max-width:148px; }
  .delivery-workbench th[data-log-column],.delivery-workbench td[data-ship-column="logs"] { position:static; }
  .delivery-drawer-mask.show .modal,.delivery-drawer-mask.show .modal.lg { width:100vw; padding:16px; }
  .delivery-drawer-mask .modal [data-delivery-dialog] > .modal-foot { bottom:-16px; }
}

.delivery-equipment-fields {
  grid-column:1/-1; display:grid; grid-template-columns:minmax(130px,185px) 1fr; gap:10px 14px;
  padding:10px 12px; border:1px solid #dce6ef; background:#fff; border-radius:8px;
}
.delivery-equipment-fields[hidden] { display:none; }
.delivery-equipment-fields fieldset:last-child { grid-column:1/-1; }
@media (max-width:600px) { .delivery-equipment-fields {grid-template-columns:minmax(0,1fr);} }

.delivery-grid-group-bar {
  display:flex; align-items:end; flex-wrap:wrap; gap:8px 14px; margin-bottom:12px;
}
.delivery-grid-group-bar .delivery-field {flex:1 1 180px; max-width:340px;}
.delivery-grid-group-bar [data-total-tons] {margin-right:auto; padding-bottom:7px; color:#415d76;}
.delivery-grid-confirm, .delivery-grid-check {
  display:flex; align-items:center; gap:10px; width:fit-content; border-radius:8px;
  color:#174667; cursor:pointer; font-weight:650;
}
.delivery-grid-confirm {min-height:48px; padding:10px 14px; margin-bottom:12px; border:1px solid #a8c6e0; background:#eaf4ff;}
.delivery-grid-check {grid-column:1/-1; min-height:32px; padding-inline:6px; color:#38546b;}
.delivery-grid-confirm input, .delivery-grid-check input, .delivery-receipt-batch input {
  flex:none; width:22px; height:22px; margin:0; accent-color:#195ea5;
}
.delivery-grid-confirm[hidden], .delivery-grid-check[hidden], .delivery-grid-group-bar button[hidden],
.delivery-equipment-trip[hidden], .delivery-form-trip[hidden] {display:none;}
.delivery-equipment-trip {grid-column:1/-1; border:1px solid #d6e4f0; border-radius:10px; background:white; padding:12px;}
.delivery-equipment-trip > header {display:flex; flex-wrap:wrap; gap:4px 12px; align-items:baseline; color:#254969;}
.delivery-equipment-trip .delivery-form-trip {margin:10px 0 0; background:#f3f7fb;}
.delivery-trip-options {display:grid; gap:8px; margin:12px 0;}
.delivery-trip-options button {
  display:flex; flex-direction:column; gap:4px; max-width:100%; text-align:left; padding:10px 14px;
  border:1px solid #c4d4e3; border-radius:8px; background:#f7fafc; color:#244660;
}
.delivery-trip-options small {font-weight:400; white-space:normal; overflow-wrap:anywhere;}
.delivery-receipt-batch {font-size:12px; color:#234e76;}
.delivery-receipt-batch input {width:19px;height:19px;}
@media (max-width:600px) {
  .delivery-grid-group-bar .delivery-field {max-width:none; flex-basis:100%;}
  .delivery-grid-confirm {width:100%;}
  .delivery-equipment-trip .delivery-form-trip {grid-template-columns:minmax(0,1fr);}
}

.delivery-device-review {min-width:185px; max-width:260px; white-space:normal;}
.delivery-device-review summary {cursor:pointer; color:#174e83; white-space:nowrap;}
.delivery-device-review > div {display:grid; gap:4px; margin:7px 0; padding:8px; border-radius:6px; background:#eff5fa;}
.delivery-device-review label {display:grid; gap:3px; font-size:12px;}
.delivery-device-review input {min-width:0; width:100%;}
