.rack-inv-card {
  border: 1px solid #b2bec3;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  font-family: Inter, sans-serif;
}

.rack-inv-header {
  padding: 14px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.rack-search-box {
  flex: 1 1 240px;
  min-width: 220px;
  position: relative;
}

.rack-search-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 10px;
  gap: 8px;
}

.rack-dropdown-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
}

.rack-dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rack-dropdown-item:hover {
  background: #f1f5f9;
  color: #0b57d0;
}

.rack-btn-add {
  padding: 8px 12px;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rack-btn-add:hover {
  background: #e2e8f0;
}

.rack-banner {
  padding: 10px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.rack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.rack-table th {
  background: #f8fafc;
  color: #475569;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.rack-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 12px;
}

.rack-table tr {
  background-color: #ffffff;
  transition: background-color 0.15s ease;
}

.rack-table tr:hover {
  background: #f8fafc;
}

.rack-table tr.rack-row-dragging {
  opacity: 0.25 !important;
  background: #e0f2fe !important;
}

.rack-table tr.rack-row-drag-over-top td {
  border-top: 3px solid #0b57d0 !important;
}

.rack-table tr.rack-row-drag-over-bottom td {
  border-bottom: 3px solid #0b57d0 !important;
}

/* Columna ACCIONES fija (sticky) al desplazarse horizontalmente */
#tablaEquipos43 th:last-child,
#tablaEquipos43 td:last-child {
  position: sticky;
  right: 0;
  box-shadow: -1px 0 0 #e2e8f0, -4px 0 6px -2px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

#tablaEquipos43 th:last-child {
  background-color: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  z-index: 3;
}

#tablaEquipos43 td:last-child {
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  z-index: 2;
}

#tablaEquipos43 tr:hover td:last-child {
  background-color: #f8fafc;
}

#tablaEquipos43 tr[style*="background-color"] td:last-child {
  background-color: #fff5f5;
}

#tablaEquipos43 tr.rack-row-dragging td:last-child {
  background-color: #e0f2fe !important;
}

.rack-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: grab;
  padding: 4px;
  border-radius: 4px;
  user-select: none;
  touch-action: none;
  transition: color 0.15s, background-color 0.15s;
}

.rack-drag-handle:hover {
  color: #0b57d0;
  background-color: #e2e8f0;
}

.rack-drag-handle:active {
  cursor: grabbing;
}

.badge-activo {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-pasivo {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}

.badge-status-ok {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #dcfce7;
  color: #15803d;
}

.badge-status-modificado {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #b45309;
}

.badge-status-retirado {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fee2e2;
  color: #b91c1c;
}

.btn-action-icon {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 5px;
  border-radius: 4px;
  line-height: 1;
}

.btn-action-icon:hover {
  background: #e2e8f0;
}

/* Modal de edición */
.modal-rack-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-rack-card {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.modal-rack-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-rack-body {
  padding: 16px 18px;
}

.modal-rack-footer {
  padding: 12px 18px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f8fafc;
}

.modal-form-group {
  margin-bottom: 12px;
}

.modal-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
}

.modal-form-group textarea {
  resize: vertical;
  min-height: 52px;
}

/* Tarjeta de Destino de Planilla para n8n */
.rack-destination-card {
  margin-top: 14px;
  border: 1px solid #b2bec3;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: visible;
  position: relative;
  font-family: Inter, sans-serif;
}

.rack-dest-header {
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.rack-dest-mode-toggles {
  display: inline-flex;
  gap: 4px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 6px;
}

.rack-dest-toggle-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rack-dest-toggle-btn.active {
  background: #0b57d0;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rack-dest-body {
  padding: 14px 16px;
  overflow: visible;
  position: relative;
}

#inputNombreNuevaPlanilla43:disabled {
  cursor: default;
  background-color: #ffffff;
}

.rack-destination-card.rack-card-error {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
  animation: pulseCardError 0.4s ease-in-out;
}

@keyframes pulseCardError {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

.rack-dest-error-banner {
  display: none;
  margin: 10px 16px 0 16px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #f87171;
  border-radius: 6px;
  color: #991b1b;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}