.dispatch-blocks-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line, #d8e2dc);
  border-radius: 12px;
  background: #f8fbf9;
}

.dispatch-blocks-field legend {
  padding: 0 5px;
  font-weight: 700;
}

.dispatch-blocks-field > p {
  margin: 0 0 10px;
  color: var(--muted, #66736b);
  font-size: 0.82rem;
}

.dispatch-block-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dispatch-block-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #c8d8cf;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.dispatch-block-check:has(input:checked) {
  border-color: #25734c;
  background: #e8f5ed;
  color: #195b3a;
}

.dispatch-block-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #25734c;
}

.dispatch-history-blocks {
  display: inline-block;
  min-width: max-content;
  font-weight: 700;
  color: #205f42;
}

/* La salida puede crecer al agregar bloques. El formulario completo debe
   desplazarse dentro del dialogo sin ocultar productos ni acciones. */
.dispatch-entry-form {
  grid-template-rows: auto auto auto auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.dispatch-entry-form .dispatch-form-workspace {
  min-height: auto;
  overflow: visible;
  align-items: start;
}

.dispatch-entry-form .dispatch-form-main,
.dispatch-entry-form .dispatch-form-side {
  min-height: auto;
}

.dispatch-entry-form .dispatch-form-side {
  grid-template-rows: auto auto auto;
}

@media (max-width: 720px) {
  .dispatch-block-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dispatch-block-check {
    border-radius: 10px;
  }
}


/* UX rapido para registrar salidas: bloques agrupados y selector global. */
.dispatch-blocks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dispatch-blocks-toolbar > p {
  margin: 0;
  color: var(--muted, #66736b);
  font-size: 0.82rem;
}

.dispatch-block-select-all {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 12px;
}

.dispatch-block-potrero-groups {
  display: grid;
  gap: 10px;
}

.dispatch-block-potrero-group {
  padding: 10px;
  border: 1px solid #dce8e1;
  border-radius: 10px;
  background: #fff;
}

.dispatch-block-potrero-title {
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #365c49;
}

.dispatch-time-fast {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .dispatch-blocks-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dispatch-block-select-all {
    width: 100%;
  }
}

/* Órdenes de aplicación sin potrero: ubicación informativa, sin selección obligatoria. */
.dispatch-blocks-not-applicable {
  background: #eff7fc;
  border-color: #b8d8e9;
}
.dispatch-blocks-not-applicable > p {
  margin: 0;
  color: #23495b;
  line-height: 1.45;
}
.dispatch-blocks-not-applicable > p + p {
  margin-top: 5px;
}
.dispatch-blocks-not-applicable strong {
  color: #173b50;
}
