<!doctype html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>" dir="ltr">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo $__env->yieldContent('title', 'Dashboard'); ?> · <?php echo e(config('app.name')); ?></title>
    <link rel="stylesheet" href="<?php echo e(asset('assets/app.css')); ?>">
</head>
<body>
<div class="app-shell">
    <aside class="sidebar">
        <div class="brand">
            <div class="brand-mark">TA</div>
            <div><strong><?php echo e(auth()->user()->company?->trade_name ?: config('app.name')); ?></strong><small>Transport Accounting</small></div>
        </div>
        <a class="nav-link <?php echo e(request()->routeIs('dashboard') ? 'active' : ''); ?>" href="<?php echo e(route('dashboard')); ?>">▦ Dashboard</a>

        <div class="nav-group">Operations</div>
        <?php if(auth()->user()->hasPermission('transport_jobs.view')): ?><a class="nav-link <?php echo e(request()->routeIs('jobs.*') ? 'active' : ''); ?>" href="<?php echo e(route('jobs.index')); ?>">▣ Transport Jobs</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('trips.view')): ?><a class="nav-link <?php echo e(request()->routeIs('trips.*') ? 'active' : ''); ?>" href="<?php echo e(route('trips.index')); ?>">↝ Trips & Dispatch</a><?php endif; ?>
        <?php $__currentLoopData = ['service-types'=>'Service Types','routes'=>'Routes','vehicles'=>'Vehicles','drivers'=>'Drivers','maintenance'=>'Maintenance','fuel'=>'Fuel Entries']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php ($moduleConfig=config("erp.modules.$key")); ?>
            <?php if($moduleConfig && auth()->user()->hasPermission($moduleConfig['permission'].'.view')): ?><a class="nav-link <?php echo e(request()->is("masters/$key*") ? 'active' : ''); ?>" href="<?php echo e(route('masters.index',$key)); ?>">• <?php echo e($label); ?></a><?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

        <div class="nav-group">Sales & Receivables</div>
        <?php if(auth()->user()->hasPermission('parties.view')): ?><a class="nav-link <?php echo e(request()->routeIs('parties.*') ? 'active' : ''); ?>" href="<?php echo e(route('parties.index')); ?>">◎ Parties</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('quotations.view')): ?><a class="nav-link <?php echo e(request()->routeIs('quotations.*') ? 'active' : ''); ?>" href="<?php echo e(route('quotations.index')); ?>">◇ Quotations</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('customer_invoices.view')): ?><a class="nav-link <?php echo e(request()->routeIs('invoices.*') ? 'active' : ''); ?>" href="<?php echo e(route('invoices.index')); ?>">▤ Customer Invoices</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('receipts.view')): ?><a class="nav-link <?php echo e(request()->routeIs('receipts.*') ? 'active' : ''); ?>" href="<?php echo e(route('receipts.index')); ?>">↓ Receipts</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('adjustment_notes.view')): ?><a class="nav-link <?php echo e(request()->routeIs('notes.*') ? 'active' : ''); ?>" href="<?php echo e(route('notes.index')); ?>">± Credit / Debit Notes</a><?php endif; ?>

        <div class="nav-group">Purchases & Payments</div>
        <?php if(auth()->user()->hasPermission('vendor_bills.view')): ?><a class="nav-link <?php echo e(request()->routeIs('bills.*') ? 'active' : ''); ?>" href="<?php echo e(route('bills.index')); ?>">▥ Vendor Bills</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('payments.view')): ?><a class="nav-link <?php echo e(request()->routeIs('payments.*') ? 'active' : ''); ?>" href="<?php echo e(route('payments.index')); ?>">↑ Payment Vouchers</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('expenses.view')): ?><a class="nav-link <?php echo e(request()->routeIs('expenses.*') ? 'active' : ''); ?>" href="<?php echo e(route('expenses.index')); ?>">◈ Expenses</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('driver_advances.view')): ?><a class="nav-link <?php echo e(request()->routeIs('driver-advances.*') ? 'active' : ''); ?>" href="<?php echo e(route('driver-advances.index')); ?>">⇣ Driver Advances</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('contra_settlements.view')): ?><a class="nav-link <?php echo e(request()->routeIs('contra.*') ? 'active' : ''); ?>" href="<?php echo e(route('contra.index')); ?>">⇄ Contra Settlements</a><?php endif; ?>

        <div class="nav-group">Contracts & Banking</div>
        <?php $__currentLoopData = ['contracts'=>'Contracts','rate-cards'=>'Rate Cards','bank-accounts'=>'Bank Accounts']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php ($moduleConfig=config("erp.modules.$key")); ?>
            <?php if($moduleConfig && auth()->user()->hasPermission($moduleConfig['permission'].'.view')): ?><a class="nav-link <?php echo e(request()->is("masters/$key*") ? 'active' : ''); ?>" href="<?php echo e(route('masters.index',$key)); ?>">• <?php echo e($label); ?></a><?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php if(auth()->user()->hasPermission('bank_reconciliation.view')): ?><a class="nav-link <?php echo e(request()->routeIs('bank.*') ? 'active' : ''); ?>" href="<?php echo e(route('bank.index')); ?>">≋ Bank Reconciliation</a><?php endif; ?>

        <div class="nav-group">Accounting & Reports</div>
        <?php if(auth()->user()->hasPermission('journals.view')): ?><a class="nav-link <?php echo e(request()->routeIs('journals.*') ? 'active' : ''); ?>" href="<?php echo e(route('journals.index')); ?>">▧ Journal Entries</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('reports.view')): ?><a class="nav-link <?php echo e(request()->routeIs('reports.*') ? 'active' : ''); ?>" href="<?php echo e(route('reports.index')); ?>">▥ Reports</a><?php endif; ?>
        <?php $__currentLoopData = ['accounts'=>'Chart of Accounts','tax-codes'=>'VAT Codes','branches'=>'Branches']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php ($moduleConfig=config("erp.modules.$key")); ?>
            <?php if($moduleConfig && auth()->user()->hasPermission($moduleConfig['permission'].'.view')): ?><a class="nav-link <?php echo e(request()->is("masters/$key*") ? 'active' : ''); ?>" href="<?php echo e(route('masters.index',$key)); ?>">• <?php echo e($label); ?></a><?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

        <div class="nav-group">Administration</div>
        <?php if(auth()->user()->hasPermission('users.view')): ?><a class="nav-link <?php echo e(request()->routeIs('users.*') ? 'active' : ''); ?>" href="<?php echo e(route('users.index')); ?>">♙ Users & Roles</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('company_settings.view')): ?><a class="nav-link <?php echo e(request()->routeIs('settings.*') ? 'active' : ''); ?>" href="<?php echo e(route('settings.edit')); ?>">⚙ Company Settings</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('periods.view')): ?><a class="nav-link <?php echo e(request()->routeIs('periods.*') ? 'active' : ''); ?>" href="<?php echo e(route('periods.index')); ?>">▦ Fiscal Periods</a><?php endif; ?>
        <?php if(auth()->user()->hasPermission('audit_logs.view')): ?><a class="nav-link <?php echo e(request()->routeIs('audit.*') ? 'active' : ''); ?>" href="<?php echo e(route('audit.index')); ?>">◷ Audit Trail</a><?php endif; ?>
    </aside>
    <main class="main">
        <header class="topbar">
            <div style="display:flex;align-items:center;gap:12px"><button class="btn btn-secondary mobile-toggle" data-sidebar-toggle>☰</button><div class="topbar-title"><?php echo $__env->yieldContent('page_title', 'Dashboard'); ?></div></div>
            <div class="user-menu">
                <div class="user-meta text-right"><strong><?php echo e(auth()->user()->name); ?></strong><div class="muted" style="font-size:11px"><?php echo e(auth()->user()->branch?->name ?? 'All branches'); ?></div></div>
                <div class="avatar"><?php echo e(strtoupper(substr(auth()->user()->name,0,1))); ?></div>
                <form method="post" action="<?php echo e(route('logout')); ?>"><?php echo csrf_field(); ?><button class="btn btn-secondary btn-sm">Logout</button></form>
            </div>
        </header>
        <section class="content">
            <?php if(session('success')): ?><div class="alert alert-success" data-auto-hide><?php echo e(session('success')); ?></div><?php endif; ?>
            <?php if(session('error')): ?><div class="alert alert-error"><?php echo e(session('error')); ?></div><?php endif; ?>
            <?php if(session('warning')): ?><div class="alert alert-warning"><?php echo e(session('warning')); ?></div><?php endif; ?>
            <?php if($errors->any()): ?><div class="alert alert-error"><strong>Please correct the following:</strong><ul><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><li><?php echo e($error); ?></li><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></ul></div><?php endif; ?>
            <?php echo $__env->yieldContent('content'); ?>
        </section>
    </main>
</div>
<script src="<?php echo e(asset('assets/app.js')); ?>"></script>
<?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH /home/cbo/public_html/resources/views/layouts/app.blade.php ENDPATH**/ ?>