<?php $__env->startSection('title', 'Уулзалтууд'); ?>
<?php $__env->startSection('page_title', 'Уулзалтууд'); ?>

<?php $__env->startSection('content'); ?>

<div class="flex flex-wrap items-center gap-2 mb-6">
    <?php $tabs = ['' => ['Бүгд','all'], 'pending' => ['Хүлээгдэж буй','pending'], 'confirmed' => ['Баталгаажсан','confirmed'], 'completed' => ['Дууссан','completed'], 'cancelled' => ['Цуцлагдсан','cancelled']]; ?>
    <?php $__currentLoopData = $tabs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => [$label, $cKey]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <a href="<?php echo e(route('admin.meetings.index', array_filter(['status' => $key]))); ?>"
           class="px-4 py-2 rounded-lg text-sm font-semibold transition <?php echo e(request('status', '') === $key ? 'bg-nsma-red text-white' : 'bg-white border border-gray-200'); ?>">
            <?php echo e($label); ?> (<?php echo e($statusCounts[$cKey] ?? 0); ?>)
        </a>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>

<form method="GET" class="flex items-center gap-2 mb-6">
    <input type="hidden" name="status" value="<?php echo e(request('status')); ?>">
    <input type="text" name="search" value="<?php echo e(request('search')); ?>" placeholder="Хайх..." class="px-4 py-2 border border-gray-200 rounded-lg outline-none">
    <input type="date" name="date_from" value="<?php echo e(request('date_from')); ?>" class="px-4 py-2 border border-gray-200 rounded-lg outline-none">
    <input type="date" name="date_to" value="<?php echo e(request('date_to')); ?>" class="px-4 py-2 border border-gray-200 rounded-lg outline-none">
    <button class="px-4 py-2 bg-nsma-dark text-white rounded-lg">Шүүх</button>
</form>

<div class="bg-white rounded-2xl border border-gray-100 overflow-hidden">
    <table class="w-full">
        <thead class="bg-gray-50 border-b">
            <tr>
                <th class="text-left px-4 py-3 text-xs font-semibold uppercase">Огноо/Цаг</th>
                <th class="text-left px-4 py-3 text-xs font-semibold uppercase">Хүн</th>
                <th class="text-left px-4 py-3 text-xs font-semibold uppercase">Сэдэв</th>
                <th class="text-left px-4 py-3 text-xs font-semibold uppercase">Төрөл</th>
                <th class="text-left px-4 py-3 text-xs font-semibold uppercase">Хариуцагч</th>
                <th class="text-left px-4 py-3 text-xs font-semibold uppercase">Төлөв</th>
                <th class="text-right px-4 py-3 text-xs font-semibold uppercase"></th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $meetings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $m): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="border-b border-gray-100">
                    <td class="px-4 py-3 text-sm"><?php echo e($m->preferred_date->format('Y-m-d')); ?> <?php echo e(substr($m->preferred_time, 0, 5)); ?></td>
                    <td class="px-4 py-3">
                        <div class="font-semibold"><?php echo e($m->full_name); ?></div>
                        <div class="text-xs text-gray-500"><?php echo e($m->company_name ?? $m->email); ?></div>
                    </td>
                    <td class="px-4 py-3 text-sm"><?php echo e($m->subject); ?></td>
                    <td class="px-4 py-3 text-sm"><?php echo e($m->meetingTypeLabel()); ?></td>
                    <td class="px-4 py-3 text-sm"><?php echo e($m->assignedUser->name ?? '-'); ?></td>
                    <td class="px-4 py-3"><span class="text-xs px-2 py-1 rounded-full bg-<?php echo e($m->statusColor()); ?>-100 text-<?php echo e($m->statusColor()); ?>-700"><?php echo e($m->statusLabel()); ?></span></td>
                    <td class="px-4 py-3 text-right">
                        <a href="<?php echo e(route('admin.meetings.show', $m)); ?>" class="px-3 py-1 text-xs bg-nsma-red text-white rounded">Үзэх</a>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="7" class="text-center py-12 text-gray-500">Уулзалт байхгүй байна.</td></tr>
            <?php endif; ?>
        </tbody>
    </table>
</div>

<div class="mt-4"><?php echo e($meetings->links()); ?></div>

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

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\uninsma.mn\resources\views/admin/meetings/index.blade.php ENDPATH**/ ?>