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

:root {
    --primary-color: #4F46E5;
    --secondary-color: #7C3AED;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left i {
    font-size: 48px;
    opacity: 0.9;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); }
.stat-icon.green { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-subtext {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Heebo', sans-serif;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Chart Cards */
.chart-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.chart-header {
    margin-bottom: 24px;
}

.chart-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.chart-header i {
    color: var(--primary-color);
}

.chart-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.chart-container {
    position: relative;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Daily Selector */
.daily-selector {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.daily-selector label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-selector select {
    flex: 1;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Heebo', sans-serif;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.daily-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Daily Summary */
.daily-summary {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    color: white;
}

.summary-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 16px;
}

.summary-stat-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.summary-stat-value {
    font-size: 28px;
    font-weight: 700;
}

/* Tables */
.daily-table-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.daily-table-container h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--bg-color);
}

.data-table th {
    padding: 14px 12px;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

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

.insight-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.insight-header i {
    font-size: 24px;
    color: var(--primary-color);
}

.insight-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.insight-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.insight-item {
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 10px;
}

.insight-item:last-child {
    margin-bottom: 0;
}

.insight-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Recommendations */
.recommendations-card {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.recommendations-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: #92400E;
}

.recommendations-header i {
    font-size: 28px;
}

.recommendations-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.recommendations-content {
    color: #78350F;
}

.recommendation-item {
    background: white;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    border-right: 4px solid #F59E0B;
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: #92400E;
}

.recommendation-text {
    font-size: 14px;
    line-height: 1.6;
}

/* Activity Timeline */
.activity-timeline {
    padding: 20px 0;
}

.timeline-day {
    margin-bottom: 32px;
}

.timeline-day-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 8px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 10px;
    position: relative;
    padding-right: 48px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-time {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 100px;
    font-size: 15px;
}

.timeline-details {
    flex: 1;
}

.timeline-activity {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .stat-value {
        font-size: 24px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading i {
    font-size: 48px;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}