<!doctype html>
<html lang="ms">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin – Data Pelajar</title>
    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
    <style>
        body{
            margin:0;
            font-family:Figtree,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
            background:radial-gradient(circle at top,#1d4ed8,#020617);
            color:#e5e7eb;
        }
        .wrap{
            min-height:100vh;
            padding:22px 18px 26px;
            display:flex;
            justify-content:center;
        }
        .card{
            width:100%;
            max-width:1180px;
            background:rgba(15,23,42,.96);
            border-radius:22px;
            border:1px solid rgba(148,163,184,.4);
            box-shadow:0 24px 80px rgba(15,23,42,1);
            padding:20px 20px 18px;
        }
        h1{
            margin:0 0 4px;
            font-size:20px;
        }
        .subtitle{
            margin:0 0 18px;
            font-size:13px;
            color:#9ca3af;
        }
        .toolbar{
            display:flex;
            justify-content:space-between;
            align-items:center;
            margin-bottom:12px;
            gap:12px;
            flex-wrap:wrap;
        }
        .btn-primary{
            border:none;
            border-radius:999px;
            padding:8px 14px;
            background:linear-gradient(135deg,#38bdf8,#0ea5e9);
            color:#0f172a;
            font-size:13px;
            font-weight:600;
            cursor:pointer;
            display:inline-flex;
            align-items:center;
            gap:6px;
        }
        table{
            width:100%;
            border-collapse:collapse;
            font-size:12px;
            margin-top:4px;
        }
        th,td{
            padding:6px 8px;
            border-bottom:1px solid rgba(55,65,81,.9);
            text-align:left;
            white-space:nowrap;
        }
        th{
            font-size:11px;
            text-transform:uppercase;
            letter-spacing:.08em;
            color:#9ca3af;
        }
        tbody tr:nth-child(even){
            background:rgba(15,23,42,.7);
        }
        .badge{
            display:inline-flex;
            align-items:center;
            padding:2px 8px;
            border-radius:999px;
            background:rgba(37,99,235,.25);
            color:#bfdbfe;
            font-size:11px;
        }
        .actions{
            display:flex;
            gap:6px;
        }
        .link{
            font-size:11px;
            color:#93c5fd;
            text-decoration:none;
        }
        .link-danger{
            color:#fecaca;
        }
        .status{
            margin-bottom:10px;
            font-size:12px;
            color:#bbf7d0;
        }
        .empty{
            font-size:13px;
            color:#9ca3af;
            padding:16px 0 6px;
        }
        .pagination{
            margin-top:10px;
            font-size:12px;
            color:#9ca3af;
        }
        .pagination span,
        .pagination a{
            margin-right:6px;
        }
    </style>
</head>
<body>
<div class="wrap">
    <div class="card">
        <?php echo $__env->make('admin.partials.nav', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

        <h1>Data Pelajar Mengikut Kelas</h1>
        <p class="subtitle">Kemaskini kohort, program, kelas dan pecahan jantina/asrama/agama/kaum.</p>

        <?php if(session('status')): ?>
            <div class="status"><?php echo e(session('status')); ?></div>
        <?php endif; ?>

        <div class="toolbar">
            <form method="get" action="<?php echo e(route('admin.students.index')); ?>">
                <input
                    type="text"
                    name="search"
                    placeholder="Cari kohort / program / kelas..."
                    value="<?php echo e(request('search')); ?>"
                    style="padding:6px 9px;border-radius:999px;border:1px solid rgba(148,163,184,.7);background:rgba(15,23,42,.9);color:#e5e7eb;font-size:12px;min-width:220px;"
                >
            </form>

            <a href="<?php echo e(route('admin.students.create')); ?>" class="btn-primary">
                + Rekod Kelas
            </a>
        </div>

        <?php if($students->count()): ?>
            <div style="overflow-x:auto;">
                <table>
                    <thead>
                    <tr>
                        <th>Kohort</th>
                        <th>Program</th>
                        <th>Kelas</th>
                        <th>L</th>
                        <th>P</th>
                        <th>Asrama</th>
                        <th>Luar</th>
                        <th>Islam</th>
                        <th>Bukan Islam</th>
                        <th>Melayu</th>
                        <th>Cina</th>
                        <th>India</th>
                        <th>Lain</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $student): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><span class="badge"><?php echo e($student->kohort); ?></span></td>
                            <td><?php echo e($student->program); ?></td>
                            <td><?php echo e($student->kelas); ?></td>
                            <td><?php echo e($student->bil_lelaki); ?></td>
                            <td><?php echo e($student->bil_perempuan); ?></td>
                            <td><?php echo e($student->bil_asrama); ?></td>
                            <td><?php echo e($student->bil_bukan_asrama); ?></td>
                            <td><?php echo e($student->agama_islam); ?></td>
                            <td><?php echo e($student->agama_bukan_islam); ?></td>
                            <td><?php echo e($student->kaum_melayu); ?></td>
                            <td><?php echo e($student->kaum_cina); ?></td>
                            <td><?php echo e($student->kaum_india); ?></td>
                            <td><?php echo e($student->kaum_lain); ?></td>
                            <td>
                                <div class="actions">
                                    <a href="<?php echo e(route('admin.students.edit', $student)); ?>" class="link">Edit</a>
                                    <form method="post" action="<?php echo e(route('admin.students.destroy', $student)); ?>" onsubmit="return confirm('Padam rekod kelas ini?')">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('delete'); ?>
                                        <button type="submit" class="link link-danger">Padam</button>
                                    </form>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>

            <div class="pagination">
                <?php echo e($students->withQueryString()->links()); ?>

            </div>
        <?php else: ?>
            <div class="empty">Belum ada rekod kelas pelajar. Tambah rekod baharu menggunakan butang “Rekod Kelas”.</div>
        <?php endif; ?>
    </div>
</div>
</body>
</html>

<?php /**PATH C:\xampp\htdocs\dash\resources\views/admin/students/index.blade.php ENDPATH**/ ?>