<?php $__env->startSection('title', $isMyTasks ? 'My Tasks' : 'Dashboard'); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <span style="font-weight:600;color:var(--text-primary);"><?php echo e($isMyTasks ? 'My Tasks' : 'Home'); ?></span>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    
    <div style="margin-bottom:28px;">
        <?php if($isMyTasks): ?>
            <h1 style="font-size:1.6rem;font-weight:700;margin-bottom:4px;">My Tasks</h1>
            <p class="text-muted">All tasks assigned to you across projects.</p>
        <?php else: ?>
            <h1 style="font-size:1.6rem;font-weight:700;margin-bottom:4px;">Good <?php echo e(now()->hour < 12 ? 'morning' : (now()->hour < 17 ? 'afternoon' : 'evening')); ?>, <?php echo e(explode(' ', auth()->user()->name)[0]); ?> 👋</h1>
            <p class="text-muted">Here's what's happening with your projects today.</p>
        <?php endif; ?>
    </div>

    
    <div class="grid grid-4 mb-6">
        <div class="stat-card">
            <div class="stat-card-header">
                <div class="stat-card-icon" style="background:rgba(99,102,241,0.15);color:var(--accent-primary);">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:20px;height:20px;"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>
                </div>
            </div>
            <div class="stat-card-value" style="color:var(--accent-primary);"><?php echo e($stats['total_tasks']); ?></div>
            <div class="stat-card-label">Total Tasks</div>
        </div>
        <div class="stat-card">
            <div class="stat-card-header">
                <div class="stat-card-icon" style="background:rgba(34,197,94,0.15);color:var(--accent-green);">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:20px;height:20px;"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>
                </div>
            </div>
            <div class="stat-card-value" style="color:var(--accent-green);"><?php echo e($stats['completed_tasks']); ?></div>
            <div class="stat-card-label">Completed</div>
        </div>
        <div class="stat-card">
            <div class="stat-card-header">
                <div class="stat-card-icon" style="background:rgba(239,68,68,0.15);color:var(--accent-red);">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:20px;height:20px;"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
                </div>
            </div>
            <div class="stat-card-value" style="color:var(--accent-red);"><?php echo e($stats['overdue_tasks']); ?></div>
            <div class="stat-card-label">Overdue</div>
        </div>
        <div class="stat-card">
            <div class="stat-card-header">
                <div class="stat-card-icon" style="background:rgba(236,72,153,0.15);color:var(--accent-pink);">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:20px;height:20px;"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>
                </div>
            </div>
            <div class="stat-card-value" style="color:var(--accent-pink);"><?php echo e($stats['active_projects']); ?></div>
            <div class="stat-card-label">Active Projects</div>
        </div>
    </div>

    <?php if($isMyTasks): ?>
    

    
    <?php if($overdueTasks->count() > 0): ?>
    <div class="card mb-4">
        <div class="card-header">
            <h3 class="card-header-title" style="color:var(--accent-red);">⚠️ Overdue</h3>
            <span class="badge badge-danger"><?php echo e($overdueTasks->count()); ?></span>
        </div>
        <div>
            <?php $__currentLoopData = $overdueTasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="task-item" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                    <div class="task-checkbox"></div>
                    <div class="task-info">
                        <div class="task-title"><?php echo e($task->title); ?></div>
                        <div class="task-meta">
                            <span class="task-meta-item"><?php echo e($task->project->name ?? ''); ?></span>
                            <span class="task-meta-item overdue">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                                <?php echo e($task->due_date->format('M j')); ?> — overdue
                            </span>
                        </div>
                    </div>
                    <div class="task-right">
                        <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
    <?php endif; ?>

    
    <div class="card mb-4">
        <div class="card-header">
            <h3 class="card-header-title">🔧 In Progress</h3>
            <span class="badge badge-primary"><?php echo e($myTasks->where('status', 'in_progress')->count()); ?></span>
        </div>
        <div>
            <?php $__empty_1 = true; $__currentLoopData = $myTasks->where('status', 'in_progress'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="task-item" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                    <div class="task-checkbox"></div>
                    <div class="task-info">
                        <div class="task-title"><?php echo e($task->title); ?></div>
                        <div class="task-meta">
                            <span class="task-meta-item">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>
                                <?php echo e($task->project->name ?? ''); ?>

                            </span>
                            <?php if($task->due_date): ?>
                                <span class="task-meta-item <?php echo e($task->is_overdue ? 'overdue' : ''); ?>"><?php echo e($task->due_date->format('M j')); ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="task-right">
                        <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                        <span class="badge badge-primary">In Progress</span>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="empty-state" style="padding:20px;">
                    <div class="empty-state-text">No in-progress tasks</div>
                </div>
            <?php endif; ?>
        </div>
    </div>

    
    <div class="card mb-4">
        <div class="card-header">
            <h3 class="card-header-title">📋 To Do</h3>
            <span class="badge badge-secondary"><?php echo e($myTasks->where('status', 'todo')->count()); ?></span>
        </div>
        <div>
            <?php $__empty_1 = true; $__currentLoopData = $myTasks->where('status', 'todo'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="task-item" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                    <div class="task-checkbox"></div>
                    <div class="task-info">
                        <div class="task-title"><?php echo e($task->title); ?></div>
                        <div class="task-meta">
                            <span class="task-meta-item">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>
                                <?php echo e($task->project->name ?? ''); ?>

                            </span>
                            <?php if($task->due_date): ?>
                                <span class="task-meta-item <?php echo e($task->is_overdue ? 'overdue' : ''); ?>"><?php echo e($task->due_date->format('M j')); ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="task-right">
                        <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                        <span class="badge badge-secondary">To Do</span>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="empty-state" style="padding:20px;">
                    <div class="empty-state-text">No to-do tasks</div>
                </div>
            <?php endif; ?>
        </div>
    </div>

    
    <?php if($myTasks->where('status', 'review')->count() > 0): ?>
    <div class="card mb-4">
        <div class="card-header">
            <h3 class="card-header-title">👀 In Review</h3>
            <span class="badge badge-warning"><?php echo e($myTasks->where('status', 'review')->count()); ?></span>
        </div>
        <div>
            <?php $__currentLoopData = $myTasks->where('status', 'review'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="task-item" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                    <div class="task-checkbox"></div>
                    <div class="task-info">
                        <div class="task-title"><?php echo e($task->title); ?></div>
                        <div class="task-meta">
                            <span class="task-meta-item"><?php echo e($task->project->name ?? ''); ?></span>
                            <?php if($task->due_date): ?>
                                <span class="task-meta-item"><?php echo e($task->due_date->format('M j')); ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="task-right">
                        <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                        <span class="badge badge-warning">Review</span>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
    <?php endif; ?>

    
    <?php if($completedTasks->count() > 0): ?>
    <div class="card">
        <div class="card-header">
            <h3 class="card-header-title">✅ Recently Completed</h3>
            <span class="badge badge-success"><?php echo e($completedTasks->count()); ?></span>
        </div>
        <div>
            <?php $__currentLoopData = $completedTasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="task-item" style="opacity:0.7;" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                    <div class="task-checkbox completed"></div>
                    <div class="task-info">
                        <div class="task-title completed"><?php echo e($task->title); ?></div>
                        <div class="task-meta">
                            <span class="task-meta-item"><?php echo e($task->project->name ?? ''); ?></span>
                            <?php if($task->completed_at): ?>
                                <span class="task-meta-item">Completed <?php echo e($task->completed_at->diffForHumans()); ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="task-right">
                        <span class="badge badge-success">Done</span>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
    <?php endif; ?>

    <?php else: ?>
    

    
    <?php if($chartData): ?>
    <div class="grid grid-3 mb-6">
        
        <div class="card chart-card">
            <div class="card-header">
                <h3 class="card-header-title">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:16px;height:16px;margin-right:6px;vertical-align:middle;color:var(--accent-primary);">
                        <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
                    </svg>
                    Weekly Trend
                </h3>
            </div>
            <div class="card-body" style="padding:8px 12px 4px;">
                <div id="chart-weekly" style="min-height:220px;"></div>
            </div>
        </div>

        
        <div class="card chart-card">
            <div class="card-header">
                <h3 class="card-header-title">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:16px;height:16px;margin-right:6px;vertical-align:middle;color:var(--accent-yellow);">
                        <circle cx="12" cy="12" r="10"></circle>
                        <path d="M12 2a10 10 0 0 1 10 10h-10z"></path>
                    </svg>
                    Task Distribution
                </h3>
            </div>
            <div class="card-body" style="padding:8px 12px 4px;">
                <div id="chart-distribution" style="min-height:220px;"></div>
            </div>
        </div>

        
        <div class="card chart-card">
            <div class="card-header">
                <h3 class="card-header-title">
                    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:16px;height:16px;margin-right:6px;vertical-align:middle;color:var(--accent-green);">
                        <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                        <circle cx="9" cy="7" r="4"></circle>
                        <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
                        <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
                    </svg>
                    Team Workload
                </h3>
            </div>
            <div class="card-body" style="padding:8px 12px 4px;">
                <div id="chart-workload" style="min-height:220px;"></div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <div style="display:grid;grid-template-columns:1fr 380px;gap:24px;">
        
        <div>
            
            <div class="card mb-4">
                <div class="card-header">
                    <h3 class="card-header-title">My Tasks</h3>
                    <div class="flex items-center gap-2">
                        <span class="badge badge-primary"><?php echo e($myTasks->count()); ?></span>
                        <a href="<?php echo e(route('dashboard')); ?>?my_tasks=1" class="btn btn-ghost btn-sm">View All</a>
                    </div>
                </div>
                <div>
                    <?php $__empty_1 = true; $__currentLoopData = $myTasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <div class="task-item" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                            <div class="task-checkbox <?php echo e($task->is_completed ? 'completed' : ''); ?>"></div>
                            <div class="task-info">
                                <div class="task-title <?php echo e($task->is_completed ? 'completed' : ''); ?>"><?php echo e($task->title); ?></div>
                                <div class="task-meta">
                                    <span class="task-meta-item">
                                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>
                                        <?php echo e($task->project->name ?? ''); ?>

                                    </span>
                                    <?php if($task->due_date): ?>
                                        <span class="task-meta-item <?php echo e($task->is_overdue ? 'overdue' : ''); ?>">
                                            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                                            <?php echo e($task->due_date->format('M j')); ?>

                                        </span>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="task-right">
                                <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                                <span class="badge badge-<?php echo e($task->status === 'completed' ? 'success' : ($task->status === 'in_progress' ? 'primary' : ($task->status === 'review' ? 'warning' : 'secondary'))); ?>"><?php echo e(ucfirst(str_replace('_', ' ', $task->status))); ?></span>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <div class="empty-state">
                            <div class="empty-state-icon">
                                <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>
                            </div>
                            <div class="empty-state-title">You're all caught up!</div>
                            <div class="empty-state-text">No tasks assigned to you right now.</div>
                        </div>
                    <?php endif; ?>
                </div>
            </div>

            
            <?php if($overdueTasks->count() > 0): ?>
            <div class="card mb-4">
                <div class="card-header">
                    <h3 class="card-header-title" style="color:var(--accent-red);">⚠️ Overdue Tasks</h3>
                    <span class="badge badge-danger"><?php echo e($overdueTasks->count()); ?></span>
                </div>
                <div>
                    <?php $__currentLoopData = $overdueTasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="task-item" onclick="window.location='<?php echo e(route('tasks.show', $task)); ?>'">
                            <div class="task-checkbox"></div>
                            <div class="task-info">
                                <div class="task-title"><?php echo e($task->title); ?></div>
                                <div class="task-meta">
                                    <span class="task-meta-item"><?php echo e($task->project->name ?? ''); ?></span>
                                    <span class="task-meta-item overdue">
                                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                                        <?php echo e($task->due_date->format('M j')); ?> — overdue
                                    </span>
                                </div>
                            </div>
                            <div class="task-right">
                                <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
            <?php endif; ?>

            
            <div class="card">
                <div class="card-header">
                    <h3 class="card-header-title">Project Progress</h3>
                    <a href="<?php echo e(route('projects.index')); ?>" class="btn btn-ghost btn-sm">View All</a>
                </div>
                <div class="card-body">
                    <div class="grid grid-2">
                        <?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <a href="<?php echo e(route('projects.show', $project)); ?>" class="project-card">
                                <div class="project-card-color" style="background: <?php echo e($project->color); ?>;"></div>
                                <div class="project-card-title"><?php echo e($project->name); ?></div>
                                <div class="project-card-desc"><?php echo e(Str::limit($project->description, 80)); ?></div>
                                <div class="project-card-progress">
                                    <?php
                                        $progress = $project->tasks_count > 0 ? round(($project->completed_tasks_count / $project->tasks_count) * 100) : 0;
                                    ?>
                                    <div style="display:flex;justify-content:space-between;font-size:0.78rem;color:var(--text-tertiary);margin-bottom:4px;">
                                        <span>Progress</span>
                                        <span><?php echo e($progress); ?>%</span>
                                    </div>
                                    <div class="progress">
                                        <div class="progress-bar <?php echo e($progress >= 70 ? 'green' : ($progress >= 40 ? '' : 'yellow')); ?>" style="width: <?php echo e($progress); ?>%"></div>
                                    </div>
                                </div>
                                <div class="project-card-stats">
                                    <span><?php echo e($project->completed_tasks_count); ?>/<?php echo e($project->tasks_count); ?> tasks</span>
                                    <span class="badge badge-<?php echo e($project->status_badge); ?>"><?php echo e(ucfirst(str_replace('_', ' ', $project->status))); ?></span>
                                </div>
                            </a>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </div>
        </div>

        
        <div>
            <div class="card">
                <div class="card-header">
                    <h3 class="card-header-title">Recent Activity</h3>
                </div>
                <div class="card-body" style="padding:12px 20px;">
                    <ul class="activity-feed">
                        <?php $__empty_1 = true; $__currentLoopData = $activities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <li class="activity-item">
                                <div class="activity-icon">
                                    <?php if($activity->causer): ?>
                                        <div class="avatar avatar-sm"><?php echo e($activity->causer->initials); ?></div>
                                    <?php else: ?>
                                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>
                                    <?php endif; ?>
                                </div>
                                <div class="activity-content">
                                    <div class="activity-text">
                                        <strong><?php echo e($activity->causer->name ?? 'System'); ?></strong>
                                        <?php echo e($activity->description); ?>

                                    </div>
                                    <div class="activity-time"><?php echo e($activity->created_at->diffForHumans()); ?></div>
                                </div>
                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <li class="empty-state" style="padding:24px;">
                                <div class="empty-state-text">No recent activity</div>
                            </li>
                        <?php endif; ?>
                    </ul>
                </div>
            </div>

            
            <?php if($upcomingTasks->count() > 0): ?>
            <div class="card mt-4">
                <div class="card-header">
                    <h3 class="card-header-title">📅 Upcoming (7 days)</h3>
                    <span class="badge badge-info"><?php echo e($upcomingTasks->count()); ?></span>
                </div>
                <div>
                    <?php $__currentLoopData = $upcomingTasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="task-item">
                            <div class="task-checkbox"></div>
                            <div class="task-info">
                                <div class="task-title"><?php echo e($task->title); ?></div>
                                <div class="task-meta">
                                    <span class="task-meta-item"><?php echo e($task->due_date->format('M j')); ?></span>
                                </div>
                            </div>
                            <div class="priority-dot" style="background: <?php echo e($task->priority_color); ?>"></div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
            <?php endif; ?>
        </div>
    </div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php if(!$isMyTasks && $chartData): ?>
<?php $__env->startPush('scripts'); ?>
<script>
document.addEventListener('DOMContentLoaded', function() {
    const chartData = <?php echo json_encode($chartData, 15, 512) ?>;

    const chartTheme = { mode: 'dark', palette: 'palette1' };
    const chartFont = { fontFamily: 'inherit' };

    // 1. Weekly Completion Trend
    new ApexCharts(document.querySelector('#chart-weekly'), {
        chart: { type: 'area', height: 220, background: 'transparent', toolbar: { show: false }, zoom: { enabled: false }, animations: { enabled: true, easing: 'easeinout', speed: 600 } },
        theme: chartTheme,
        series: [
            { name: 'Completed', data: chartData.weekly.map(w => w.completed) },
            { name: 'Created', data: chartData.weekly.map(w => w.created) }
        ],
        xaxis: { categories: chartData.weekly.map(w => w.week), labels: { style: { ...chartFont, colors: '#8b8fa3', fontSize: '11px' } }, axisBorder: { show: false }, axisTicks: { show: false } },
        yaxis: { labels: { style: { ...chartFont, colors: '#8b8fa3', fontSize: '11px' } } },
        colors: ['#22c55e', '#6366f1'],
        fill: { type: 'gradient', gradient: { shadeIntensity: 1, opacityFrom: 0.45, opacityTo: 0.05, stops: [0, 90, 100] } },
        stroke: { curve: 'smooth', width: 2.5 },
        dataLabels: { enabled: false },
        grid: { borderColor: 'rgba(255,255,255,0.06)', strokeDashArray: 4, padding: { left: 4, right: 4 } },
        legend: { position: 'top', horizontalAlign: 'right', fontSize: '11px', labels: { colors: '#8b8fa3' }, markers: { width: 8, height: 8, radius: 4 } },
        tooltip: { theme: 'dark', style: { fontSize: '12px' } },
    }).render();

    // 2. Task Distribution
    const dist = chartData.distribution;
    new ApexCharts(document.querySelector('#chart-distribution'), {
        chart: { type: 'donut', height: 220, background: 'transparent', animations: { enabled: true, easing: 'easeinout', speed: 600 } },
        theme: chartTheme,
        series: [dist.todo, dist.in_progress, dist.review, dist.completed],
        labels: ['To Do', 'In Progress', 'Review', 'Completed'],
        colors: ['#6b7280', '#3b82f6', '#f59e0b', '#22c55e'],
        plotOptions: { pie: { donut: { size: '68%', labels: { show: true, name: { fontSize: '12px', color: '#8b8fa3' }, value: { fontSize: '22px', fontWeight: 700, color: '#e2e4eb' }, total: { show: true, label: 'Total', fontSize: '12px', color: '#8b8fa3', formatter: function(w) { return w.globals.seriesTotals.reduce((a, b) => a + b, 0); } } } } } },
        stroke: { width: 2, colors: ['#1a1d2e'] },
        dataLabels: { enabled: false },
        legend: { position: 'bottom', fontSize: '11px', labels: { colors: '#8b8fa3' }, markers: { width: 8, height: 8, radius: 4 } },
        tooltip: { theme: 'dark', style: { fontSize: '12px' } },
    }).render();

    // 3. Team Workload
    const workload = chartData.workload;
    new ApexCharts(document.querySelector('#chart-workload'), {
        chart: { type: 'bar', height: 220, background: 'transparent', toolbar: { show: false }, animations: { enabled: true, easing: 'easeinout', speed: 600 } },
        theme: chartTheme,
        plotOptions: { bar: { horizontal: true, barHeight: '55%', borderRadius: 4, borderRadiusApplication: 'end' } },
        series: [
            { name: 'Open', data: workload.map(m => m.open) },
            { name: 'Completed', data: workload.map(m => m.completed) }
        ],
        xaxis: { categories: workload.map(m => m.name), labels: { style: { ...chartFont, colors: '#8b8fa3', fontSize: '11px' } }, axisBorder: { show: false }, axisTicks: { show: false } },
        yaxis: { labels: { style: { ...chartFont, colors: '#a0a3b1', fontSize: '11px' } } },
        colors: ['#6366f1', '#22c55e'],
        fill: { opacity: 0.9 },
        grid: { borderColor: 'rgba(255,255,255,0.06)', strokeDashArray: 4 },
        dataLabels: { enabled: false },
        legend: { position: 'top', horizontalAlign: 'right', fontSize: '11px', labels: { colors: '#8b8fa3' }, markers: { width: 8, height: 8, radius: 4 } },
        tooltip: { theme: 'dark', style: { fontSize: '12px' } },
    }).render();
});
</script>
<?php $__env->stopPush(); ?>
<?php endif; ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/asana/resources/views/dashboard/index.blade.php ENDPATH**/ ?>