/* Pagina de inicio. Salio del <style> en linea de paginas/inicio.html. */

/* ══════════════════════════════════════════════════════════════
   INDICADORES — desplazamiento automático tipo ticker
   ══════════════════════════════════════════════════════════════ */
.usp-ind-outer {
    overflow: hidden;
    width: 100%;
    position: relative;
}
.usp-ind-track {
    display: flex;
    gap: 14px;
    animation: usp-scroll-ind 28s linear infinite;
    width: max-content;
}
.usp-ind-outer:hover .usp-ind-track {
    animation-play-state: paused;
}
@keyframes usp-scroll-ind {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.usp-ind-card {
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    padding: 14px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    min-width: 220px;
    max-width: 220px;
    flex-shrink: 0;
}
.usp-ind-card .ind-titulo {
    font-size: 11px;
    font-weight: 700;
    color: #002265;
    text-transform: uppercase;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
    min-height: 28px;
}
.usp-ind-card .ind-valor {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 6px 0 4px 0;
    word-break: break-word;
}
.usp-ind-card .ind-unidad    { font-size: 13px; font-weight: 400; color: #555; }
.usp-ind-card .ind-variacion { font-size: 12px; font-weight: 600; }
.usp-ind-card .ind-periodo   { color: #777; font-weight: 400; }

/* ══════════════════════════════════════════════════════════════
   TABLERO DE PRECIOS
   ══════════════════════════════════════════════════════════════ */
.usp-tablero {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,.07);
    margin-top: 20px;
}
.usp-tablero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.usp-mes-label   { font-weight: 800; color: #002265; font-size: 20px; }
.usp-slider-hint { font-size: 13px; color: #888; }

/* Slider con ventana deslizante y botones laterales */
.usp-slider-controles {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}
.usp-slider-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #002265;
    background: #fff;
    color: #002265;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    margin-top: 2px;
}
.usp-slider-btn:hover    { background: #002265; color: #fff; }
.usp-slider-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.usp-slider-inner {
    flex: 1;
    position: relative;
    padding-bottom: 38px;
}
#filtro-mes {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #d0d8ea;
    outline: none;
    cursor: pointer;
}
#filtro-mes::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #002265;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #002265;
    cursor: pointer;
}
#filtro-mes::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #002265;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #002265;
    cursor: pointer;
}
#slider-marcas {
    display: flex;
    justify-content: space-between;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin-top: 4px;
}
#slider-marcas span {
    font-size: 9px;
    color: #555;
    text-align: center;
    flex: 1;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#slider-marcas span .marca-mes {
    font-size: 9px;
    color: #555;
}
#slider-marcas span .marca-anio {
    font-size: 9px;
    font-weight: 700;
    color: #002265;
    border-top: 2px solid #002265;
    padding-top: 1px;
    margin-top: 1px;
    min-width: 100%;
    text-align: center;
}
#slider-marcas span.activa .marca-mes {
    color: #002265;
    font-weight: 800;
}

