/* ═══════════════════════════════════════════════════════════════════
 * semaforo.css — El Semáforo de Tampico v5
 *
 * Hero y KPI cards usan el esquema visual de "Tampico al día":
 * navy oscuro premium, dorado, Playfair Display + Montserrat.
 * Resto (filtros pill, tabla ranking, drawer, footer) conserva su look.
 * ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════ HERO Y KPIs (estilo Tampico al día) ═══════════════ */
.sm-section {
  --navy: #0F2238;
  --navy-deep: #081628;
  --navy-light: #1C3A5C;
  --gold: #C9A84C;
  --gold-bright: #E5C46A;
  --paper: #FAF7F0;
  --tline: rgba(201,168,76,.18);

  position: relative;
  padding: clamp(60px, 8vw, 100px) 24px clamp(50px, 6vw, 80px);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(201,168,76,.10), transparent 70%),
    radial-gradient(700px 500px at 85% 90%, rgba(201,168,76,.06), transparent 70%),
    linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: var(--paper);
  overflow: hidden;
}

.sm-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.85 0 0 0 0 0.4 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .35;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.sm-section::after {
  content: '';
  position: absolute;
  top: 50%; left: -10%;
  width: 120%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  transform: rotate(-8deg);
  opacity: .15;
  pointer-events: none;
}

.sm-wrap {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.sm-back {
  display: inline-block;
  color: var(--gold-bright);
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
  transition: opacity .2s;
  opacity: .85;
}
.sm-back:hover { opacity: 1; }

/* Header del hero */
.sm-head {
  text-align: center;
  margin-bottom: clamp(40px, 5vw, 60px);
}

.sm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border: 1px solid var(--gold);
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: .22em;
  margin-bottom: 24px;
  background: rgba(201,168,76,.05);
}
.sm-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--gold);
  animation: sm-pulse 2.4s ease-in-out infinite;
}
@keyframes sm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.85); }
}

.sm-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: clamp(42px, 6.5vw, 84px);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0 0 20px;
  color: var(--paper);
}
.sm-title em {
  font-style: italic;
  font-weight: 700;
  color: var(--gold);
}

.sm-sub {
  font-family: 'Open Sans', sans-serif;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65;
  max-width: 620px;
  margin: 0 auto;
  color: rgba(250,247,240,.78);
  font-weight: 400;
}

/* Indicadores en tiempo real */
.iv-section {
  margin: clamp(28px, 4vw, 48px) auto 0;
}

.iv-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.iv-titulo h2 {
  margin: 0 0 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--paper);
  letter-spacing: -.01em;
}

.iv-titulo p {
  margin: 0;
  font-size: 13px;
  color: rgba(250,247,240,.55);
}

.iv-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.iv-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(76,175,80,.10);
  border: 1px solid rgba(76,175,80,.35);
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #a5d6a7;
}

.iv-status[data-conectado="false"] {
  background: rgba(201,168,76,.10);
  border-color: rgba(201,168,76,.4);
  color: var(--gold-bright);
}

.iv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 0 0 rgba(76,175,80,.7);
  animation: iv-pulse-dot 1.8s infinite;
}
.iv-status[data-conectado="false"] .iv-dot {
  background: var(--gold-bright);
  box-shadow: 0 0 0 0 rgba(224,197,114,.5);
}
@keyframes iv-pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,.7); }
  70%  { box-shadow: 0 0 0 8px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

.iv-live {
  font-weight: 800;
  letter-spacing: .08em;
}

.iv-time {
  font-weight: 500;
  color: rgba(250,247,240,.6);
  border-left: 1px solid rgba(255,255,255,.18);
  padding-left: 8px;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* Grid de KPI cards */
.iv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 880px) {
  .iv-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .iv-header { flex-direction: column; align-items: flex-start; }
  .iv-titulo h2 { font-size: 19px; }
}

.iv-card {
  background: linear-gradient(155deg, #1f3552 0%, #0f223a 100%);
  border: 1px solid rgba(201,168,76,.18);
  border-radius: 12px;
  padding: 18px 16px 16px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color .3s, transform .25s;
}

.iv-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(201,168,76,.12), transparent 60%);
  pointer-events: none;
}

.iv-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--gold-bright);
  position: relative;
  z-index: 1;
}

