<?php $__env->startSection('title', $student->user->name); ?>
<?php $__env->startSection('page-title', 'Student Profile'); ?>
<?php $__env->startSection('sidebar-nav'); ?>
<div class="nav-item"><a href="<?php echo e(route('admin.dashboard')); ?>"><i class="bi bi-grid"></i> Dashboard</a></div>
<div class="nav-item"><a href="<?php echo e(route('admin.students.index')); ?>"><i class="bi bi-people"></i> Students</a></div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="page-header">
    <div style="display:flex;align-items:center;gap:16px;">
        <div class="avatar" style="width:56px;height:56px;font-size:22px;"><?php echo e(strtoupper(substr($student->user->name, 0, 1))); ?></div>
        <div>
            <h1><?php echo e($student->user->name); ?></h1>
            <p><?php echo e($student->stream?->schoolClass->name); ?> <?php echo e($student->stream?->name); ?> &bull; Adm: <?php echo e($student->admission_no); ?></p>
        </div>
    </div>
    <div style="display:flex;gap:8px;">
        <a href="<?php echo e(route('admin.students.edit', $student)); ?>" class="btn btn-outline"><i class="bi bi-pencil"></i> Edit</a>
        <a href="<?php echo e(route('admin.students.index')); ?>" class="btn btn-secondary"><i class="bi bi-arrow-left"></i> Back</a>
    </div>
</div>

<div class="grid grid-3" style="margin-bottom:24px;">
    <div class="stat-card">
        <div class="stat-icon green"><i class="bi bi-envelope"></i></div>
        <div class="stat-info"><h3 style="font-size:14px;"><?php echo e($student->user->email); ?></h3><p>Email</p></div>
    </div>
    <div class="stat-card">
        <div class="stat-icon blue"><i class="bi bi-phone"></i></div>
        <div class="stat-info"><h3 style="font-size:14px;"><?php echo e($student->user->phone ?? 'N/A'); ?></h3><p>Phone</p></div>
    </div>
    <div class="stat-card">
        <div class="stat-icon <?php echo e($student->status === 'active' ? 'green' : 'red'); ?>"><i class="bi bi-circle-fill"></i></div>
        <div class="stat-info"><h3 style="font-size:14px;"><?php echo e(ucfirst($student->status)); ?></h3><p>Status</p></div>
    </div>
</div>

<div class="grid grid-2">
    <div class="card">
        <div class="card-header"><h5>Recent Marks</h5></div>
        <div class="card-body" style="padding:0;">
            <?php $__empty_1 = true; $__currentLoopData = $student->marks->take(10); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mark): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div style="padding:10px 20px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;">
                <div>
                    <div style="font-weight:500;font-size:13px;"><?php echo e($mark->subject->name); ?></div>
                    <div style="font-size:12px;color:var(--gray);"><?php echo e($mark->exam->name); ?></div>
                </div>
                <div style="text-align:right;">
                    <span style="font-weight:700;"><?php echo e($mark->score); ?>%</span>
                    <span class="badge badge-info" style="margin-left:6px;"><?php echo e($mark->grade); ?></span>
                </div>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div style="padding:20px;text-align:center;color:var(--gray);">No marks recorded</div>
            <?php endif; ?>
        </div>
    </div>
    <div class="card">
        <div class="card-header"><h5>Fee Invoices</h5></div>
        <div class="card-body" style="padding:0;">
            <?php $__empty_1 = true; $__currentLoopData = $student->feeInvoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div style="padding:10px 20px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;">
                <div>
                    <div style="font-weight:500;font-size:13px;"><?php echo e($invoice->term->name); ?></div>
                    <div style="font-size:12px;color:var(--gray);">Total: KES <?php echo e(number_format($invoice->total_amount)); ?></div>
                </div>
                <div style="text-align:right;">
                    <div style="font-size:13px;color:<?php echo e($invoice->balance > 0 ? 'var(--danger)' : 'var(--success)'); ?>;">
                        Balance: KES <?php echo e(number_format($invoice->balance)); ?>

                    </div>
                    <span class="badge <?php echo e($invoice->status === 'paid' ? 'badge-success' : ($invoice->status === 'partial' ? 'badge-warning' : 'badge-danger')); ?>">
                        <?php echo e(ucfirst($invoice->status)); ?>

                    </span>
                </div>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div style="padding:20px;text-align:center;color:var(--gray);">No invoices</div>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

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