/* Dashboard CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* KPI Cards */
.kpi-section {
    margin-bottom: 40px;
}

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    border-right: 5px solid #667eea;
    transition: transform 0.3s ease;
}

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

.kpi-value {
    font-size: 2.2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.kpi-change {
    font-size: 0.9rem;
    margin-top: 8px;
}

.positive { color: #e74c3c; }
.negative { color: #27ae60; }

/* Sections */
.section {
    background: white;
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.section-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.section-content {
    padding: 30px;
}

/* Grid Layouts */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.chart-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2d3436;
}

/* Insights */
.insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.insight-card {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    padding: 20px;
    border-radius: 10px;
    border-right: 4px solid #f39c12;
}

.insight-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2d3436;
}

.insight-text {
    color: #2d3436;
    font-size: 0.95rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-right: 3px solid #74b9ff;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2d3436;
}

.stat-label {
    font-size: 0.9rem;
    color: #636e72;
    margin-top: 5px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .chart-container img {
        max-width: 100%;
        height: auto;
    }
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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