/* =========================================================
   PORTAL FINANCIERO
   Diseño institucional - 100% local
   ========================================================= */

.pf-contenedor {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2937;
}

/* Encabezado */

.pf-encabezado {
    border-bottom: 1px solid #d9dee5;
    padding-bottom: 18px;
    margin-bottom: 25px;
}

.pf-superior {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.pf-titulo {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.pf-subtitulo {
    margin: 6px 0 0;
    color: #6b7280;
    font-size: 14px;
}

.pf-estado {
    font-size: 13px;
    color: #4b5563;
    text-align: right;
}

.pf-estado-punto {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #198754;
    border-radius: 50%;
    margin-right: 6px;
}

/* Sección */

.pf-seccion-titulo {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .4px;
    margin: 0 0 15px;
    text-transform: uppercase;
}

/* Tarjetas */

.pf-tarjetas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.pf-tarjeta {
    background: #ffffff;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    padding: 20px;
    cursor: pointer;
    transition: box-shadow .2s ease, transform .2s ease;
}

.pf-tarjeta:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(0,0,0,.08);
}

.pf-tarjeta-titulo {
    color: #687385;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.pf-tarjeta-serie {
    color: #8a929e;
    font-size: 12px;
    margin-top: 3px;
}

.pf-valor {
    font-size: 31px;
    font-weight: 600;
    margin-top: 15px;
    color: #172033;
}

.pf-unidad {
    font-size: 15px;
    font-weight: 400;
    color: #687385;
}

.pf-variacion {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
}

.pf-variacion.subida {
    color: #198754;
}

.pf-variacion.bajada {
    color: #c0392b;
}

.pf-variacion.neutral {
    color: #687385;
}

.pf-fecha {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #edf0f3;
    font-size: 12px;
    color: #6b7280;
}

.pf-fuente {
    margin-top: 5px;
    font-size: 11px;
    color: #9aa1ab;
}

/* Área de consulta */

.pf-consulta {
    background: #ffffff;
    border: 1px solid #dfe4ea;
    border-radius: 6px;
    padding: 25px;
}

.pf-consulta-barra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.pf-filtros {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pf-boton-serie {
    border: 1px solid #cfd5dc;
    background: #fff;
    color: #394150;
    border-radius: 4px;
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
}

.pf-boton-serie:hover,
.pf-boton-serie.activo {
    background: #26364a;
    color: #fff;
    border-color: #26364a;
}

.pf-periodo {
    border: 1px solid #cfd5dc;
    border-radius: 4px;
    padding: 8px 12px;
    background: #fff;
    color: #394150;
}

/* Gráfica */

.pf-grafica-contenedor {
    position: relative;
    width: 100%;
    height: 380px;
    border-top: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
    padding: 20px 0;
    box-sizing: border-box;
}

#pf-grafica {
    width: 100%;
    height: 100%;
    display: block;
}

.pf-cargando {
    text-align: center;
    padding: 50px;
    color: #6b7280;
    font-size: 14px;
}

/* Pie */

.pf-pie {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 11px;
    color: #8b939f;
}

/* Modal */

.pf-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pf-modal.visible {
    display: flex;
}

.pf-modal-contenido {
    background: #fff;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    overflow: auto;
    border-radius: 7px;
    box-shadow: 0 15px 50px rgba(0,0,0,.25);
}

.pf-modal-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
}

.pf-modal-titulo {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.pf-modal-cerrar {
    border: 0;
    background: transparent;
    font-size: 25px;
    color: #6b7280;
    cursor: pointer;
}

.pf-modal-cuerpo {
    padding: 25px;
}

/* Responsive */

@media (max-width: 800px) {

    .pf-tarjetas {
        grid-template-columns: 1fr;
    }

    .pf-superior {
        flex-direction: column;
        align-items: flex-start;
    }

    .pf-estado {
        text-align: left;
    }

    .pf-consulta-barra {
        flex-direction: column;
        align-items: flex-start;
    }

    .pf-grafica-contenedor {
        height: 300px;
    }
}