<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="py-12 bg-gray-50 min-h-screen">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
 
            <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between bg-white p-6 rounded-2xl border border-gray-100 shadow-sm gap-4">
                <div>
                    <h2 class="text-2xl font-black text-gray-800 tracking-tight">Detail Kunjungan</h2>
                    <p class="text-sm text-gray-400 font-medium mt-0.5">Informasi berkas pengajuan lengkap dari <?php echo e($kunjungan->nama_campus); ?>.</p>
                </div>
                <div>
                    <a href="<?php echo e(route('admin.kunjungan.index')); ?>"  class="inline-flex items-center gap-2 bg-white hover:bg-gray-50 text-gray-600 px-5 py-2.5 rounded-xl font-bold text-xs border border-gray-200 shadow-sm transition-all active:scale-95 whitespace-nowrap">
                        Kembali ke List
                    </a>
                </div>
            </div>

            <div class="bg-white shadow-sm rounded-2xl border border-gray-100 p-6 md:p-8">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">

                    <div class="space-y-1">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Kode Tiket</p>
                        <p class="inline-flex items-center px-3 py-1 rounded-md bg-gray-100 text-gray-800 text-sm font-mono font-bold">
                            #<?php echo e($kunjungan->kode_tiket); ?>

                        </p>
                    </div>

                    <div class="space-y-1">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Status Pengajuan</p>
                        <div>
                            <?php if($kunjungan->status == 'pending'): ?>
                                <span class="inline-flex items-center px-2.5 py-1 bg-amber-50 text-amber-600 text-[10px] font-extrabold rounded-md uppercase tracking-wider border border-amber-100">
                                    Menunggu
                                </span>
                            <?php elseif($kunjungan->status == 'disetujui'): ?>
                                <span class="inline-flex items-center px-2.5 py-1 bg-green-50 text-green-600 text-[10px] font-extrabold rounded-md uppercase tracking-wider border border-green-100">
                                    Disetujui
                                </span>
                            <?php else: ?>
                                <span class="inline-flex items-center px-2.5 py-1 bg-red-50 text-red-600 text-[10px] font-extrabold rounded-md uppercase tracking-wider border border-red-100">
                                    Ditolak
                                </span>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="space-y-1">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Nama Instansi / Kampus</p>
                        <p class="font-bold text-gray-800 uppercase text-base"><?php echo e($kunjungan->nama_kampus); ?></p>
                    </div>

                    <div class="space-y-1">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Program Studi</p>
                        <p class="font-bold text-gray-800 uppercase text-base"><?php echo e($kunjungan->prodi); ?></p>
                    </div>

                    <div class="space-y-1">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Nama Penanggung Jawab</p>
                        <p class="font-bold text-gray-700 text-base"><?php echo e($kunjungan->penanggung_jawab); ?></p>
                    </div>

                    <div class="space-y-1">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">No. WhatsApp / HP</p>
                        <p class="font-bold text-gray-700 text-base font-mono"><?php echo e($kunjungan->no_hp); ?></p>
                    </div>

                    <div class="space-y-1 md:col-span-2">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Tanggal Pelaksanaan Kunjungan</p>
                        <p class="font-bold text-gray-700 text-base">
                            <?php echo e(\Carbon\Carbon::parse($kunjungan->tanggal_kunjungan)->translatedFormat('l, d F Y')); ?>

                        </p>
                    </div>

                    <div class="space-y-1 md:col-span-2">
                        <p class="text-xs font-bold text-gray-400 uppercase tracking-wider">Maksud dan Tujuan Kunjungan</p>
                        <div class="bg-gray-50 border border-gray-100 p-4 rounded-xl text-sm font-medium text-gray-700 leading-relaxed">
                            <?php echo e($kunjungan->tujuan); ?>

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

                <?php if($kunjungan->status != 'pending'): ?>
                    <div class="mt-8 pt-6 border-t border-gray-100">
                        <div class="p-4 <?php echo e($kunjungan->status == 'disetujui' ? 'bg-green-50/50 border-green-100 text-green-800' : 'bg-red-50/50 border-red-100 text-red-800'); ?> rounded-xl border">
                            <p class="text-xs font-bold uppercase tracking-wider mb-1 opacity-70">
                                <?php echo e($kunjungan->status == 'disetujui' ? 'Catatan Persetujuan Admin' : 'Alasan Penolakan Admin'); ?>

                            </p>
                            <p class="text-sm font-bold">
                                <?php echo e($kunjungan->catatan ?? 'Tidak ada catatan tambahan yang dilampirkan.'); ?>

                            </p>
                        </div>
                    </div>
                <?php endif; ?>
            </div>

            <?php if($kunjungan->status == 'pending'): ?>
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    
                    <div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4">
                        <div class="flex items-center gap-2 text-green-700 font-black text-sm uppercase tracking-wide">
                            Setujui Permohonan
                        </div>
                        <form action="<?php echo e(route('admin.kunjungan.status', $kunjungan->id)); ?>" method="POST" class="space-y-4">
                            <?php echo csrf_field(); ?> 
                            <?php echo method_field('PATCH'); ?>
                            <input type="hidden" name="status" value="disetujui">
                            
                            <div class="space-y-2">
                                <label for="catatan_setuju" class="text-[11px] font-bold text-gray-400 uppercase tracking-wider block">Catatan Operasional (Opsional)</label>
                                <textarea name="catatan_setuju" 
                                          id="catatan_setuju"
                                          class="w-full px-4 py-3 rounded-xl border border-gray-200 text-sm font-bold text-gray-800 focus:ring-2 focus:ring-green-700/20 focus:border-green-700 transition-all" 
                                          rows="3" 
                                          placeholder="Contoh: datang jam 9.00"></textarea>
                            </div>
                            
                            <button type="submit" class="w-full bg-green-700 hover:bg-green-800 text-white font-bold py-3 px-4 rounded-xl text-xs shadow-md transition-all active:scale-[0.98]">
                                Validasi & Setujui Kunjungan
                            </button>
                        </form>
                    </div>

                    <div class="bg-white p-6 rounded-2xl border border-gray-100 shadow-sm space-y-4">
                        <div class="flex items-center gap-2 text-red-700 font-black text-sm uppercase tracking-wide">
                            Tolak Permohonan
                        </div>
                        <form action="<?php echo e(route('admin.kunjungan.status', $kunjungan->id)); ?>" method="POST" class="space-y-4">
                            <?php echo csrf_field(); ?> 
                            <?php echo method_field('PATCH'); ?>
                            <input type="hidden" name="status" value="ditolak">
                            
                            <div class="space-y-2">
                                <label for="catatan_tolak" class="text-[11px] font-bold text-gray-400 uppercase tracking-wider block">Alasan Penolakan</label>
                                <textarea name="catatan_tolak" 
                                          id="catatan_tolak"
                                          class="w-full px-4 py-3 rounded-xl border border-gray-200 text-sm font-bold text-gray-800 focus:ring-2 focus:ring-red-700/20 focus:border-red-500 transition-all" 
                                          rows="3" 
                                          placeholder="Tuliskan alasan penolakan secara jelas agar dapat dievaluasi oleh pemohon..." 
                                          required></textarea>
                            </div>
                            
                            <button type="submit" class="w-full bg-red-600 hover:bg-red-700 text-white font-bold py-3 px-4 rounded-xl text-xs shadow-md transition-all active:scale-[0.98]">
                                Tolak Berkas Pengajuan
                            </button>
                        </form>
                    </div>
                </div>
            <?php endif; ?> 
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH D:\TempeZhi\resources\views/admin/kunjungan/show.blade.php ENDPATH**/ ?>