/* ============================================= */
/* ====== ESTILOS VISTA INICIO (BENTO BOX) ===== */
/* ============================================= */

#hero.inicio-view.active {
    display: block !important; 
}

.inicio-view .main-view-container {
    width: 100%;
    margin: 0 auto;
}

.inicio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 15px;
}

/* --- Filtro de Tiempo (Segmented Control) --- */
.inicio-time-filter {
    display: flex;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.inicio-time-filter input[type="radio"] { display: none; }
.inicio-time-filter label {
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

/* ========================================================= */
/* BOTONES DE FILTRO DE TIEMPO (INICIO) EN VERDE CORPORATIVO */
/* ========================================================= */
.inicio-time-filter input[type="radio"]:checked + label {
    background-color: rgb(0, 150, 136) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 150, 136, 0.3) !important;
    border-radius: 8px;
}

/* --- Termómetro de Supervivencia (Runway) --- */
.runway-indicator {
    position: absolute;
    bottom: -10px;
    right: 15px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.runway-indicator.success { color: var(--success-color); border-color: rgba(16, 185, 129, 0.3); }
.runway-indicator.warning { color: var(--warning-color); border-color: rgba(255, 193, 7, 0.3); }
.runway-indicator.danger { color: var(--danger-color); border-color: rgba(239, 68, 68, 0.3); }
.runway-indicator .lucide { width: 14px; height: 14px; }

/* --- Smart Banner --- */
.smart-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.smart-banner .banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.smart-banner .banner-content strong {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.smart-banner .banner-content p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.smart-banner.danger { border-left-color: var(--danger-color); background: rgba(220, 53, 69, 0.05); }
.smart-banner.danger .banner-icon { background: rgba(220, 53, 69, 0.1); color: var(--danger-color); }
.smart-banner.warning { border-left-color: var(--warning-color); background: rgba(255, 193, 7, 0.05); }
.smart-banner.warning .banner-icon { background: rgba(255, 193, 7, 0.1); color: var(--warning-color); }
.smart-banner.success { border-left-color: var(--success-color); background: rgba(25, 135, 84, 0.05); }
.smart-banner.success .banner-icon { background: rgba(25, 135, 84, 0.1); color: var(--success-color); }
.smart-banner.neutral { border-left-color: rgb(0, 150, 136); background: rgba(0, 150, 136, 0.05); }
.smart-banner.neutral .banner-icon { background: rgba(0, 150, 136, 0.1); color: rgb(0, 150, 136); }

/* ================================================= */
/* ============= BENTO BOX GRID LAYOUT ============= */
/* ================================================= */
.inicio-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.inicio-section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    
    /* MAGIA: Sombra elegante y profunda idéntica a Balance */
    box-shadow: 0 1px 0.5rem rgba(0, 0, 0, 0.081) !important;
    
    display: flex;
    flex-direction: column;
    
    /* REGLA ESTRICTA: Sin animaciones ni saltos */
    transition: none !important;
    transform: none !important;
}

/* Bloqueo de seguridad para evitar que cualquier hover las haga saltar */
.inicio-section-card:hover {
    transform: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.081) !important;
}

/* Asignación de espacios (Grid Spans) para PC */
.bento-chart { grid-column: span 8; }
.bento-doughnut { grid-column: span 4; }
.bento-podium { grid-column: span 4; }
.bento-savings { grid-column: span 4; }
.bento-alerts { grid-column: span 4; }
.bento-actions { grid-column: span 12; } /* Las acciones toman todo el ancho abajo */

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.2rem 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--card-border);
}

.empty-state-mini {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin: auto 0;
    padding: 1rem;
}

/* --- Gráficas --- */
.canvas-wrapper-inicio {
    position: relative;
    flex-grow: 1;
    min-height: 220px;
    width: 100%;
}

/* --- Podio de Campeones --- */
.podium-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.podium-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--input-bg);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.podium-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.podium-info .medal { font-size: 1.2rem; }
.podium-name { font-weight: 700; color: var(--text-primary); font-size: 0.95rem; }
.podium-amount { font-weight: 800; color: var(--success-color); }

