/* Company Analytics Dashboard Styles */
.company-analytics {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    margin: 2rem 0;
    border-radius: 16px;
}

.analytics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.analytics-header {
    text-align: center;
    margin-bottom: 3rem;
}

.analytics-header h2 {
    color: #1e293b;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.analytics-header p {
    color: #64748b;
    font-size: 1.1rem;
    margin: 0;
}

/* Customer Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.metric-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 4px solid #3b82f6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.metric-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.metric-label {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.metric-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-change.positive {
    color: #10b981;
}

.metric-change.negative {
    color: #ef4444;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.chart-subtitle {
    color: #64748b;
    font-size: 0.875rem;
}

.chart-canvas {
    width: 100%;
    height: 300px;
    position: relative;
}

/* Customer Growth Chart */
.growth-chart {
    grid-column: span 2;
}

/* Revenue Chart */
.revenue-chart {
    grid-column: span 2;
}

/* Customer Demographics */
.demographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.demographic-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.demographic-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.demographic-label {
    font-size: 0.875rem;
    color: #64748b;
}

.demographic-value {
    margin-left: auto;
    font-weight: 600;
    color: #1e293b;
}

/* Customer Types */
.customer-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.customer-type {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    text-align: center;
}

.customer-type-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.customer-type-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.customer-type-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
}

.customer-type-desc {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analytics-container {
        padding: 0 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .growth-chart,
    .revenue-chart {
        grid-column: span 1;
    }
    
    .analytics-header h2 {
        font-size: 2rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
