.env-block {
  margin-bottom: 24px;
}

.env-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.env-filter-field {
  max-width: none;
}

.env-search-field {
  max-width: none;
}

.env-block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.env-block-title {
  font-family: "Syne", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
}

.env-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 4px;
}

.env-pedido-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.env-pedido-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(232, 197, 71, 0.24);
}

.env-pedido-item.seleccionado {
  background: rgba(232, 197, 71, 0.1);
  border-color: rgba(232, 197, 71, 0.5);
}

.env-pedido-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f0e0b;
  background: transparent;
  flex-shrink: 0;
}

.env-pedido-item.seleccionado .env-pedido-check {
  background: var(--accent);
  border-color: var(--accent);
}

.env-pedido-info {
  flex: 1;
  min-width: 0;
}

.env-pedido-cliente {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.env-pedido-cliente-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.env-pedido-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(103, 207, 255, 0.16);
  border: 1px solid rgba(103, 207, 255, 0.38);
  color: #9fe8ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.env-pedido-dir,
.env-pedido-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.env-pedido-uni {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.env-pedido-row-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.env-panel {
  margin-bottom: 24px;
  padding: 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
}

.env-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.env-panel-header h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.env-resumen-sel {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(232, 197, 71, 0.1);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.env-card {
  padding: 15px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 10px;
}

.env-card-history {
  opacity: 0.96;
}

.env-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.env-card-id {
  font-size: 14px;
  font-weight: 700;
  font-family: "Syne", sans-serif;
  letter-spacing: 0.4px;
}

.env-card-meta {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}

.env-card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.env-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-borrador {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.badge-confirmado {
  background: rgba(90, 158, 111, 0.13);
  border-color: rgba(90, 158, 111, 0.24);
  color: #a7ddb7;
}

.badge-en-ruta {
  background: rgba(232, 197, 71, 0.14);
  border-color: rgba(232, 197, 71, 0.24);
  color: #f6dd8b;
}

.badge-completado {
  background: rgba(212, 118, 59, 0.14);
  border-color: rgba(212, 118, 59, 0.22);
  color: #f2b085;
}

.env-card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.env-stat {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.env-stat-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
}

.env-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.env-stat-text {
  font-size: 13px;
  line-height: 1.35;
}

.env-pedidos-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.env-pedido-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.env-pedido-row-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.env-pedido-row-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.env-pedido-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.env-reorder-handle {
  position: relative;
  padding-left: 16px;
  cursor: grab;
  touch-action: none;
}

.env-reorder-handle::before {
  content: "::";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(232, 197, 71, 0.55);
  font-size: 11px;
  letter-spacing: -1px;
}

.env-pedido-row.is-dragging {
  position: relative;
  z-index: 3;
  pointer-events: none;
  background: rgba(232, 197, 71, 0.1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

body.envio-sorting {
  user-select: none;
}

.env-pedido-row-main strong {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.env-pedido-row-main span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.env-pedido-row-note {
  font-size: 11px;
  color: rgba(240, 237, 230, 0.72);
  font-style: normal;
  line-height: 1.35;
  white-space: normal;
}

.env-pedido-row-note span {
  color: var(--accent);
  font-weight: 700;
}

.env-pedido-row-qty {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.env-inline-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(192, 80, 74, 0.3);
  background: rgba(192, 80, 74, 0.12);
  color: #f5a29b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.env-inline-action-accent {
  border-color: rgba(232, 197, 71, 0.32);
  background: rgba(232, 197, 71, 0.12);
  color: var(--accent);
}

.env-inline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(232, 197, 71, 0.24);
  background: rgba(232, 197, 71, 0.08);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.env-card-notas {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  padding: 10px 11px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.env-note-editor {
  margin-bottom: 10px;
}

.env-note-editor label {
  margin-bottom: 8px;
}

.env-note-editor textarea {
  margin-bottom: 8px;
}

.env-note-save {
  width: 100%;
}

.env-inline-edit-row {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 10px;
}

.env-inline-edit-field {
  flex: 1;
  min-width: 0;
}

.env-inline-edit-field label {
  margin-bottom: 8px;
}

.env-inline-edit-row .env-inline-action {
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
}

.env-add-panel {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.env-add-trigger-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 10px;
}

.env-add-trigger {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(232, 197, 71, 0.28);
  background: rgba(232, 197, 71, 0.12);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.env-add-trigger.active {
  background: rgba(232, 197, 71, 0.2);
  border-color: rgba(232, 197, 71, 0.45);
}

.env-add-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.env-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.env-add-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.env-add-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.env-add-main strong {
  font-size: 13px;
  color: var(--text);
}

.env-add-main span {
  font-size: 12px;
  color: var(--muted);
}

.env-add-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.env-empty-inline {
  font-size: 12px;
  color: var(--muted);
}

.env-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ruta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--accent);
  color: #0f0e0b;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.env-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.env-state-chip {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.env-state-chip.active {
  background: rgba(232, 197, 71, 0.16);
  border-color: rgba(232, 197, 71, 0.4);
  color: var(--accent);
}

.env-remove-all {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(192, 80, 74, 0.25);
  background: rgba(192, 80, 74, 0.1);
  color: #f5a29b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.env-empty {
  padding: 26px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.retiro-card {
  /* Inherits env-card styles */
}
