<?php $__env->startSection('title', 'Khan Motors'); ?>

<?php $__env->startSection('content'); ?>
<div class="text-center mb-4">
    <h1 class="display-6 fw-bold text-uppercase text-danger" style="letter-spacing: 2px;">
        Khan Motor's Dashboard
    </h1>
</div>

<div class="row g-3">
    <!-- Stats Cards -->
    <?php
        $progress = $totalSales > 0 ? round(($totalreceived / $totalSales) * 100) : 0;
    ?>

    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Available Cars','value' => ''.e($totalCars).'','icon' => 'fas fa-car','color' => 'primary','url' => '/cars']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Available Cars','value' => ''.e($totalCars).'','icon' => 'fas fa-car','color' => 'primary','url' => '/cars']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Reports','value' => ''.e($totalreports).'','icon' => 'fas fa-file-alt','color' => 'warning','url' => '/cars-reports']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Reports','value' => ''.e($totalreports).'','icon' => 'fas fa-file-alt','color' => 'warning','url' => '/cars-reports']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Total Sold','value' => ''.e($totalsold).'','icon' => 'fas fa-car','color' => 'info','url' => '/cars']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Total Sold','value' => ''.e($totalsold).'','icon' => 'fas fa-car','color' => 'info','url' => '/cars']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Total Sale','value' => ''.e(number_format($totalSales)).'','icon' => 'fas fa-dollar-sign','color' => 'primary','url' => '/car-sales']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Total Sale','value' => ''.e(number_format($totalSales)).'','icon' => 'fas fa-dollar-sign','color' => 'primary','url' => '/car-sales']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Received','value' => ''.e(number_format($totalreceived)).'','icon' => 'fas fa-money-bill','color' => 'success','url' => '/car-sales']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Received','value' => ''.e(number_format($totalreceived)).'','icon' => 'fas fa-money-bill','color' => 'success','url' => '/car-sales']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Remaining','value' => ''.e(number_format($totalremainings)).'','icon' => 'fas fa-coins','color' => 'danger','url' => '/car-sales']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Remaining','value' => ''.e(number_format($totalremainings)).'','icon' => 'fas fa-coins','color' => 'danger','url' => '/car-sales']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.dashboard.card','data' => ['title' => 'Customers','value' => ''.e($totalCustomers).'','icon' => 'fas fa-users','color' => 'warning','url' => '/customers']]); ?>
<?php $component->withName('dashboard.card'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['title' => 'Customers','value' => ''.e($totalCustomers).'','icon' => 'fas fa-users','color' => 'warning','url' => '/customers']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

    <!-- Progress Bar Example -->
    <div class="col-md-12">
    <div class="card dashboard-card">
            <div class="card-body">
                <h6 class="mb-2 text-muted">Payment Collection Progress</h6>
                <div class="progress mb-2" style="height: 20px;">
                    <div class="progress-bar bg-success" role="progressbar" style="width: <?php echo e($progress); ?>%;" aria-valuenow="<?php echo e($progress); ?>" aria-valuemin="0" aria-valuemax="100">
                        <?php echo e($progress); ?>%
                    </div>
                </div>
                <small>Total: <?php echo e(number_format($totalSales)); ?> | Received: <?php echo e(number_format($totalreceived)); ?> | Remaining: <?php echo e(number_format($totalremainings)); ?></small>
            </div>
        </div>
    </div>
</div>

<!-- Recent Activities and Quick Actions -->
<div class="row mt-4">
    <div class="col-md-6">
    <div class="card dashboard-card">
            <div class="card-header bg-white">
                <h5 class="mb-0">Recent Activities</h5>
            </div>
            <div class="card-body">
                <ul class="list-group list-group-flush small">
                    <?php $__currentLoopData = $recentActivities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li class="list-group-item d-flex justify-content-between">
                            <span><?php echo e($activity['text']); ?></span>
                            <small class="text-muted"><?php echo e(\Carbon\Carbon::parse($activity['created_at'])->diffForHumans()); ?></small>
                        </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php if(empty($recentActivities)): ?>
                        <li class="list-group-item text-muted">No recent activities</li>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
    </div>

    <div class="col-md-6">
    <div class="card dashboard-card">
            <div class="card-header bg-white">
                <h5 class="mb-0">Quick Actions</h5>
            </div>
            <div class="card-body d-grid gap-2">
                <a href="/cars/create" class="btn btn-outline-danger">Add New Car</a>
                <a href="/customers/create" class="btn btn-outline-warning">Add New Customer</a>
                <a href="/car-sales" class="btn btn-outline-success">New Sale</a>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>




<style>
    .dashboard-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border-radius: 10px;
        box-shadow: 0 14px 20px rgba(0, 0, 0, 0.5);
    }

    .dashboard-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    }
</style>


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