/* KPIs */
.usp-kpi {
    background: #f7f9fc;
    border-left: 4px solid #002265;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.usp-kpi .kpi-label {
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .4px;
}
.usp-kpi .kpi-valor {
    font-size: 22px;
    font-weight: 800;
    color: #002265;
    line-height: 1.2;
}
.usp-kpi.kpi-amarillo { border-left-color: #ffc107; }
.usp-kpi.kpi-verde    { border-left-color: #28a745; }
.usp-kpi.kpi-rojo     { border-left-color: #dc3545; }

/* ══════════════════════════════════════════════════════════════
   CALENDARIO ALMANAQUE
   ══════════════════════════════════════════════════════════════ */
.usp-cal-wrap { max-width: 820px; margin: 0 auto; }
.usp-cal-nav  {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.usp-cal-titulo {
    font-weight: 800;
    color: #002265;
    font-size: 20px;
    margin: 0;
}
.usp-cal-grid-dow,
.usp-cal-grid-dias {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.usp-cal-dow {
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    color: #002265;
    padding: 6px 0;
    background: #f0f4ff;
    border-radius: 4px;
}
.usp-cal-day {
    min-height: 72px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 4px 5px;
    background: #fff;
    overflow: hidden;
}
.usp-cal-day.vacio { background: transparent; border-color: transparent; }
.usp-cal-day.hoy   { background: #002265; color: #fff; border-color: #002265; }
.usp-cal-num { font-weight: 700; font-size: 13px; margin-bottom: 2px; }

/* Chip individual por evento */
.usp-ev-chip {
    display: block;
    font-size: 9px;
    line-height: 1.2;
    border-radius: 3px;
    padding: 2px 4px;
    margin-top: 2px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: filter .15s;
}
.usp-ev-chip:hover            { filter: brightness(0.88); }
.usp-cal-day.hoy .usp-ev-chip { opacity: 0.95; }

/* ══════════════════════════════════════════════════════════════
   LABORATORIOS — layout mapa izquierda + texto derecha
   ══════════════════════════════════════════════════════════════ */
.usp-lab-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin: 16px 0;
}
.usp-lab-mapa {
    flex: 0 0 50%;
    max-width: 50%;
}
.usp-lab-mapa #mapa-laboratorios {
    height: 640px;
    width: 100%;
    border-radius: 10px;
    margin: 0;
    z-index: 1;
}
.usp-lab-texto {
    flex: 1;
    padding: 8px 4px;
}
.usp-lab-texto p {
    text-align: justify;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.85);
    line-height: 1.6;
    margin-bottom: 14px;
}

/* Responsive: apila en pantallas pequeñas */
@media (max-width: 767px) {
    .usp-lab-layout      { flex-direction: column; }
    .usp-lab-mapa        { flex: 0 0 100%; max-width: 100%; }
    .usp-lab-mapa #mapa-laboratorios { height: 340px; }
}

/* ══════════════════════════════════════════════════════════════
   FICHA OE171
   ══════════════════════════════════════════════════════════════ */
.ficha-oe171 {
    font-size: 13px;
    color: #555;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e5;
}
.ficha-oe171 a { font-weight: 700; color: #002265; text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   CLASES QUE ANTES ERAN style="" EN LA PLANTILLA O EN inicio.js
   ══════════════════════════════════════════════════════════════ */
.ini-bloque            { margin: 20px; }
.ini-bloque-vertical   { margin: 20px 0; }
.ini-centro            { text-align: center; }
.ini-negrita           { font-weight: bold; }
.ini-sangria-1         { margin-left: 20px; }
.ini-sangria-2         { margin-left: 40px; }
.ini-mt-0              { margin-top: 0; }
.ini-mt-8              { margin-top: 8px; }

.ini-titulo,
.ini-subtitulo,
.ini-parrafo,
.ini-lista,
.ini-tabla,
.ini-tablero-titulo    { font-family: var(--usp-fuente-texto); }

.ini-titulo            { font-weight: bold; font-size: 24px; color: var(--usp-texto); }
.ini-subtitulo         { font-weight: bold; font-size: 20px; color: var(--usp-texto); }
.ini-parrafo           { text-align: justify; font-size: 20px; color: var(--usp-texto); }
.ini-lista             { margin-left: 40px; font-size: 20px; color: var(--usp-texto); }

.ini-tablero-encabezado { text-align: center; margin-bottom: 16px; }
.ini-tablero-titulo    { font-weight: bold; font-size: 22px; color: var(--usp-azul); margin: 0; }
.ini-grafico           { position: relative; height: 300px; }
.ini-pista             { display: flex; justify-content: flex-end; margin-top: 20px; margin-bottom: 4px; }
.ini-nota              { font-size: 12px; color: #555; margin-top: 4px; }
.usp-kpi .ini-kpi-chico { font-size: 17px; }

/* Bootstrap 5.3 pinta el fondo en cada celda (--bs-table-bg), no en la fila:
   el color va en las celdas o quedaria texto blanco sobre fondo blanco. */
.ini-tabla-cabeza th {
    --bs-table-bg: var(--usp-azul);
    --bs-table-color: #fff;
    background-color: var(--usp-azul);
    color: #fff;
}

/* Parrafos que arma inicio.js desde textos.json */
.usp-texto {
    text-align: justify;
    font-family: var(--usp-fuente-texto);
    font-size: 20px;
    color: var(--usp-texto);
    margin-bottom: 20px;
}
.usp-texto--vineta { margin-bottom: 8px; }

.usp-lab-texto p.usp-texto-lateral {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 16px;
}
.usp-lab-texto p.usp-texto-lateral--unico { margin-bottom: 0; }

/* Variacion de los indicadores */
.ind-variacion--estable { color: #6c757d; }
.ind-variacion--subida  { color: #28a745; }
.ind-variacion--bajada  { color: #dc3545; }

/* Reproductor de YouTube */
.usp-video {
    display: block;
    width: 100%;
    height: 360px;
    border: 0;
    border-radius: 8px;
    margin-top: 15px;
}
