/* ============================================================
   historial.css — Estilos de la vista de historial
   ids.hfranklin.mx
   ============================================================ */

/* --- BOTÓN VOLVER EN HEADER --- */
.btn-volver {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
  transition: color 0.12s;
}

.btn-volver:hover { color: var(--color-accent); }

/* --- BARRA DE FILTROS --- */
.filtros-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 52px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  z-index: 90;
}

.filtro-grupo {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filtro-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.filtro-select,
.filtro-input {
  height: 30px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  padding: 0 8px;
  outline: none;
  transition: border-color 0.12s;
}

.filtro-select { min-width: 90px; }
.filtro-input  { width: 130px; }

.filtro-select:focus,
.filtro-input:focus {
  border-color: var(--color-accent);
}

/* Estilo del calendario nativo (fecha) */
.filtro-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.btn-limpiar,
.btn-recargar {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-limpiar { margin-left: auto; }

/* --- CONTENIDO PRINCIPAL --- */
.historial-main {
  position: fixed;
  top: calc(var(--header-height) + 52px);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 12px;
}

/* --- ESTADOS DE CARGA / ERROR / VACÍO --- */
.estado-carga,
.estado-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 16px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.estado-error {
  margin: 16px 0;
}

/* --- TABLA DE REGISTROS --- */
.tabla-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.tabla-historial {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* Encabezados */
.tabla-historial thead {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 10;
}

.tabla-historial th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Filas de datos */
.tabla-historial tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}

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

.tabla-historial tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.tabla-historial td {
  padding: 8px 12px;
  vertical-align: middle;
}

/* Columnas específicas */
.col-hora  { width: 90px; }
.col-hab   { width: 100px; }
.col-fotos { width: 60px; text-align: center; }
.col-thumbs { }

/* Celda de hora */
.celda-hora {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-text);
}

.celda-hora .fecha-row {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* Celda de habitación */
.celda-hab {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 14px;
}

/* Celda de número de fotos */
.celda-num-fotos {
  text-align: center;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Miniaturas de fotos */
.thumbs-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Thumbnail clicable */
.thumb {
  width: 52px;
  height: 33px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: border-color 0.12s, transform 0.1s;
  background: var(--color-surface);
}

.thumb:hover {
  border-color: var(--color-accent);
  transform: scale(1.08);
}

/* Slot vacío de thumbnail */
.thumb-vacio {
  width: 52px;
  height: 33px;
  border-radius: 4px;
  border: 1px dashed var(--color-border);
  background: transparent;
}

/* Icono de enlace a Drive */
.thumb-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
  flex-shrink: 0;
}

.thumb-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* --- CONTADOR DE RESULTADOS --- */
.resultados-contador {
  padding: 10px 0 4px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
}
