<?php $__env->startSection('title', 'Student Dashboard'); ?>
<?php $__env->startSection('page-title', 'My Dashboard'); ?>
<?php $__env->startSection('sidebar-nav'); ?>
<div class="nav-item"><a href="<?php echo e(route('student.dashboard')); ?>"><i class="bi bi-grid"></i> Dashboard</a></div>
<div class="nav-item"><a href="<?php echo e(route('student.results')); ?>"><i class="bi bi-bar-chart"></i> My Results</a></div>
<div class="nav-item"><a href="<?php echo e(route('student.fees')); ?>"><i class="bi bi-cash"></i> Fee Balance</a></div>
<div class="nav-item"><a href="<?php echo e(route('student.attendance')); ?>"><i class="bi bi-calendar-check"></i> Attendance</a></div>
<div class="nav-item"><a href="<?php echo e(route('student.assignments')); ?>"><i class="bi bi-file-earmark-text"></i> Assignments</a></div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="page-header">
    <div>
        <h1>Hello, <?php echo e(auth()->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 class="grid grid-4" style="margin-bottom:24px;">
    <div class="stat-card">
        <div class="stat-icon green"><i class="bi bi-mortarboard"></i></div>
        <div class="stat-info">
            <h3><?php echo e($recentMarks->count()); ?></h3>
            <p>Recent Results</p>
        </div>
    </div>
    <div class="stat-card">
        <div class="stat-icon <?php echo e(($currentInvoice?->balance ?? 0) > 0 ? 'red' : 'green'); ?>">
            <i class="bi bi-cash"></i>
        </div>
        <div class="stat-info">
            <h3>KES <?php echo e(number_format($currentInvoice?->balance ?? 0)); ?></h3>
            <p>Fee Balance</p>
        </div>
    </div>
    <div class="stat-card">
        <div class="stat-icon blue"><i class="bi bi-file-earmark-text"></i></div>
        <div class="stat-info">
            <h3><?php echo e($upcomingAssignments->count()); ?></h3>
            <p>Pending Assignments</p>
        </div>
    </div>
</div>

<div class="grid grid-2">
    <div class="card">
        <div class="card-header"><h5>Recent Marks</h5><a href="<?php echo e(route('student.results')); ?>" class="btn btn-sm btn-secondary">View All</a></div>
        <div class="card-body" style="padding:0;">
            <?php $__empty_1 = true; $__currentLoopData = $recentMarks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mark): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div style="padding:12px 20px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;">
                <div>
                    <div style="font-weight:500;"><?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;">
                    <div style="font-weight:700;font-size:18px;"><?php echo e($mark->score); ?>%</div>
                    <span class="badge badge-info"><?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 results yet</div>
            <?php endif; ?>
        </div>
    </div>
    <div class="card">
        <div class="card-header"><h5>Upcoming Assignments</h5></div>
        <div class="card-body" style="padding:0;">
            <?php $__empty_1 = true; $__currentLoopData = $upcomingAssignments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div style="padding:12px 20px;border-bottom:1px solid var(--border);">
                <div style="font-weight:500;"><?php echo e($a->title); ?></div>
                <div style="font-size:12px;color:var(--gray);"><?php echo e($a->subject->name); ?> &bull; Due: <?php echo e($a->due_date->format('d M Y')); ?></div>
                <?php if($a->due_date->isToday()): ?>
                    <span class="badge badge-danger" style="margin-top:4px;">Due Today!</span>
                <?php elseif($a->due_date->isTomorrow()): ?>
                    <span class="badge badge-warning" style="margin-top:4px;">Due Tomorrow</span>
                <?php endif; ?>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div style="padding:20px;text-align:center;color:var(--gray);">No upcoming assignments</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\student\dashboard.blade.php ENDPATH**/ ?>