.iv-icon {
  font-size: 16px;
  line-height: 1;
}

.iv-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--gold-bright);
  text-transform: uppercase;
}

.iv-value {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 44px;
  font-weight: 700;
  color: var(--paper);
  line-height: 1;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}

.iv-unit {
  display: block;
  font-size: 12px;
  color: rgba(250,247,240,.6);
  line-height: 1.3;
  font-family: 'Open Sans', sans-serif;
  position: relative;
  z-index: 1;
}

/* ═══════════════ FILTROS PILL ═══════════════ */
.semaforo3-filtros-wrap {
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-300);
  padding: var(--space-3) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--sombra-sm);
}

.semaforo3-filtros-wrap > .container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.semaforo3-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.semaforo3-pill {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border: 1.5px solid var(--gris-300);
  border-radius: 100px;
  background: var(--blanco);
  color: var(--gris-700);
  cursor: pointer;
  transition: var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.semaforo3-pill:hover { border-color: var(--azul); color: var(--azul); }

.semaforo3-pill--activo {
  background: var(--azul);
  color: var(--blanco);
  border-color: var(--azul);
}

.semaforo3-pill__emoji { font-size: 1.05rem; line-height: 1; }

.semaforo3-pill__count {
  background: rgba(0, 0, 0, 0.10);
  color: inherit;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 100px;
  font-weight: 700;
  margin-left: 2px;
}

.semaforo3-pill--activo .semaforo3-pill__count {
  background: rgba(255, 255, 255, 0.25);
}

/* ═══════════════ TABLA RANKING ═══════════════ */
.semaforo3-tabla-wrap {
  padding: var(--space-5) 0 var(--space-7);
  background: var(--gris-100);
}

.semaforo3-card {
  background: var(--blanco);
  border: 1px solid var(--gris-300);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.semaforo3-table-scroll {
  overflow-x: auto;
  max-height: 70vh;
}

.semaforo3-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.92rem;
  min-width: 780px;
}

.semaforo3-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.semaforo3-table th {
  background: #0F2238;
  color: var(--blanco);
  padding: 14px 8px;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: bottom;
}

.semaforo3-table th.col-rank   { width: 60px;  text-align: center; }
.semaforo3-table th.col-total  { width: 80px;  text-align: center; }
.semaforo3-table th.col-nivel  { width: 110px; text-align: center; }

.semaforo3-table th.col-cat {
  text-align: center;
  vertical-align: bottom;
  min-width: 90px;
  padding: 10px 6px;
}

.col-cat__emoji {
  font-size: 1.4rem;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.col-cat__label {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.semaforo3-table tbody tr {
  border-bottom: 1px solid var(--gris-100);
  transition: var(--t-fast);
  cursor: pointer;
}
.semaforo3-table tbody tr:hover { background: var(--azul-claro); }
.semaforo3-table tbody tr:last-child { border-bottom: none; }

.semaforo3-table td {
  padding: 14px 8px;
  color: var(--gris-900);
  vertical-align: middle;
}

.semaforo3-table td.col-rank   { text-align: center; }
.semaforo3-table td.col-total {
  text-align: center;
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  color: var(--azul);
}
.semaforo3-table td.col-nivel  { text-align: center; }
.semaforo3-table td.col-cat    { text-align: center; color: var(--gris-700); font-weight: 600; }
.semaforo3-table td.col-cat--cero { color: var(--gris-300); font-weight: 400; }
.semaforo3-table td.col-cat--alto { color: var(--rojo); font-weight: 700; font-size: 1.05rem; }

.semaforo3-table td.col-colonia {
  font-weight: 600;
  color: #0F2238;
  padding-left: var(--space-3);
  font-family: 'Montserrat', sans-serif;
}

/* Medallas top 3 */
.semaforo3-medalla {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  color: var(--blanco);
  font-size: 0.9rem;
}
.semaforo3-medalla--1 { background: var(--rojo); }
.semaforo3-medalla--2 { background: var(--naranja); }
.semaforo3-medalla--3 { background: #C9A84C; color: #0F2238; }
.semaforo3-medalla--n {
  background: transparent;
  color: var(--gris-500);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Badges nivel */
.semaforo3-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.semaforo3-badge--critico { background: rgba(198, 40, 40, 0.12); color: var(--rojo); }
.semaforo3-badge--alto    { background: rgba(217, 119, 6, 0.12); color: var(--naranja); }
.semaforo3-badge--medio   { background: rgba(201, 168, 76, 0.18); color: #8c7426; }
.semaforo3-badge--bajo    { background: var(--gris-100); color: var(--gris-700); }
.semaforo3-badge::before { content: "●"; font-size: 0.6em; line-height: 1; }

.semaforo3-loading {
  text-align: center;
  padding: var(--space-7) !important;
  color: var(--gris-500);
}

/* Footer card */
.semaforo3-card__footer {
  background: var(--gris-100);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  border-top: 1px solid var(--gris-300);
}

.semaforo3-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: var(--blanco);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--t-fast);
}
.semaforo3-share:hover {
  background: #1ebd5a;
  transform: translateY(-1px);
  box-shadow: var(--sombra-sm);
}
.semaforo3-share__emoji { font-size: 1.1rem; line-height: 1; }

.semaforo3-actualizado {
  font-size: 0.82rem;
  color: var(--gris-700);
  font-family: 'Open Sans', monospace;
}

.semaforo3-disclaimer {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: rgba(201, 168, 76, 0.10);
  border: 1px solid rgba(201, 168, 76, 0.30);
  border-radius: 12px;
  color: #8c7426;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ═══════════════ PANEL DETALLE ═══════════════ */
.semaforo3-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
}

.semaforo3-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 34, 56, 0.55);
  backdrop-filter: blur(2px);
}

.semaforo3-panel__contenido {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--blanco);
  height: 100%;
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  /* Fix bug visual (mayo 2026): la animation se disparaba al renderizar la
     página y producía un flash blanco visible aunque el aside padre tenía
     [hidden]. Ahora la animation solo aplica cuando el panel está abierto
     (sin atributo hidden), no al primer paint. */
}

/* Animación se dispara SOLO cuando el panel está visible (sin [hidden]) */
.semaforo3-panel:not([hidden]) .semaforo3-panel__contenido {
  animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.semaforo3-panel__header {
  padding: 28px 24px;
  color: var(--blanco);
  position: relative;
}

.semaforo3-panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--blanco);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--t-fast);
}
.semaforo3-panel__close:hover { background: rgba(255, 255, 255, 0.35); }

