

<?php $__env->startSection('title', 'Finance Dashboard'); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-header">
        <h1 class="page-title">Finance Dashboard</h1>
        <nav class="breadcrumb">
            <a href="<?php echo e(route('dashboard')); ?>" class="breadcrumb-item">Home</a>
            <span class="breadcrumb-item active">Finance</span>
        </nav>
    </div>

    <div class="row g-3 mb-4">
        <div class="col-md-4">
            <div class="card h-100"><div class="card-body">
                <h6 class="text-muted">Today</h6>
                <div class="small">Income: <strong class="text-success"><?php echo e(platform_money($today_income)); ?></strong></div>
                <div class="small">Expense: <strong class="text-danger"><?php echo e(platform_money($today_expense)); ?></strong></div>
                <div class="small">Net: <strong><?php echo e(platform_money($today_profit)); ?></strong></div>
            </div></div>
        </div>
        <div class="col-md-4">
            <div class="card h-100"><div class="card-body">
                <h6 class="text-muted">This Month</h6>
                <div class="small">Income: <strong class="text-success"><?php echo e(platform_money($month_income)); ?></strong></div>
                <div class="small">Expense: <strong class="text-danger"><?php echo e(platform_money($month_expense)); ?></strong></div>
                <div class="small">Profit: <strong><?php echo e(platform_money($month_profit)); ?></strong></div>
            </div></div>
        </div>
        <div class="col-md-4">
            <div class="card h-100"><div class="card-body">
                <h6 class="text-muted">Overall</h6>
                <div class="small">Total Income: <strong><?php echo e(platform_money($total_income)); ?></strong></div>
                <div class="small">Total Expense: <strong><?php echo e(platform_money($total_expense)); ?></strong></div>
                <div class="small">Balance: <strong class="text-primary"><?php echo e(platform_money($current_balance)); ?></strong></div>
            </div></div>
        </div>
    </div>

    <div class="row g-3">
        <div class="col-xl-8">
            <div class="card">
                <div class="card-header"><h5 class="card-title mb-0">Recent Transactions</h5></div>
                <div class="card-body p-0">
                    <div class="table-responsive">
                        <table class="table table-hover mb-0">
                            <thead class="table-light"><tr><th>Date</th><th>Type</th><th>Category</th><th>Amount</th></tr></thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $recent_transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tx): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td><?php echo e($tx->transaction_at->format('M j, Y')); ?></td>
                                        <td><span class="badge bg-<?php echo e($tx->type->value === 'income' ? 'success' : 'danger'); ?>"><?php echo e(ucfirst($tx->type->value)); ?></span></td>
                                        <td><?php echo e($tx->categoryName()); ?></td>
                                        <td><?php echo e(platform_money($tx->amount)); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr><td colspan="4" class="text-center text-muted py-4">No transactions yet</td></tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-4">
            <div class="card mb-3">
                <div class="card-header"><h5 class="card-title mb-0">Top Income Sources</h5></div>
                <ul class="list-group list-group-flush">
                    <?php $__empty_1 = true; $__currentLoopData = $top_income_categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <li class="list-group-item d-flex justify-content-between"><span><?php echo e($item->name); ?></span><strong><?php echo e(platform_money($item->total)); ?></strong></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <li class="list-group-item text-muted">No data</li>
                    <?php endif; ?>
                </ul>
            </div>
            <div class="card">
                <div class="card-header"><h5 class="card-title mb-0">Highest Expenses</h5></div>
                <ul class="list-group list-group-flush">
                    <?php $__empty_1 = true; $__currentLoopData = $top_expense_categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <li class="list-group-item d-flex justify-content-between"><span><?php echo e($item->name); ?></span><strong><?php echo e(platform_money($item->total)); ?></strong></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <li class="list-group-item text-muted">No data</li>
                    <?php endif; ?>
                </ul>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('eliteadmin::layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\RABI\rabi\module-laravel-platform\apps\admin\modules\Finance/resources/views/dashboard/index.blade.php ENDPATH**/ ?>