/* css/visitas_historial.css */

#historialTabla {
  width: 100%;
}

.vh-col-tiempo-total {
  width: 90px;
  max-width: 90px;
  min-width: 70px;
  text-align: center;
  white-space: nowrap;
}

.vh-filtros-card {
  background: #908075;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  padding: 9px;
  margin: 0 9px 10px 9px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vh-campos {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-end;
  min-width: 0;
}

.vh-field {
  flex: 1 1 0;
  min-width: 0;
}

.vh-field label {
  display: block;
  font-size: 12px;
  color: #fff;
  margin-bottom: 5px;
}

.vh-input,
.vh-select,
.vh-filtros-card .ts-control {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #cdd6e1;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
  color: #333;
  box-sizing: border-box;
}

.vh-filtros-card .ts-control { min-height: 30px; }
.vh-filtros-card .ts-wrapper { width: 100%; min-width: 0; }

.vh-date .vh-input { height: 59px; min-width: 140px; }
.vh-visitante .vh-select,
.vh-visitante .ts-control { min-width: 140px; }

.vh-filtros-card .ts-dropdown .option.active,
.vh-filtros-card .ts-dropdown .option.selected {
  background: #dac5a6 !important;
  color: #111 !important;
}

.vh-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  align-self: flex-end;
}

.vh-btn {
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.vh-btn.primary { background: #2f6fed; color: #fff; }
.vh-btn.ghost { background: #eef2fb; color: #2f6fed; border-color: #d0daf1; }
.vh-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.vh-resultados {
  font-size: 12px;
  color: #fff;
  background: #19386e;
  border: 1px solid #a9b8d1;
  padding: 5px 8px;
  border-radius: 7px;
}

.vh-fila-actions { display: none; }
.vh-spacer { display: none; }

/* Ajuste de tabla para evitar overflow y permitir altura variable */
#historialTabla { table-layout: fixed; }
#historialTabla th,
#historialTabla td {
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  vertical-align: top;
}
#historialTabla th { white-space: nowrap; }
#historialTabla td { padding: 6px 8px; }

/* Limitar columnas largas y permitir salto de línea */
#historialTabla th:nth-child(1),
#historialTabla td:nth-child(1) { /* Empresa */
  min-width: 140px;
}
#historialTabla th:nth-child(3),
#historialTabla td:nth-child(3) { /* Patente */
  width: 90px;
  max-width: 90px;
  min-width: 80px;
}
#historialTabla th:nth-child(4),
#historialTabla td:nth-child(4) { /* Estacionamiento */
  width: 110px;
  max-width: 110px;
  min-width: 110px;
}
#historialTabla th:nth-child(5),
#historialTabla td:nth-child(5) { /* Fecha Ingreso */
  width: 125px;
  max-width: 125px;
  min-width: 125px;
}
#historialTabla th:nth-child(7),
#historialTabla td:nth-child(7) { /* Piso */
  width: 80px;
  max-width: 80px;
  min-width: 70px;
}
#historialTabla th:nth-child(8),
#historialTabla td:nth-child(8) { /* Departamento */
  width: 150px;
  max-width: 150px;
  min-width: 140px;
}
#historialTabla th:nth-child(6),
#historialTabla td:nth-child(6) { /* Fecha Salida */
  width: 125px;
  max-width: 125px;
  min-width: 125px;
}
#historialTabla th:nth-child(9),
#historialTabla td:nth-child(9) { /* Recibio */
  min-width: 120px;
}
#historialTabla th:nth-child(10),
#historialTabla td:nth-child(10),
#historialTabla th:nth-child(11),
#historialTabla td:nth-child(11) { /* Comentarios */
  min-width: 160px;
}

@media (max-width: 900px) {
  .vh-actions { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .vh-actions { width: 100%; }
  .vh-btn { width: 100%; }
  .vh-filtros-card { margin: 0 6px 12px 6px; }
}
