/* ===== ESTILOS GENERALES Y CONTENEDOR PRINCIPAL ===== */
.rutas-container {
  width: 100%;
  max-width: 100%;
  margin: 1.6rem auto;
  padding: 0 0.8rem;
  box-sizing: border-box;
}

/* ===== PANEL DE ACCIONES PRINCIPALES ===== */
.acciones {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.6rem;
  padding: 1.2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #f0f0f0;
}

.acciones h2 {
  color: #1a202c;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.acciones > div {
  display: flex;
  gap: 0.8rem;
}

/* ===== SISTEMA DE BOTONES MEJORADO ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  min-height: 36px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

/* Variantes de botones mejoradas */
.btn-primary {
  background: linear-gradient(135deg, #008c3a 0%, #00b050 100%);
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 140, 58, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #006e2e 0%, #008c3a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 140, 58, 0.35);
}

.btn-mantenimiento {
  background: linear-gradient(135deg, #5b5b5b 0%, #7a7a7a 100%);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(91, 91, 91, 0.25);
}

.btn-mantenimiento:hover {
  background: linear-gradient(135deg, #4a4a4a 0%, #666666 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 91, 91, 0.35);
}

.btn-outline {
  background: transparent;
  border: 2px solid #008c3a;
  color: #008c3a;
  box-shadow: 0 2px 6px rgba(0, 140, 58, 0.1);
}

.btn-outline:hover {
  background: #008c3a;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 140, 58, 0.25);
}

.btn-cancelar {
  background: linear-gradient(135deg, #6c757d 0%, #8a939b 100%);
  color: white;
  box-shadow: 0 3px 8px rgba(108, 117, 125, 0.25);
}

.btn-cancelar:hover {
  background: linear-gradient(135deg, #5a6268 0%, #727b84 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 117, 125, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
  color: white;
  box-shadow: 0 3px 8px rgba(40, 167, 69, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838 0%, #28a745 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.35);
}

/* ===== SISTEMA DE FILTROS MEJORADO ===== */

#filtroEstado {
  background: #fff;
  padding: 0.4rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  margin: 1rem;
  border: 1px solid #f0f0f0;

}


.filtros-container {
  background: #fff;
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  margin-bottom: 1.2rem;
  border: 1px solid #f0f0f0;
}

.filtros-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 0.7rem;
}

.filtros-header h3 {
  color: #1a202c;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
}

.filtro-grupo label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #374151;
  font-size: 0.85rem;
}

.filtro-grupo input,
.filtro-grupo select {
  padding: 0.65rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.25s;
  font-family: 'Nunito', sans-serif;
  min-height: 40px;
  box-sizing: border-box;
  background: #fafafa;
}

.filtro-grupo input:focus,
.filtro-grupo select:focus {
  outline: none;
  border-color: #008c3a;
  box-shadow: 0 0 0 3px rgba(0, 140, 58, 0.15);
  background: white;
  transform: translateY(-1px);
}

/* ===== SISTEMA DE TABLA MEJORADO ===== */
.tabla-contenedor {
  background: #fff;
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  overflow-x: auto;
  margin-bottom: 1.2rem;
  width: 100%;
  border: 1px solid #f0f0f0;
  -webkit-overflow-scrolling: touch;
}

.tabla {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
}

/* Cabeceras de tabla mejoradas */
.tabla th {
  background:#7ba5ff;
  color: #fff;
  padding: 0.7rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 0.75rem;
  border-bottom: 2px solid #5f76dc;
}

/* Celdas de tabla mejoradas */
.tabla td {
  padding: 0.7rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.8rem;
  text-align: left;
  color: #374151;
  vertical-align: middle;
  transition: background-color 0.2s;
}

.tabla tr:last-child td {
  border-bottom: none;
}

.tabla tr:hover {
  background: #f8fafc;
  transform: scale(1.002);
}

/* ===== INDICADORES DE ESTADO MEJORADOS ===== */
.estado {
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
  text-align: center;
  min-width: 80px;
  border: 1.5px solid;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.estado-nota-credito {
  background-color: #17a2b8;
  color: white;
  border-color: #5fafff;
}


.estado-reenviado {
  background: #ffffff;
  color: #484848;
  border-color: #333333;
}


.estado-anulado {
  background: linear-gradient(135deg, #8c8c8c 0%, #5d5d5d 100%);
  color: #ffffff;
  border-color: #2c2c2c;
}

.estado-pendiente {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  border-color: #ffd351;
}

.estado-en-proceso {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
  border-color: #6edff6;
}

.estado-completado {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border-color: #28a745;
}

.estado-entregado-parcial {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
  border-color: #6edff6;
}

.estado-devolucion {
  background: linear-gradient(135deg, #ffced2 0%, #ffabb4 100%);
  color: #900816;
  border-color: #dc3545;
}

.estado-reprogramado {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  border-color: #ffd351;
}

/* ===== BOTONES DE ACCIÓN EN TABLA MEJORADOS ===== */
.acciones-tabla {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}


.btn-images {
  background: linear-gradient(135deg, #0d6efd 0%, #3d8bfd 100%);
  color: #fff;
  border: none;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  min-height: 32px;
  min-width: 65px;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

.btn-images:hover {
  background: linear-gradient(135deg, #094bb3 0%, #0d6efd 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}


.btn-edit {
  background: linear-gradient(135deg, #0d6efd 0%, #3d8bfd 100%);
  color: #fff;
  border: none;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  min-height: 32px;
  min-width: 65px;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

.btn-edit:hover {
  background: linear-gradient(135deg, #094bb3 0%, #0d6efd 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-delete {
  background: linear-gradient(135deg, #dc3545 0%, #e35d6a 100%);
  color: #fff;
  border: none;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  min-height: 32px;
  min-width: 65px;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
}

.btn-delete:hover {
  background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ===== SISTEMA DE PAGINACIÓN MEJORADO ===== */
.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.6rem;
  padding: 1.2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #f0f0f0;
}

.btn-pag {
  background: linear-gradient(135deg, #008c3a 0%, #00b050 100%);
  color: white;
  border: none;
  padding: 0.65rem 1.3rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  transition: all 0.25s;
  min-height: 40px;
  box-sizing: border-box;
  box-shadow: 0 3px 8px rgba(0, 140, 58, 0.25);
}

.btn-pag:hover:not(:disabled) {
  background: linear-gradient(135deg, #006e2e 0%, #008c3a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 140, 58, 0.35);
}

.btn-pag:disabled {
  background: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.info-pagina {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

/* ===== FORMULARIOS MEJORADOS ===== */
.formulario-ruta {
  background: white;
  border-radius: 12px;
  padding: 1.6rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin-top: 1.2rem;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #f0f0f0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.form-grupo {
  display: flex;
  flex-direction: column;
}

.form-grupo label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #1a202c;
  font-size: 0.85rem;
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
  padding: 0.65rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  transition: all 0.25s;
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  background: #fafafa;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
  outline: none;
  border-color: #008c3a;
  box-shadow: 0 0 0 3px rgba(0, 140, 58, 0.15);
  background: white;
  transform: translateY(-1px);
}

.form-grupo textarea {
  min-height: 90px;
  resize: vertical;
}

.acciones-formulario {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid #e8e8e8;
}

/* ===== MEDIA QUERIES ACTUALIZADAS ===== */
@media (max-width: 768px) {
  .rutas-container {
    padding: 0 0.6rem;
    margin: 1rem auto;
  }
  
  .acciones {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 1rem;
  }
  
  .acciones > div {
    width: 100%;
    flex-direction: column;
    gap: 0.6rem;
  }
  
  .filtros-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .paginacion {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .tabla-contenedor {
    padding: 0.8rem;
  }
  
  .tabla th {
    padding: 0.6rem 0.5rem;
    font-size: 0.65rem;
  }
  
  .tabla td {
    padding: 0.6rem 0.5rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .rutas-container {
    padding: 0 0.4rem;
    margin: 0.4rem auto;
  }
  
  .acciones,
  .filtros-container,
  .tabla-contenedor {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .estado {
    min-width: 70px;
    font-size: 0.6rem;
    padding: 0.3rem 0.5rem;
  }
  
  .btn-edit,
  .btn-delete {
    width: 100%;
    min-width: auto;
    font-size: 0.65rem;
    padding: 0.4rem 0.6rem;
    min-height: 30px;
  }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-edit,
  .btn-delete,
  .btn-pag {
    transition: none;
    transform: none;
  }
  
  .btn::before {
    display: none;
  }
}

/* Efectos de brillo mejorados */
.btn:active {
  transform: translateY(0);
  transition: transform 0.1s;
}




/* ===== IMPORTACIÓN DE DATOS (ESTILO ORIGINAL) ===== */
.importar-datos-container {
  margin-bottom: 20px;
}

.acciones-botones {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.area-importar-datos {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
}

.importar-instructions {
  background: #e7f3ff;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 4px solid #007bff;
}

.importar-instructions h3 {
  margin: 0 0 10px 0;
  color: #0056b3;
  font-size: 16px;
}

.importar-instructions p {
  margin: 5px 0;
  font-size: 14px;
  color: #495057;
}

.textarea-excel {
  width: 100%;
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.textarea-excel:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.importar-acciones {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Botones específicos para importación (manteniendo el nuevo estilo) */
.btn-importar {
  background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
  color: white;
  box-shadow: 0 3px 8px rgba(40, 167, 69, 0.25);
}

.btn-importar:hover {
  background: linear-gradient(135deg, #218838 0%, #28a745 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.35);
}

.btn-limpiar {
  background: linear-gradient(135deg, #6c757d 0%, #8a939b 100%);
  color: white;
  box-shadow: 0 3px 8px rgba(108, 117, 125, 0.25);
}

.btn-limpiar:hover {
  background: linear-gradient(135deg, #5a6268 0%, #727b84 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 117, 125, 0.35);
}

/* ===== MEDIA QUERIES PARA IMPORTACIÓN ===== */
@media (max-width: 768px) {
  .area-importar-datos {
    padding: 15px;
    margin-top: 15px;
  }
  
  .importar-instructions {
    padding: 12px;
  }
  
  .importar-instructions h3 {
    font-size: 15px;
  }
  
  .importar-instructions p {
    font-size: 13px;
  }
  
  .textarea-excel {
    padding: 10px;
    font-size: 13px;
  }
  
  .importar-acciones {
    flex-direction: column;
  }
  
  .importar-acciones .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .area-importar-datos {
    padding: 12px;
    margin-top: 12px;
  }
  
  .importar-instructions {
    padding: 10px;
  }
  
  .importar-instructions h3 {
    font-size: 14px;
  }
  
  .importar-instructions p {
    font-size: 12px;
  }
  
  .acciones-botones {
    flex-direction: column;
    align-items: stretch;
  }
  
  .acciones-botones .btn {
    width: 100%;
    justify-content: center;
  }
}
