@extends('layouts.app')
@section('title', 'Reports')
@section('page_title', 'Reports & Analytics')
@section('breadcrumbs')
    <li class="breadcrumb-item"><a href="{{ route('dashboard') }}">Home</a></li><li class="breadcrumb-item active">Reports</li>
@endsection

@section('content')
    @php
        $reports = [
            ['Student Report', 'List & filter students by class, status, gender', 'bi-mortarboard', 'primary', 'reports.students'],
            ['Admissions Report', 'New admissions over a date range', 'bi-clipboard-check', 'info', 'reports.admissions'],
            ['Fee Collection', 'Payments collected over a period', 'bi-cash-coin', 'success', 'reports.fee-collection'],
            ['Defaulters', 'Families with overdue fee balances', 'bi-exclamation-triangle', 'danger', 'reports.defaulters'],
            ['Branch Summary', 'Students & revenue per branch', 'bi-buildings', 'warning', 'reports.branch-summary'],
        ];
    @endphp
    <div class="row g-3">
        @foreach($reports as [$name, $desc, $icon, $tone, $route])
            <div class="col-md-6 col-xl-4">
                <a href="{{ route($route) }}" class="text-decoration-none">
                    <div class="card h-100">
                        <div class="card-body d-flex align-items-start gap-3">
                            <div class="stat-card"><div class="icon bg-soft-{{ $tone }}"><i class="bi {{ $icon }}"></i></div></div>
                            <div>
                                <h6 class="mb-1 text-dark">{{ $name }}</h6>
                                <p class="small text-muted mb-0">{{ $desc }}</p>
                            </div>
                        </div>
                    </div>
                </a>
            </div>
        @endforeach
    </div>

    <div class="card mt-3"><div class="card-body">
        <h6 class="mb-2"><i class="bi bi-link-45deg me-1"></i>Other reports</h6>
        <div class="d-flex flex-wrap gap-2">
            @can('attendance.view')<a href="{{ route('attendance.students.report') }}" class="btn btn-sm btn-light border">Attendance Summary</a>@endcan
            @can('exams.view')<a href="{{ route('results.gazette') }}" class="btn btn-sm btn-light border">Exam Gazette</a>
            <a href="{{ route('results.positions') }}" class="btn btn-sm btn-light border">Position Holders</a>@endcan
            @can('accounting.view')
                <a href="{{ route('reports.trial-balance') }}" class="btn btn-sm btn-light border">Trial Balance</a>
                <a href="{{ route('reports.profit-loss') }}" class="btn btn-sm btn-light border">Profit &amp; Loss</a>
                <a href="{{ route('reports.balance-sheet') }}" class="btn btn-sm btn-light border">Balance Sheet</a>
            @endcan
        </div>
    </div></div>
@endsection