.semaforo3-panel__titulo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.semaforo3-panel__sub {
  font-size: 0.92rem;
  opacity: 0.92;
  font-family: 'Montserrat', sans-serif;
}

.semaforo3-panel__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.semaforo3-panel__stat {
  background: rgba(255, 255, 255, 0.15);
  padding: 8px;
  border-radius: 8px;
}

.semaforo3-panel__stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.85;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  letter-spacing: .08em;
}

.semaforo3-panel__stat-value {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.1;
}

.semaforo3-panel__body { padding: 20px; }

.semaforo3-panel__body h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--azul);
  margin: 0 0 14px;
}

.semaforo3-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--gris-300);
  border-radius: 8px;
  margin-bottom: 8px;
}

.semaforo3-cat__icono {
  font-size: 1.7rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--azul-claro);
  border-radius: 8px;
  flex-shrink: 0;
}

.semaforo3-cat__nombre {
  flex: 1;
  font-size: 0.92rem;
  color: var(--gris-900);
  font-weight: 500;
}

.semaforo3-cat__bloque {
  font-size: 0.72rem;
  color: var(--gris-500);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-family: 'Montserrat', sans-serif;
}

.semaforo3-cat__count {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--azul);
  font-family: 'Playfair Display', Georgia, serif;
}

/* Reportes con foto */
.semaforo3-panel__fotos {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--gris-300);
}

.semaforo3-fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.semaforo3-foto-card {
  border: 1px solid var(--gris-300);
  border-radius: 8px;
  overflow: hidden;
  background: var(--blanco);
}

.semaforo3-foto-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--gris-100);
  overflow: hidden;
}

.semaforo3-foto-card__img-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gris-100) 25%, var(--gris-300) 50%, var(--gris-100) 75%);
  background-size: 200% 200%;
  animation: shimmer3 1.5s ease infinite;
}
.semaforo3-foto-card__img-wrap.cargada::before { display: none; }

