<?php $__env->startSection('title','Professional Applications'); ?>
<?php $__env->startSection('subtitle','Review professional credentials, documents, and application decisions.'); ?>
<?php $__env->startSection('content'); ?>
<form class="filter-panel application-filters" method="get">
    <div class="tabs">
        <a class="<?php echo e(!request('status')?'active':''); ?>" href="<?php echo e(route('applications')); ?>">All</a><?php $__currentLoopData = ['pending','approved','declined']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <a class="<?php echo e(request('status')===$status?'active':''); ?>" href="<?php echo e(route('applications',['status'=>$status])); ?>"><?php echo e(ucfirst($status)); ?></a><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <div class="filter-controls">
        <input name="q" value="<?php echo e(request('q')); ?>" placeholder="Search applicant or email">
        <input type="hidden" name="status" value="<?php echo e(request('status')); ?>">
        <button>Search</button>
    </div>
</form>
<div class="application-stats">
    <article>
        <span>
            <i data-lucide="files"></i>
        </span>
        <div>
            <p>Total Applications</p>
            <strong><?php echo e(number_format($stats['total'])); ?></strong>
        </div>
    </article>
    <article>
        <span class="pending">
            <i data-lucide="clock-3"></i>
        </span>
        <div>
            <p>Pending Review</p>
            <strong><?php echo e(number_format($stats['pending'])); ?></strong>
        </div>
    </article>
    <article>
        <span>
            <i data-lucide="badge-check"></i>
        </span>
        <div>
            <p>Approved</p>
            <strong><?php echo e(number_format($stats['approved'])); ?></strong>
        </div>
    </article>
    <article>
        <span class="declined">
            <i data-lucide="circle-x"></i>
        </span>
        <div>
            <p>Declined</p>
            <strong><?php echo e(number_format($stats['declined'])); ?></strong>
        </div>
    </article>
</div>
<div class="application-table">
    <div class="table-scroll">
        <table>
            <thead>
                <tr>
                    <th>Applicant</th>
                    <th>Profession</th>
                    <th>Submitted</th>
                    <th>Default Rate</th>
                    <th>Status</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody><?php $__empty_1 = true; $__currentLoopData = $applications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $application): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?> <tr>
                    <td>
                        <div class="user-cell">
                            <div class="avatar application-avatar" style="--avatar-border:<?php echo e($application->profession?->color_hex??'#d8ddd4'); ?>"><?php echo e(strtoupper(substr($application->user?->profile?->full_name??'P',0,1))); ?></div>
                            <div>
                                <b><?php echo e($application->user?->profile?->full_name??'Professional'); ?></b>
                                <span><?php echo e($application->user?->email); ?></span>
                            </div>
                        </div>
                    </td>
                    <td>
                        <b><?php echo e($application->profession?->name??'—'); ?></b>
                        <small><?php echo e($application->profession?->salutation); ?></small>
                    </td>
                    <td><?php echo e($application->updated_at?->format('M d, Y')); ?>

                        <small><?php echo e($application->updated_at?->diffForHumans()); ?></small>
                    </td>
                    <td>
                        <b>₱<?php echo e(number_format($application->default_rate,2)); ?></b>
                    </td>
                    <td>
                        <span class="application-status <?php echo e($application->status); ?>"><?php echo e(ucfirst($application->status)); ?></span>
                    </td>
                    <td>
                        <a class="review-link" href="<?php echo e(route('applications.show',$application)); ?>">Review <i data-lucide="arrow-right"></i>
                        </a>
                    </td>
                </tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?> <tr>
                    <td colspan="6" class="empty">No professional applications match this filter.</td>
                </tr><?php endif; ?> </tbody>
        </table>
    </div>
    <div class="table-footer">
        <span>Showing <?php echo e($applications->firstItem()??0); ?> to <?php echo e($applications->lastItem()??0); ?> of <?php echo e(number_format($applications->total())); ?> applications</span><?php echo e($applications->onEachSide(1)->links('vendor.pagination.default')); ?>

    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/dev/desxpert-admin/resources/views/admin/applications.blade.php ENDPATH**/ ?>