/* ============================================
   Cost Analyses - Grouped Accordion View
   ============================================ */

.analyses-group {
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.analyses-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.analyses-group-header:hover {
    background: #f3f4f6;
}

.analyses-group-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.analyses-group-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1f2937;
}

.analyses-group-latest {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.analyses-toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.analysis-card {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.analysis-card:last-child {
    border-bottom: none;
}

.analysis-latest {
    background: #fefce8;
    border-left: 4px solid #eab308;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.analysis-date {
    color: #6b7280;
    font-size: 0.875rem;
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.stat-value.waste {
    color: #ef4444;
}

.stat-value.savings {
    color: #10b981;
}

.analysis-breakdown {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
}

.analysis-breakdown strong {
    color: #1f2937;
}

/* Analysis History */
.analyses-history {
    background: #f9fafb;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

.analyses-history-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.analysis-history-item {
    background: white;
    margin: 0.75rem 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.analysis-stats-compact {
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.analysis-stats-compact div {
    display: flex;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .analyses-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .analysis-stats {
        grid-template-columns: 1fr;
    }
    
    .analysis-breakdown {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .analysis-stats-compact {
        flex-direction: column;
        gap: 0.5rem;
    }
}
