@extends('layouts.app') @section('title', $student->full_name) @push('styles') @endpush @section('content')
{{-- Header --}}

Profil Siswa

Kembali
{{-- ===== HERO CARD ===== --}}
{{-- Avatar --}}
@if($student->photo_path) {{ $student->full_name }} @else {{ strtoupper(substr($student->full_name, 0, 1)) }} @endif

{{ $student->full_name }}

{{ $student->nisn ?? '—' }} {{ $student->class_name ?? '—' }} {{ $student->department_name ?? $student->department_code ?? '—' }}
@if($student->is_active) Aktif @else Tidak Aktif @endif
{{-- SP Level Badge --}} @if($currentSpLevel)
{{ $currentSpLevel->name }} — {{ $currentSpLevel->min_points }}+ poin
@endif {{-- Quick Stats --}}

Total Poin

{{ $totalPoints }}

Pelanggaran

{{ $violationCount }}x

SP Terbit

{{ $activeSpLetters }}

Terakhir

@if($lastViolation) {{ $lastViolation->violation_date->diffForHumans() }} @else — @endif

{{-- ===== SP PROGRESS ===== --}} @if($spThresholds->count() > 0)

Progress Ambang Surat Peringatan

{{ $totalPoints }} / {{ $nextSpThreshold ? $nextSpThreshold->min_points : $spThresholds->last()->min_points }} poin
{{-- Progress Bar --}} @php $maxPoints = $nextSpThreshold ? $nextSpThreshold->min_points : $spThresholds->last()->min_points; if ($totalPoints >= $spThresholds->last()->min_points) { $progressPercent = 100; } else { $progressPercent = min(100, ($totalPoints / $maxPoints) * 100); } @endphp
{{-- Threshold Markers --}}
@foreach($spThresholds as $threshold) @php $tsReached = $totalPoints >= $threshold->min_points; @endphp
{{ $threshold->min_points }}
{{ $threshold->name }}
@endforeach
{{-- Status --}} @if($currentSpLevel)

{{ $currentSpLevel->name }} sudah tercapai

Siswa ini telah mencapai ambang minimal {{ $currentSpLevel->min_points }} poin. Surat peringatan telah diterbitkan.

@elseif($nextSpThreshold && $violationCount > 0)

Menuju {{ $nextSpThreshold->name }}

{{ $nextSpThreshold->min_points - $totalPoints }} poin lagi untuk mencapai ambang {{ $nextSpThreshold->name }} ({{ $nextSpThreshold->min_points }} poin)

@endif
@endif {{-- ===== VIOLATIONS TIMELINE ===== --}}

Riwayat Pelanggaran

{{ $violationCount }} catatan pelanggaran

@forelse($student->violations as $v)
{{-- Timeline dot --}}
{{ $v->violationType->name ?? '—' }} @if($v->is_verified) ✓ Terverifikasi @endif
@if($v->description)

{{ $v->description }}

@endif
{{ $v->violation_date->format('d M Y') }} @if($v->violation_time) {{ $v->violation_time }} @endif @if($v->location) {{ $v->location }} @endif {{ $v->recorder->name ?? '—' }}
{{-- Evidence photos --}} @if($v->evidences && $v->evidences->count() > 0)
@foreach($v->evidences->take(3) as $ev) Bukti @endforeach @if($v->evidences->count() > 3)
+{{ $v->evidences->count() - 3 }}
@endif
@endif
+{{ $v->points }} @if($v->sanction) {{ $v->sanction }} @endif Detail
@empty

Belum Ada Pelanggaran

Siswa ini belum memiliki catatan pelanggaran

@endforelse
{{-- ===== SP LETTERS ===== --}} @if($student->spLetters->count() > 0)

Surat Peringatan

{{ $student->spLetters->count() }} surat diterbitkan

@foreach($student->spLetters as $sp)

{{ $sp->spThreshold?->name ?? 'SP' }} @if($sp->status === 'draft') Draft @elseif($sp->status === 'issued') Terbit @endif

{{ $sp->letter_number }} • {{ $sp->created_at->format('d M Y') }}

{{-- Always show on mobile --}}
@endforeach
@endif {{-- ===== STUDENT INFO DETAILS ===== --}}

Informasi Lengkap

NISN

{{ $student->nisn ?? '—' }}

NIS

{{ $student->student_number ?? '—' }}

Jenis Kelamin

{{ $student->gender === 'L' ? 'Laki-laki' : ($student->gender === 'P' ? 'Perempuan' : '—') }}

Tempat, Tanggal Lahir

{{ $student->place_of_birth ?? '—' }}{{ $student->place_of_birth && $student->date_of_birth ? ', ' : '' }} {{ $student->date_of_birth ? $student->date_of_birth->format('d M Y') : '—' }}

Kelas

{{ $student->class_name ?? '—' }}

Jurusan

{{ $student->department_name ?? $student->department_code ?? '—' }}

Alamat

{{ $student->address ?? '—' }}

@if($student->phone_number || $student->email)

Telepon

{{ $student->phone_number ?? '—' }}

Email

{{ $student->email ?? '—' }}

@endif

Tahun Akademik

{{ $student->academic_year_name ?? '—' }}

Terakhir Sinkron

{{ $student->synced_at ? $student->synced_at->format('d M Y H:i') : '—' }}

@endsection