:root{
  --aa-accent: rgba(120, 76, 170, .90);
  --aa-text: #4b2c68;
  --aa-muted: rgba(0,0,0,.55);
  --aa-circ: 327; /* ~2π*52 (r=52 en el SVG) */
  --aa-dur: 0.85s; /* prueba 0.85s, si lo quieres más lento 1s */
}

/* =========================
   GRID (contenedor de tiles)
========================= */
.aa-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
@media (max-width: 992px){
  .aa-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px){
  .aa-grid{ grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

/* =========================
   TILE (cada apartado clickeable)
========================= */
.aa-tile{
  display:block;
  text-decoration:none;
  text-align:center;
  padding: 10px 8px 6px;
  border-radius: 16px;
  transition: transform .12s ease;
}
.aa-tile:hover{
  transform: translateY(-2px);
}

/* =========================
   WRAP del icono (caja 130x130)
   Aquí viven: PNG + ring SVG + órbita
========================= */
.aa-iconWrap{
  width: 130px;
  height: 130px;
  margin: 0 auto 10px;
  position: relative;
  display: grid;
  place-items: center;
}

/* PNG del icono */
.aa-icon{
  width: 74px;
  height: 74px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

/* =========================
   RING SVG (círculo que se dibuja)
========================= */
.aa-ring{
  position:absolute;
  inset: 0;
  width:130px;
  height:130px;
  display:block;
  transform: rotate(-90deg);  /* empieza a dibujar desde arriba */
  pointer-events:none;        /* no bloquea hover */
  z-index: 10;

  opacity: 0;                 /* apagado al inicio */
  transition: opacity .12s ease;
}

.aa-ringCircle{
  fill: none;
  stroke: var(--aa-accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: var(--aa-circ);
  stroke-dashoffset: var(--aa-circ); /* oculto al inicio */
  opacity: 1;
}

/* =========================
   ORBIT (estrella que gira)
========================= */
.aa-orbit{
  position:absolute;
  inset:0;
  width:130px;
  height:130px;
  z-index: 11;
  display:grid;
  place-items: start center;
  pointer-events:none;

  opacity:0;
  transform: rotate(0deg);
}

/* Estrella */
.aa-star{
  position: relative; /* necesario para la estela (::after) */
  font-size: 18px;
  line-height: 1;
  color: var(--aa-accent);
  transform: translateY(-4px);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.12));
  text-shadow:
    0 0 6px rgba(120, 76, 170, .55),
    0 0 12px rgba(120, 76, 170, .35);
}

/* Estela (cola de cometa) */
.aa-star::after{
  content:"";
  position:absolute;
  left: 50%;
  top: 50%;
  width: 10px;      /* largo de la estela */
  height: 4px;      /* grosor (te faltaba esta propiedad) */
  transform: translate(-100%, -50%); /* se extiende hacia atrás */
  background: linear-gradient(90deg,
    rgba(120, 76, 170, 0),
    rgba(120, 76, 170, .65)
  );
  border-radius: 999px;
  filter: blur(.3px);
  opacity: .9;
  pointer-events:none;
}

/* =========================
   HOVER: activar animaciones
   + fallback .is-hover (por si lo usas con JS)
========================= */
a.aa-tile:hover .aa-ring,
.aa-tile.is-hover .aa-ring{
  opacity: 1;
}

/* círculo: dibuja y DESAPARECE al final */
a.aa-tile:hover .aa-ringCircle,
.aa-tile.is-hover .aa-ringCircle{
  /*animation: aa-draw-fade .65s ease forwards;*/
  animation: aa-draw-fade var(--aa-dur) linear forwards;
}

/* estrella: gira */
a.aa-tile:hover .aa-orbit,
.aa-tile.is-hover .aa-orbit{
  opacity:1;
  /*animation: aa-spin .65s linear forwards;*/
  animation: aa-spin var(--aa-dur) linear forwards;
}

/* Dibuja el trazo y al final se desvanece */
@keyframes aa-draw-fade{
  0%{
    stroke-dashoffset: var(--aa-circ);
    opacity: 1;
  }
  95%{
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100%{
    stroke-dashoffset: 0;
    opacity: 0; /* desaparece al terminar */
  }
}

/* Vuelta de la estrella */
@keyframes aa-spin{
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =========================
   TITLES / SUBTITLE tablas
========================= */
.aa-title{
  display:block;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--aa-text);
  text-transform: uppercase;
  font-size: 16px;
}
.aa-subtitle{
  color: var(--aa-muted);
  font-size: 13px;
}
/* =====================================
   AJUSTE PARA TABLA APILADA (MÓVIL)
===================================== */
@media only screen and (max-width: 768px) {
    /* Forzamos el modelo de caja para que el padding no sume al ancho total */
    table, thead, tbody, th, td, tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    thead {
        display: none !important;
    }

    tr {
        margin-bottom: 20px !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 8px !important;
        padding: 15px !important;
        background: #fff !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
        height: auto !important; /* El recuadro crece según el contenido */
    }

    td {
        border: none !important;
        padding: 8px 0 !important;
        text-align: left !important;
        
        /* --- SOLUCIÓN AL DESBORDE DE TEXTO --- */
        white-space: normal !important;      /* Permite saltos de línea */
        word-wrap: break-word !important;    /* Rompe palabras largas si es necesario */
        overflow-wrap: break-word !important; 
        overflow: hidden !important;         /* Asegura que nada salga del límite */
    }

    /* Línea divisoria opcional para separar datos dentro de la tarjeta */
    td:not(:last-child) {
        border-bottom: 1px solid #f0f0f0 !important;
        margin-bottom: 5px;
    }
}

/* =========================
   ACCESIBILIDAD (Original)
========================= */
@media (prefers-reduced-motion: reduce){
  .aa-tile{ transition:none; }
  .aa-ring{ opacity:1; transition:none; }
  .aa-ringCircle{ stroke-dashoffset: 0; opacity: 1; animation:none; }
  .aa-orbit{ opacity:1; animation:none; }
}

.btn-floating i.bi {
    font-size: 1.2rem;
    line-height: 40px; 
    display: block;
}

table.highlight tbody tr:hover {
    background-color: rgba(127, 38, 83, 0.05) !important;
}


/*Graficas*/
/* Tarjetas de Estadísticas */
.stat-card {
    border-radius: 12px !important;
    overflow: visible !important; /* Para que el badge sobresalga */
    margin-top: 30px;
    border: 1px solid rgba(0,0,0,0.05);
}

.year-badge {
    position: absolute;
    top: -20px;
    left: 20px;
    background: linear-gradient(135deg, #7F2653, #b33975);
    color: white;
    padding: 5px 25px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(127, 38, 83, 0.3);
    z-index: 2;
}

.secondary-badge {
    background: linear-gradient(135deg, #6F4E83, #8e68a6) !important;
}

.stat-card .card-content {
    padding-top: 35px !important;
}

.stat-actions {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.action-link {
    color: #7F2653 !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.action-link i {
    margin-right: 8px;
    vertical-align: middle;
}

/* Responsividad para botones en móvil */
@media (max-width: 600px) {
    .stat-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .stat-actions .btn, .stat-actions .btn-flat {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
}
/* imagenes de infografias zoom */
  .gallery-container {
    display: flex;
    flex-wrap: wrap;         
    justify-content: center; 
    gap: 20px;               
    max-width: 1000px;      
    margin: 0 auto;          
}

.image-wrapper {
    flex: 0 1 calc(31% - 10px); 
    min-width: 250px; 
}

.zoom-trigger {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    cursor: zoom-in;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zoom-trigger:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}


.modal {
    display: none; 
    position: fixed;   
    inset: 0;          
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.98);
    z-index: 999999 !important;
    
  
    display: none; 
    justify-content: center;
    align-items: center;
}

/* La imagen expandida */
.modal-content {
    max-width: 95%;   
    max-height: 70vh; /
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoom-in 0.3s ease-out;
}


.close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-size: 60px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    z-index: 1000000;
}

@keyframes zoom-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Tamaño personalizado para el modal */
#modal-info {
    max-width: 500px;
    border-radius: 15px;
    overflow-y: visible; /* Para que la X pueda sobresalir un poco si quieres */
}

/* Posicionamiento de la X de cerrar */
.btn-close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #4a148c; /* Tu color morado */
    cursor: pointer;
    z-index: 1000;
}

.btn-close-modal i {
    font-size: 28px;
}

/* Ajuste del contenido para que no choque con la X */
#modal-info .modal-content {
    padding-top: 10px;
}