<?php $__env->startSection('title', 'Tambah Audit & Daftar Audit'); ?>

<?php $__env->startSection('content'); ?>
<div class="min-h-screen bg-slate-50 p-3" x-data="{ open: false }">

    <style>
        [x-cloak] {
            display: none !important;
        }

        .select-clean {
            appearance: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            background-image: none !important;
        }

        .select-clean::-ms-expand {
            display: none !important;
        }

        .modal-scroll::-webkit-scrollbar {
            width: 8px;
        }

        .modal-scroll::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 999px;
        }

        .modal-scroll::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 999px;
        }

        .modal-scroll::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }
    </style>

    
    <?php if(session('success')): ?>
        <div x-data="{ show: true }"
            x-show="show"
            x-transition:enter="transform ease-out duration-500"
            x-transition:enter-start="-translate-y-10 opacity-0"
            x-transition:enter-end="translate-y-0 opacity-100"
            x-transition:leave="transition ease-in duration-500"
            x-transition:leave-start="opacity-100"
            x-transition:leave-end="opacity-0"
            x-init="setTimeout(() => show = false, 4000)"
            class="fixed top-4 left-1/2 z-50 w-[90%] max-w-sm -translate-x-1/2 rounded-xl bg-green-600 px-4 py-3 text-sm text-white shadow-xl"
            role="alert">

            <div class="flex items-center justify-between gap-3">
                <div class="flex items-center gap-3">
                    <div class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-white/15">
                        <i class="fas fa-check text-xs"></i>
                    </div>

                    <div>
                        <p class="text-sm font-semibold">Sukses!</p>
                        <p class="text-xs text-white/90"><?php echo e(session('success')); ?></p>
                    </div>
                </div>

                <button @click="show = false"
                    class="flex h-8 w-8 items-center justify-center rounded-lg text-lg font-bold leading-none text-white/90 transition hover:bg-white/15 hover:text-white">
                    &times;
                </button>
            </div>
        </div>
    <?php endif; ?>

    
    <div class="mb-4 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">
        <div class="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between">
            <div class="flex items-center gap-3">
                <div class="flex h-9 w-9 items-center justify-center rounded-lg bg-blue-50 text-blue-600">
                    <i class="fas fa-clipboard-list text-xs"></i>
                </div>

                <div>
                    <h2 class="text-base font-bold text-slate-800">Audit 5S</h2>
                    <p class="mt-0.5 text-xs text-slate-500">
                        Input data audit dan lakukan verifikasi audit.
                    </p>
                </div>
            </div>

            <button @click="open = true"
                class="inline-flex h-9 items-center justify-center gap-2 rounded-lg bg-blue-600 px-4 text-xs font-semibold text-white shadow-sm transition hover:bg-blue-700 hover:shadow-md">
                <i class="fas fa-plus text-xs"></i>
                Tambah Audit
            </button>
        </div>
    </div>

    
    <div x-show="open"
        x-cloak
        x-transition.opacity
        class="fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 px-4 py-6 backdrop-blur-sm">

        <div @click.away="open = false"
            x-show="open"
            x-transition:enter="transition ease-out duration-200"
            x-transition:enter-start="opacity-0 scale-95 translate-y-2"
            x-transition:enter-end="opacity-100 scale-100 translate-y-0"
            x-transition:leave="transition ease-in duration-150"
            x-transition:leave-start="opacity-100 scale-100 translate-y-0"
            x-transition:leave-end="opacity-0 scale-95 translate-y-2"
            class="modal-scroll relative z-50 w-full max-w-xl max-h-[88vh] overflow-y-auto rounded-xl border border-slate-200 bg-white shadow-2xl">

            
            <div class="sticky top-0 z-10 flex items-center justify-between border-b border-slate-100 bg-white px-4 py-3">
                <div class="flex items-center gap-3">
                    <div class="flex h-10 w-10 items-center justify-center rounded-xl shadow-sm"
                        style="background-color: rgba(47, 67, 91, 0.10);">
                        <i data-lucide="clipboard-plus"
                            class="h-5 w-5"
                            style="color:#2f435b;"
                            stroke-width="2.3"></i>
                    </div>

                    <div>
                        <h2 class="text-sm font-bold text-slate-800">
                            Form Tambah Audit
                        </h2>
                        <p class="mt-0.5 text-xs text-slate-500">
                            Lengkapi data audit dan unggah foto sebelum.
                        </p>
                    </div>
                </div>

                <button type="button"
                    @click="open = false"
                    class="flex h-8 w-8 items-center justify-center rounded-lg text-slate-400 transition hover:bg-slate-100 hover:text-slate-700">
                    <i class="fas fa-xmark text-xs"></i>
                </button>
            </div>

            
            <form action="<?php echo e(route('audit.store')); ?>" method="POST" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>

                <div class="px-4 py-4">
                    <div class="grid grid-cols-1 gap-3 md:grid-cols-2">

                        <div>
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Nama Auditor <span class="text-red-500">*</span>
                            </label>
                            <input type="text"
                                name="auditor"
                                required
                                class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 text-xs text-slate-700 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100"
                                placeholder="Masukkan nama auditor">
                        </div>

                        <div>
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Nama Auditee <span class="text-red-500">*</span>
                            </label>
                            <input type="text"
                                name="auditi"
                                required
                                class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 text-xs text-slate-700 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100"
                                placeholder="Masukkan nama auditee">
                        </div>

                        <div>
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Tema Audit <span class="text-red-500">*</span>
                            </label>

                            <div x-data="{ selectOpen: false }" class="relative">
                                <select name="tema_id"
                                    required
                                    @focus="selectOpen = true"
                                    @blur="selectOpen = false"
                                    @change="selectOpen = false"
                                    class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs text-slate-700 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                    <option value="">-- Pilih Tema --</option>
                                    <?php $__currentLoopData = $temaList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $nama): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($id); ?>"><?php echo e($nama); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>

                                <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                    <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                        :class="selectOpen ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                                </span>
                            </div>
                        </div>

                        <div>
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Kategori Audit <span class="text-red-500">*</span>
                            </label>

                            <div x-data="{ selectOpen: false }" class="relative">
                                <select name="kategori"
                                    required
                                    @focus="selectOpen = true"
                                    @blur="selectOpen = false"
                                    @change="selectOpen = false"
                                    class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs text-slate-700 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                    <option value="">-- Pilih Kategori --</option>
                                    <option value="Ringkas">Ringkas</option>
                                    <option value="Rapi">Rapi</option>
                                    <option value="Resik">Resik</option>
                                    <option value="Safety">Safety</option>
                                    <option value="ISO 14001">Disiplin</option>
                                </select>

                                <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                    <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                        :class="selectOpen ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                                </span>
                            </div>
                        </div>

                        <div>
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Divisi yang Diaudit <span class="text-red-500">*</span>
                            </label>

                            <div x-data="{ selectOpen: false }" class="relative">
                                <select name="bagian_id"
                                    required
                                    @focus="selectOpen = true"
                                    @blur="selectOpen = false"
                                    @change="selectOpen = false"
                                    class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs text-slate-700 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                    <option value="">-- Pilih Divisi --</option>
                                    <?php $__currentLoopData = $bagians; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bagian): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($bagian->id); ?>"><?php echo e($bagian->nama_bagian); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>

                                <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                    <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                        :class="selectOpen ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                                </span>
                            </div>
                        </div>

                        <div>
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Tanggal Audit <span class="text-red-500">*</span>
                            </label>
                            <input type="date"
                                name="tanggal_audit"
                                required
                                value="<?php echo e(old('tanggal_audit')); ?>"
                                class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 text-xs text-slate-700 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                        </div>

                        <div class="md:col-span-2">
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Area Temuan
                            </label>
                            <input type="text"
                                name="lokasi"
                                class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 text-xs text-slate-700 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100"
                                placeholder="Contoh: Area produksi, gudang, kantor, dll">
                        </div>

                        <div class="md:col-span-2">
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Keterangan
                            </label>
                            <input type="text"
                                name="keterangan"
                                class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 text-xs text-slate-700 outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100"
                                placeholder="Tambahkan keterangan singkat">
                        </div>

                        <div class="md:col-span-2">
                            <label class="mb-1 block text-xs font-semibold text-slate-600">
                                Foto Sebelum <span class="text-red-500">*</span>
                            </label>

                            <div class="rounded-xl border border-dashed border-slate-300 bg-slate-50 px-4 py-3 transition hover:border-blue-400 hover:bg-white">
                                <div class="flex items-center gap-3">
                                    <div class="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-blue-50 text-blue-600">
                                        <i class="fas fa-image text-xs"></i>
                                    </div>

                                    <div class="min-w-0 flex-1">
                                        <input type="file"
                                            name="foto_sebelum"
                                            accept="image/*"
                                            required
                                            class="block w-full cursor-pointer text-xs text-slate-600 file:mr-3 file:rounded-lg file:border-0 file:bg-blue-600 file:px-3 file:py-2 file:text-xs file:font-medium file:text-white hover:file:bg-blue-700">

                                        <p class="mt-1 text-[11px] text-slate-400">
                                            Format gambar disarankan JPG, PNG, atau JPEG.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>

                
                <div class="sticky bottom-0 z-10 flex items-center justify-end gap-2 border-t border-slate-100 bg-white px-4 py-3 shadow-[0_-8px_20px_rgba(15,23,42,0.06)]">
                    <button @click="open = false"
                        type="button"
                        class="inline-flex h-8 w-20 items-center justify-center gap-1 rounded-lg bg-gray-200 px-2 text-xs font-medium text-slate-600 transition hover:bg-gray-300">
                        <i class="fas fa-xmark text-[10px]"></i>
                        Batal
                    </button>

                    <button type="submit"
                        class="inline-flex h-8 w-20 items-center justify-center gap-1 rounded-lg bg-blue-500 px-2 text-xs font-medium text-white transition hover:bg-blue-600">
                        <i class="fas fa-check text-[10px]"></i>
                        Tambah
                    </button>
                </div>
            </form>
        </div>
    </div>

    
    <div class="mb-4 overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm">

        
        <div class="border-b border-slate-100 bg-white px-4 py-3">
            <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
                <div class="flex items-center gap-3">
                    <div class="flex h-9 w-9 items-center justify-center rounded-lg bg-red-50 text-red-600">
                        <i class="fas fa-clipboard-list text-xs"></i>
                    </div>

                    <div>
                        <h3 class="text-sm font-bold text-slate-800">Daftar Audit Belum Verifikasi</h3>
                        <p class="mt-0.5 text-xs text-slate-500">
                            Data audit dengan status open yang masih memerlukan proses verifikasi.
                        </p>
                    </div>
                </div>
            </div>
        </div>

        
        <div class="border-b border-slate-100 bg-slate-50/70 px-4 py-3">
            <form action="<?php echo e(route('audit.create')); ?>" method="GET">
                <div class="rounded-xl border border-slate-200 bg-white px-3 py-3 shadow-sm">
                    <div class="grid grid-cols-1 gap-2 md:grid-cols-5">

                        
                        <div x-data="{ open: false }" class="relative">
                            <select name="belum_tema"
                                @focus="open = true"
                                @blur="open = false"
                                @change="open = false"
                                class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs font-medium text-slate-600 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                <option value="">-- Pilih Tema --</option>
                                <?php $__currentLoopData = $temaList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $nama): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($id); ?>" <?php echo e($belumTema == $id ? 'selected' : ''); ?>>
                                        <?php echo e($nama); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>

                            <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                    :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                            </span>
                        </div>

                        
                        <div x-data="{ open: false }" class="relative">
                            <select name="belum_bulan"
                                @focus="open = true"
                                @blur="open = false"
                                @change="open = false"
                                class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs font-medium text-slate-600 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                <option value="">-- Pilih Bulan --</option>
                                <?php for($i = 1; $i <= 12; $i++): ?>
                                    <option value="<?php echo e($i); ?>" <?php echo e($belumBulan == $i ? 'selected' : ''); ?>>
                                        <?php echo e(\Carbon\Carbon::create()->month($i)->translatedFormat('F')); ?>

                                    </option>
                                <?php endfor; ?>
                            </select>

                            <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                    :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                            </span>
                        </div>

                        
                        <div x-data="{ open: false }" class="relative">
                            <select name="belum_tahun"
                                @focus="open = true"
                                @blur="open = false"
                                @change="open = false"
                                class="select-clean h-9 w-full rounded-lg border border-slate-200 bg-slate-50 px-3 pr-9 text-xs font-medium text-slate-600 outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                                <option value="">-- Pilih Tahun --</option>
                                <?php $__currentLoopData = $tahunList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tahun): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($tahun); ?>" <?php echo e($belumTahun == $tahun ? 'selected' : ''); ?>>
                                        <?php echo e($tahun); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>

                            <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                                <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                                    :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                            </span>
                        </div>

                        
                        <input type="hidden" name="sudah_tema" value="<?php echo e($sudahTema); ?>">
                        <input type="hidden" name="sudah_bulan" value="<?php echo e($sudahBulan); ?>">
                        <input type="hidden" name="sudah_tahun" value="<?php echo e($sudahTahun); ?>">

                        
                        <div class="grid grid-cols-2 gap-2 md:col-span-2">
                            <button type="submit"
                                class="inline-flex h-9 items-center justify-center gap-1.5 rounded-lg bg-blue-500 px-3 text-xs font-medium text-white transition hover:bg-blue-600">
                                <i class="fas fa-check text-[11px]"></i>
                                Filter
                            </button>

                            <a href="<?php echo e(route('audit.create', ['reset' => 1])); ?>"
                                class="inline-flex h-9 items-center justify-center gap-1.5 rounded-lg bg-gray-200 px-3 text-xs font-medium text-slate-600 transition hover:bg-gray-300">
                                <i class="fas fa-rotate-left text-[11px]"></i>
                                Reset
                            </a>
                        </div>

                    </div>
                </div>
            </form>
        </div>

        
        <div class="flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between">
            <div class="flex items-center gap-2 text-xs text-slate-600">
                <span>Tampilkan</span>

                <div x-data="{ open: false }" class="relative">
                    <select id="entriesBelum"
                        @focus="open = true"
                        @blur="open = false"
                        @change="open = false"
                        class="select-clean h-9 w-20 rounded-lg border border-slate-200 bg-slate-50 px-3 pr-8 text-xs font-medium text-slate-700 shadow-sm outline-none transition focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">
                        <option value="5">5</option>
                        <option value="10" selected>10</option>
                        <option value="25">25</option>
                        <option value="50">50</option>
                    </select>

                    <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-500">
                        <i class="fas fa-chevron-down text-[10px] transition-transform duration-300"
                            :class="open ? 'rotate-180 text-blue-500' : 'rotate-0'"></i>
                    </span>
                </div>

                <span>entri</span>
            </div>

            <div class="relative w-full sm:w-64">
                <input type="text"
                    id="searchBelum"
                    placeholder="Cari data audit..."
                    class="h-9 w-full rounded-lg border border-slate-200 bg-slate-50 pl-3 pr-9 text-xs text-slate-700 shadow-sm outline-none transition placeholder:text-slate-400 focus:border-blue-500 focus:bg-white focus:ring-2 focus:ring-blue-100">

                <span class="pointer-events-none absolute inset-y-0 right-3 flex items-center text-slate-400">
                    <svg class="h-3.5 w-3.5"
                        fill="none"
                        stroke="currentColor"
                        stroke-width="2"
                        viewBox="0 0 24 24">
                        <path stroke-linecap="round"
                            stroke-linejoin="round"
                            d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
                    </svg>
                </span>
            </div>
        </div>

        
        <div class="overflow-x-auto px-4 pb-4">
            <div class="overflow-hidden rounded-lg border border-slate-200">
                <table class="w-full min-w-[900px] border-collapse text-xs">
                    <thead>
                        <tr class="border-b border-slate-200 bg-slate-50 uppercase tracking-wide text-slate-500">
                            <th class="w-14 border-r border-slate-200 px-3 py-2 text-center font-bold">No</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tema</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Divisi</th>
                            <th class="w-24 border-r border-slate-200 px-3 py-2 text-center font-bold">Status</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tanggal Audit</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Tanggal Verifikasi</th>
                            <th class="border-r border-slate-200 px-3 py-2 text-center font-bold">Keterangan Sebelum</th>
                            <th class="w-28 px-3 py-2 text-center font-bold">Aksi</th>
                        </tr>
                    </thead>

                    <tbody id="bodyBelum" class="divide-y divide-slate-100">
                        <?php $__empty_1 = true; $__currentLoopData = $auditBelumDilengkapi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $audit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr class="transition hover:bg-slate-50">
                                <td class="border-r border-slate-100 px-3 py-2 text-center font-medium text-slate-600">
                                    <?php echo e($index + 1); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left font-semibold text-slate-700">
                                    <?php echo e($audit->tema->nama ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left text-slate-600">
                                    <?php echo e($audit->bagian->nama_bagian ?? '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center">
                                    <span class="inline-flex rounded-full bg-red-100 px-3 py-1 text-xs font-semibold text-red-500">
                                        Open
                                    </span>
                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center text-slate-600">
                                    <?php echo e(\Carbon\Carbon::parse($audit->tanggal_audit)->translatedFormat('d F Y')); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-center text-slate-600">
                                    <?php echo e($audit->tanggal_verifikasi ? \Carbon\Carbon::parse($audit->tanggal_verifikasi)->translatedFormat('d F Y') : '-'); ?>

                                </td>

                                <td class="border-r border-slate-100 px-3 py-2 text-left text-slate-600">
                                    <?php echo e($audit->keterangan ?? '-'); ?>

                                </td>

                                <td class="px-3 py-2 text-center">
                                    <a href="<?php echo e(route('audit.verifikasi.form', $audit->id)); ?>"
                                        class="inline-flex h-8 items-center justify-center gap-1 rounded-lg bg-blue-500 px-3 text-xs font-medium text-white transition hover:bg-blue-600">
                                        <i class="fas fa-check text-[11px]"></i>
                                        Lakukan Verifikasi
                                    </a>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="8" class="px-3 py-6 text-center text-xs italic text-slate-500">
                                    Belum ada data audit yang perlu diverifikasi.
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>

    </div>

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

<?php $__env->startPush('scripts'); ?>
<script>
function applyFilter(searchId, selectId, tableBodyId) {
    const searchInput = document.getElementById(searchId);
    const selectInput = document.getElementById(selectId);
    const tbody = document.getElementById(tableBodyId);

    if (!searchInput || !selectInput || !tbody) return;

    const rows = Array.from(tbody.querySelectorAll("tr"));

    function filterRows() {
        const searchTerm = searchInput.value.toLowerCase();
        const perPage = parseInt(selectInput.value);
        let visible = 0;

        rows.forEach((row) => {
            const text = row.innerText.toLowerCase();
            const match = text.includes(searchTerm);

            if (match && visible < perPage) {
                row.style.display = "";
                visible++;
            } else {
                row.style.display = "none";
            }
        });
    }

    searchInput.addEventListener("input", filterRows);
    selectInput.addEventListener("change", filterRows);
    filterRows();
}

document.addEventListener("DOMContentLoaded", function () {
    applyFilter("searchBelum", "entriesBelum", "bodyBelum");
    applyFilter("searchSudah", "entriesSudah", "bodySudah");

    if (window.lucide) {
        window.lucide.createIcons();
    }
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('web_user.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\ea-systems\resources\views/web_user/tambah-audit.blade.php ENDPATH**/ ?>