@props([
    'progress',   // WitnessProgress
    'topN' => 3,
])

@php
    $missing = collect($progress->missingEvidenceSections);
    $count = $missing->count();
@endphp

@if($count > 0)
    <div class="witness-missing-summary">
        <div class="d-flex align-items-center gap-2 small fw-semibold text-warning-emphasis mb-1">
            <span class="mdi mdi-shield-alert-outline" aria-hidden="true"></span>
            {{ $count }} {{ \Illuminate\Support\Str::plural('section', $count) }} without supporting evidence
        </div>
        <p class="text-muted mb-1" style="font-size:.78rem;">
            Evidence is optional for many sections — only add it where it strengthens the account.
        </p>

        <ul class="mb-1 ps-4 small">
            @foreach($missing->take($topN) as $title)
                <li>{{ $title }}</li>
            @endforeach
        </ul>

        @if($count > $topN)
            <button class="btn btn-sm btn-link px-0" type="button" data-bs-toggle="collapse"
                    data-bs-target="#missingEvidenceMore" aria-expanded="false" aria-controls="missingEvidenceMore">
                View all {{ $count }} sections
            </button>
            <div class="collapse" id="missingEvidenceMore">
                <ul class="mb-0 ps-4 small">
                    @foreach($missing->slice($topN) as $title)
                        <li>{{ $title }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
    </div>
@else
    <p class="text-muted small mb-0">
        <span class="mdi mdi-check text-success" aria-hidden="true"></span>
        Every evidence-backed section has confirmed findings.
    </p>
@endif
