<?php $__env->startSection('title', 'HR & Employee Compliance'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-5">
    <header class="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between"><div><p class="text-[10px] font-bold uppercase tracking-[.18em] text-orange-600">Workforce & compliance</p><h1 class="mt-1 text-2xl font-bold text-[#0b1f38]">HR & Employee Compliance</h1><p class="mt-1 text-xs text-slate-500">Staff records, access, visas, passports, Emirates IDs and insurance expiry controls.</p></div><div class="flex gap-2"><a href="<?php echo e(route('app.employees.index')); ?>" class="rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-xs font-bold text-slate-700">Employee Directory</a><?php if(auth()->user()->hasPermission('employees.create')): ?><a href="<?php echo e(route('app.employees.create')); ?>" class="rounded-xl bg-orange-600 px-4 py-2.5 text-xs font-bold text-white">+ Add Employee</a><?php endif; ?></div></header>

    <section class="grid gap-3 sm:grid-cols-3 xl:grid-cols-6">
        <?php $__currentLoopData = [
            ['Total Staff',$employeesCount,'text-slate-900'], ['Active Staff',$activeEmployeesCount,'text-emerald-600'],
            ['Visas Expiring',$expiringVisasCount,'text-amber-600'], ['Passports Expiring',$expiringPassportsCount,'text-violet-600'],
            ['Emirates ID Expiring',$expiringEmiratesIdsCount,'text-rose-600'], ['Insurance Due',$insuranceDueCount,'text-blue-600']
        ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$label,$value,$color]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <article class="rounded-2xl border border-slate-200 bg-white p-4 shadow-sm"><p class="text-[9px] font-bold uppercase tracking-wider text-slate-400"><?php echo e($label); ?></p><strong class="mt-2 block text-2xl <?php echo e($color); ?>"><?php echo e(number_format($value)); ?></strong></article>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </section>

    <section class="erp-panel">
        <div class="erp-panel-heading"><div><h2>Employee Compliance Watchlist</h2><p>Employee documents reaching expiry within the next 60 days.</p></div><a href="<?php echo e(route('app.employees.index')); ?>">Manage employees</a></div>
        <div class="mt-4 overflow-x-auto"><table class="erp-table"><thead><tr><th>Employee</th><th>Document</th><th>Number</th><th>Expiry Date</th><th>Time Remaining</th></tr></thead><tbody>
            <?php $__empty_1 = true; $__currentLoopData = $upcomingDocuments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $document): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr><td><strong><?php echo e($document->employee?->full_name ?? 'Employee unavailable'); ?></strong><small><?php echo e($document->employee?->employee_code); ?></small></td><td><strong><?php echo e(str($document->document_type)->replace('_',' ')->title()); ?></strong><small><?php echo e($document->issued_at); ?></small></td><td><strong><?php echo e($document->document_number ?: 'Not recorded'); ?></strong></td><td><strong><?php echo e($document->expiry_date?->format('d M Y')); ?></strong></td><td><span class="erp-status" data-status="warning"><?php echo e($document->expiry_date?->diffForHumans()); ?></span></td></tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="5"><div class="erp-empty"><span>✓</span><strong>No employee documents expire within 60 days</strong><p>Compliance records are currently clear.</p></div></td></tr>
            <?php endif; ?>
        </tbody></table></div>
    </section>

    <section class="grid gap-4 sm:grid-cols-2">
        <a href="<?php echo e(route('app.employees.index')); ?>" class="erp-quick-action"><span class="bg-blue-50 text-blue-600">E</span><div><strong>Employee Directory</strong><small class="mt-1 block font-normal text-slate-500">Manage staff profiles, designations and compliance records.</small></div></a>
        <?php if(auth()->user()->hasPermission('roles.view')): ?><a href="<?php echo e(route('app.users.index')); ?>" class="erp-quick-action"><span class="bg-violet-50 text-violet-600">U</span><div><strong>User Access Management</strong><small class="mt-1 block font-normal text-slate-500">Control logins, roles, permissions and account status.</small></div></a><?php endif; ?>
    </section>
</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\panels\hr.blade.php ENDPATH**/ ?>