/* ===== tabla-estilos.css ===== */
/* Contiene únicamente clases para tablas, cabeceras y celdas */

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

.tabla,
.tabla-puntos,
.tabla-despachos {
  width: 100%;
  border-collapse: collapse;
  border-radius: 7px;
  overflow: hidden;
}

/* Cabeceras de tabla */
.tabla th,
.tabla-puntos th,
.tabla-despachos th {
  background:#7ba5ff;
  color: #fff;
  padding: 0.6rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.34px;
  font-size: 0.64rem;
  border-bottom: 2px solid #5f76dc;
}

/* Celdas de tabla */
.tabla td,
.tabla-puntos td,
.tabla-despachos td {
  padding: 0.6rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.68rem;
  text-align: left;
  color: #374151;
  vertical-align: middle;
  transition: background-color 0.2s;
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.tabla tr:hover,
.tabla-puntos tr:hover,
.tabla-despachos tr:hover {
  background: #f8fafc;
}

/* ===== COLUMNA DE ACCIONES - VERSIÓN SIMPLIFICADA ===== */
.tabla td:last-child,
.tabla-puntos td:last-child,
.tabla-despachos td:last-child {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  padding: 0.43rem !important;
  text-align: center !important;
  vertical-align: middle;
  overflow: visible !important;
  white-space: nowrap !important;
}

.tabla th:last-child,
.tabla-puntos th:last-child,
.tabla-despachos th:last-child {
  text-align: center;
}

.acciones-tabla {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  width: max-content;
  margin: 0 auto;
}

/* ===== MEDIA QUERIES ===== */

/* Tablet - 768px */
@media (max-width: 768px) {
  .tabla td:last-child,
  .tabla-puntos td:last-child,
  .tabla-despachos td:last-child {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    padding: 0.34rem !important;
  }
  
  .acciones-tabla {
    gap: 0.26rem;
  }
  
  .tabla th,
  .tabla-puntos th,
  .tabla-despachos th {
    padding: 0.51rem 0.43rem;
    font-size: 0.6rem;
  }
  
  .tabla td,
  .tabla-puntos td,
  .tabla-despachos td {
    padding: 0.51rem 0.43rem;
    font-size: 0.64rem;
    max-width: 20ch;
  }
}

/* Móvil - 526px */
@media (max-width: 526px) {
  .tabla,
  .tabla-puntos,
  .tabla-despachos {
    width: max-content;
    min-width: 100%;
  }

  .tabla th,
  .tabla td,
  .tabla-puntos th,
  .tabla-puntos td,
  .tabla-despachos th,
  .tabla-despachos td {
    white-space: nowrap;
    max-width: 20ch;
  }
  
  .tabla td:last-child,
  .tabla-puntos td:last-child,
  .tabla-despachos td:last-child {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    padding: 0.26rem !important;
  }

  .acciones-tabla {
    gap: 0.21rem;
  }
  
  .tabla th,
  .tabla-puntos th,
  .tabla-despachos th {
    padding: 0.43rem 0.34rem;
    font-size: 0.55rem;
  }
  
  .tabla td,
  .tabla-puntos td,
  .tabla-despachos td {
    padding: 0.43rem 0.34rem;
    font-size: 0.6rem;
    max-width: 20ch;
  }
}

/* Móvil pequeño - 360px */
@media (max-width: 360px) {
  .tabla td:last-child,
  .tabla-puntos td:last-child,
  .tabla-despachos td:last-child {
    width: 85px !important;
    min-width: 85px !important;
    max-width: 85px !important;
    padding: 0.21rem !important;
  }
  
  .acciones-tabla {
    gap: 0.17rem;
  }

  .tabla th,
  .tabla-despachos th,
  .tabla-puntos th {
    padding: 0.34rem 0.26rem;
    font-size: 0.51rem;
  }

  .tabla td,
  .tabla-despachos td,
  .tabla-puntos td {
    padding: 0.34rem 0.26rem;
    font-size: 0.55rem;
    max-width: 20ch;
  }
}