@keyframes shimmer3 {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.semaforo3-foto-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
}
.semaforo3-foto-card__img.cargada { opacity: 1; }

.semaforo3-foto-card__info { padding: 8px; font-size: 0.74rem; }

.semaforo3-foto-card__folio {
  color: var(--gris-500);
  font-family: 'Open Sans', monospace;
  font-size: 0.65rem;
}

.semaforo3-foto-card__cat {
  font-weight: 600;
  color: var(--gris-900);
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.semaforo3-foto-card__cat-emoji { font-size: 0.95rem; }
.semaforo3-foto-card__fecha { color: var(--gris-500); font-size: 0.7rem; }

/* ═══════════════ META FOOTER ═══════════════ */
.semaforo3-meta {
  background: #0F2238;
  padding: 36px 0;
  font-size: 0.88rem;
  color: rgba(250,247,240,.6);
  text-align: center;
}
.semaforo3-meta p { margin: 0 0 8px; }
.semaforo3-meta a { color: var(--gold-bright, #E5C46A); text-decoration: underline; }
.semaforo3-meta__api code {
  background: rgba(255,255,255,.08);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Open Sans', monospace;
  font-size: 0.78rem;
  color: var(--gold-bright, #E5C46A);
}

/* ═══════════════ Mobile ═══════════════ */
@media (max-width: 700px) {
  .sm-section { padding: 50px 20px 40px; }
  .iv-value { font-size: 36px; }
  .semaforo3-table { font-size: 0.85rem; }
  .semaforo3-table th, .semaforo3-table td { padding: 10px 6px; }
  .col-cat__emoji { font-size: 1.2rem; }
  .col-cat__label { font-size: 0.6rem; }
  .semaforo3-panel__contenido { max-width: 100%; }
  .semaforo3-fotos-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════ Embed mode ═══════════════ */
body.semaforo-embed .sm-section,
body.semaforo-embed .semaforo3-meta { display: none; }
body.semaforo-embed .semaforo3-filtros-wrap { position: static; }


/* ════════════════════════════════════════════════════════════════════
   SEMÁFORO v4.1 — Vista de reportes filtrados por categoría + Lightbox
   ════════════════════════════════════════════════════════════════════ */

/* Indicador de que la categoría es clickeable */
.semaforo3-cat--clickable {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.semaforo3-cat--clickable:hover,
.semaforo3-cat--clickable:focus-visible {
  transform: translateY(-1px);
  border-color: var(--azul);
  background: linear-gradient(135deg, #fff 0%, var(--azul-claro) 100%);
  box-shadow: 0 4px 14px rgba(27, 58, 92, 0.10);
  outline: none;
}
.semaforo3-cat--clickable:active {
  transform: translateY(0);
}

.semaforo3-cat__arrow {
  font-size: 1.4rem;
  color: var(--gris-500);
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  margin-left: 4px;
  flex-shrink: 0;
  transition: transform .15s ease, color .15s ease;
}
.semaforo3-cat--clickable:hover .semaforo3-cat__arrow {
  color: var(--azul);
  transform: translateX(2px);
}

/* Botón "Volver al desglose" */
.semaforo3-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  background: var(--gris-100);
  color: var(--azul);
  border: 1px solid var(--gris-300);
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.semaforo3-back-btn:hover,
.semaforo3-back-btn:focus-visible {
  background: var(--azul-claro);
  border-color: var(--azul);
  outline: none;
}
.semaforo3-back-btn:active {
  transform: scale(0.98);
}

/* Header de la vista filtrada (emoji + nombre + count) */
.semaforo3-cat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--azul-claro) 0%, #ffffff 100%);
  border: 1px solid var(--azul-claro);
  border-radius: 12px;
}
.semaforo3-cat-header__emoji {
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blanco);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(27, 58, 92, 0.08);
  flex-shrink: 0;
}
.semaforo3-cat-header__textos {
  flex: 1;
  min-width: 0;
}
.semaforo3-cat-header__nombre {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--azul);
  line-height: 1.25;
  margin-bottom: 3px;
}
.semaforo3-cat-header__count {
  font-size: 0.82rem;
  color: var(--gris-500);
  font-weight: 600;
}

/* Estado vacío */
.semaforo3-cat-empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--gris-500);
  font-size: 0.9rem;
  background: var(--gris-100);
  border: 1px dashed var(--gris-300);
  border-radius: 12px;
}

/* Grid de cards grandes con foto + folio + descripción + fecha + estado */
.semaforo3-cat-reportes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .semaforo3-cat-reportes-grid { grid-template-columns: repeat(2, 1fr); }
}

