<?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">
                        Bulk Edit Biaya Master
                    </span>
                </h1>
                <p class="text-slate-500 dark:text-slate-400 text-sm pl-1">
                    <i data-lucide="edit-3" class="w-4 h-4 inline mr-2"></i>
                    Edit banyak data biaya master sekaligus
                </p>
            </div>

            <div class="flex items-center gap-4">
                <a href="<?php echo e(route('biaya-master.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>
            </div>
        </div>

        <!-- Main Card -->
        <div class="group relative">
            <div
                class="absolute -inset-1 bg-gradient-to-r from-violet-600/10 to-indigo-600/10 rounded-3xl blur opacity-0 group-hover:opacity-30 transition duration-500">
            </div>
            <div
                class="relative bg-white dark:bg-[#1a1a2e] p-8 rounded-3xl border border-slate-200 dark:border-white/5 shadow-xl">

                <!-- Form Header -->
                <div class="flex items-center gap-4 mb-8 pb-6 border-b border-slate-100 dark:border-white/5">
                    <div
                        class="w-12 h-12 rounded-2xl bg-gradient-to-br from-blue-500/10 to-cyan-600/10 text-blue-500 flex items-center justify-center">
                        <i data-lucide="edit-3" class="w-6 h-6"></i>
                    </div>
                    <div>
                        <h3 class="text-xl font-bold text-gray-900 dark:text-white">Form Bulk Edit Biaya Master</h3>
                        <p class="text-sm text-slate-500 dark:text-slate-400">
                            Mengedit <?php echo e(count($biayaList)); ?> data biaya master yang dipilih
                        </p>
                    </div>
                </div>

                <!-- Info Alert -->
                <div class="mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-500/20 rounded-2xl">
                    <div class="flex items-start gap-3">
                        <i data-lucide="info" class="w-5 h-5 text-blue-500 flex-shrink-0 mt-0.5"></i>
                        <div class="text-sm text-blue-700 dark:text-blue-300">
                            <p class="font-medium mb-1">Informasi:</p>
                            <ul class="list-disc list-inside space-y-1">
                                <li>Field yang dikosongkan tidak akan diupdate</li>
                                <li>Field "Kode Biaya", "Komponen", dan "Total" bisa diisi per baris</li>
                                <li>Kampus dan Program Studi tidak dapat diubah melalui bulk edit</li>
                            </ul>
                        </div>
                    </div>
                </div>

                <!-- Form -->
                <form action="<?php echo e(route('biaya-master.bulk.update')); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <?php $__currentLoopData = $ids; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <input type="hidden" name="ids[]" value="<?php echo e($id); ?>">
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    <!-- Per Item Updates -->
                    <div class="mb-8">
                        <h4 class="font-semibold text-lg text-gray-900 dark:text-white mb-4 flex items-center gap-2">
                            <i data-lucide="list" class="w-5 h-5 text-blue-500"></i>
                            Edit Per Item
                        </h4>

                        <div class="overflow-x-auto">
                            <table class="w-full border border-slate-200 dark:border-gray-700">
                                <thead>
                                    <tr class="bg-slate-50 dark:bg-white/5">
                                        <th
                                            class="border-b border-slate-200 dark:border-gray-700 py-3 px-4 text-left text-xs font-semibold text-slate-500 dark:text-slate-400">
                                            No</th>
                                        <th
                                            class="border-b border-slate-200 dark:border-gray-700 py-3 px-4 text-left text-xs font-semibold text-slate-500 dark:text-slate-400">
                                            Kode Biaya</th>
                                        <th
                                            class="border-b border-slate-200 dark:border-gray-700 py-3 px-4 text-left text-xs font-semibold text-slate-500 dark:text-slate-400">
                                            Komponen</th>
                                        <th
                                            class="border-b border-slate-200 dark:border-gray-700 py-3 px-4 text-left text-xs font-semibold text-slate-500 dark:text-slate-400">
                                            Total</th>
                                        <th
                                            class="border-b border-slate-200 dark:border-gray-700 py-3 px-4 text-left text-xs font-semibold text-slate-500 dark:text-slate-400">
                                            Data Saat Ini</th>
                                    </tr>
                                </thead>
                                <tbody class="divide-y divide-slate-100 dark:divide-white/5">
                                    <?php $__currentLoopData = $biayaList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $biaya): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr class="hover:bg-slate-50/50 dark:hover:bg-white/5">
                                            <td class="py-3 px-4 text-sm text-slate-600 dark:text-slate-400">
                                                <?php echo e($index + 1); ?>

                                            </td>
                                            <td class="py-3 px-4">
                                                <input type="text" name="kode_biaya[<?php echo e($biaya->id); ?>]"
                                                    value="<?php echo e(old('kode_biaya.' . $biaya->id, $biaya->kode_biaya)); ?>"
                                                    placeholder="<?php echo e($biaya->kode_biaya); ?>"
                                                    class="w-full px-3 py-2 bg-white dark:bg-gray-800 border border-slate-200 dark:border-gray-700 rounded-lg text-sm text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                            </td>
                                            <td class="py-3 px-4">
                                                <input type="text" name="komponen[<?php echo e($biaya->id); ?>]"
                                                    value="<?php echo e(old('komponen.' . $biaya->id, $biaya->komponen)); ?>"
                                                    placeholder="<?php echo e($biaya->komponen); ?>"
                                                    class="w-full px-3 py-2 bg-white dark:bg-gray-800 border border-slate-200 dark:border-gray-700 rounded-lg text-sm text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500">
                                            </td>
                                            <td class="py-3 px-4">
                                                <input type="text" name="total[<?php echo e($biaya->id); ?>]"
                                                    value="<?php echo e(old('total.' . $biaya->id, 'Rp ' . number_format($biaya->total, 0, ',', '.'))); ?>"
                                                    class="currency-input w-full px-3 py-2 bg-white dark:bg-gray-800 border border-slate-200 dark:border-gray-700 rounded-lg text-sm text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500"
                                                    placeholder="Rp 0">
                                            </td>
                                            <td class="py-3 px-4 text-xs">
                                                <div class="space-y-1">
                                                    <div><span class="font-medium">Kode:</span>
                                                        <?php echo e($biaya->kode_biaya); ?></div>
                                                    <div><span class="font-medium">Komponen:</span>
                                                        <?php echo e($biaya->komponen); ?></div>
                                                    <div><span class="font-medium">Total:</span> Rp
                                                        <?php echo e(number_format($biaya->total, 0, ',', '.')); ?></div>
                                                    <div class="mt-2 pt-2 border-t border-slate-200 dark:border-gray-700">
                                                        <span class="font-medium">Kampus:</span> <?php echo e($biaya->kampus->nama ?? '-'); ?><br>
                                                        <span class="font-medium">Prodi:</span> <?php echo e($biaya->prodi->nama ?? '-'); ?>

                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <!-- Form Footer -->
                    <div class="pt-6 border-t border-slate-100 dark:border-white/5">
                        <div class="flex flex-col sm:flex-row justify-end items-center gap-4">
                            <a href="<?php echo e(route('biaya-master.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">
                                <i data-lucide="x" class="w-4 h-4"></i>
                                Batal
                            </a>
                            <button type="submit"
                                class="px-4 py-2.5 bg-gradient-to-r from-blue-600 to-cyan-700 text-white rounded-xl text-sm font-medium hover:shadow-lg hover:shadow-blue-500/25 transition-all flex items-center gap-2">
                                <i data-lucide="save" class="w-4 h-4"></i>
                                Update Semua Data
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

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

            // Format Rupiah untuk input currency
            function formatRupiah(angka) {
                if (!angka) return '';
                let numberString = angka.toString().replace(/[^,\d]/g, '');
                let split = numberString.split(',');
                let sisa = split[0].length % 3;
                let rupiah = split[0].substr(0, sisa);
                let ribuan = split[0].substr(sisa).match(/\d{3}/gi);

                if (ribuan) {
                    let separator = sisa ? '.' : '';
                    rupiah += separator + ribuan.join('.');
                }

                return 'Rp ' + (split[1] !== undefined ? rupiah + ',' + split[1] : rupiah);
            }

            function parseRupiah(rupiah) {
                return parseInt(rupiah.toString().replace(/[^\d]/g, '')) || 0;
            }

            // Setup currency inputs
            document.querySelectorAll('.currency-input').forEach(input => {
                // Format initial value
                if (input.value && !input.value.includes('Rp')) {
                    let value = parseRupiah(input.value);
                    input.value = 'Rp ' + (value ? value.toLocaleString('id-ID') : '0');
                }

                input.addEventListener('input', function(e) {
                    let value = this.value.replace(/[^\d]/g, '');
                    if (value) {
                        this.value = 'Rp ' + parseInt(value).toLocaleString('id-ID');
                    } else {
                        this.value = 'Rp 0';
                    }
                });
            });
        });
    </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/biaya-master/bulk-edit.blade.php ENDPATH**/ ?>