<div>

    {{-- Stock Overview --}}
    <div class="row g-4 mb-4">

        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body text-center py-4">
                    <div class="mb-2">
                        <div class="avatar-sm bg-danger-subtle rounded-circle d-flex align-items-center justify-content-center mx-auto" style="width:48px;height:48px;">
                            <i class="mdi mdi-card-account-details-outline text-danger fs-4"></i>
                        </div>
                    </div>
                    <div class="display-6 fw-bold text-danger">{{ number_format($missingIdPoaCount) }}</div>
                    <div class="fw-semibold text-dark mt-1">Missing ID / POA</div>
                    <div class="text-muted small">Clients waiting on documents</div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body text-center py-4">
                    <div class="mb-2">
                        <div class="avatar-sm bg-warning-subtle rounded-circle d-flex align-items-center justify-content-center mx-auto" style="width:48px;height:48px;">
                            <i class="mdi mdi-magnify text-warning fs-4"></i>
                        </div>
                    </div>
                    <div class="display-6 fw-bold text-warning">{{ number_format($investigationCount) }}</div>
                    <div class="fw-semibold text-dark mt-1">Investigation — DSAR Activity</div>
                    <div class="text-muted small">Clients currently under investigation</div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body text-center py-4">
                    <div class="mb-2">
                        <div class="avatar-sm bg-success-subtle rounded-circle d-flex align-items-center justify-content-center mx-auto" style="width:48px;height:48px;">
                            <i class="mdi mdi-account-group text-success fs-4"></i>
                        </div>
                    </div>
                    <div class="display-6 fw-bold text-success">{{ number_format($activelyClaimingCount) }}</div>
                    <div class="fw-semibold text-dark mt-1">Actively Claiming</div>
                    <div class="text-muted small">Open clients in the active pipeline</div>
                </div>
            </div>
        </div>

    </div>

    {{-- Original KPI Cards --}}
    <div class="row g-4 mb-4">

        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body">
                    <div class="d-flex align-items-center mb-3">
                        <div class="flex-shrink-0 me-3">
                            <div class="avatar-sm bg-primary-subtle rounded-circle d-flex align-items-center justify-content-center" style="width:42px;height:42px;">
                                <i class="mdi mdi-account-plus text-primary fs-5"></i>
                            </div>
                        </div>
                        <div>
                            <h6 class="mb-0 fw-semibold text-dark">Clients Created</h6>
                            <small class="text-muted">New registrations</small>
                        </div>
                    </div>
                    <div class="row text-center g-0">
                        <div class="col border-end">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-primary">{{ number_format($clientsToday) }}</div>
                                <div class="text-muted small">Today</div>
                            </div>
                        </div>
                        <div class="col border-end">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-primary">{{ number_format($clientsWeek) }}</div>
                                <div class="text-muted small">This Week</div>
                            </div>
                        </div>
                        <div class="col">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-primary">{{ number_format($clientsMonth) }}</div>
                                <div class="text-muted small">This Month</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body">
                    <div class="d-flex align-items-center mb-3">
                        <div class="flex-shrink-0 me-3">
                            <div class="avatar-sm bg-warning-subtle rounded-circle d-flex align-items-center justify-content-center" style="width:42px;height:42px;">
                                <i class="mdi mdi-flag text-warning fs-5"></i>
                            </div>
                        </div>
                        <div>
                            <h6 class="mb-0 fw-semibold text-dark">Ready for DSAR</h6>
                            <small class="text-muted">Claims reaching this status</small>
                        </div>
                    </div>
                    <div class="row text-center g-0">
                        <div class="col border-end">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-warning">{{ number_format($status24Today) }}</div>
                                <div class="text-muted small">Today</div>
                            </div>
                        </div>
                        <div class="col border-end">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-warning">{{ number_format($status24Week) }}</div>
                                <div class="text-muted small">This Week</div>
                            </div>
                        </div>
                        <div class="col">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-warning">{{ number_format($status24Month) }}</div>
                                <div class="text-muted small">This Month</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-body">
                    <div class="d-flex align-items-center mb-3">
                        <div class="flex-shrink-0 me-3">
                            <div class="avatar-sm bg-success-subtle rounded-circle d-flex align-items-center justify-content-center" style="width:42px;height:42px;">
                                <i class="mdi mdi-check-circle text-success fs-5"></i>
                            </div>
                        </div>
                        <div>
                            <h6 class="mb-0 fw-semibold text-dark">DSARs Sent</h6>
                            <small class="text-muted">Claims reaching this status</small>
                        </div>
                    </div>
                    <div class="row text-center g-0">
                        <div class="col border-end">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-success">{{ number_format($status34Today) }}</div>
                                <div class="text-muted small">Today</div>
                            </div>
                        </div>
                        <div class="col border-end">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-success">{{ number_format($status34Week) }}</div>
                                <div class="text-muted small">This Week</div>
                            </div>
                        </div>
                        <div class="col">
                            <div class="py-2">
                                <div class="fs-4 fw-bold text-success">{{ number_format($status34Month) }}</div>
                                <div class="text-muted small">This Month</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

    {{-- Throughput Table --}}
    <div class="card border-0 shadow-sm">
        <div class="card-body">
            <h6 class="fw-semibold text-dark mb-3">Pipeline Throughput</h6>
            <div class="table-responsive">
                <table class="table table-sm table-hover align-middle mb-0">
                    <thead class="table-light">
                        <tr>
                            <th class="text-muted fw-normal">Stage</th>
                            <th class="text-center text-muted fw-normal">Today</th>
                            <th class="text-center text-muted fw-normal">This Week</th>
                            <th class="text-center text-muted fw-normal">This Month</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>Leads In <span class="text-muted small">(created)</span></td>
                            <td class="text-center fw-semibold">{{ number_format($clientsToday) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($clientsWeek) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($clientsMonth) }}</td>
                        </tr>
                        <tr>
                            <td>Sent To Redress <span class="text-muted small">(Parts 1/3)</span></td>
                            <td class="text-center fw-semibold">{{ number_format($sentToRedressToday) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($sentToRedressWeek) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($sentToRedressMonth) }}</td>
                        </tr>
                        <tr>
                            <td>APP Number Received</td>
                            <td class="text-center fw-semibold">{{ number_format($appNumberToday) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($appNumberWeek) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($appNumberMonth) }}</td>
                        </tr>
                        <tr>
                            <td>Ready For DSAR</td>
                            <td class="text-center fw-semibold">{{ number_format($status24Today) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($status24Week) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($status24Month) }}</td>
                        </tr>
                        <tr>
                            <td>DSAR Sent</td>
                            <td class="text-center fw-semibold">{{ number_format($status34Today) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($status34Week) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($status34Month) }}</td>
                        </tr>
                        <tr>
                            <td>Part DSAR Received</td>
                            <td class="text-center fw-semibold">{{ number_format($partDsarToday) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($partDsarWeek) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($partDsarMonth) }}</td>
                        </tr>
                        <tr>
                            <td>Closed</td>
                            <td class="text-center fw-semibold">{{ number_format($closedToday) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($closedWeek) }}</td>
                            <td class="text-center fw-semibold">{{ number_format($closedMonth) }}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

</div>
