<?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="mb-12">
        <div class="flex flex-col md:flex-row justify-between items-start md:items-center gap-6 mb-8">
            <div class="relative">
                <div
                    class="absolute -left-3 -top-3 w-20 h-20 bg-gradient-to-br from-violet-500/10 to-indigo-600/10 rounded-full blur-xl">
                </div>
                <h1 class="text-4xl font-black tracking-tight dark:text-white relative z-10 mb-2">
                    <span class="bg-gradient-to-r from-violet-600 to-indigo-600 bg-clip-text text-transparent">
                        Detail RAP
                    </span>
                </h1>
                <p class="text-slate-500 dark:text-slate-400 text-sm pl-1">
                    <i data-lucide="user" class="w-4 h-4 inline mr-2"></i>
                    Informasi lengkap Recruitment Affiliate Program (RAP)
                </p>
            </div>

            <div class="flex items-center gap-4">
                <a href="<?php echo e(route('rap.index')); ?>"
                    class="px-4 py-2.5 bg-white dark:bg-gray-800 border border-slate-200 dark:border-gray-700 rounded-xl text-sm font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-700 transition-all flex items-center gap-2 shadow-sm">
                    <i data-lucide="arrow-left" class="w-4 h-4"></i>
                    <span>Kembali</span>
                </a>
                <a href="<?php echo e(route('rap.edit', $rap->id)); ?>"
                    class="px-4 py-2.5 bg-gradient-to-r from-amber-600 to-orange-700 text-white rounded-xl text-sm font-medium hover:shadow-lg hover:shadow-amber-500/25 transition-all flex items-center gap-2">
                    <i data-lucide="edit" class="w-4 h-4"></i>
                    Edit
                </a>
            </div>
        </div>

        <?php if(isset($notifications) && count($notifications) > 0): ?>
            <div class="mb-6 space-y-3">
                <?php $__currentLoopData = $notifications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notif): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div
                        class="bg-<?php echo e($notif['type'] == 'info' ? 'blue' : 'green'); ?>-500/10 border border-<?php echo e($notif['type'] == 'info' ? 'blue' : 'green'); ?>-500/30 rounded-xl p-4">
                        <div class="flex items-center justify-between">
                            <div class="flex items-center gap-3">
                                <i data-lucide="<?php echo e($notif['type'] == 'info' ? 'info' : 'gift'); ?>"
                                    class="w-5 h-5 text-<?php echo e($notif['type'] == 'info' ? 'blue' : 'green'); ?>-600"></i>
                                <p class="text-sm text-gray-700 dark:text-gray-300"><?php echo e($notif['message']); ?></p>
                            </div>
                            <?php if(isset($notif['action'])): ?>
                                <a href="<?php echo e($notif['action']); ?>"
                                    class="px-3 py-1.5 bg-gradient-to-r from-emerald-600 to-green-700 text-white rounded-lg text-xs font-medium hover:shadow-lg transition-all">
                                    <?php echo e($notif['action_text']); ?>

                                </a>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        <?php endif; ?>

        <!-- Info Cards -->
        <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
            <div class="bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 p-4">
                <div class="text-center">
                    <p class="text-2xl font-bold text-violet-600"><?php echo e($rap->total_mahasiswa_daftar); ?></p>
                    <p class="text-xs text-slate-500">Total Mahasiswa Direkrut</p>
                </div>
            </div>
            <div class="bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 p-4">
                <div class="text-center">
                    <?php
                        $totalBonus = $rap->hitungTotalBonus();
                    ?>
                    <p class="text-2xl font-bold text-emerald-600">Rp
                        <?php echo e(number_format($totalBonus, 0, ',', '.')); ?></p>
                    <p class="text-xs text-slate-500">Total Bonus (Jika Memenuhi Syarat)</p>
                </div>
            </div>
            <div class="bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 p-4">
                <div class="text-center">
                    <p class="text-2xl font-bold <?php echo e($rap->status == 'aktif' ? 'text-green-600' : 'text-red-600'); ?>">
                        <?php echo e($rap->status == 'aktif' ? 'Aktif' : 'Nonaktif'); ?>

                    </p>
                    <p class="text-xs text-slate-500">Status</p>
                </div>
            </div>
        </div>

        <!-- Main Content -->
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
            <!-- Data Pribadi -->
            <div
                class="bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
                <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                    <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                        <i data-lucide="user" class="w-4 h-4 text-violet-500"></i>
                        Data Pribadi
                    </h3>
                </div>
                <div class="p-4 space-y-3">
                    <div class="grid grid-cols-2 gap-3">
                        <div>
                            <p class="text-xs text-slate-500">Nama Lengkap</p>
                            <p class="font-medium text-gray-900 dark:text-white"><?php echo e($rap->nama); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">Tipe</p>
                            <p>
                                <span
                                    class="px-2 py-1 text-xs rounded-full <?php echo e($rap->tipe == 'mahasiswa' ? 'bg-blue-500/10 text-blue-600' : 'bg-purple-500/10 text-purple-600'); ?>">
                                    <?php echo e($rap->tipe == 'mahasiswa' ? 'Mahasiswa' : 'Non Mahasiswa'); ?>

                                </span>
                            </p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">No HP/WA</p>
                            <p class="font-medium"><?php echo e($rap->no_hp); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">Email</p>
                            <p class="font-medium"><?php echo e($rap->email ?? '-'); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">Alamat</p>
                            <p class="font-medium"><?php echo e($rap->alamat ?? '-'); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">Marketing</p>
                            <p class="font-medium"><?php echo e($rap->marketing ?? '-'); ?></p>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Data Bank/E-Wallet -->
            <div
                class="bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
                <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                    <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                        <i data-lucide="credit-card" class="w-4 h-4 text-violet-500"></i>
                        Data Rekening / E-Wallet
                    </h3>
                </div>
                <div class="p-4 space-y-3">
                    <div class="grid grid-cols-2 gap-3">
                        <div>
                            <p class="text-xs text-slate-500">Nomor Rekening/E-Wallet</p>
                            <p class="font-medium"><?php echo e($rap->no_rekening ?? '-'); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">Bank/E-Wallet</p>
                            <p class="font-medium"><?php echo e($rap->bank_ewallet ?? '-'); ?></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Data Akademik (khusus Mahasiswa) -->
        <?php if($rap->tipe == 'mahasiswa'): ?>
            <div
                class="mt-6 bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
                <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                    <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                        <i data-lucide="graduation-cap" class="w-4 h-4 text-violet-500"></i>
                        Data Akademik
                    </h3>
                </div>
                <div class="p-4">
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                        <div>
                            <p class="text-xs text-slate-500">Kampus</p>
                            <p class="font-medium"><?php echo e($rap->kampus ?? '-'); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">Program Studi</p>
                            <p class="font-medium"><?php echo e($rap->prodi ?? '-'); ?></p>
                        </div>
                        <div>
                            <p class="text-xs text-slate-500">NIM</p>
                            <p class="font-medium"><?php echo e($rap->nim ?? '-'); ?></p>
                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?>

        <!-- Data Institusi (khusus Non Mahasiswa) -->
        <?php if($rap->tipe == 'non_mahasiswa'): ?>
            <div
                class="mt-6 bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
                <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                    <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                        <i data-lucide="building" class="w-4 h-4 text-violet-500"></i>
                        Data Institusi/Perusahaan
                    </h3>
                </div>
                <div class="p-4">
                    <div class="grid grid-cols-1 gap-4">
                        <div>
                            <p class="text-xs text-slate-500">Asal Institusi/Perusahaan</p>
                            <p class="font-medium"><?php echo e($rap->institusi ?? '-'); ?></p>
                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?>

        <!-- File Uploads -->
        <div
            class="mt-6 bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
            <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                    <i data-lucide="folder-open" class="w-4 h-4 text-violet-500"></i>
                    Dokumen Pendukung
                </h3>
            </div>
            <div class="p-4">
                <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                    <div>
                        <p class="text-xs text-slate-500 mb-2">Buku Rekening/E-Wallet</p>
                        <?php if($rap->file_buku_rekening): ?>
                            <a href="<?php echo e(route('rap.download', ['id' => $rap->id, 'type' => 'buku_rekening'])); ?>"
                                class="inline-flex items-center gap-2 px-3 py-2 bg-blue-50 text-blue-600 rounded-lg hover:bg-blue-100 transition text-sm">
                                <i data-lucide="file-text" class="w-4 h-4"></i>
                                Download File
                            </a>
                        <?php else: ?>
                            <p class="text-sm text-slate-400 italic">Tidak ada file</p>
                        <?php endif; ?>
                    </div>
                    <div>
                        <p class="text-xs text-slate-500 mb-2">KTP</p>
                        <?php if($rap->file_ktp): ?>
                            <a href="<?php echo e(route('rap.download', ['id' => $rap->id, 'type' => 'ktp'])); ?>"
                                class="inline-flex items-center gap-2 px-3 py-2 bg-blue-50 text-blue-600 rounded-lg hover:bg-blue-100 transition text-sm">
                                <i data-lucide="file-text" class="w-4 h-4"></i>
                                Download File
                            </a>
                        <?php else: ?>
                            <p class="text-sm text-slate-400 italic">Tidak ada file</p>
                        <?php endif; ?>
                    </div>
                    <div>
                        <p class="text-xs text-slate-500 mb-2">Form Pendaftaran RAP</p>
                        <?php if($rap->file_form_pendaftaran): ?>
                            <a href="<?php echo e(route('rap.download', ['id' => $rap->id, 'type' => 'form_pendaftaran'])); ?>"
                                class="inline-flex items-center gap-2 px-3 py-2 bg-blue-50 text-blue-600 rounded-lg hover:bg-blue-100 transition text-sm">
                                <i data-lucide="file-text" class="w-4 h-4"></i>
                                Download File
                            </a>
                        <?php else: ?>
                            <p class="text-sm text-slate-400 italic">Tidak ada file</p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>

        <!-- Bonus yang Sudah Cair -->
        <div
            class="mt-6 bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
            <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                    <i data-lucide="gift" class="w-4 h-4 text-violet-500"></i>
                    Bonus yang Sudah Cair
                </h3>
            </div>
            <div class="p-4">
                <?php
                    $bonusCair = $rap->bonusCair()->where('status', 'disetujui')->get();
                ?>
                <?php if($bonusCair->count() > 0): ?>
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                        <?php $__currentLoopData = $bonusCair; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bonus): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="p-4 bg-green-50 dark:bg-green-900/20 rounded-xl border border-green-200 dark:border-green-500/30">
                                <div class="flex justify-between items-start">
                                    <div>
                                        <p class="text-sm font-medium text-green-800 dark:text-green-300">
                                            Tahun Ajaran: <?php echo e($bonus->tahun_ajaran); ?>

                                        </p>
                                        <p class="text-2xl font-bold text-green-600 mt-1">
                                            Rp <?php echo e(number_format($bonus->nominal, 0, ',', '.')); ?>

                                        </p>
                                        <?php if($bonus->ruleBonus): ?>
                                            <p class="text-xs text-green-600 mt-1">
                                                (<?php echo e($bonus->ruleBonus->nama_rule); ?>)
                                            </p>
                                        <?php endif; ?>
                                    </div>
                                    <div class="text-right">
                                        <span class="px-2 py-1 text-xs rounded-full bg-green-500/20 text-green-700">
                                            Sudah Cair
                                        </span>
                                        <?php if($bonus->tanggal_cair): ?>
                                            <p class="text-xs text-slate-500 mt-1">
                                                <?php echo e($bonus->tanggal_cair->format('d/m/Y H:i')); ?>

                                            </p>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                <?php else: ?>
                    <div class="text-center py-6 bg-slate-50 dark:bg-gray-800/30 rounded-xl">
                        <i data-lucide="gift" class="w-12 h-12 mx-auto text-slate-400 mb-2"></i>
                        <p class="text-slate-500">Belum ada bonus yang cair</p>
                    </div>
                <?php endif; ?>
            </div>
        </div>

        <!-- Daftar Mahasiswa yang Direkrut -->
        <div
            class="mt-6 bg-white dark:bg-[#1a1a2e] rounded-xl border border-slate-200 dark:border-white/5 overflow-hidden">
            <div class="p-4 border-b bg-gradient-to-r from-slate-50 to-gray-50 dark:from-gray-800 dark:to-gray-900">
                <h3 class="font-semibold text-gray-900 dark:text-white flex items-center gap-2">
                    <i data-lucide="users" class="w-4 h-4 text-violet-500"></i>
                    Daftar Mahasiswa yang Direkrut
                </h3>
                <p class="text-xs text-slate-500 mt-1">Total: <?php echo e($rap->mahasiswa->count()); ?> mahasiswa</p>
            </div>
            <div class="overflow-x-auto">
                <table class="w-full">
                    <thead>
                        <tr class="bg-slate-50/50 dark:bg-white/5 border-b">
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">No</th>
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">NIM</th>
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">Nama</th>
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">Kampus</th>
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">Prodi</th>
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">Angkatan</th>
                            <th class="text-left py-3 px-4 text-xs font-semibold text-slate-500 uppercase">Status</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-slate-100 dark:divide-gray-800">
                        <?php $__empty_1 = true; $__currentLoopData = $rap->mahasiswa; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $mhs): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr class="hover:bg-slate-50/50 dark:hover:bg-gray-800/30">
                                <td class="py-3 px-4"><?php echo e($loop->iteration); ?></td>
                                <td class="py-3 px-4 font-mono"><?php echo e($mhs->nim); ?></td>
                                <td class="py-3 px-4 font-medium"><?php echo e($mhs->nama); ?></td>
                                <td class="py-3 px-4"><?php echo e($mhs->kampus->nama ?? '-'); ?></td>
                                <td class="py-3 px-4"><?php echo e($mhs->prodi->nama ?? '-'); ?></td>
                                <td class="py-3 px-4"><?php echo e($mhs->angkatan); ?></td>
                                <td class="py-3 px-4">
                                    <span
                                        class="px-2 py-1 text-xs rounded-full <?php echo e($mhs->status_akademik == 'aktif' ? 'bg-green-500/10 text-green-600' : 'bg-yellow-500/10 text-yellow-600'); ?>">
                                        <?php echo e(ucfirst($mhs->status_akademik)); ?>

                                    </span>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="py-8 text-center text-slate-500">
                                    <i data-lucide="inbox" class="w-12 h-12 mx-auto mb-3 text-slate-400"></i>
                                    <p>Belum ada mahasiswa yang direkrut</p>
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>

        <!-- Timestamps -->
        <div class="mt-6 text-center text-xs text-slate-500">
            <p>Dibuat: <?php echo e($rap->created_at ? $rap->created_at->format('d/m/Y H:i:s') : '-'); ?></p>
            <p>Terakhir diperbarui: <?php echo e($rap->updated_at ? $rap->updated_at->format('d/m/Y H:i:s') : '-'); ?></p>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            lucide.createIcons();

            <?php if(session('success')): ?>
                Swal.fire({
                    title: 'Berhasil!',
                    text: '<?php echo e(session('success')); ?>',
                    icon: 'success',
                    confirmButtonText: 'Mengerti',
                    timer: 3000,
                    timerProgressBar: true
                });
            <?php endif; ?>

            <?php if(session('error')): ?>
                Swal.fire({
                    title: 'Gagal!',
                    text: '<?php echo e(session('error')); ?>',
                    icon: 'error',
                    confirmButtonText: 'Mengerti'
                });
            <?php endif; ?>
        });
    </script>
 <?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 C:\Users\User\Documents\K2-PROJECTS\k2-sipema\resources\views/rap/show.blade.php ENDPATH**/ ?>