<!-- Updated Add Modal with compact design like your friend's -->
<style>
.compact-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.section-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid;
}

.section-header.personal { border-color: #007bff; }
.section-header.institution { border-color: #28a745; }
.section-header.guidance { border-color: #ffc107; }

.form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control, .form-select {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.mb-section {
    margin-bottom: 1.5rem;
}

.mb-field {
    margin-bottom: 0.75rem;
}

.text-required {
    color: #dc3545;
    font-weight: 600;
}

.input-group-text {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.invalid-feedback {
    font-size: 0.8rem;
}

small.text-muted {
    font-size: 0.75rem;
}
</style>

<div class="modal fade compact-modal" id="addSiswaModal" tabindex="-1">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header py-3">
                <h5 class="modal-title mb-0">
                    <i class="fas fa-user-plus me-2"></i>Tambah Siswa Magang
                </h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <form method="POST" action="<?php echo e(route('admin.create.siswa')); ?>" id="addSiswaForm">
                <?php echo csrf_field(); ?>
                <div class="modal-body">
                    <!-- Section 1: Data Personal -->
                    <div class="mb-section">
                        <div class="section-header personal text-primary">
                            <i class="fas fa-user me-2"></i>Data Personal
                        </div>
                        <div class="row g-2">
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Nama Siswa <span class="text-required">*</span></label>
                                <input type="text" name="nama_siswa" class="form-control <?php $__errorArgs = ['nama_siswa'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                                       value="<?php echo e(old('nama_siswa')); ?>" required>
                                <?php $__errorArgs = ['nama_siswa'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Jenis Kelamin <span class="text-required">*</span></label>
                                <select name="jk" class="form-select <?php $__errorArgs = ['jk'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">Pilih</option>
                                    <option value="L" <?php echo e(old('jk') == 'L' ? 'selected' : ''); ?>>Laki-laki</option>
                                    <option value="P" <?php echo e(old('jk') == 'P' ? 'selected' : ''); ?>>Perempuan</option>
                                </select>
                                <?php $__errorArgs = ['jk'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">No. Telp Siswa <span class="text-required">*</span></label>
                                <input type="text" name="no_telp_siswa" class="form-control <?php $__errorArgs = ['no_telp_siswa'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                                       value="<?php echo e(old('no_telp_siswa')); ?>" required>
                                <?php $__errorArgs = ['no_telp_siswa'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                            <div class="col-md-6 mb-field">
                                <label class="form-label">Nomor RFID</label>
                                <div class="input-group">
                                    <span class="input-group-text"><i class="fas fa-id-card"></i></span>
                                    <input type="text" name="rfid_number" class="form-control <?php $__errorArgs = ['rfid_number'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                                           value="<?php echo e(old('rfid_number')); ?>" placeholder="Scan/input manual">
                                </div>
                                <small class="text-muted">Kosongkan jika belum ada</small>
                                <?php $__errorArgs = ['rfid_number'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        </div>
                    </div>

                    <!-- Section 2: Data Institusi -->
                    <div class="mb-section">
                        <div class="section-header institution text-success">
                            <i class="fas fa-building me-2"></i>Data Institusi
                        </div>
                        <div class="row g-2">
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Sekolah <span class="text-required">*</span></label>
                                <select name="id_sekolah" class="form-select <?php $__errorArgs = ['id_sekolah'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="">Pilih Sekolah</option>
                                    <?php $__currentLoopData = $sekolah; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($sch->id); ?>" <?php echo e(old('id_sekolah') == $sch->id ? 'selected' : ''); ?>><?php echo e($sch->nama_sekolah); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php $__errorArgs = ['id_sekolah'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">DU/DI</label>
                                <select name="id_dudi" class="form-select <?php $__errorArgs = ['id_dudi'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                                    <option value="">Pilih DU/DI</option>
                                    <?php $__currentLoopData = $dudi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($d->id); ?>" <?php echo e(old('id_dudi') == $d->id ? 'selected' : ''); ?>><?php echo e($d->nama_dudi); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php $__errorArgs = ['id_dudi'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        </div>
                    </div>

                    <!-- Section 3: Data Pembimbing & Periode -->
                    <div class="mb-section">
                        <div class="section-header guidance text-warning">
                            <i class="fas fa-users me-2"></i>Pembimbing & Periode Magang
                        </div>
                        <div class="row g-2">
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Pembimbing Sekolah</label>
                                <select name="id_pembimbing_sekolah" class="form-select <?php $__errorArgs = ['id_pembimbing_sekolah'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                                    <option value="">Pilih Pembimbing</option>
                                    <?php $__currentLoopData = $pembimbingSekolah; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ps): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($ps->id); ?>" <?php echo e(old('id_pembimbing_sekolah') == $ps->id ? 'selected' : ''); ?>><?php echo e($ps->nama_pembimbing); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php $__errorArgs = ['id_pembimbing_sekolah'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Pembimbing Magang</label>
                                <select name="id_pembimbing_magang" class="form-select <?php $__errorArgs = ['id_pembimbing_magang'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                                    <option value="">Pilih Pembimbing</option>
                                    <?php $__currentLoopData = $pembimbingMagang; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($pm->id); ?>" <?php echo e(old('id_pembimbing_magang') == $pm->id ? 'selected' : ''); ?>><?php echo e($pm->nama_pembimbing); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <?php $__errorArgs = ['id_pembimbing_magang'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Mulai Magang <span class="text-required">*</span></label>
                                <input type="date" name="mulai_magang" class="form-control <?php $__errorArgs = ['mulai_magang'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                                       value="<?php echo e(old('mulai_magang')); ?>" required>
                                <?php $__errorArgs = ['mulai_magang'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Selesai Magang <span class="text-required">*</span></label>
                                <input type="date" name="selesai_magang" class="form-control <?php $__errorArgs = ['selesai_magang'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" 
                                       value="<?php echo e(old('selesai_magang')); ?>" required>
                                <?php $__errorArgs = ['selesai_magang'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <div class="invalid-feedback"><?php echo e($message); ?></div>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer py-2">
                    <button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">
                        <i class="fas fa-times me-1"></i>Batal
                    </button>
                    <button type="submit" class="btn btn-primary btn-sm">
                        <i class="fas fa-save me-1"></i>Simpan
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- Edit Modal with compact design -->
<div class="modal fade compact-modal" id="editSiswaModal" tabindex="-1">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <form method="POST" id="editSiswaForm">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>
                <div class="modal-header py-3">
                    <h5 class="modal-title mb-0">
                        <i class="fas fa-edit me-2"></i>Edit Siswa Magang
                    </h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body">
                    <!-- Section 1: Data Personal -->
                    <div class="mb-section">
                        <div class="section-header personal text-primary">
                            <i class="fas fa-user me-2"></i>Data Personal
                        </div>
                        <div class="row g-2">
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Nama Siswa <span class="text-required">*</span></label>
                                <input type="text" name="nama_siswa" id="editNamaSiswa" class="form-control" required>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Jenis Kelamin <span class="text-required">*</span></label>
                                <select name="jk" id="editJk" class="form-select" required>
                                    <option value="">Pilih</option>
                                    <option value="L">Laki-laki</option>
                                    <option value="P">Perempuan</option>
                                </select>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">No. Telp Siswa <span class="text-required">*</span></label>
                                <input type="text" name="no_telp_siswa" id="editNoTelpSiswa" class="form-control" required>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Nomor RFID</label>
                                <div class="input-group">
                                    <span class="input-group-text"><i class="fas fa-id-card"></i></span>
                                    <input type="text" name="rfid_number" id="editRfidNumber" class="form-control" 
                                           placeholder="Scan/input manual">
                                </div>
                                <small class="text-muted">Kosongkan untuk menghapus</small>
                                <div class="invalid-feedback"></div>
                            </div>
                        </div>
                    </div>

                    <!-- Section 2: Data Institusi -->
                    <div class="mb-section">
                        <div class="section-header institution text-success">
                            <i class="fas fa-building me-2"></i>Data Institusi
                        </div>
                        <div class="row g-2">
                            <div class="col-md-6 mb-field">
                                <label class="form-label">Sekolah <span class="text-required">*</span></label>
                                <select name="id_sekolah" id="editIdSekolah" class="form-select" required>
                                    <option value="">Pilih Sekolah</option>
                                    <?php $__currentLoopData = $sekolah; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($s->id); ?>"><?php echo e($s->nama_sekolah); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-6 mb-field">
                                <label class="form-label">DU/DI</label>
                                <select name="id_dudi" id="editIdDudi" class="form-select">
                                    <option value="">Pilih DU/DI</option>
                                    <?php $__currentLoopData = $dudi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($d->id); ?>"><?php echo e($d->nama_dudi); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback"></div>
                            </div>
                        </div>
                    </div>

                    <!-- Section 3: Data Pembimbing & Periode -->
                    <div class="mb-section">
                        <div class="section-header guidance text-warning">
                            <i class="fas fa-users me-2"></i>Pembimbing & Periode Magang
                        </div>
                        <div class="row g-2">
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Pembimbing Sekolah</label>
                                <select name="id_pembimbing_sekolah" id="editIdPembimbingSekolah" class="form-select">
                                    <option value="">Pilih Pembimbing</option>
                                    <?php $__currentLoopData = $pembimbingSekolah; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ps): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($ps->id); ?>"><?php echo e($ps->nama_pembimbing); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Pembimbing Magang</label>
                                <select name="id_pembimbing_magang" id="editIdPembimbingMagang" class="form-select">
                                    <option value="">Pilih Pembimbing</option>
                                    <?php $__currentLoopData = $pembimbingMagang; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pm): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($pm->id); ?>"><?php echo e($pm->nama_pembimbing); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Mulai Magang <span class="text-required">*</span></label>
                                <input type="date" name="mulai_magang" id="editMulaiMagang" class="form-control" required>
                                <div class="invalid-feedback"></div>
                            </div>
                            <div class="col-md-3 mb-field">
                                <label class="form-label">Selesai Magang <span class="text-required">*</span></label>
                                <input type="date" name="selesai_magang" id="editSelesaiMagang" class="form-control" required>
                                <div class="invalid-feedback"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer py-2">
                    <button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">
                        <i class="fas fa-times me-1"></i>Batal
                    </button>
                    <button type="submit" class="btn btn-warning btn-sm">
                        <i class="fas fa-save me-1"></i>Update
                    </button>
                </div>
            </form>
        </div>
    </div>
</div><?php /**PATH C:\laragon\www\presensi-magang\resources\views/admin/siswa/edit.blade.php ENDPATH**/ ?>