@extends('layouts.app') @section('title', 'My Dashboard') @section('page-title', 'Dashboard') @section('content') @php $hour = now()->hour; $greeting = $hour < 12 ? 'Good Morning' : ($hour < 17 ? 'Good Afternoon' : 'Good Evening'); @endphp
{{-- Greeting --}}

{{ $greeting }}, {{ explode(' ', auth()->user()->name)[0] }}

{{ $profile?->class_?->full_name ?? '' }} · Roll No: {{ $profile?->roll_number ?? '—' }}

{{-- Stats Cards --}}

Attendance

{{ $attendance['percentage'] }}%

{{ $attendance['present'] }}/{{ $attendance['total'] }} days

Assignments

{{ $pendingAssignments }}

pending

Fees Due

₹{{ number_format($feesDue) }}

Class

{{ $profile?->class_?->full_name ?? 'N/A' }}

{{-- Left: Main content (2 cols) --}}
{{-- Subject Performance Chart --}} @if($subjectMarks->isNotEmpty())

Subject Performance

@foreach($subjectMarks as $subject => $pct)
{{ $subject }}
{{ $pct }}%
@endforeach
@endif {{-- Recent Marks --}}

Recent Marks

@forelse($recentMarks as $mark) @empty @endforelse
Subject Exam Marks Grade
{{ $mark->exam->subject->name ?? '—' }} {{ $mark->exam->name }} @if($mark->is_absent) ABSENT @else {{ $mark->marks_obtained }} /{{ $mark->exam->total_marks }} @endif {{ $mark->grade ?? '—' }}
No marks recorded yet
{{-- AI Insights --}} @if($insights->isNotEmpty())

AI Insights

@foreach($insights as $insight) @php $config = match($insight->type) { 'performance_overview' => ['bg' => 'bg-amber-50', 'border' => 'border-amber-200', 'icon' => 'fa-chart-line', 'color' => 'text-amber-600'], 'strength' => ['bg' => 'bg-green-50', 'border' => 'border-green-200', 'icon' => 'fa-star', 'color' => 'text-green-600'], 'improvement' => ['bg' => 'bg-orange-50', 'border' => 'border-orange-200', 'icon' => 'fa-arrow-up', 'color' => 'text-orange-600'], 'trend' => ['bg' => 'bg-blue-50', 'border' => 'border-blue-200', 'icon' => 'fa-chart-bar', 'color' => 'text-blue-600'], 'warning' => ['bg' => 'bg-red-50', 'border' => 'border-red-200', 'icon' => 'fa-exclamation-circle', 'color' => 'text-red-600'], 'attendance' => ['bg' => 'bg-purple-50', 'border' => 'border-purple-200', 'icon' => 'fa-clipboard-check', 'color' => 'text-purple-600'], default => ['bg' => 'bg-stone-50', 'border' => 'border-stone-200', 'icon' => 'fa-info-circle', 'color' => 'text-stone-600'], }; @endphp

{{ $insight->insight }}

@endforeach
@endif
{{-- Right sidebar --}}
{{-- Class Teacher --}} @if(isset($classObj)) @include('components.class-teacher-card') @endif {{-- Mini Calendar --}}
@php $today = now(); $firstDay = $today->copy()->startOfMonth(); $lastDay = $today->copy()->endOfMonth(); @endphp

{{ $today->format('F Y') }}

@foreach(['S','M','T','W','T','F','S'] as $d)
{{ $d }}
@endforeach @for($i = 0; $i < $firstDay->dayOfWeek; $i++)
@endfor @for($d = 1; $d <= $lastDay->day; $d++)
{{ $d }}
@endfor
{{-- Upcoming Events --}} @include('components.upcoming-events') {{-- Announcements --}}

Announcements

@forelse($announcements as $a)

{{ $a->title }}

{{ Str::limit($a->content, 80) }}

{{ $a->created_at->diffForHumans() }}

@empty
No announcements
@endforelse
@endsection