@media screen {
  #appView .page.logistics-page { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  #appView .logistics-workspace { width: 100%; min-width: 0; margin: 0; padding: 0; overflow: hidden; border: 1px solid #e0e6f1; border-radius: 14px; background: #fff; }
  #appView .logistics-workspace-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #e8edf5; }
  #appView .logistics-record-count { display: flex; align-items: baseline; gap: 7px; color: #8090a5; font-size: 12px; }
  #appView .logistics-record-count strong { color: #253d5d; font-size: 22px; font-variant-numeric: tabular-nums; }
  #appView .logistics-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  #appView .logistics-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e8edf5; background: #fafbfe; }
  #appView .logistics-filters > .document-search { flex: 1 1 280px; min-width: 0; max-width: 460px; }
  #appView .logistics-filters > select { width: 140px; height: 40px; border: 1px solid #dce3ef; border-radius: 9px; padding: 7px 10px; background: #fff; color: #344d6b; }
  #appView .logistics-status-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
  #appView .logistics-status-filters button { min-height: 36px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #75859d; font-size: 13px; cursor: pointer; }
  #appView .logistics-status-filters button.active { background: #edeaff; color: #5f4bd3; font-weight: 650; }
  #appView .logistics-route-stop { display: flex; align-items: start; gap: 8px; margin: 5px 0; }
  #appView .logistics-route-stop > i { display: grid; flex: 0 0 22px; width: 22px; height: 22px; place-items: center; border-radius: 6px; background: #edf3fe; color: #5076bc; font-size: 10px; font-style: normal; }
  #appView .logistics-route-stop.destination > i { background: #ebf7f3; color: #248979; }
  #appView .logistics-route-stop > div { min-width: 0; }
  #appView .logistics-route-stop strong { font-weight: 550; }
  #appView .logistics-route-stop small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; color: #8794a7; line-height: 1.5; }
  #appView .logistics-awaiting { display: inline-block; padding: 4px 9px; border-radius: 6px; background: #f2f4f9; color: #8793a5; font-size: 12px; }
  .logistics-default-tag { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: #eaf7f2; color: #238474; font-size: 11px; font-weight: 500; }
  .logistics-request-form { display: grid; gap: 14px; }
  .logistics-form-section,.vehicle-address-card { min-width: 0; padding: 16px; border: 1px solid #e1e7f1; border-radius: 12px; background: #fff; }
  .logistics-form-section > h4,.vehicle-address-card h4 { margin: 0 0 14px; color: #294361; font-size: 15px; }
  .vehicle-route-editor { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .vehicle-address-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
  .vehicle-address-card-head h4 { margin: 0; }
  .vehicle-address-card-head > i { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #eaf1fd; color: #5476b8; font-size: 12px; font-style: normal; }
  .vehicle-address-card.delivery .vehicle-address-card-head > i { background: #eaf7f2; color: #238474; }
  .vehicle-address-card label { min-width: 0; }
  .logistics-address-picker { position: relative; min-width: 0; }
  .logistics-address-picker > input:not([type=hidden]) { width: 100%; }
  .logistics-address-suggestions { position: absolute; z-index: 12; top: calc(100% + 5px); left: 0; width: 100%; max-height: 260px; overflow-y: auto; border: 1px solid #d8e1ef; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px #23365420; }
  .logistics-address-suggestions > button { display: grid; gap: 5px; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid #edf1f7; background: #fff; color: #2c4261; text-align: left; cursor: pointer; }
  .logistics-address-suggestions > button:hover,.logistics-address-suggestions > button:focus-visible { background: #f2f4ff; }
  .logistics-address-suggestions > button > span { display: flex; align-items: center; gap: 8px; }
  .logistics-address-suggestions strong { font-size: 13px; }
  .logistics-address-suggestions em { padding: 2px 5px; border-radius: 5px; background: #eaf7f2; color: #238474; font-size: 10px; font-style: normal; }
  .logistics-address-suggestions small { color: #8190a6; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  .logistics-suggestion-state { padding: 13px; color: #8290a6; font-size: 12px; line-height: 1.5; }
  .logistics-address-linked { display: block; margin-top: 5px; color: #548270; font-size: 11px; }
  .logistics-default-option { display: flex; align-items: center; gap: 8px; color: #556b84; font-size: 13px; }
  .logistics-request-form > .form-actions { margin-top: 0; padding-top: 14px; }
}

@media screen and (min-width: 901px) {
  #appView .logistics-workspace .vehicle-request-table { min-width: 0 !important; width: 100%; max-width: 100%; table-layout: fixed; }
  #appView .logistics-workspace .vehicle-request-table :is(th,td) { min-width: 0; padding: 12px 10px; overflow-wrap: anywhere; white-space: normal; }
  /* Reserve the number column including the 38px selection inset; share the remaining width. */
  #appView .logistics-workspace .vehicle-request-table th:nth-child(1) { width: 240px; }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(2) { width: calc(24% - 57.6px); }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(3) { width: calc(14% - 33.6px); }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(4) { width: calc(14% - 33.6px); }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(5) { width: calc(10% - 24px); }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(6) { width: calc(10% - 24px); }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(7) { width: calc(16% - 38.4px); }
  #appView .logistics-workspace .vehicle-request-table th:nth-child(8) { width: calc(12% - 28.8px); }
  #appView .vehicle-request-number-cell > :is(.vehicle-request-number,.vehicle-request-source) { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
  #appView .vehicle-request-number { font-variant-numeric: tabular-nums; }
  #appView .vehicle-request-table .owner-identity > i { display: none; }
  #appView .vehicle-request-table :is(.owner-identity,.vehicle-row-actions) { min-width: 0; }
  #appView .vehicle-request-table .vehicle-row-actions { flex-wrap: wrap; }
  #appView .vehicle-request-table .vehicle-row-actions.compact-row-actions { gap: 5px; flex-wrap: wrap; }
}

@media screen and (max-width: 900px) {
  #appView .logistics-workspace-head { align-items: start; gap: 10px; padding: 12px; }
  #appView .logistics-head-actions { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
  #appView .logistics-head-actions > button { flex: 1 1 100px; margin: 0; }
  #appView .logistics-head-actions > .primary { flex-basis: 100%; }
  #appView .logistics-record-count strong { font-size: 20px; }
  #appView .logistics-filters { display: flex; flex-flow: row wrap; gap: 8px; padding: 12px; }
  #appView .logistics-status-filters { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; width: 100%; margin: 0; }
  #appView .logistics-status-filters > button { min-width: 0; min-height: 40px; padding: 7px 3px; font-size: 12px; }
  #appView .logistics-filters > .document-search { flex: 1 1 100%; max-width: none; }
  #appView .logistics-filters > select { flex: 1 1 150px; width: 100%; min-width: 0; margin: 0; }
  #appView .logistics-workspace .vehicle-request-table td.vehicle-route-cell { grid-column: 1 / -1; }
  #appView .logistics-workspace .vehicle-request-number-cell > :is(.vehicle-request-number,.vehicle-request-source) { display: block; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
  #appView .logistics-route-stop { margin: 6px 0; }
  #appView .logistics-route-stop small { display: block; overflow: visible; font-size: 12px; }
  body #dialog .vehicle-route-editor { grid-template-columns: minmax(0,1fr); gap: 12px; }
  body #dialog :is(.logistics-form-section,.vehicle-address-card) { padding: 13px; }
  body #dialog .vehicle-address-card .form-grid { grid-template-columns: minmax(0,1fr); }
  body #dialog .logistics-address-suggestions { max-height: 220px; }
  body #dialog .logistics-address-suggestions > button { min-height: 68px; padding: 12px; }
  body #dialog .logistics-request-form > .form-actions { position: sticky; bottom: -14px; z-index: 5; padding: 12px 0 max(8px,env(safe-area-inset-bottom)); background: #fff; }
}
