<?php $__env->startSection('title', __('Dashboard')); ?>
<?php $__env->startSection('content'); ?>
<div class="row g-3 mb-4">
    <?php $__currentLoopData = [
        ['Today Sales', $todaySales, 'fa-sack-dollar', ''],
        ['Received Today', $todayPaid, 'fa-coins', ''],
        ['Customer Due', $customerDue, 'fa-user-clock', 'text-danger'],
        ['Stock Value', $stockValue, 'fa-warehouse', ''],
    ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$label, $value, $icon, $class]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="col-md-3"><div class="card"><div class="card-body d-flex align-items-center gap-3"><div class="stat-icon"><i class="fa-solid <?php echo e($icon); ?>"></i></div><div><small class="text-muted"><?php echo e(__($label)); ?></small><h5 class="mb-0 money <?php echo e($class); ?>"><?php echo e(number_format($value, 2)); ?> <?php echo e($moneyCode); ?></h5></div></div></div></div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
<div class="row g-3">
    <div class="col-lg-8">
        <div class="card"><div class="card-body"><div class="d-flex justify-content-between"><h6><?php echo e(__('Sales & Purchase Trend')); ?></h6><small class="text-muted"><?php echo e(__('Last 7 days')); ?></small></div><canvas id="trendChart" height="105"></canvas></div></div>
    </div>
    <div class="col-lg-4">
        <div class="card h-100"><div class="card-body"><h6><?php echo e(__('Business Health')); ?></h6><div class="d-flex justify-content-between border-bottom py-3"><span><?php echo e(__('Supplier Due')); ?></span><strong class="text-danger money"><?php echo e(number_format($supplierDue, 2)); ?> <?php echo e($moneyCode); ?></strong></div><div class="d-flex justify-content-between border-bottom py-3"><span><?php echo e(__('Customers')); ?></span><strong><?php echo e($customers); ?></strong></div><div class="d-flex justify-content-between py-3"><span><?php echo e(__('Low Stock Items')); ?></span><strong class="text-warning"><?php echo e($lowStock->count()); ?></strong></div><a href="<?php echo e(route('reports.index')); ?>" class="btn btn-success w-100"><?php echo e(__('Open Reports')); ?></a></div></div>
    </div>
</div>
<div class="row g-3 mt-1">
    <div class="col-lg-7">
        <div class="card"><div class="card-body"><div class="d-flex justify-content-between align-items-center mb-3"><h6 class="mb-0"><?php echo e(__('Recent Invoices')); ?></h6><a href="<?php echo e(route('invoices.index')); ?>" class="small"><?php echo e(__('View all')); ?></a></div><div class="table-responsive"><table class="table align-middle"><thead><tr><th>#</th><th><?php echo e(__('Customer')); ?></th><th><?php echo e(__('Total')); ?></th><th><?php echo e(__('Status')); ?></th></tr></thead><tbody><?php $__empty_1 = true; $__currentLoopData = $recentInvoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td><a href="<?php echo e(route('invoices.show', $invoice)); ?>"><?php echo e($invoice->invoice_number); ?></a><br><small><?php echo e($invoice->invoice_date->format('d M')); ?></small></td><td><?php echo e($invoice->customer?->name ?? $invoice->walk_in_name ?? __('Walk-in Customer')); ?></td><td class="money"><?php echo e(number_format($invoice->total, 2)); ?> <?php echo e($invoice->currency_code); ?></td><td><span class="badge badge-soft rounded-pill"><?php echo e(__(ucfirst($invoice->status))); ?></span></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="4" class="text-center text-muted py-4"><?php echo e(__('No invoices yet.')); ?></td></tr><?php endif; ?></tbody></table></div></div></div>
    </div>
    <div class="col-lg-5">
        <div class="card"><div class="card-body"><h6 class="mb-3"><i class="fa-solid fa-triangle-exclamation text-warning me-2"></i><?php echo e(__('Low Stock Alert')); ?></h6><?php $__empty_1 = true; $__currentLoopData = $lowStock; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><div class="d-flex justify-content-between border-bottom py-2"><span><?php echo e($product->name); ?><small class="d-block text-muted"><?php echo e($product->sku); ?></small></span><strong class="text-danger"><?php echo e($product->stock_quantity); ?> <?php echo e($product->unit); ?></strong></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><p class="text-muted text-center py-3 mb-0"><?php echo e(__('Stock levels look good.')); ?></p><?php endif; ?></div></div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?><script src="https://cdn.jsdelivr.net/npm/chart.js"></script><script>new Chart(document.getElementById('trendChart'),{type:'line',data:{labels:<?php echo json_encode($chartLabels, 15, 512) ?>,datasets:[{label:'<?php echo e(__('Sales')); ?>',data:<?php echo json_encode($chartSales, 15, 512) ?>,borderColor:'#22a06b',backgroundColor:'rgba(34,160,107,.12)',fill:true,tension:.35},{label:'<?php echo e(__('Purchases')); ?>',data:<?php echo json_encode($chartPurchases, 15, 512) ?>,borderColor:'#f59e0b',tension:.35}]},options:{responsive:true,plugins:{legend:{position:'bottom'}},scales:{y:{beginAtZero:true}}}});</script><?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\TradeERP\resources\views/dashboard.blade.php ENDPATH**/ ?>