<?php $__env->startSection('title', 'Staff'); ?>

<?php $__env->startSection('content'); ?>
<div class="row mt-4">
<div class="col-12">
    <div class="page-header">
        <div>
            <h1 class="page-title">Staff</h1>
            <p class="page-subtitle">Manage your team, roles, and availability.</p>
        </div>
        <div class="page-actions">
            <a href="<?php echo e(route('staff.create')); ?>" class="btn btn-primary"><i class="fe fe-plus me-1"></i>Add Staff</a>
        </div>
    </div>

    <div class="card mb-4">
        <div class="card-body">
            <form method="get" action="<?php echo e(route('staff.index')); ?>" class="row g-3 align-items-end">
                <div class="col-12 col-md-6 col-lg-4">
                    <label class="form-label">Search</label>
                    <input type="text" name="search" value="<?php echo e(request('search')); ?>" placeholder="Name, mobile, email..." class="form-control">
                </div>
                <div class="col-12 col-md-6 col-lg-3">
                    <label class="form-label">Branch</label>
                    <select name="branch_id" class="form-control form-select">
                        <option value="">All</option>
                        <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $b): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($b->id); ?>" <?php echo e((string)request('branch_id') === (string)$b->id ? 'selected' : ''); ?>><?php echo e($b->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="col-12 col-md-6 col-lg-2">
                    <label class="form-label">Status</label>
                    <select name="status" class="form-control form-select">
                        <option value="">All</option>
                        <option value="active" <?php echo e(request('status') === 'active' ? 'selected' : ''); ?>>Active</option>
                        <option value="inactive" <?php echo e(request('status') === 'inactive' ? 'selected' : ''); ?>>Inactive</option>
                        <option value="on_leave" <?php echo e(request('status') === 'on_leave' ? 'selected' : ''); ?>>On Leave</option>
                    </select>
                </div>
                <div class="col-12 col-lg-auto">
                    <button type="submit" class="btn btn-primary"><i class="fe fe-filter me-1"></i>Filter</button>
                </div>
            </form>
        </div>
    </div>

    <div class="card">
        <div class="card-body">
            <div class="table-responsive">
                <table class="table border text-nowrap text-md-nowrap table-hover mb-0">
                    <thead>
                        <tr>
                            <th>Code</th>
                            <th>Name</th>
                            <th>Branch</th>
                            <th>Designation</th>
                            <th>Status</th>
                            <th class="text-end">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $staff; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $member): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($member->employee_code); ?></td>
                            <td><?php echo e($member->full_name); ?></td>
                            <td><?php echo e($member->branch?->name ?? '—'); ?></td>
                            <td><?php echo e($member->designation ?? '—'); ?></td>
                            <td>
                                <?php
                                    $badgeClass = match($member->status) {
                                        'active' => 'badge-success',
                                        'on_leave' => 'badge-warning',
                                        default => 'badge-muted',
                                    };
                                ?>
                                <span class="badge <?php echo e($badgeClass); ?>">
                                    <?php echo e($member->status); ?>

                                </span>
                            </td>
                            <td class="text-end table-actions">
                        <a href="<?php echo e(route('staff.show', $member)); ?>" class="btn btn-icon btn-sm btn-light" title="View"><i class="fe fe-eye"></i></a>
                        <a href="<?php echo e(route('staff.edit', $member)); ?>" class="btn btn-icon btn-sm btn-light" title="Edit"><i class="fe fe-edit"></i></a>
                        <form action="<?php echo e(route('staff.destroy', $member)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Delete this staff member?');">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="btn btn-icon btn-sm btn-light text-danger" title="Delete"><i class="fe fe-trash-2"></i></button>
                        </form>
                    </td>
                </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="6" class="text-center text-muted py-4">No staff found.</td>
                        </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <?php if($staff->hasPages()): ?>
    <div class="mt-4">
        <?php echo e($staff->withQueryString()->links()); ?>

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

<?php echo $__env->make('layouts.sash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\xampp\htdocs\salon\resources\views/staff/index.blade.php ENDPATH**/ ?>