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

<?php $__env->startSection('content'); ?>
<div class="space-y-6">
    <div class="flex flex-col md:flex-row md:items-center justify-between gap-4"><div><p class="text-xs font-bold uppercase tracking-[0.18em] text-violet-600">Double-entry ledger</p><h1 class="text-2xl font-extrabold text-slate-950 dark:text-white">Finance & accounting</h1><p class="text-sm text-slate-500">Live operational postings with government clearing and VAT liabilities kept out of revenue.</p></div><div class="flex gap-2"><a href="<?php echo e(route('app.billing.invoices.index')); ?>" class="rounded-xl bg-white border border-slate-200 px-4 py-2 text-xs font-bold">Invoices</a><a href="<?php echo e(route('app.billing.refunds.index')); ?>" class="rounded-xl bg-slate-900 px-4 py-2 text-xs font-bold text-white">Refund control</a></div></div>
    <div class="grid grid-cols-2 lg:grid-cols-4 gap-4"><?php $__currentLoopData = [['Monthly service revenue',$serviceRevenue,'text-emerald-600'],['Government fees handled',$governmentFees,'text-amber-600'],['VAT output payable',$vatPayable,'text-violet-600'],['Outstanding receivables',$receivables,'text-rose-600']]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$label,$amount,$color]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="rounded-2xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 p-4"><p class="text-[10px] font-bold uppercase tracking-wider text-slate-400"><?php echo e($label); ?></p><p class="mt-1 text-xl font-extrabold <?php echo e($color); ?>">AED <?php echo e(number_format((float)$amount,2)); ?></p></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div>
    <div class="grid grid-cols-1 xl:grid-cols-2 gap-6">
        <div class="bg-white dark:bg-slate-800 rounded-3xl border border-slate-200 dark:border-slate-700 overflow-hidden shadow-sm"><div class="p-5 border-b border-slate-200 dark:border-slate-700"><h2 class="font-bold">Chart of accounts & balances</h2><p class="text-xs text-slate-500">System accounts are created only when a real transaction posts.</p></div><div class="overflow-x-auto"><table class="w-full text-sm"><thead class="bg-slate-50 dark:bg-slate-900/50 text-[11px] uppercase text-slate-500"><tr><th class="p-4 text-left">Account</th><th class="p-4 text-left">Type</th><th class="p-4 text-right">Debit</th><th class="p-4 text-right">Credit</th></tr></thead><tbody class="divide-y divide-slate-100 dark:divide-slate-700"><?php $__empty_1 = true; $__currentLoopData = $accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><tr><td class="p-4"><span class="font-mono text-xs text-sky-700"><?php echo e($account->account_code); ?></span><p class="font-bold"><?php echo e($account->account_name); ?></p></td><td class="p-4 text-slate-500"><?php echo e(ucfirst($account->account_type)); ?> <?php if($account->is_clearing): ?><span class="text-[10px] font-bold text-amber-600">CLEARING</span><?php endif; ?></td><td class="p-4 text-right">AED <?php echo e(number_format((float)($account->debit_total ?? 0),2)); ?></td><td class="p-4 text-right">AED <?php echo e(number_format((float)($account->credit_total ?? 0),2)); ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><tr><td colspan="4" class="p-12 text-center text-slate-400">No journal activity yet.</td></tr><?php endif; ?></tbody></table></div></div>
        <div class="bg-white dark:bg-slate-800 rounded-3xl border border-slate-200 dark:border-slate-700 p-5 shadow-sm"><h2 class="font-bold">Recent journals</h2><div class="mt-4 space-y-3"><?php $__empty_1 = true; $__currentLoopData = $journals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $journal): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><div class="rounded-2xl border border-slate-200 dark:border-slate-700 p-4"><div class="flex justify-between gap-3"><div><p class="font-bold text-sm"><?php echo e($journal->entry_number); ?></p><p class="text-xs text-slate-400"><?php echo e($journal->narration); ?></p></div><div class="text-right"><p class="font-extrabold">AED <?php echo e(number_format((float)$journal->total_debit,2)); ?></p><p class="text-[10px] uppercase text-emerald-600 font-bold">Balanced</p></div></div><div class="mt-3 grid grid-cols-2 gap-2 text-[11px]"><?php $__currentLoopData = $journal->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="rounded-lg bg-slate-50 px-2 py-1 flex justify-between"><span><?php echo e($item->account?->account_name); ?></span><span class="font-bold"><?php echo e((float)$item->debit > 0 ? 'Dr '.number_format((float)$item->debit,2) : 'Cr '.number_format((float)$item->credit,2)); ?></span></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><div class="rounded-2xl border border-dashed border-slate-200 p-10 text-center text-xs text-slate-400">No journals posted yet.</div><?php endif; ?></div></div>
    </div>
</div>
<?php $__env->stopSection(); ?>

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