

<?php $__env->startSection('title', 'Dashboard Admin Sekolah'); ?>

<?php $__env->startSection('content'); ?>
            <!-- Profile Update Modal -->
            <?php if(isset($data['profile_needs_update']) && $data['profile_needs_update']): ?>
            <div class="modal fade" id="profileUpdateModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="profileUpdateModalLabel" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered">
                    <div class="modal-content border-0 shadow-lg">
                        <div class="modal-header bg-warning text-white border-0">
                            <h5 class="modal-title" id="profileUpdateModalLabel">
                                <i class="bi bi-exclamation-triangle-fill me-2"></i>Perhatian: Update Data Sekolah
                            </h5>
                        </div>
                        <div class="modal-body text-center py-4">
                            <div class="mb-3">
                                <i class="bi bi-building text-warning" style="font-size: 4rem;"></i>
                            </div>
                            <h5 class="mb-3">Data Sekolah Belum Diperbarui</h5>
                            <p class="text-muted mb-4">
                                Anda belum melakukan update data sekolah. Silakan lengkapi dan perbarui data sekolah Anda untuk melanjutkan.
                            </p>
                            <div class="alert alert-warning text-start" role="alert">
                                <small>
                                    <i class="bi bi-info-circle me-1"></i>
                                    <strong>Penting:</strong> Data yang perlu dilengkapi meliputi informasi sekolah, kontak, dan data kepala sekolah.
                                </small>
                            </div>
                        </div>
                        <div class="modal-footer border-0">
                            <a href="<?php echo e(route('admin-sekolah.profil')); ?>" class="btn btn-warning w-100">
                                <i class="bi bi-pencil-square me-2"></i>Update Data Sekolah Sekarang
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <?php endif; ?>

            <!-- Header -->
            <div class="d-flex justify-content-between align-items-center mb-4 flex-wrap">
                <div class="mb-2 mb-md-0">
                    <h3 class="mb-1">Dashboard Admin Sekolah</h3>
                    <p class="text-muted mb-0">Selamat datang, <strong><?php echo e($user->name); ?></strong></p>
                    <?php if($data['school']): ?>
                    <small class="text-muted"><i class="bi bi-building"></i> <?php echo e($data['school']->name); ?></small>
                    <?php endif; ?>
                </div>
                <div class="text-end">
                    <small class="text-muted d-none d-md-block"><?php echo e(now()->isoFormat('dddd, D MMMM Y')); ?></small>
                    <small class="text-muted d-md-none"><?php echo e(now()->isoFormat('D MMM Y')); ?></small>
                </div>
            </div>

            <!-- Academic Year Info -->
            <?php if($activeAcademicYear): ?>
            <div class="alert alert-info border-0 shadow-sm mb-4" role="alert">
                <div class="d-flex align-items-center">
                    <div class="flex-shrink-0">
                        <i class="bi bi-calendar-check-fill fs-3"></i>
                    </div>
                    <div class="flex-grow-1 ms-3">
                        <h6 class="alert-heading mb-1">
                            <i class="bi bi-star-fill text-warning me-1"></i>
                            Tahun Ajaran Aktif: <strong><?php echo e($activeAcademicYear->name); ?></strong>
                        </h6>
                        <p class="mb-0 small">
                            <i class="bi bi-calendar-event me-1"></i>
                            Periode: <?php echo e($activeAcademicYear->start_date->format('d M Y')); ?> - <?php echo e($activeAcademicYear->end_date->format('d M Y')); ?>

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

            <!-- Statistics Cards -->
            <div class="row mb-4">
                <div class="col-6 col-md-3 mb-3">
                    <div class="card border-0 shadow-sm h-100">
                        <div class="card-body">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h6 class="text-muted fw-normal mb-1 small">Total Guru</h6>
                                    <h3 class="mb-0 text-primary"><?php echo e($data['total_guru']); ?></h3>
                                    <small class="text-muted">Pendidik</small>
                                </div>
                                <div class="d-none d-sm-block">
                                    <i class="bi bi-people text-primary opacity-50" style="font-size: 2.5rem;"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-6 col-md-3 mb-3">
                    <div class="card border-0 shadow-sm h-100">
                        <div class="card-body">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h6 class="text-muted fw-normal mb-1 small">SPTJM Pending</h6>
                                    <h3 class="mb-0 text-warning"><?php echo e($data['pending_sptjm']); ?></h3>
                                    <small class="text-muted">Menunggu Verifikasi</small>
                                </div>
                                <div class="d-none d-sm-block">
                                    <i class="bi bi-hourglass-split text-warning opacity-50" style="font-size: 2.5rem;"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-6 col-md-3 mb-3">
                    <div class="card border-0 shadow-sm h-100">
                        <div class="card-body">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h6 class="text-muted fw-normal mb-1 small">SPTJM Verified</h6>
                                    <h3 class="mb-0 text-success"><?php echo e($data['verified_sptjm']); ?></h3>
                                    <small class="text-muted">Disetujui</small>
                                </div>
                                <div class="d-none d-sm-block">
                                    <i class="bi bi-check-circle text-success opacity-50" style="font-size: 2.5rem;"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-6 col-md-3 mb-3">
                    <div class="card border-0 shadow-sm h-100">
                        <div class="card-body">
                            <div class="d-flex justify-content-between align-items-center">
                                <div>
                                    <h6 class="text-muted fw-normal mb-1 small">Form Evaluasi</h6>
                                    <h3 class="mb-0 text-info"><?php echo e($data['active_forms']); ?></h3>
                                    <small class="text-muted">Aktif</small>
                                </div>
                                <div class="d-none d-sm-block">
                                    <i class="bi bi-file-text text-info opacity-50" style="font-size: 2.5rem;"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Recent Activities & Quick Actions -->
            <div class="row">
                <div class="col-lg-8 mb-4">
                    <div class="card border-0 shadow-sm">
                        <div class="card-header bg-white border-bottom">
                            <h5 class="card-title mb-0">
                                <i class="bi bi-clock-history text-info"></i> Aktivitas Terbaru
                            </h5>
                        </div>
                        <div class="card-body">
                            <?php if($data['recent_activities']->count() > 0): ?>
                                <div class="list-group list-group-flush">
                                    <?php $__currentLoopData = $data['recent_activities']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="list-group-item px-0 py-3">
                                        <div class="d-flex align-items-start">
                                            <div class="flex-shrink-0">
                                                <span class="badge bg-<?php echo e($activity['color']); ?> rounded-circle p-2">
                                                    <i class="bi bi-<?php echo e($activity['icon']); ?>"></i>
                                                </span>
                                            </div>
                                            <div class="flex-grow-1 ms-3">
                                                <div class="d-flex w-100 justify-content-between flex-wrap">
                                                    <h6 class="mb-1"><?php echo e($activity['message']); ?></h6>
                                                    <small class="text-muted"><?php echo e($activity['time']); ?></small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            <?php else: ?>
                                <div class="text-center py-4">
                                    <i class="bi bi-inbox text-muted" style="font-size: 3rem;"></i>
                                    <p class="text-muted mt-2 mb-0">Belum ada aktivitas terbaru</p>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>

                    <!-- SPTJM Status Chart -->
                    <div class="card border-0 shadow-sm mt-3">
                        <div class="card-header bg-white border-bottom">
                            <h5 class="card-title mb-0">
                                <i class="bi bi-bar-chart text-primary"></i> Status SPTJM
                            </h5>
                        </div>
                        <div class="card-body">
                            <div class="row text-center">
                                <div class="col-4">
                                    <div class="p-3 bg-light rounded">
                                        <h4 class="mb-1 text-success"><?php echo e($data['verified_sptjm']); ?></h4>
                                        <small class="text-muted">Disetujui</small>
                                    </div>
                                </div>
                                <div class="col-4">
                                    <div class="p-3 bg-light rounded">
                                        <h4 class="mb-1 text-warning"><?php echo e($data['pending_sptjm']); ?></h4>
                                        <small class="text-muted">Pending</small>
                                    </div>
                                </div>
                                <div class="col-4">
                                    <div class="p-3 bg-light rounded">
                                        <h4 class="mb-1 text-primary"><?php echo e($data['total_sptjm']); ?></h4>
                                        <small class="text-muted">Total</small>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-lg-4 mb-4">
                    <div class="card border-0 shadow-sm">
                        <div class="card-header bg-white border-bottom">
                            <h5 class="card-title mb-0">
                                <i class="bi bi-lightning-fill text-warning"></i> Aksi Cepat
                            </h5>
                        </div>
                        <div class="card-body">
                            <div class="d-grid gap-2">
                                <a href="<?php echo e(route('admin-sekolah.sptjm')); ?>" class="btn btn-primary btn-sm">
                                    <i class="bi bi-file-earmark-plus"></i> Upload SPTJM
                                </a>
                                <a href="#" class="btn btn-outline-success btn-sm">
                                    <i class="bi bi-people"></i> Kelola Guru
                                </a>
                                <a href="#" class="btn btn-outline-info btn-sm">
                                    <i class="bi bi-graph-up"></i> Lihat Laporan
                                </a>
                                <a href="#" class="btn btn-outline-secondary btn-sm">
                                    <i class="bi bi-download"></i> Export Data
                                </a>
                            </div>
                        </div>
                    </div>

                    <!-- School Info -->
                    <?php if($data['school']): ?>
                    <div class="card border-0 shadow-sm mt-3">
                        <div class="card-header bg-white border-bottom">
                            <h6 class="card-title mb-0">
                                <i class="bi bi-info-circle text-info"></i> Info Sekolah
                            </h6>
                        </div>
                        <div class="card-body">
                            <table class="table table-sm table-borderless mb-0">
                                <tr>
                                    <td class="text-muted"><small><strong>Nama</strong></small></td>
                                    <td><small><?php echo e($data['school']->name); ?></small></td>
                                </tr>
                                <tr>
                                    <td class="text-muted"><small><strong>NPSN</strong></small></td>
                                    <td><small><?php echo e($data['school']->npsn); ?></small></td>
                                </tr>
                                <tr>
                                    <td class="text-muted"><small><strong>Jenjang</strong></small></td>
                                    <td><small><?php echo e(strtoupper($data['school']->level ?? '-')); ?></small></td>
                                </tr>
                                <tr>
                                    <td class="text-muted"><small><strong>Alamat</strong></small></td>
                                    <td><small><?php echo e($data['school']->address); ?></small></td>
                                </tr>
                                <tr>
                                    <td class="text-muted"><small><strong>Status</strong></small></td>
                                    <td>
                                        <?php if($data['school']->is_active): ?>
                                            <span class="badge bg-success">Aktif</span>
                                        <?php else: ?>
                                            <span class="badge bg-secondary">Nonaktif</span>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <?php endif; ?>
                </div>
            </div>

            <!-- Info Alert -->
            <div class="row">
                <div class="col-12">
                    <div class="alert alert-info border-0 shadow-sm" role="alert">
                        <div class="d-flex align-items-center">
                            <i class="bi bi-lightbulb me-2" style="font-size: 1.5rem;"></i>
                            <div>
                                <strong>Tips:</strong> Pastikan untuk mengupload SPTJM secara berkala sesuai periode yang ditentukan. 
                                Verifikasi SPTJM akan dilakukan oleh pengawas sekolah.
                            </div>
                        </div>
                    </div>
                </div>
            </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<?php if(isset($data['profile_needs_update']) && $data['profile_needs_update']): ?>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        var profileUpdateModal = new bootstrap.Modal(document.getElementById('profileUpdateModal'));
        profileUpdateModal.show();
    });
</script>
<?php endif; ?>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\appsuper\resources\views/dashboards/admin-sekolah.blade.php ENDPATH**/ ?>