@extends('admin.layout')

@section('title', 'Dashboard')

@section('content')
    <div class="admin-heading">
        <div>
            <span>Overview</span>
            <h1>Website Management</h1>
        </div>
    </div>

    <div class="admin-stats">
        @foreach ($counts as $label => $value)
            <article>
                <span>{{ ucfirst($label) }}</span>
                <strong>{{ $value }}</strong>
            </article>
        @endforeach
    </div>

    <section class="admin-card">
        <h2>Latest Darul Ifta Questions</h2>
        <div class="admin-list">
            @forelse ($latestQuestions as $question)
                <a href="{{ route('admin.questions.index') }}">
                    <strong>{{ $question->title }}</strong>
                    <span>{{ $question->user->name }} · {{ $question->status }} · {{ $question->created_at->diffForHumans() }}</span>
                </a>
            @empty
                <p>No questions yet.</p>
            @endforelse
        </div>
    </section>
@endsection
