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

<?php $__env->startSection('content'); ?>
<div class="space-y-6">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-xl font-bold text-slate-900 dark:text-white">HR Document Compliance Expiries</h1>
            <p class="text-xs text-slate-500">Track expiring passports, residence visas, Emirates IDs, labour cards, and health insurance.</p>
        </div>
        <a href="<?php echo e(route('app.employees.index')); ?>" class="px-4 py-2 bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-200 font-semibold text-xs rounded-xl">Back to Directory</a>
    </div>

    <!-- Expiring Documents Table (Requirement 26) -->
    <div class="bg-white dark:bg-slate-800 rounded-3xl border border-slate-200 dark:border-slate-700/60 shadow-sm overflow-hidden text-xs">
        <div class="p-4 border-b border-slate-200 dark:border-slate-700 font-bold flex items-center justify-between">
            <span>Expiring Documents (Next 90 Days)</span>
            <span class="px-2 py-0.5 rounded bg-amber-100 text-amber-800 font-bold text-[10px]">Automated Reminder Engine Active</span>
        </div>
        <div class="overflow-x-auto">
            <table class="w-full text-left rtl:text-right">
                <thead class="bg-slate-50 dark:bg-slate-900/60 border-b border-slate-200 dark:border-slate-700 text-slate-500 uppercase tracking-wider font-bold">
                    <tr>
                        <th class="px-6 py-4">Employee</th>
                        <th class="px-6 py-4">Document Type</th>
                        <th class="px-6 py-4">Document #</th>
                        <th class="px-6 py-4">Expiry Date</th>
                        <th class="px-6 py-4">Days Remaining</th>
                        <th class="px-6 py-4 text-right rtl:text-left">Action</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-slate-200 dark:divide-slate-700/60 font-medium">
                    <?php $__empty_1 = true; $__currentLoopData = $expiringDocs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $doc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="hover:bg-slate-50 dark:hover:bg-slate-700/30">
                            <td class="px-6 py-4 font-bold text-slate-900 dark:text-white"><?php echo e($doc->employee->full_name); ?></td>
                            <td class="px-6 py-4 uppercase font-bold text-sky-600 text-[10px]"><?php echo e(str_replace('_', ' ', $doc->document_type)); ?></td>
                            <td class="px-6 py-4 font-mono text-slate-500"><?php echo e($doc->document_number ?? 'N/A'); ?></td>
                            <td class="px-6 py-4 font-mono font-bold text-slate-800 dark:text-slate-200"><?php echo e($doc->expiry_date->format('d M Y')); ?></td>
                            <td class="px-6 py-4">
                                <?php $days = now()->diffInDays($doc->expiry_date, false); ?>
                                <span class="px-2.5 py-0.5 rounded-full text-[10px] font-bold <?php echo e($days <= 30 ? 'bg-rose-100 text-rose-700' : 'bg-amber-100 text-amber-700'); ?>">
                                    <?php echo e($days < 0 ? 'EXPIRED' : $days . ' Days Left'); ?>

                                </span>
                            </td>
                            <td class="px-6 py-4 text-right rtl:text-left">
                                <a href="<?php echo e(route('app.employees.show', $doc->employee_id)); ?>#document-<?php echo e($doc->id); ?>" class="text-sky-600 font-bold hover:underline">Update Expiry</a>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="6" class="px-6 py-8 text-center text-slate-400 font-semibold">
                                No employee compliance documents expiring within the next 90 days.
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </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\hr\employees\expiries.blade.php ENDPATH**/ ?>