.semaforo3-cat-reporte-card {
  background: var(--blanco);
  border: 1px solid var(--gris-300);
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.semaforo3-cat-reporte-card:hover,
.semaforo3-cat-reporte-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27, 58, 92, 0.12);
  border-color: var(--azul);
  outline: none;
}

.semaforo3-cat-reporte-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--gris-100);
  overflow: hidden;
}
.semaforo3-cat-reporte-card__img-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gris-100) 25%, var(--gris-300) 50%, var(--gris-100) 75%);
  background-size: 200% 200%;
  animation: shimmer3 1.5s ease infinite;
}
.semaforo3-cat-reporte-card__img-wrap.cargada::before { display: none; }
.semaforo3-cat-reporte-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity .3s;
}
.semaforo3-cat-reporte-card__img.cargada { opacity: 1; }

.semaforo3-cat-reporte-card__info {
  padding: 12px 14px 14px;
}
.semaforo3-cat-reporte-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
}
.semaforo3-cat-reporte-card__folio {
  font-family: 'Open Sans', monospace;
  font-size: 0.72rem;
  color: var(--gris-500);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.semaforo3-cat-reporte-card__estado {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.semaforo3-cat-reporte-card__estado--pendiente  { background: rgba(201,168,76,.18);  color: var(--dorado-texto); }
.semaforo3-cat-reporte-card__estado--en_proceso { background: var(--azul-claro);     color: var(--azul); }
.semaforo3-cat-reporte-card__estado--resuelto   { background: rgba(46,125,50,.16);   color: var(--verde-oscuro); }
.semaforo3-cat-reporte-card__estado--vencido    { background: rgba(198,40,40,.14);   color: var(--rojo-oscuro); }
.semaforo3-cat-reporte-card__estado--cerrado    { background: var(--gris-100);       color: var(--gris-500); }
.semaforo3-cat-reporte-card__estado--turnado    { background: var(--azul-claro);     color: var(--azul); }
.semaforo3-cat-reporte-card__estado--sin_respuesta { background: rgba(198,40,40,.14); color: var(--rojo-oscuro); }

.semaforo3-cat-reporte-card__desc {
  font-size: 0.88rem;
  color: var(--gris-900);
  line-height: 1.5;
  margin-bottom: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.semaforo3-cat-reporte-card__fecha {
  font-size: 0.72rem;
  color: var(--gris-500);
  font-family: 'Montserrat', sans-serif;
}

/* ───────────────────────────────────────────────────────────
   Lightbox (zoom de foto)
   ─────────────────────────────────────────────────────────── */
.semaforo3-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 34, 56, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lbFadeIn .25s ease-out;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.semaforo3-lightbox__inner {
  max-width: 1100px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--blanco);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: lbZoomIn .3s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes lbZoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.semaforo3-lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .15s ease, transform .15s ease;
}
.semaforo3-lightbox__close:hover {
  background: rgba(0,0,0,0.75);
  transform: scale(1.06);
}
.semaforo3-lightbox__img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}
.semaforo3-lightbox__caption {
  padding: 18px 22px;
  background: var(--blanco);
  border-top: 1px solid var(--gris-300);
}
.semaforo3-lightbox__top {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.semaforo3-lightbox__folio {
  font-family: 'Open Sans', monospace;
  font-size: 0.82rem;
  color: var(--gris-500);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.semaforo3-lightbox__estado {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
}
.semaforo3-lightbox__desc {
  font-size: 0.95rem;
  color: var(--gris-900);
  line-height: 1.55;
  margin-bottom: 8px;
  word-wrap: break-word;
}
.semaforo3-lightbox__meta {
  font-size: 0.78rem;
  color: var(--gris-500);
  font-family: 'Montserrat', sans-serif;
}

@media (max-width: 600px) {
  .semaforo3-lightbox { padding: 0; }
  .semaforo3-lightbox__inner { border-radius: 0; height: 100%; }
  .semaforo3-lightbox__img { max-height: 60vh; }
}
