/* Shipment page-only styles */

.shipment-filter-list-only,
.shipment-filter-card {
  align-items: flex-end;
}

.shipment-table-scroll,
.shipment-detail-scroll {
  max-width: 100%;
  overflow: auto;
}

.shipment-dialog {
  width: min(1320px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
}

.shipment-dialog form {
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 40px);
}

.shipment-dialog .shipment-form-card {
  max-height: calc(100vh - 122px);
  overflow-x: hidden;
  overflow-y: auto;
}

.shipment-dialog .barcode-cell,
.shipment-dialog textarea {
  max-width: 100%;
}

.shipment-form-top-grid {
  display: grid;
  grid-template-columns: 150px minmax(160px, 1fr) 130px minmax(220px, 1fr) 130px auto;
  gap: 10px;
  align-items: end;
}

.shipment-form-top-grid label {
  min-width: 0;
}

.shipment-note-field {
  grid-column: auto;
}

.shipment-form-actions-top {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0;
  white-space: nowrap;
}

.shipment-form-actions-top button {
  height: 38px;
  min-width: 100px;
  white-space: nowrap;
}

.shipment-line-scroll {
  margin-top: 14px;
  max-height: 120px;
  overflow-x: hidden;
  overflow-y: auto;
}

.shipment-line-scroll .shipment-small-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.shipment-line-builder {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) 76px minmax(360px, 1.4fr) 104px;
  gap: 12px;
  align-items: end;
  margin-top: 30px;
  padding-top: 0;
  border-top: 0;
}

.shipment-line-builder .barcode-paste textarea {
  min-height: 38px;
  height: 38px;
  resize: vertical;
}

#shipAddLineButton {
  min-width: 104px;
  white-space: nowrap;
  word-break: keep-all;
}

@media (max-width: 1180px) {
  .shipment-form-top-grid {
    grid-template-columns: 150px minmax(180px, 1fr) 130px 130px;
  }

  .shipment-note-field {
    grid-column: 1 / span 2;
  }

  .shipment-form-actions-top {
    grid-column: 3 / span 2;
  }

  .shipment-line-builder {
    grid-template-columns: minmax(220px, 1fr) 80px;
  }

  .shipment-line-builder .barcode-paste {
    grid-column: 1 / -1;
  }

  #shipAddLineButton {
    grid-column: 2;
  }
}
