@import url('fonts.css');

/* =============================================
  GLOBALES
============================================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text: #000;
  --font-stack: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #000, #6b1d5e, #c84b31);
  font-family: var(--font-stack);
}

body {
  display: flex;
  flex-direction: column;
}

/* =============================================
  Reportes (reportes.html)
============================================= */

.reportes-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem;
}

.reportes-logo {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  margin-bottom: 0.25rem;
}

#cardDistrito {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.categoria-bloque {
  margin-bottom: 0.25rem;
}

.categoria-bloque:last-child {
  margin-bottom: 0;
}

.categoria-fija {
  height: 350px;
}

.categoria-contenido {
  height: 330px;
}

.categoria-reporte {
  height: 350px;
}

.categoria-mitad {
  flex: 1;
  min-width: 0;
}

.reportes-titulo {
  font-size: 2.35rem;
  font-family: 'BebasNeue', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.05em;
}

.reportes-row {
  gap: 0.25rem;
}

.reportes-col {
  flex: 1;
  min-width: 0;
}

.reportes-logo-img {
  height: 70px;
}

.reportes-filtros {
  flex-direction: row;
}

#headerAcciones {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.reportes-categoria-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b1d5e;
  border-bottom: 1px solid #dee2e6;
  background: #fff;
}

.minh-0 {
  min-height: 0;
}

.categoria-filtros {
  font-size: 0.85rem;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.categoria-contenido.oculto {
  height: 0 !important;
  overflow: hidden;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* Estado sin datos: colapsa el contenedor y centra el mensaje */
.categoria-sin-datos {
  height: auto !important;
  min-height: 0 !important;
}
.categoria-sin-datos .reporte-msg-sin-datos {
  flex-grow: 1;
}

.alerta-flotante {
  z-index: 9999;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preloader-logo {
  width: 80px;
  height: 80px;
  animation: pulso 1.5s infinite;
}

@keyframes pulso {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* =============================================
  TV pública (turno.html)
============================================= */

/* ─── Header / Logos ─────────────────────── */

.tv-logos {
  gap: 6vw;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.tv-logos img {
  height: 80px;
  object-fit: contain;
}

/* ─── Imagen / Spinner ───────────────────── */

.tv-main-row .col-6:first-child > div {
  border-bottom-left-radius: 16px;
}

#imgActual {
  opacity: 0;
  transition: opacity 0.3s;
  object-fit: contain;
  border-radius: inherit;
}

#spinnerImg {
  color: #6b1d5e;
}

/* ─── Panel de texto ─────────────────────── */

.tv-panel-texto {
  background-image: url('../img/fnd_col.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  overflow-y: auto;
  border-bottom-right-radius: 16px;
}

#txtTurno {
  font-size: 1.938rem;
  text-align: center;
  overflow-wrap: break-word;
  color: var(--text);
}

#txtTurno .titulo {
  line-height: 1;
  font-size: 2.625rem;
}

#txtTurno .subtitulo {
  line-height: 1.1;
  font-size: 2.375rem;
  padding: 20px 0;
}

#txtTurno .descripcion {
  line-height: 0.9;
  text-align: left;
}

.resaltado {
  font-weight: 700;
  text-transform: uppercase;
}

/* =============================================
  RESPONSIVE
============================================= */

@media (width <= 1300px) {
  .reportes-logo {
    justify-content: flex-start !important;
  }
}

@media (width <= 880px) {
  .reportes-logo {
    justify-content: center !important;
  }

  #headerAcciones {
    position: static !important;
    transform: none !important;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
  }
}

@media (width <= 768px) {
  html, body {
    overflow-y: auto;
  }

  body {
    display: block;
  }

  .tv-logos {
    flex-wrap: wrap;
  }

  .tv-logos img {
    height: 50px;
  }

  .container-fluid.flex-grow-1 {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .tv-main-row {
    flex-direction: column;
  }

  .tv-main-row>.col-6 {
    width: 100%;
    height: auto;
  }

  #txtTurno {
    font-size: 1.25rem;
  }

  /* ─── Reportes ─────────────────────────────── */

  .reportes-page {
    min-height: 100vh;
    flex: none;
  }

  .reportes-page>.categoria-bloque {
    height: auto !important;
  }

  .categoria-contenido {
    height: auto !important;
  }

  .reportes-filtros {
    flex-direction: column;
  }

  /* ─── Quitar redondeos en responsive ─────── */

  .tv-logos,
  .tv-main-row .col-6:first-child > div,
  .tv-panel-texto,
  .reportes-logo {
    border-radius: 0 !important;
  }
}

#penasResumen table tbody td,
#penasResumen table tbody th {
    cursor: pointer;
}

#rankingContenido {
    height: auto !important;
}

#penasResumen tbody tr:hover td,
#penasResumen tbody tr:hover th {
    background-color: rgba(107, 29, 94, 0.06);
}

#penasResumen tbody td.col-highlight,
#penasResumen tbody th.col-highlight {
    background-color: rgba(200, 75, 49, 0.06);
}

#penasResumen tbody tr:hover td.col-highlight,
#penasResumen tbody tr:hover th.col-highlight {
    background-color: rgba(107, 29, 94, 0.10);
}

#penasResumen table tfoot th {
  border-top: 1px solid #B5B6B7;
}

/* =============================================
  FEEDBACK VISUAL EN FILTROS
============================================= */

.select-procesando {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
}

.btn-procesando {
  pointer-events: none;
  opacity: 0.8;
}

.paginacion-controls {
  border-top: 1px solid #dee2e6;
  padding-top: 0.5rem;
}

/* =============================================
  BOTÓN EXPORTAR GRÁFICO
============================================= */

.exportar-wrapper {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
}

.btn-exportar-grafico {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-exportar-grafico:hover {
  opacity: 1;
}

.exportar-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 2px;
  min-width: 100px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  overflow: hidden;
}

.exportar-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.85rem;
  cursor: pointer;
}

.exportar-item:hover {
  background: #f0f0f0;
}
