/* ==================== ANALYTICS PAGE STYLES ==================== */

/* Quick Insights Cards */
.analytics-quick-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* Analytics Cards Responsive */
#analytics .settings-card {
    margin-bottom: 16px;
}

#analytics .settings-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

/* Prediction Card Grid - Mobile */
@media (max-width: 480px) {
    #analytics .settings-card > div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: 1fr !important;
    }
    
    #analytics .settings-card > div[style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Prediction card inner grid */
    #analytics .settings-card[style*="linear-gradient"] > div:last-child {
        grid-template-columns: 1fr !important;
    }
}

/* Month Summary Grid */
@media (max-width: 400px) {
    #analytics .stat-card {
        padding: 12px !important;
    }
    
    #analytics .stat-card > div:nth-child(2) {
        font-size: 18px !important;
    }
}

/* Top Performers Grid */
@media (max-width: 480px) {
    #analytics div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* Customer Insights Grid */
@media (max-width: 380px) {
    #analytics div[style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Profit Trend Summary */
#profitTrendSummary {
    overflow-x: auto;
}

@media (max-width: 480px) {
    #profitTrendSummary > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Rate Trends Items */
#rateTrendsContainer > div {
    transition: transform 0.2s ease;
}

#rateTrendsContainer > div:active {
    transform: scale(0.98);
}

/* Items to Focus */
#itemsToFocus > div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#itemsToFocus > div:hover {
    transform: translateX(4px);
}

/* Smart Suggestions Card */
#smartSuggestions > div:last-child {
    border-bottom: none !important;
}

/* Scrollable Charts */
#profitTrendChart {
    -webkit-overflow-scrolling: touch;
}

#profitTrendChart::-webkit-scrollbar {
    height: 4px;
}

#profitTrendChart::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

#profitTrendChart::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* Page Header */
#analytics .page-header {
    text-align: center;
    padding: 8px 0;
}

/* Filter Buttons in Analytics */
#analytics .filter-btn {
    font-size: 11px;
    padding: 6px 10px;
}

/* Outstanding Dues Cards */
#analytics .stat-card[style*="border-left: 4px"] {
    transition: transform 0.2s ease;
}

#analytics .stat-card[style*="border-left: 4px"]:active {
    transform: scale(0.98);
}

/* Loading State */
#analytics .loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Empty State */
#analytics .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Projection Cards Animation */
#analytics .stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#analytics .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
