/* =========================================
   REPARTOS POR XLSX
========================================= */
.dispatch-xlsx-client {
  display: grid;
  gap: 5px;
}

.dispatch-xlsx-mapping {
  display: grid;
  gap: 4px;
}

.dispatch-xlsx-multiplier-help {
  display: block;
  margin-top: 6px;
  color: var(--lj-accent);
  font-size: 0.78rem;
}

.dispatch-xlsx-row-disabled td {
  opacity: 0.55;
  background: var(--lj-surface) !important;
}

.dispatch-xlsx-row-related td {
  background: var(--lj-surface-2) !important;
}

.dispatch-xlsx-row-pending td {
  background: var(--lj-surface) !important;
}

.dispatch-xlsx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lj-accent);
}

sl-switch.dispatch-xlsx-toggle::part(label) {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--lj-accent);
}


.dispatch-xlsx-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dispatch-xlsx-table {
  min-width: 980px;
}

.dispatch-xlsx-type-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.dispatch-xlsx-type-divider {
  width: 1px;
  height: 30px;
  background: var(--lj-accent-soft);
  margin: 0 4px;
}

.dispatch-xlsx-selector-wrap {
  text-align: left;
}

.dispatch-xlsx-target-list {
  margin-top: 8px;
  max-height: 42vh;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.dispatch-xlsx-selector-row {
  margin-bottom: 0;
}

.dispatch-xlsx-stock-hint.is-ok {
  color: var(--lj-success) !important;
  font-weight: 700;
}

.dispatch-xlsx-stock-hint.is-danger {
  color: var(--lj-danger) !important;
  font-weight: 700;
}

.dispatch-xlsx-ingredient-qty-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.dispatch-xlsx-ingredient-qty-row {
  display: grid;
  gap: 6px;
  margin: 0;
}

.dispatch-xlsx-ingredient-qty-label {
  color: var(--lj-accent);
  font-size: 0.88rem;
  font-weight: 700;
}


.dispatch-xlsx-head-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dispatch-xlsx-uploading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--lj-accent);
}

.dispatch-xlsx-client-badge {
  width: fit-content;
  white-space: nowrap;
}

.dispatch-xlsx-date-cell {
  white-space: nowrap;
}

.dispatch-xlsx-map-state {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.dispatch-xlsx-map-state.is-related {
  background: var(--lj-surface-2);
  color: var(--lj-success);
  border: 1px solid color-mix(in srgb, var(--lj-success) 35%, var(--lj-surface));
}

.dispatch-xlsx-map-state.is-pending {
  background: var(--lj-surface);
  color: var(--lj-danger);
  border: 1px solid color-mix(in srgb, var(--lj-danger) 35%, var(--lj-surface));
}

#dispatchXlsxProcessBtn:disabled {
  background-color: var(--lj-surface-2) !important;
  border-color: var(--lj-border-strong) !important;
  color: var(--lj-muted) !important;
}

.dispatch-xlsx-history-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.dispatch-xlsx-history-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

#dispatchXlsxMapQty.swal2-input {
  margin: 8px 0 0;
  width: 100%;
}

.dispatch-xlsx-selector-row .inventario-print-photo-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--lj-border);
  flex: 0 0 42px;
}

.dispatch-xlsx-selector-row .thumb-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

@media (max-width: 640px) {
  .dispatch-xlsx-type-actions {
    flex-wrap: wrap;
  }
  .dispatch-xlsx-type-divider {
    display: none;
  }
  .dispatch-xlsx-history-filters {
    grid-template-columns: 1fr;
  }
}

.dispatch-xlsx-type-actions sl-button {
  width: auto;
  max-width: none;
  white-space: nowrap;
}


.dispatch-xlsx-invoice-cell,
.dispatch-xlsx-kilos-cell > span {
  font-weight: 700;
}

.dispatch-xlsx-map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  white-space: normal;
  max-width: 100%;
  color: var(--lj-accent);
}

.dispatch-xlsx-map-link.is-unmapped {
  color: var(--lj-danger);
}


.dispatch-xlsx-mapped-kg {
  font-weight: 800;
}

.dispatch-xlsx-mapped-kg.is-ok {
  color: var(--lj-success);
}

