<?php $__env->startSection('title', 'Master Assessment Kompetensi'); ?>
<?php $__env->startSection('page_title', 'Master Assessment'); ?>

<?php $__env->startSection('style'); ?>
    <style>
        

        

        

        .summary-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.85rem;
            margin-bottom: 1rem;
        }

        .summary-tile {
            display: flex;
            gap: 0.85rem;
            align-items: center;
            padding: 1rem;
            background: #f4f1e9;
            border: 1px solid rgba(0,0,0,0.05);
            border-radius: 8px;
        }

        .summary-icon {
            width: 42px;
            height: 42px;
            flex: 0 0 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #d4a017;
            background: #e6ddc5;
            border-radius: 8px;
        }

        .summary-number {
            color: #4a3728;
            font-size: 1.45rem;
            font-weight: 800;
            line-height: 1;
        }

        .summary-label {
            margin-top: 0.25rem;
            color: #6c757d;
            font-size: 0.82rem;
        }

        .master-tabs {
            gap: 0.5rem;
            padding: 0.75rem;
            margin-bottom: 1rem;
            background: #f4f1e9;
            border: 1px solid rgba(0,0,0,0.05);
            border-radius: 8px;
        }

        .master-tabs .nav-link {
            color: #6c757d;
            border: 0;
            border-radius: 6px;
            font-weight: 650;
        }

        .master-tabs .nav-link.active {
            color: #f4f1e9;
            background: #d4a017;
        }

        .master-panel {
            margin-bottom: 0;
            border: 1px solid rgba(0,0,0,0.05);
            border-radius: 8px;
            box-shadow: none;
            overflow: hidden;
        }

        .master-panel .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            padding: 1rem 1.15rem;
            color: #4a3728;
            background: #ffffff;
            border-bottom: 1px solid rgba(0,0,0,0.05);
            border-radius: 0;
        }

        .master-panel .card-header h5 {
            margin: 0;
            font-size: 1rem;
            font-weight: 750;
        }

        .panel-subtitle {
            margin-top: 0.2rem;
            color: #64748b;
            font-size: 0.8rem;
        }

        

        .table-clean {
            margin: 0;
        }

        .table-clean thead th {
            padding: 0.85rem;
            color: #637181;
            background: #ffffff;
            border-bottom: 2px solid #e7ecf1;
            font-size: 0.8rem;
            text-transform: uppercase;
            vertical-align: middle;
        }

        .table-clean tbody td {
            padding: 0.9rem 0.85rem;
            color: #4a3728;
            border-color: rgba(0, 0, 0, 0.05);
            vertical-align: middle;
        }

        .name-strong {
            color: #334155;
            font-weight: 700;
        }

        .meta-text {
            color: #64748b;
            font-size: 0.8rem;
        }

        .type-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.3rem 0.55rem;
            border-radius: 6px;
            color: #7a5c1e;
            background: #e6ddc5;
            font-size: 0.75rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .status-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.3rem 0.55rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 700;
        }

        .status-pill.active {
            color: #4a6348;
            background: #dce5da;
        }

        .status-pill.inactive {
            color: #8c6a28;
            background: #f2e7c9;
        }

        .empty-state {
            padding: 2rem 1rem;
            color: #64748b;
            text-align: center;
        }

        /* Custom Form Styles */
        .custom-input-group {
            border: 1px solid #dee2e6;
            border-radius: 0.5rem;
            display: flex;
            align-items: stretch;
            background: #fff;
            transition: all 0.2s ease;
        }
        .custom-input-group:focus-within {
            border-color: #d4a017;
            box-shadow: 0 0 0 0.25rem rgba(212, 160, 23, 0.15);
        }
        .custom-input-group .input-group-text {
            background: transparent;
            border: none;
            color: #d4a017;
            padding-right: 0.5rem;
            display: flex;
            align-items: center;
        }
        .custom-input-group .form-control,
        .custom-input-group .form-select {
            border: none;
            padding-left: 0;
            background: transparent;
            box-shadow: none;
        }
        
        .custom-radio-card {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.6rem 1rem;
            border: 1px solid #dee2e6;
            border-radius: 0.5rem;
            cursor: pointer;
            background: #fff;
            transition: all 0.2s ease;
        }
        .custom-radio-card:hover {
            border-color: #babbbc;
        }
        .custom-radio-card input[type="radio"] {
            position: absolute;
            opacity: 0;
            cursor: pointer;
        }
        .custom-radio-card .radio-indicator {
            width: 18px;
            height: 18px;
            border: 2px solid #dee2e6;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        .custom-radio-card .radio-indicator::after {
            content: '';
            width: 10px;
            height: 10px;
            background: #d4a017;
            border-radius: 50%;
            transform: scale(0);
            transition: 0.2s transform ease;
        }
        .custom-radio-card input[type="radio"]:checked ~ .radio-indicator {
            border-color: #d4a017;
        }
        .custom-radio-card input[type="radio"]:checked ~ .radio-indicator::after {
            transform: scale(1);
        }
        .custom-radio-card .icon {
            color: #d4a017;
            font-size: 1.1rem;
        }
        .custom-radio-card:has(input[type="radio"]:checked) {
            border-color: #d4a017;
            background-color: #fcfbf8;
        }
        .custom-radio-card input[type="radio"]:checked ~ .radio-label {
            color: #4a3728;
            font-weight: 600;
        }
        .custom-radio-card .radio-label {
            color: #6c757d;
            font-weight: 500;
        }
        
        .form-label-styled {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: #4a3728;
        }

        @media (max-width: 991.98px) {
            .summary-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (max-width: 575.98px) {
            

            .summary-grid {
                grid-template-columns: 1fr;
            }
        }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<?php
$opsiKlasikal = [
    'K1. Pelatihan Struktural Kepemimpinan',
    'K2. Pelatihan Manajerial',
    'K3. Pelatihan Teknis',
    'K4. Pelatihan fungsional',
    'K5. Pelatihan sosial kultural',
    'K6. Seminar/konferensi/ sarasehan',
    'K7. Workshop atau lokakarya',
    'K8. Kursus',
    'K9. Penataran',
    'K10. Bimbingan Teknis',
    'K11. Sosialisasi'
];
$opsiNonKlasikal = [
    'NK.1 Coaching',
    'NK.2 Mentoring',
    'NK.3 E-Learning',
    'NK.4 Pelatihan Jarak Jauh',
    'NK.5 Detasering (secondment)',
    'NK.6 Pembelajaran alam terbuka (outbond)',
    'NK.7 Patok banding (benchmarking)',
    'NK.8 Pertukaran PNS dengan pegawai swasta/badan usaha milik negara/badan usaha milik daerah',
    'NK.9 Belajar mandiri (self development)',
    'NK.10 Komunitas belajar/community practices/networking',
    'NK.11 Magang/praktik kerja'
];
?>
    <section class="page-hero">
        <div>
            <h3>Master Penilaian Mandiri Kompetensi</h3>
            <p>Kelola kompetensi, indikator, standar jabatan, dan rekomendasi pelatihan.</p>
        </div>
        <a href="<?php echo e(route('admin.assessment-kompetensi.index')); ?>" class="btn btn-primary">
            <i class="fas fa-clipboard-list"></i> Lihat Assessment
        </a>
    </section>

    <section class="summary-grid">
        <div class="summary-tile">
            <span class="summary-icon"><i class="fas fa-layer-group"></i></span>
            <div>
                <div class="summary-number"><?php echo e(number_format($kompetensi->count())); ?></div>
                <div class="summary-label">Kompetensi</div>
            </div>
        </div>
        <div class="summary-tile">
            <span class="summary-icon"><i class="fas fa-list-check"></i></span>
            <div>
                <div class="summary-number"><?php echo e(number_format($indikator->count())); ?></div>
                <div class="summary-label">Indikator Terbaru</div>
            </div>
        </div>
        <div class="summary-tile">
            <span class="summary-icon"><i class="fas fa-briefcase"></i></span>
            <div>
                <div class="summary-number"><?php echo e(number_format($standards->count())); ?></div>
                <div class="summary-label">Standar Terbaru</div>
            </div>
        </div>
        <div class="summary-tile">
            <span class="summary-icon"><i class="fas fa-graduation-cap"></i></span>
            <div>
                <div class="summary-number"><?php echo e(number_format($rekomendasi->count())); ?></div>
                <div class="summary-label">Rekomendasi Terbaru</div>
            </div>
        </div>
    </section>

    <ul class="nav nav-pills master-tabs" id="assessmentMasterTabs" role="tablist">
        <li class="nav-item" role="presentation">
            <button class="nav-link active" id="kompetensi-tab" data-bs-toggle="tab" data-bs-target="#kompetensi-pane"
                type="button" role="tab">
                <i class="fas fa-layer-group"></i> Kompetensi
            </button>
        </li>

        <li class="nav-item" role="presentation">
            <button class="nav-link" id="standar-tab" data-bs-toggle="tab" data-bs-target="#standar-pane" type="button"
                role="tab">
                <i class="fas fa-briefcase"></i> Standar Jabatan
            </button>
        </li>
        <li class="nav-item" role="presentation">
            <button class="nav-link" id="rekomendasi-tab" data-bs-toggle="tab" data-bs-target="#rekomendasi-pane"
                type="button" role="tab">
                <i class="fas fa-graduation-cap"></i> Rekomendasi
            </button>
        </li>
    </ul>

    <div class="tab-content">
        <div class="tab-pane fade show active" id="kompetensi-pane" role="tabpanel" aria-labelledby="kompetensi-tab">
            <div class="card master-panel">
                <div class="card-header">
                    <div>
                        <h5>Master Kompetensi</h5>
                        <div class="panel-subtitle">Data dasar kompetensi manajerial dan sosial kultural.</div>
                    </div>
                </div>
                <div class="card-body">
                    <form action="<?php echo e(route('admin.assessment-master.kompetensi.store')); ?>" method="POST"
                        class="form-surface">
                        <?php echo csrf_field(); ?>
                        <div class="row g-3">
                            <div class="col-lg-4">
                                <label class="form-label" for="nama_kompetensi">Nama Kompetensi</label>
                                <input type="text" id="nama_kompetensi" name="nama_kompetensi" class="form-control"
                                    placeholder="Contoh: Integritas" required>
                            </div>
                            <div class="col-lg-3">
                                <label class="form-label" for="jenis_kompetensi">Jenis</label>
                                <select id="jenis_kompetensi" name="jenis_kompetensi" class="form-select" required>
                                    <option value="manajerial">Manajerial</option>
                                    <option value="sosial_kultural">Sosial Kultural</option>
                                </select>
                            </div>
                            <div class="col-lg-5">
                                <label class="form-label" for="deskripsi_kompetensi">Deskripsi</label>
                                <textarea id="deskripsi_kompetensi" name="deskripsi" class="form-control" rows="1"
                                    placeholder="Deskripsi singkat kompetensi"></textarea>
                            </div>
                            <div class="col-12">
                                <button class="btn btn-primary"><i class="fas fa-save"></i> Simpan Kompetensi</button>
                            </div>
                        </div>
                    </form>

                    <div class="table-responsive-md">
                        <table class="table table-clean">
                            <thead>
                                <tr>
                                    <th>Kompetensi</th>
                                    <th class="text-center">Jenis</th>
                                    <th class="text-center">Indikator</th>
                                    <th class="text-center">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $kompetensi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>
                                            <div class="name-strong"><?php echo e($item->nama_kompetensi); ?></div>
                                            <?php if($item->deskripsi): ?>
                                                <div class="meta-text"><?php echo e($item->deskripsi); ?></div>
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-center"><span class="type-pill"><?php echo e($item->jenis_label); ?></span></td>
                                        <td class="text-center"><span class="badge bg-primary"><?php echo e($item->indikator_count); ?></span>
                                        </td>
                                        <td class="text-center">
                                            <div class="d-flex justify-content-center gap-2">
                                                <button class="btn btn-sm btn-info text-white" data-bs-toggle="modal" data-bs-target="#deskripsiModal<?php echo e($item->id); ?>">
                                                    <i class="fas fa-book"></i> Kelola Deskripsi
                                                </button>
                                                <a href="<?php echo e(route('admin.assessment-master.indikator.manage', $item->id)); ?>" class="btn btn-sm btn-primary">
                                                    <i class="fas fa-list-check"></i> Kelola Indikator
                                                </a>
                                            </div>
                                        </td>
                                    </tr>

                                    <!-- Modal Kelola Deskripsi -->
                                    <div class="modal fade" id="deskripsiModal<?php echo e($item->id); ?>" tabindex="-1" aria-hidden="true">
                                        <div class="modal-dialog modal-lg">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title">Kamus Kompetensi: <?php echo e($item->nama_kompetensi); ?></h5>
                                                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                                                </div>
                                                <form action="<?php echo e(route('admin.assessment-master.kompetensi.update-deskripsi-jenjang', $item->id)); ?>" method="POST">
                                                    <?php echo csrf_field(); ?>
                                                    <div class="modal-body">
                                                        <p class="text-muted mb-4">Masukkan deskripsi / definisi kompetensi ini untuk masing-masing jenjang jabatan.</p>
                                                        <div class="row g-3">
                                                            <?php $__currentLoopData = $jenjangList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $jenjang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <?php
                                                                    $currentDeskripsi = $item->deskripsiJenjang->where('jenjang_jabatan_id', $jenjang->id)->first()->deskripsi ?? '';
                                                                ?>
                                                                <div class="col-12">
                                                                    <label class="form-label fw-bold"><?php echo e($jenjang->nama_jenjang); ?></label>
                                                                    <textarea name="deskripsi_jenjang[<?php echo e($jenjang->id); ?>]" class="form-control" rows="2" placeholder="Deskripsi untuk <?php echo e($jenjang->nama_jenjang); ?>"><?php echo e($currentDeskripsi); ?></textarea>
                                                                </div>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
                                                        <button type="submit" class="btn btn-primary">Simpan Deskripsi</button>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>



        <div class="tab-pane fade" id="standar-pane" role="tabpanel" aria-labelledby="standar-tab">
            <div class="card master-panel">
                <div class="card-header">
                    <div>
                        <h5>Master Standar Kompetensi Jabatan</h5>
                        <div class="panel-subtitle">Hubungkan jenjang jabatan dengan kompetensi dan level standarnya.
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <form action="<?php echo e(route('admin.assessment-master.standar.store')); ?>" method="POST" class="form-surface">
                        <?php echo csrf_field(); ?>
                        <div class="row g-3">
                            <div class="col-lg-4">
                                <label class="form-label" for="jenjang_jabatan_id">Jenjang Jabatan</label>
                                <select id="jenjang_jabatan_id" name="jenjang_jabatan_id" class="form-select"
                                    required>
                                    <option value="">Pilih Jenjang</option>
                                    <?php $__currentLoopData = $jenjangList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $jenjang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($jenjang->id); ?>"><?php echo e($jenjang->nama_jenjang); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="col-lg-3">
                                <label class="form-label" for="standar_kompetensi_id">Kompetensi</label>
                                <select id="standar_kompetensi_id" name="kompetensi_id" class="form-select" required>
                                    <option value="">Pilih Kompetensi</option>
                                    <?php $__currentLoopData = $kompetensi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($item->id); ?>"><?php echo e($item->nama_kompetensi); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="col-lg-2">
                                <label class="form-label" for="level">Level</label>
                                <select id="level" name="level" class="form-select" required>
                                    <option value="" disabled selected>Pilih Level</option>
                                    <?php for($level = 2; $level <= 5; $level++): ?>
                                        <option value="<?php echo e($level); ?>">Level <?php echo e($level); ?></option>
                                    <?php endfor; ?>
                                </select>
                            </div>
                            <div class="col-lg-3">
                                <label class="form-label" for="deskripsi_standar">Deskripsi</label>
                                <textarea id="deskripsi_standar" name="deskripsi" class="form-control" rows="1"
                                    placeholder="Deskripsi standar"></textarea>
                            </div>
                            <div class="col-12">
                                <button class="btn btn-primary"><i class="fas fa-save"></i> Simpan Standar</button>
                            </div>
                        </div>
                    </form>

                    <div class="table-responsive-md">
                        <table class="table table-clean">
                            <thead>
                                <tr>
                                    <th>Jenjang</th>
                                    <th>Kompetensi</th>
                                    <th class="text-end">Level</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $standards; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td>
                                            <div class="name-strong"><?php echo e($item->jenjangJabatan->nama_jenjang ?? '-'); ?></div>
                                            <div class="meta-text"><?php echo e($item->jenjangJabatan->kategori ?? '-'); ?></div>
                                        </td>
                                        <td><?php echo e($item->kompetensi->nama_kompetensi); ?></td>
                                        <td class="text-end"><span class="badge bg-primary">Level <?php echo e($item->level); ?></span></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class="tab-pane fade" id="rekomendasi-pane" role="tabpanel" aria-labelledby="rekomendasi-tab">
            <div class="card master-panel">
                <div class="card-header">
                    <div>
                        <h5>Master Rekomendasi Pelatihan</h5>
                        <div class="panel-subtitle">Rekomendasi aktif muncul saat ada kebutuhan pengembangan kompetensi.
                        </div>
                    </div>
                </div>
                <div class="card-body">
                    <form action="<?php echo e(route('admin.assessment-master.rekomendasi.store')); ?>" method="POST"
                        class="form-surface">
                        <?php echo csrf_field(); ?>
                        <div class="row g-4">
                            <div class="col-lg-3">
                                <label class="form-label-styled" for="rekomendasi_kompetensi_id">Kompetensi <span class="text-danger">*</span></label>
                                <div class="custom-input-group">
                                    <span class="input-group-text"><i class="fas fa-book"></i></span>
                                    <select id="rekomendasi_kompetensi_id" name="kompetensi_id" class="form-select" required>
                                        <option value="" disabled selected>Pilih Kompetensi</option>
                                        <?php $__currentLoopData = $kompetensi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($item->id); ?>"><?php echo e($item->nama_kompetensi); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-3">
                                <label class="form-label-styled" for="rekomendasi_jenjang_jabatan_id">Jenjang Jabatan <span class="text-danger">*</span></label>
                                <div class="custom-input-group">
                                    <span class="input-group-text"><i class="fas fa-chart-bar"></i></span>
                                    <select id="rekomendasi_jenjang_jabatan_id" name="jenjang_jabatan_id" class="form-select" required>
                                        <option value="" disabled selected>Pilih Jenjang</option>
                                        <?php $__currentLoopData = $jenjangList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $jenjang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($jenjang->id); ?>"><?php echo e($jenjang->nama_jenjang); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <label class="form-label-styled" for="nama_pelatihan">Nama Pelatihan <span class="text-danger">*</span></label>
                                <div class="custom-input-group">
                                    <span class="input-group-text"><i class="far fa-file-alt"></i></span>
                                    <input type="text" id="nama_pelatihan" name="nama_pelatihan" class="form-control" placeholder="Masukkan nama pelatihan" required>
                                </div>
                            </div>

                            <div class="col-lg-4">
                                <label class="form-label-styled d-block">Jenis Pelatihan <span class="text-danger">*</span></label>
                                <div class="d-flex gap-2 mt-1">
                                    <label class="custom-radio-card flex-fill">
                                        <input type="radio" name="jenis_pelatihan" value="Teknis" required>
                                        <span class="radio-indicator"></span>
                                        <i class="fas fa-wrench icon"></i>
                                        <span class="radio-label">Teknis</span>
                                    </label>
                                    <label class="custom-radio-card flex-fill">
                                        <input type="radio" name="jenis_pelatihan" value="Umum" required>
                                        <span class="radio-indicator"></span>
                                        <i class="fas fa-users icon"></i>
                                        <span class="radio-label">Umum</span>
                                    </label>
                                </div>
                            </div>

                            <div class="col-lg-4">
                                <label class="form-label-styled d-block">Bentuk Pelatihan <span class="text-danger">*</span></label>
                                <div class="d-flex gap-2 mt-1">
                                    <label class="custom-radio-card flex-fill">
                                        <input type="radio" name="bentuk_pelatihan" value="klasikal" required>
                                        <span class="radio-indicator"></span>
                                        <i class="fas fa-university icon"></i>
                                        <span class="radio-label">Klasikal</span>
                                    </label>
                                    <label class="custom-radio-card flex-fill">
                                        <input type="radio" name="bentuk_pelatihan" value="non_klasikal" required>
                                        <span class="radio-indicator"></span>
                                        <i class="fas fa-desktop icon"></i>
                                        <span class="radio-label">Non Klasikal</span>
                                    </label>
                                </div>
                            </div>

                            <div class="col-lg-4">
                                <label class="form-label-styled d-block">Status <span class="text-danger">*</span></label>
                                <div class="d-flex gap-2 mt-1">
                                    <label class="custom-radio-card flex-fill">
                                        <input type="radio" name="status" value="aktif" checked required>
                                        <span class="radio-indicator"></span>
                                        <i class="fas fa-check-circle icon"></i>
                                        <span class="radio-label">Aktif</span>
                                    </label>
                                    <label class="custom-radio-card flex-fill">
                                        <input type="radio" name="status" value="nonaktif" required>
                                        <span class="radio-indicator"></span>
                                        <i class="fas fa-times-circle icon"></i>
                                        <span class="radio-label">Nonaktif</span>
                                    </label>
                                </div>
                            </div>

                            <div class="col-12">
                                <label class="form-label-styled" for="deskripsi_rekomendasi">Deskripsi <span class="text-danger">*</span></label>
                                <div class="custom-input-group flex-nowrap align-items-start pt-2">
                                    <span class="input-group-text align-items-start pt-1"><i class="far fa-file-alt"></i></span>
                                    <textarea id="deskripsi_rekomendasi" name="deskripsi" class="form-control" rows="2"
                                        placeholder="Masukkan deskripsi rekomendasi pelatihan" required></textarea>
                                </div>
                            </div>
                            <div class="col-12">
                                <button class="btn btn-primary"><i class="fas fa-save"></i> Simpan Rekomendasi</button>
                            </div>
                        </div>
                    </form>

                    <div class="table-responsive-md">
                        <table class="table table-clean">
                            <thead>
                                <tr>
                                    <th>Kompetensi</th>
                                    <th>Jenjang</th>
                                    <th>Pelatihan & Deskripsi</th>
                                    <th class="text-center">Bentuk</th>
                                    <th class="text-center">Status</th>
                                    <th class="text-center">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $rekomendasi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($item->kompetensi->nama_kompetensi); ?></td>
                                        <td><?php echo e($item->jenjangJabatan?->nama_jenjang ?? '-'); ?></td>
                                        <td>
                                            <div class="name-strong"><?php echo e($item->nama_pelatihan); ?></div>
                                            <div class="meta-text"><?php echo e($item->jenis_pelatihan ?? '-'); ?></div>
                                            <?php if($item->deskripsi): ?>
                                                <div class="small text-muted mt-1"><?php echo e($item->deskripsi); ?></div>
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-center"><span class="type-pill"><?php echo e($item->bentuk_label); ?></span></td>
                                        <td class="text-center">
                                            <form action="<?php echo e(route('admin.assessment-master.rekomendasi.toggle', $item->id)); ?>"
                                                method="POST" class="d-inline">
                                                <?php echo csrf_field(); ?>
                                                <?php echo method_field('PATCH'); ?>
                                                <button type="submit" class="btn btn-sm btn-link p-0 text-decoration-none">
                                                    <span
                                                        class="status-pill <?php echo e($item->status === 'aktif' ? 'active' : 'inactive'); ?>">
                                                        <?php echo e(ucfirst($item->status)); ?> <i class="fas fa-sync-alt ms-1"></i>
                                                    </span>
                                                </button>
                                            </form>
                                        </td>
                                        <td class="text-center">
                                            <div class="d-flex justify-content-center gap-2">
                                                <button class="btn btn-sm btn-warning" data-bs-toggle="modal"
                                                    data-bs-target="#editRekomendasiModal<?php echo e($item->id); ?>">
                                                    <i class="fas fa-edit"></i>
                                                </button>
                                                <form action="<?php echo e(route('admin.assessment-master.rekomendasi.destroy', $item->id)); ?>"
                                                    method="POST" class="d-inline"
                                                    onsubmit="return confirm('Apakah Anda yakin ingin menghapus rekomendasi ini?');">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="btn btn-sm btn-danger"><i
                                                            class="fas fa-trash"></i></button>
                                                </form>
                                            </div>
                                        </td>
                                    </tr>
                                    <!-- Edit Modal -->
                                    <div class="modal fade" id="editRekomendasiModal<?php echo e($item->id); ?>" tabindex="-1"
                                        aria-hidden="true">
                                        <div class="modal-dialog modal-lg">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title">Edit Rekomendasi</h5>
                                                    <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                        aria-label="Close"></button>
                                                </div>
                                                <form
                                                    action="<?php echo e(route('admin.assessment-master.rekomendasi.update', $item->id)); ?>"
                                                    method="POST">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('PUT'); ?>
                                                    <div class="modal-body">
                                                        <div class="row g-3">
                                                            <div class="col-lg-6">
                                                                <label class="form-label">Kompetensi</label>
                                                                <select name="kompetensi_id" class="form-select" required>
                                                                    <?php $__currentLoopData = $kompetensi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kom): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                        <option value="<?php echo e($kom->id); ?>" <?php echo e($kom->id == $item->kompetensi_id ? 'selected' : ''); ?>>
                                                                            <?php echo e($kom->nama_kompetensi); ?></option>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                </select>
                                                            </div>
                                                            <div class="col-lg-6">
                                                                <label class="form-label">Jenjang Jabatan</label>
                                                                <select name="jenjang_jabatan_id" class="form-select" required>
                                                                    <?php $__currentLoopData = $jenjangList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $jenjang): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                        <option value="<?php echo e($jenjang->id); ?>" <?php echo e($jenjang->id == $item->jenjang_jabatan_id ? 'selected' : ''); ?>><?php echo e($jenjang->nama_jenjang); ?></option>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                </select>
                                                            </div>
                                                            <div class="col-12">
                                                                <label class="form-label">Nama Pelatihan</label>
                                                                <input type="text" name="nama_pelatihan" class="form-control"
                                                                    value="<?php echo e($item->nama_pelatihan); ?>" required>
                                                            </div>

                                                            <div class="col-lg-4">
                                                                <label class="form-label d-block">Jenis Pelatihan</label>
                                                                <div class="form-check form-check-inline mt-2">
                                                                    <input class="form-check-input" type="radio"
                                                                        name="jenis_pelatihan" id="jenis_teknis_<?php echo e($item->id); ?>"
                                                                        value="Teknis" <?php echo e($item->jenis_pelatihan == 'Teknis' ? 'checked' : ''); ?> required>
                                                                    <label class="form-check-label"
                                                                        for="jenis_teknis_<?php echo e($item->id); ?>">Teknis</label>
                                                                </div>
                                                                <div class="form-check form-check-inline mt-2">
                                                                    <input class="form-check-input" type="radio"
                                                                        name="jenis_pelatihan" id="jenis_umum_<?php echo e($item->id); ?>"
                                                                        value="Umum" <?php echo e($item->jenis_pelatihan == 'Umum' ? 'checked' : ''); ?> required>
                                                                    <label class="form-check-label"
                                                                        for="jenis_umum_<?php echo e($item->id); ?>">Umum</label>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-4">
                                                                <label class="form-label d-block">Bentuk Pelatihan</label>
                                                                <div class="form-check form-check-inline mt-2">
                                                                    <input class="form-check-input" type="radio" name="bentuk_pelatihan"
                                                                        id="bentuk_klasikal_<?php echo e($item->id); ?>" value="klasikal" <?php echo e($item->bentuk_pelatihan == 'klasikal' ? 'checked' : ''); ?> required>
                                                                    <label class="form-check-label"
                                                                        for="bentuk_klasikal_<?php echo e($item->id); ?>">Klasikal</label>
                                                                </div>
                                                                <div class="form-check form-check-inline mt-2">
                                                                    <input class="form-check-input" type="radio" name="bentuk_pelatihan"
                                                                        id="bentuk_non_klasikal_<?php echo e($item->id); ?>"
                                                                        value="non_klasikal" <?php echo e($item->bentuk_pelatihan == 'non_klasikal' ? 'checked' : ''); ?> required>
                                                                    <label class="form-check-label"
                                                                        for="bentuk_non_klasikal_<?php echo e($item->id); ?>">Non Klasikal</label>
                                                                </div>
                                                            </div>

                                                            <div class="col-lg-4">
                                                                <label class="form-label d-block">Status</label>
                                                                <div class="form-check form-check-inline mt-2">
                                                                    <input class="form-check-input" type="radio" name="status"
                                                                        id="status_aktif_<?php echo e($item->id); ?>" value="aktif" <?php echo e($item->status == 'aktif' ? 'checked' : ''); ?> required>
                                                                    <label class="form-check-label"
                                                                        for="status_aktif_<?php echo e($item->id); ?>">Aktif</label>
                                                                </div>
                                                                <div class="form-check form-check-inline mt-2">
                                                                    <input class="form-check-input" type="radio" name="status"
                                                                        id="status_nonaktif_<?php echo e($item->id); ?>" value="nonaktif" <?php echo e($item->status == 'nonaktif' ? 'checked' : ''); ?> required>
                                                                    <label class="form-check-label"
                                                                        for="status_nonaktif_<?php echo e($item->id); ?>">Nonaktif</label>
                                                                </div>
                                                            </div>

                                                            <div class="col-12">
                                                                <label class="form-label">Deskripsi</label>
                                                                <textarea name="deskripsi" class="form-control"
                                                                    rows="2"><?php echo e($item->deskripsi); ?></textarea>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="modal-footer">
                                                        <button type="button" class="btn btn-secondary"
                                                            data-bs-dismiss="modal">Batal</button>
                                                        <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
                                                    </div>
                                                </form>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <!-- jQuery and DataTables JS -->
    <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // Initialize DataTables
            $('.table-clean').DataTable({
                language: {
                    url: '//cdn.datatables.net/plug-ins/1.13.6/i18n/id.json',
                },
                "pageLength": 10,
                "ordering": false, // we disable initial ordering to maintain custom view if any, or keep it true if needed
                "lengthChange": false, // Menghilangkan opsi "Tampilkan X entri"
                "searching": false,    // Menghilangkan kotak pencarian
                "info": false,         // Menghilangkan info "Showing 1 to N of N entries"
                "paging": false        // Menghilangkan tombol paginasi
            });

            // Restore active tab from localStorage
            const activeTab = localStorage.getItem('masterAssessmentTab');
            if (activeTab) {
                const tabBtn = document.querySelector(`#assessmentMasterTabs button[data-bs-target="${activeTab}"]`);
                if (tabBtn) {
                    const tab = new bootstrap.Tab(tabBtn);
                    tab.show();
                }
            }

            // Save active tab to localStorage
            const triggerTabList = document.querySelectorAll('#assessmentMasterTabs button[data-bs-toggle="tab"]');
            triggerTabList.forEach(triggerEl => {
                triggerEl.addEventListener('shown.bs.tab', event => {
                    localStorage.setItem('masterAssessmentTab', event.target.getAttribute('data-bs-target'));
                });
            });
        });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\Skripsi-M\resources\views/admin/assessment-master/index.blade.php ENDPATH**/ ?>