 {{-- =================================================
                                     CASE DETAIL MODAL
                                ================================================== --}}

                                <div
                                    class="modal fade"
                                    id="caseModal{{ $case->id ?? $case->cino }}"
                                    tabindex="-1"
                                    aria-hidden="true"
                                >

                                    <div
                                        class="modal-dialog modal-xl modal-dialog-scrollable"
                                    >

                                        <div class="modal-content">


                                            {{-- MODAL HEADER --}}

                                            <div class="modal-header case-modal-header">

                                                <div>

                                                    <h5 class="modal-title fw-bold">

                                                        Case Details

                                                    </h5>

                                                    <div class="small opacity-75">

                                                        {{ trim($case->caseType->skey ?? '') }}
                                                        /
                                                        {{ $case->caseno }}
                                                        /
                                                        {{ $case->caseyear }}

                                                    </div>

                                                </div>


                                                <button
                                                    type="button"
                                                    class="btn-close btn-close-white"
                                                    data-bs-dismiss="modal"
                                                ></button>

                                            </div>


                                            <div class="modal-body p-4">


                                                {{-- CASE TITLE --}}

                                                <div class="modal-case-title mb-4">

                                                    <div class="modal-party">

                                                        {{ $case->pet_name ?? 'N/A' }}

                                                    </div>


                                                    <span class="modal-vs">

                                                        VS

                                                    </span>


                                                    <div class="modal-party">

                                                        {{ $case->res_name ?? 'N/A' }}

                                                    </div>

                                                </div>


                                                {{-- STATUS / CNR --}}

                                                <div class="d-flex flex-wrap gap-2 mb-4">

                                                    @if($case->c_status === 'P')

                                                        <span class="case-status pending">

                                                            <i class="bi bi-hourglass-split"></i>

                                                            Pending

                                                        </span>

                                                    @elseif($case->c_status === 'D')

                                                        <span class="case-status disposed">

                                                            <i class="bi bi-check-circle"></i>

                                                            Disposed

                                                        </span>

                                                    @else

                                                        <span class="case-status other">

                                                            {{ $case->c_status ?? 'N/A' }}

                                                        </span>

                                                    @endif


                                                    <span class="cnr-badge">

                                                        CNR:
                                                        {{ $case->cino ?? 'N/A' }}

                                                    </span>

                                                </div>


                                                {{-- BASIC INFORMATION --}}

                                                <div class="detail-section">

                                                    <div class="detail-section-title">

                                                        <i class="bi bi-file-earmark-text"></i>

                                                        Case Information

                                                    </div>


                                                    <div class="row g-3">


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Case Number
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->caseno }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Case Type
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->caseType->casename ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Year
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->caseyear }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Bench
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->bench ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Filing Date
                                                            </div>

                                                            <div class="detail-value">

                                                                @if($case->fil_dt)

                                                                    {{ \Carbon\Carbon::parse($case->fil_dt)->format('d M Y H:i') }}

                                                                @else

                                                                    N/A

                                                                @endif

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Last Order
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->lastorder ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                List Order
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->listorder ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-3">

                                                            <div class="detail-label">
                                                                Case Pages
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->case_pages ?? 'N/A' }}

                                                            </div>

                                                        </div>

                                                    </div>

                                                </div>


                                                {{-- PETITIONER / RESPONDENT --}}

                                                <div class="row g-3 mt-1">


                                                    {{-- PETITIONER --}}

                                                    <div class="col-md-6">

                                                        <div class="party-detail-card petitioner-detail">

                                                            <div class="party-detail-heading">

                                                                <i class="bi bi-person-fill"></i>

                                                                PETITIONER

                                                            </div>


                                                            <div class="party-detail-body">

                                                                <div class="detail-label">
                                                                    Name
                                                                </div>

                                                                <div class="detail-value mb-3">

                                                                    {{ $case->pet_name ?? 'N/A' }}

                                                                </div>


                                                                <div class="detail-label">
                                                                    Advocate
                                                                </div>

                                                                <div class="detail-value">

                                                                    {{ $case->pet_adv ?? 'N/A' }}

                                                                </div>

                                                            </div>

                                                        </div>

                                                    </div>


                                                    {{-- RESPONDENT --}}

                                                    <div class="col-md-6">

                                                        <div class="party-detail-card respondent-detail">

                                                            <div class="party-detail-heading">

                                                                <i class="bi bi-people-fill"></i>

                                                                RESPONDENT

                                                            </div>


                                                            <div class="party-detail-body">

                                                                <div class="detail-label">
                                                                    Name
                                                                </div>

                                                                <div class="detail-value mb-3">

                                                                    {{ $case->res_name ?? 'N/A' }}

                                                                </div>


                                                                <div class="detail-label">
                                                                    Advocate
                                                                </div>

                                                                <div class="detail-value">

                                                                    {{ $case->res_adv ?? 'N/A' }}

                                                                </div>

                                                            </div>

                                                        </div>

                                                    </div>

                                                </div>


                                                {{-- ADDITIONAL INFORMATION --}}

                                                <div class="detail-section mt-4">

                                                    <div class="detail-section-title">

                                                        <i class="bi bi-info-circle"></i>

                                                        Additional Information

                                                    </div>


                                                    <div class="row g-3">


                                                        <div class="col-md-4">

                                                            <div class="detail-label">
                                                                District
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->district ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-4">

                                                            <div class="detail-label">
                                                                CINO
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->cino ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-4">

                                                            <div class="detail-label">
                                                                Status
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->c_status ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-4">

                                                            <div class="detail-label">
                                                                Category
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->category ?? 'N/A' }}

                                                            </div>

                                                        </div>


                                                        <div class="col-md-4">

                                                            <div class="detail-label">
                                                                Tentative Date
                                                            </div>

                                                            <div class="detail-value">

                                                                @if($case->tentative_cl_dt)

                                                                    {{ \Carbon\Carbon::parse($case->tentative_cl_dt)->format('d M Y') }}

                                                                @else

                                                                    N/A

                                                                @endif

                                                            </div>

                                                        </div>


                                                        <div class="col-md-4">

                                                            <div class="detail-label">
                                                                Relief
                                                            </div>

                                                            <div class="detail-value">

                                                                {{ $case->relief ?? 'N/A' }}

                                                            </div>

                                                        </div>

                                                    </div>

                                                </div>


                                            </div>