/* --- Tus Sueños (Reservas) --- */
.savings-mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.savings-mini-item {
    background: rgba(0, 150, 136, 0.04);
    border: 1px solid rgba(0, 150, 136, 0.2);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.savings-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

.savings-mini-title { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); text-transform: uppercase;}
.savings-mini-pct { font-weight: 800; color: rgb(0, 150, 136); font-size: 1rem; }
.savings-mini-footer { font-size: 0.75rem; color: var(--text-secondary); margin-top: 8px; text-align: right; }

/* --- Alertas --- */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 5px;
    flex-grow: 1;
}

.alert-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.alert-list { display: flex; flex-direction: column; gap: 8px; }

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
}

.alert-info { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.alert-info .lucide { width: 16px; color: var(--text-secondary); flex-shrink: 0;}
.alert-item-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px;}

.alert-values { text-align: right; flex-shrink: 0; }
.alert-values .stat-value { font-size: 0.9rem; display: block; }
.alert-reason { font-size: 0.7rem; font-weight: 700; }
.alert-reason.danger { color: var(--danger-color); }
.alert-reason.warning { color: var(--warning-color); }

.alert-item.danger-alert { border-left: 3px solid var(--danger-color); }
.alert-item.warning-alert { border-left: 3px solid var(--warning-color); }

/* --- Acciones Rápidas --- */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 Columnas por defecto en PC */
    gap: 1rem;
    flex-grow: 1;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1.2rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.quick-action-btn.action-income { border-top: 3px solid var(--success-color); }
.quick-action-btn.action-income .lucide { color: var(--success-color); width: 24px; height: 24px; }
.quick-action-btn.action-expense { border-top: 3px solid var(--danger-color); }
.quick-action-btn.action-expense .lucide { color: var(--danger-color); width: 24px; height: 24px; }
.quick-action-btn.action-agenda { border-top: 3px solid rgb(0, 150, 136); }
.quick-action-btn.action-agenda .lucide { color: rgb(0, 150, 136); width: 24px; height: 24px; }
.quick-action-btn.action-inventory { border-top: 3px solid var(--primary-color); }
.quick-action-btn.action-inventory .lucide { color: var(--primary-color); width: 24px; height: 24px; }

/* ========================================= */
/* =========== RESPONSIVE DESIGN =========== */
/* ========================================= */
@media (max-width: 1100px) {
    .bento-chart { grid-column: span 12; }
    .bento-doughnut { grid-column: span 12; }
    .bento-podium { grid-column: span 6; }
    .bento-savings { grid-column: span 6; }
    .bento-alerts { grid-column: span 12; }
    .bento-actions { grid-column: span 12; }
}

@media (max-width: 768px) {
    .inicio-header { flex-direction: column; align-items: flex-start; }
    .inicio-time-filter { width: 100%; justify-content: space-between; }
    .inicio-time-filter label { text-align: center; flex-grow: 1; }
    
    .runway-indicator { position: relative; bottom: 0; right: 0; margin-top: 10px; justify-content: center; }
    
    .bento-chart, .bento-doughnut, .bento-podium, .bento-savings, .bento-alerts, .bento-actions {
        grid-column: span 12;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr); /* En móvil pasan a 2 columnas */
    }
    
    /* Reordenar en móvil por importancia */
    .bento-actions { order: 1; }
    .bento-alerts { order: 2; }
    .bento-chart { order: 3; }
    .bento-doughnut { order: 4; }
    .bento-podium { order: 5; }
    .bento-savings { order: 6; }
}

/* ========================================================= */
/* SALUDO DINÁMICO: COLOR COMPLEMENTARIO LLAMATIVO (CORAL/ÁMBAR) */
/* ========================================================= */
#inicio-greeting-title {
    background: linear-gradient(90deg, #ff6b6b, #f59e0b) !important; /* Degradado de Coral a Ámbar */
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    text-shadow: 0px 4px 15px rgba(245, 158, 11, 0.25); /* Un resplandor muy sutil */
    display: inline-block; /* Necesario para que el degradado no se estire de más */
}

/* ========================================================= */
/* SOMBRAS ESTATICAS PARA LOS KPIS SUPERIORES (SIN ANIMACIÓN)*/
/* ========================================================= */
.inicio-kpi-container .daily-stat-card {
    box-shadow: 0 1px 0.5rem rgba(0, 0, 0, 0.081) !important;
    transition: none !important;
    transform: none !important;
}

.inicio-kpi-container .daily-stat-card:hover {
    transform: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.081) !important;
}