/* Contenedor principal */
.if-container {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 16px;
    color: #222;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Mensaje de carga */
.if-loading {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
}

/* Mensaje de error */
.if-error {
    color: #dc3545;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #dc3545;
    border-radius: 4px;
    background-color: #f8d7da;
}

/* Contenido principal */
.if-content {
    display: none;
}

/* Categoría */
.if-category {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.if-category-title {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 0.5em;
    margin: 0;
    padding: 15px 20px;
   background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.if-category-units {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 14px;
    color: #6c757d;
    padding: 10px 20px;
    /*background: #e9ecef; 
    border-bottom: 1px solid #dee2e6; */
}

/* Tabla */
.if-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.if-table th {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-weight: 700;
    font-size: 17px;
    color: #222;
    background: #f8f9fa;
    padding: 14px 18px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

.if-table td {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-size: 16px;
    color: #222;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.if-table tr:last-child td {
    border-bottom: none;
}

.if-indicator-name {
    font-weight: 600;
    font-size: 16px;
}

.if-indicator-value {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-weight: 700;
    font-size: 16px;
    color: #222;
}

.if-indicator-change, .if-indicator-percent {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif !important;
    font-weight: 600;
    font-size: 16px;
}

.if-up {
    color: #28a745 !important;
}

.if-down {
    color: #dc3545 !important;
}

.if-neutral {
    color: #6c757d !important;
}

.if-indicator-chart {
    text-align: center;
}

.if-chart-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.if-chart-btn:hover {
    background: #f1f3f4;
}

.if-chart-btn svg {
    vertical-align: middle;
}

/* Modal del gráfico */
.if-chart-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.35);
    justify-content: center;
    align-items: center;
}

.if-chart-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 24px 24px 12px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    position: relative;
    min-width: 340px;
    max-width: 95vw;
}

.if-chart-modal-close {
    position: absolute;
    top: 10px; right: 18px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}

.if-chart-modal-close:hover {
    color: #dc3545;
}

@media (max-width: 768px) {
    .if-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .if-table thead, .if-table tbody {
        display: table-header-group;
    }
    .if-table tr {
        display: table-row;
    }
    .if-table th, .if-table td {
        font-size: 13px;
        padding: 8px 6px;
        white-space: nowrap;
        min-width: 110px;
        box-sizing: border-box;
    }
    .if-category-title {
        font-size: 16px;
    }
    .if-category-units {
        font-size: 12px;
    }
}

/* Estilos para mensajes de error y notificación */
.error {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.notice {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    color: #664d03;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.download-buttons {
    margin-top: 20px;
    text-align: center;
}

.download-buttons a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-pdf {
    background-color: #dc3545;
}

.download-buttons a:hover {
    opacity: 0.9;
}

.fuente-nota {
    text-align: center;
    font-size: 0.8em;
    color: #6c757d;
    margin-top: 20px;
}

/* Estilos para valores numéricos */
.indicator-table td[data-label="Último Valor"],
.indicator-table td[data-label="Cambio Abs."],
.indicator-table td[data-label="Variación %"] {
    font-family: 'Roboto Mono', monospace;
    text-align: right;
}

/* Estilos para la tabla responsive */
@media (max-width: 600px) {
    .if-table th, .if-table td {
        font-size: 11px;
        padding: 5px 3px;
        text-align: center;
    }
    .if-table th {
        font-weight: 700;
    }
    .if-category-title {
        font-size: 14px;
    }
    .if-category-units {
        font-size: 10px;
    }
}

.if-table tbody tr:nth-child(even) {
    background: #f7f8fa;
}

.indicadores-financieros-resumen {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 20px 0;
}

.indicadores-financieros-resumen .categoria {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.indicadores-financieros-resumen h3 {
    margin: 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 1.1em;
    color: #495057;
}

.tabla-indicadores {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.tabla-indicadores th,
.tabla-indicadores td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.tabla-indicadores th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.tabla-indicadores tr:last-child td {
    border-bottom: none;
}

.tabla-indicadores .valor {
    font-weight: 600;
    color: #212529;
}

.tabla-indicadores .cambio,
.tabla-indicadores .porcentaje {
    font-weight: 600;
}

.tabla-indicadores .positivo {
    color: #28a745;
}

.tabla-indicadores .negativo {
    color: #dc3545;
}

.tabla-indicadores .fecha {
    color: #6c757d;
    font-size: 0.85em;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .tabla-indicadores {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .tabla-indicadores th,
    .tabla-indicadores td {
        padding: 8px 10px;
    }
}

/* Estilos para mensajes de error y notificación */
.indicadores-financieros-resumen .error,
.indicadores-financieros-resumen .notice {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.9em;
}

.indicadores-financieros-resumen .error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.indicadores-financieros-resumen .notice {
    background-color: #e2e3e5;
    border: 1px solid #d6d8db;
    color: #383d41;
}

.if-arrow {
    font-size: 1.6em;
    font-weight: 900;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
    line-height: 1;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}
.if-num {
    font-size: 1em;
    font-weight: 600;
    vertical-align: middle;
}

/* --- Alineación de título y unidad en la cabecera de la categoría --- */
.categoria-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5em;
    padding: 15px 20px 0 0px;
}
.categoria-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #495057;
    font-weight: 600;
    background: transparent;
    padding: 10px 20px;
    border-bottom: 0px;
    text-align:left;

}
.if-category-units {
    font-size: 0.95em;
    color: #6c757d;
    font-style: italic;
    white-space: nowrap;
    text-align: right;
    margin-left: 20px;
}

/* Efecto hover para valores positivos y negativos en la tabla de indicadores */
.tabla-indicadores tbody tr:hover .positivo {
    color: #218838;
}
.tabla-indicadores tbody tr:hover .negativo {
    color: #c82333;
} 

/* Efecto hover más notorio para la fila completa */
.tabla-indicadores tbody tr:hover {
    background-color: #e2f0d9; /* Un verde muy claro, puedes ajustar el color si prefieres otro tono */
    transition: background 0.2s;
} 

.hora-actualizacion {
    color: #000;
    font-weight: bold;
    font-size: 1em;
    letter-spacing: 1px;
    margin-left: 4px;
} 