<?php $__env->startSection('title', 'Absent Members'); ?>
<?php $__env->startSection('kicker', 'Find members not marked present for a service'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('partials.module-tabs', ['tabs' => [
        ['label' => 'QR Attendance', 'route' => 'attendance.qr', 'icon' => 'scan-qr-code'],
        ['label' => 'Manual Entry', 'route' => 'attendance.manual', 'icon' => 'list-checks'],
        ['label' => 'Records', 'route' => 'attendance.records', 'icon' => 'clipboard-list'],
        ['label' => 'Today', 'route' => 'attendance.today', 'icon' => 'calendar-check'],
        ['label' => 'Absent', 'route' => 'attendance.absent', 'icon' => 'user-x'],
    ]], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="content-card mb-3">
        <form method="GET" class="row g-3 align-items-end">
            <div class="col-md-8">
                <label class="form-label">Service/Event</label>
                <select name="church_service_id" class="form-select">
                    <option value="">Select service/event</option>
                    <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($service->id); ?>" <?php if($selectedService?->id === $service->id): echo 'selected'; endif; ?>><?php echo e($service->name); ?> · <?php echo e($service->service_date?->format('d M Y')); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
            <div class="col-md-4">
                <button class="btn btn-primary w-100"><i data-lucide="user-x"></i><span>Show Absent</span></button>
            </div>
        </form>
    </div>

    <div class="table-card">
        <?php if(! $selectedService): ?>
            <div class="empty-state">Chagua service/event kuona absent members.</div>
        <?php else: ?>
            <div class="d-flex justify-content-between mb-3">
                <div class="section-title"><?php echo e($selectedService->name); ?></div>
                <span class="badge badge-soft-gold"><?php echo e($members->count()); ?> absent</span>
            </div>
            <div class="table-responsive">
                <table class="table">
                    <thead><tr><th>Member</th><th>Jumuiya</th><th>Phone</th><th>Position</th></tr></thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $members; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $member): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td class="fw-semibold"><?php echo e($member->full_name); ?></td>
                                <td><?php echo e($member->jumuiya?->name ?? '-'); ?></td>
                                <td><?php echo e($member->phone ?? '-'); ?></td>
                                <td><?php echo e($member->position?->name ?? '-'); ?></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr><td colspan="4"><div class="empty-state">Members wote wamewekwa present kwa service hii.</div></td></tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>

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