<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Report Card — <?php echo e($student->full_name); ?></title>
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size: 11px; color: #111; margin: 24px; }
        .header { text-align: center; border-bottom: 3px solid #1e3a5f; padding-bottom: 12px; margin-bottom: 20px; }
        .header h1 { font-size: 20px; margin: 0; color: #1e3a5f; }
        .header p { margin: 4px 0 0; color: #555; }
        .meta { display: table; width: 100%; margin-bottom: 16px; }
        .meta-row { display: table-row; }
        .meta-cell { display: table-cell; padding: 4px 8px 4px 0; width: 50%; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
        th, td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
        th { background: #1e3a5f; color: #fff; }
        .summary { background: #f3f4f6; padding: 12px; margin-bottom: 16px; }
        .remarks { margin-top: 16px; }
        .remarks h3 { font-size: 12px; margin-bottom: 6px; }
        .footer { margin-top: 24px; text-align: center; font-size: 9px; color: #888; }
    </style>
</head>
<body>
    <div class="header">
        <h1><?php echo e($schoolName); ?></h1>
        <p><?php echo e($schoolTagline); ?> — Student Report Card</p>
    </div>

    <div class="meta">
        <div class="meta-row">
            <div class="meta-cell"><strong>Student:</strong> <?php echo e($student->full_name); ?></div>
            <div class="meta-cell"><strong>Admission No:</strong> <?php echo e($student->admission_number); ?></div>
        </div>
        <div class="meta-row">
            <div class="meta-cell"><strong>Class:</strong> <?php echo e($schoolClass->name); ?></div>
            <div class="meta-cell"><strong>Term:</strong> <?php echo e($term->name); ?> (<?php echo e($term->academicYear?->name); ?>)</div>
        </div>
    </div>

    <table>
        <thead>
            <tr>
                <th>Subject</th>
                <th>Average %</th>
                <th>Grade</th>
                <th>Position</th>
            </tr>
        </thead>
        <tbody>
            <?php $__empty_1 = true; $__currentLoopData = $subjects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($row->subject?->name); ?></td>
                    <td><?php echo e($row->average_score !== null ? number_format($row->average_score, 1) : '—'); ?></td>
                    <td><?php echo e($row->grade_letter ?? '—'); ?></td>
                    <td><?php echo e($row->class_position ?? '—'); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="4">No approved subject results.</td></tr>
            <?php endif; ?>
        </tbody>
    </table>

    <div class="summary">
        <strong>Overall Average:</strong> <?php echo e($reportCard->overall_average !== null ? number_format($reportCard->overall_average, 1).'%' : '—'); ?>

        &nbsp;|&nbsp;
        <strong>Class Position:</strong> <?php echo e($reportCard->overall_position ?? '—'); ?>

    </div>

    <div class="remarks">
        <?php if($reportCard->class_teacher_remarks): ?>
            <h3>Class Teacher Remarks</h3>
            <p><?php echo e($reportCard->class_teacher_remarks); ?></p>
        <?php endif; ?>
        <?php if($reportCard->head_teacher_remarks): ?>
            <h3>Head Teacher Remarks</h3>
            <p><?php echo e($reportCard->head_teacher_remarks); ?></p>
        <?php endif; ?>
    </div>

    <div class="footer">
        Generated <?php echo e(now()->format('M j, Y')); ?> — <?php echo e($reportCard->status === 'published' ? 'Published' : 'Draft'); ?>

    </div>
</body>
</html>
<?php /**PATH C:\laragon\www\southend\resources\views\exports\report-card.blade.php ENDPATH**/ ?>