<?php if (isset($component)) { $__componentOriginal91fdd17964e43374ae18c674f95cdaa3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3 = $attributes; } ?>
<?php $component = App\View\Components\AdminLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AdminLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> Sales Overview <?php $__env->endSlot(); ?>
    <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
        <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
            <div class="p-6">
                <h3 class="text-lg font-medium mb-4">Sales Funnels</h3>
                <table class="min-w-full divide-y divide-gray-200">
                    <thead class="bg-gray-50"><tr>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Name</th>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Stage</th>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Value</th>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Status</th>
                    </tr></thead>
                    <tbody class="divide-y divide-gray-200">
                        <?php $__empty_1 = true; $__currentLoopData = $funnels; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $funnel): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td class="px-4 py-3 text-sm text-gray-900"><?php echo e($funnel->name); ?></td>
                                <td class="px-4 py-3 text-sm text-gray-500"><?php echo e($funnel->stage); ?></td>
                                <td class="px-4 py-3 text-sm font-medium"><?php echo e(number_format($funnel->value ?? 0, 2)); ?></td>
                                <td class="px-4 py-3"><span class="px-2 text-xs rounded-full <?php echo e($funnel->status === 'ACTIVE' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800'); ?>"><?php echo e($funnel->status ?? 'N/A'); ?></span></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr><td colspan="4" class="px-4 py-3 text-center text-gray-500">No funnels.</td></tr>
                        <?php endif; ?>
                    </tbody>
                </table>
                <div class="mt-4"><?php echo e($funnels->withQueryString()->links()); ?></div>
            </div>
        </div>
        <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
            <div class="p-6">
                <h3 class="text-lg font-medium mb-4">Sales Targets</h3>
                <table class="min-w-full divide-y divide-gray-200">
                    <thead class="bg-gray-50"><tr>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Assigned To</th>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Target</th>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">Achieved</th>
                        <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase">%</th>
                    </tr></thead>
                    <tbody class="divide-y divide-gray-200">
                        <?php $__empty_1 = true; $__currentLoopData = $targets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $target): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td class="px-4 py-3 text-sm text-gray-900"><?php echo e($target->assignee->name ?? 'N/A'); ?></td>
                                <td class="px-4 py-3 text-sm font-medium"><?php echo e(number_format($target->target_amount ?? 0, 2)); ?></td>
                                <td class="px-4 py-3 text-sm text-green-600"><?php echo e(number_format($target->achieved_amount ?? 0, 2)); ?></td>
                                <td class="px-4 py-3 text-sm">
                                    <?php $pct = $target->target_amount > 0 ? min(100, ($target->achieved_amount / $target->target_amount) * 100) : 0; ?>
                                    <div class="flex items-center"><div class="w-16 bg-gray-200 rounded-full h-2 mr-2"><div class="bg-blue-600 h-2 rounded-full" style="width: <?php echo e($pct); ?>%"></div></div><span class="text-xs"><?php echo e(number_format($pct)); ?>%</span></div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr><td colspan="4" class="px-4 py-3 text-center text-gray-500">No targets set.</td></tr>
                        <?php endif; ?>
                    </tbody>
                </table>
                <div class="mt-4"><?php echo e($targets->withQueryString()->links()); ?></div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $attributes = $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $component = $__componentOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php /**PATH C:\Users\shoko\OneDrive\Desktop\Elhamd-main\Elhamd-Laravel\resources\views/admin/sales/index.blade.php ENDPATH**/ ?>