.dispatch-xlsx-mapped-kg.is-danger {
  color: var(--lj-danger);
}

.dispatch-xlsx-mapped-kg.is-warning {
  color: var(--lj-warning);
}

.dispatch-xlsx-kilos-cell small.is-ok,
.dispatch-xlsx-kilos-cell small.is-ok strong {
  color: var(--lj-success) !important;
  font-weight: 700;
}

.dispatch-xlsx-kilos-cell small.is-danger,
.dispatch-xlsx-kilos-cell small.is-danger strong {
  color: var(--lj-danger) !important;
  font-weight: 700;
}


.dispatch-xlsx-client-name {
  display: block;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatch-xlsx-history-delete {
  display: inline-flex;
}



.dispatch-xlsx-ingredient-breakdown {
  margin-top: 6px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--lj-border);
  border-radius: var(--lj-radius-lg);
  background: var(--lj-surface);
}

.dispatch-xlsx-ingredient-line {
  margin: 0;
  font-size: 0.74rem;
}

.dispatch-xlsx-ingredient-line.is-ok,
.dispatch-xlsx-ingredient-line.is-ok strong {
  color: var(--lj-success);
}

.dispatch-xlsx-ingredient-line.is-danger,
.dispatch-xlsx-ingredient-line.is-danger strong {
  color: var(--lj-danger);
}

.dispatch-xlsx-ingredient-line.is-warning,
.dispatch-xlsx-ingredient-line.is-warning strong {
  color: var(--lj-warning);
}

.dispatch-xlsx-ingredient-item {
  display: grid;
  gap: 4px;
}

.dispatch-xlsx-conflict-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dispatch-xlsx-qty-main {
  display: inline-block;
  line-height: 1.4;
  white-space: normal;
}

.dispatch-xlsx-stock-ok {
  color: var(--lj-success);
}

.dispatch-xlsx-stock-expired,
.dispatch-xlsx-expired-part {
  color: var(--lj-danger);
  font-weight: 700;
}

.dispatch-xlsx-stock-future,
.dispatch-date-hint {
  color: var(--lj-warning);
  font-weight: 700;
}

.dispatch-date-hint {
  display: block;
  margin-top: 3px;
  line-height: 1.35;
}

.dispatch-date-hint.is-expired {
  color: var(--lj-danger);
}

.dispatch-stock-muted {
  display: block;
  color: var(--lj-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 3px;
}

.dispatch-date-block-row td {
  background: var(--lj-warning-soft) !important;
  color: var(--lj-warning);
}

.dispatch-xlsx-date-alert-row td {
  padding: 0 !important;
  border-top: 0 !important;
  background: var(--lj-warning-soft) !important;
}

.dispatch-xlsx-date-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--lj-warning);
}

.dispatch-xlsx-date-alert-copy {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
}

.dispatch-xlsx-date-alert-copy i {
  margin-top: 2px;
  color: var(--lj-warning);
}

.dispatch-xlsx-date-alert-copy strong,
.dispatch-xlsx-date-alert-copy span {
  color: inherit;
}

.dispatch-xlsx-fix-date-btn {
  flex: 0 0 auto;
  min-height: 36px;
}

.dispatch-xlsx-date-input {
  min-width: 132px;
}

.dispatch-xlsx-date-cell small {
  display: none;
}

.dispatch-xlsx-kilos-cell small {
  line-height: 1.45;
}

.dispatch-xlsx-stock-missing {
  color: var(--lj-muted);
  font-weight: 600;
}


.dispatch-xlsx-stock-create {
  color: var(--lj-muted);
  font-weight: 600;
}

.dispatch-xlsx-conflict-btn {
  margin-left: 8px;
  width: 170px;
  min-width: 170px;
  white-space: nowrap;
}

.dispatch-xlsx-conflict-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 6px;
}

.dispatch-xlsx-conflict-badge.is-sold {
  color: var(--lj-success);
  background: var(--lj-surface-2);
  border: 1px solid color-mix(in srgb, var(--lj-success) 35%, var(--lj-surface));
}

.dispatch-xlsx-conflict-badge.is-decommissioned {
  color: var(--lj-danger);
  background: var(--lj-surface);
  border: 1px solid color-mix(in srgb, var(--lj-danger) 35%, var(--lj-surface));
}

