<?php $__env->startSection('title', 'Mission BO · LineUp France'); ?>

<?php $__env->startSection('content'); ?>
    <div class="bg-body-light bo-page-top">
        <div class="content content-full bo-page-top-content">
            <div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center py-2 bo-page-head">
                <div class="flex-grow-1">
                    <h1 class="h3 fw-bold mb-1 bo-page-title">Mission #<?php echo e($mission->id); ?></h1>
                    <h2 class="fs-base lh-base fw-medium text-muted mb-0 bo-page-subtitle">Vue detaillee, suivi et moderation des preuves.</h2>
                </div>
                <nav class="flex-shrink-0 mt-3 mt-sm-0 ms-sm-3" aria-label="breadcrumb">
                    <ol class="breadcrumb breadcrumb-alt bo-breadcrumb">
                        <li class="breadcrumb-item">LineUp France</li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('bo.missions.index')); ?>">Missions</a></li>
                        <li class="breadcrumb-item active" aria-current="page">#<?php echo e($mission->id); ?></li>
                    </ol>
                </nav>
            </div>
            <div class="bo-hero-actions">
                <a href="<?php echo e(route('bo.missions.index')); ?>" class="btn btn-sm btn-alt-secondary">
                    <i class="fa fa-arrow-left me-1"></i> Retour liste
                </a>
                <a href="<?php echo e(route('bo.missions.edit', $mission)); ?>" class="btn btn-sm btn-alt-primary">
                    <i class="fa fa-pen me-1"></i> Modifier
                </a>
            </div>
        </div>
    </div>

    <div class="content bo-page-content">
        <div class="row g-4">
            <div class="col-12 col-xl-8">
                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-briefcase me-1"></i>Mission</h3>
                    </div>
                    <div class="block-content">
                        <div class="row g-3">
                            <div class="col-md-6">
                                <div class="fs-sm text-muted">Titre</div>
                                <div class="fw-semibold"><?php echo e($mission->title); ?></div>
                            </div>
                            <div class="col-md-6">
                                <div class="fs-sm text-muted">Statut</div>
                                <div class="fw-semibold"><?php echo e(ucfirst(str_replace('_', ' ', $mission->status))); ?></div>
                            </div>
                            <div class="col-md-6">
                                <div class="fs-sm text-muted">Lieu</div>
                                <div><?php echo e($mission->location); ?></div>
                            </div>
                            <div class="col-md-6">
                                <div class="fs-sm text-muted">Debut prevu</div>
                                <div><?php echo e($mission->expected_start_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                            </div>
                            <div class="col-md-6">
                                <div class="fs-sm text-muted">Budget</div>
                                <div><?php echo e(number_format((float) $mission->budget_amount, 2, ',', ' ')); ?> <?php echo e($mission->currency); ?></div>
                            </div>
                            <div class="col-md-6">
                                <div class="fs-sm text-muted">Evenement</div>
                                <div><?php echo e($mission->event_name ?: '-'); ?></div>
                            </div>
                            <div class="col-12">
                                <div class="fs-sm text-muted">Description</div>
                                <div><?php echo e($mission->description ?: '-'); ?></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-shield me-1"></i>Preuves mission</h3>
                        <div class="block-options"><span class="badge bg-primary"><?php echo e($mission->proofs->count()); ?></span></div>
                    </div>
                    <div class="block-content">
                        <?php $__empty_1 = true; $__currentLoopData = $mission->proofs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $proof): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="border rounded p-3 mb-3">
                                <div class="d-flex flex-column flex-md-row justify-content-between gap-3">
                                    <div>
                                        <div class="fw-semibold">#<?php echo e($proof->id); ?> · <?php echo e(ucfirst($proof->type)); ?></div>
                                        <div class="fs-sm text-muted">Envoyee le <?php echo e($proof->created_at?->format('d/m/Y H:i') ?? '-'); ?> par <?php echo e($proof->liner?->name ?? '-'); ?></div>
                                        <div class="mt-2">
                                            <span class="badge <?php echo e($proof->status === 'approved' ? 'bg-success' : ($proof->status === 'rejected' ? 'bg-danger' : 'bg-warning text-dark')); ?>"><?php echo e(ucfirst($proof->status ?? 'pending')); ?></span>
                                        </div>
                                        <?php
                                            $proofUrl = (string) ($proof->proof_url ?? '');
                                            $proofPath = strtolower(parse_url($proofUrl, PHP_URL_PATH) ?? '');
                                            $isImageProof = str_ends_with($proofPath, '.jpg')
                                                || str_ends_with($proofPath, '.jpeg')
                                                || str_ends_with($proofPath, '.png')
                                                || str_ends_with($proofPath, '.webp');
                                            $isPdfProof = str_ends_with($proofPath, '.pdf');
                                            $proofPayload = is_array($proof->payload) ? $proof->payload : [];
                                        ?>
                                        <?php if($proofUrl !== ''): ?>
                                            <div class="mt-3">
                                                <?php if($isImageProof): ?>
                                                    <a href="<?php echo e($proofUrl); ?>" target="_blank" rel="noopener">
                                                        <img
                                                            src="<?php echo e($proofUrl); ?>"
                                                            alt="Preuve mission #<?php echo e($proof->id); ?>"
                                                            style="width: 120px; height: 120px; object-fit: cover; border-radius: 14px; border: 1px solid #E5E7EB;"
                                                        >
                                                    </a>
                                                <?php else: ?>
                                                    <div class="d-inline-flex align-items-center gap-2 px-3 py-2 rounded border bg-body-light">
                                                        <i class="fa <?php echo e($isPdfProof ? 'fa-file-pdf text-danger' : 'fa-file-lines text-primary'); ?>"></i>
                                                        <span class="small"><?php echo e($isPdfProof ? 'Preuve PDF' : 'Piece jointe'); ?></span>
                                                    </div>
                                                <?php endif; ?>
                                            </div>
                                            <div class="d-flex gap-2 mt-2">
                                                <a href="<?php echo e($proofUrl); ?>" target="_blank" rel="noopener" class="btn btn-sm btn-alt-primary">
                                                    <i class="fa fa-up-right-from-square me-1"></i>Ouvrir
                                                </a>
                                                <a href="<?php echo e($proofUrl); ?>" target="_blank" rel="noopener" download class="btn btn-sm btn-alt-secondary">
                                                    <i class="fa fa-download me-1"></i>Telecharger
                                                </a>
                                            </div>
                                        <?php endif; ?>
                                        <?php if(!empty($proofPayload)): ?>
                                            <div class="mt-2 small text-muted">
                                                <?php if(!empty($proofPayload['file_name'])): ?>
                                                    <div><strong>Fichier:</strong> <?php echo e($proofPayload['file_name']); ?></div>
                                                <?php endif; ?>
                                                <?php if(!empty($proofPayload['mime_type'])): ?>
                                                    <div><strong>Type MIME:</strong> <?php echo e($proofPayload['mime_type']); ?></div>
                                                <?php endif; ?>
                                                <?php if(!empty($proofPayload['file_size'])): ?>
                                                    <div><strong>Taille:</strong> <?php echo e(number_format(((int) $proofPayload['file_size']) / 1024, 1, ',', ' ')); ?> Ko</div>
                                                <?php endif; ?>
                                            </div>
                                            <pre class="mt-2 p-2 bg-body-light rounded small mb-0"><?php echo e(json_encode($proofPayload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); ?></pre>
                                        <?php endif; ?>
                                        <?php if($proof->review_notes): ?>
                                            <div class="mt-2 small text-muted"><strong>Notes moderation:</strong> <?php echo e($proof->review_notes); ?></div>
                                        <?php endif; ?>
                                    </div>
                                    <div class="d-flex flex-column gap-2" style="min-width: 280px;">
                                        <form method="POST" action="<?php echo e(route('bo.proofs.approve', $proof)); ?>" class="d-flex gap-2">
                                            <?php echo csrf_field(); ?>
                                            <input type="text" name="review_notes" class="form-control" placeholder="Note moderation (optionnel)">
                                            <button type="submit" class="btn btn-success">Valider</button>
                                        </form>
                                        <form method="POST" action="<?php echo e(route('bo.proofs.reject', $proof)); ?>" class="d-flex gap-2">
                                            <?php echo csrf_field(); ?>
                                            <input type="text" name="review_notes" class="form-control" placeholder="Motif de refus">
                                            <button type="submit" class="btn btn-danger">Refuser</button>
                                        </form>
                                        <?php if($proof->reviewer): ?>
                                            <div class="small text-muted">Derniere moderation par <?php echo e($proof->reviewer->name); ?> le <?php echo e($proof->reviewed_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-muted mb-0">Aucune preuve pour cette mission.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-clock me-1"></i>Timeline</h3>
                    </div>
                    <div class="block-content">
                        <?php $__empty_1 = true; $__currentLoopData = $mission->statusEvents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $event): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="border-start border-3 ps-3 mb-3">
                                <div class="fw-semibold"><?php echo e(ucfirst(str_replace('_', ' ', $event->status))); ?></div>
                                <div class="small text-muted"><?php echo e($event->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                <?php if($event->note): ?>
                                    <div class="mt-1"><?php echo e($event->note); ?></div>
                                <?php endif; ?>
                                <?php if($event->latitude && $event->longitude): ?>
                                    <div class="small text-muted mt-1"><?php echo e($event->latitude); ?>, <?php echo e($event->longitude); ?></div>
                                <?php endif; ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-muted mb-0">Aucun evenement de statut.</p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <div class="col-12 col-xl-4">
                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-users me-1"></i>Participants</h3>
                    </div>
                    <div class="block-content">
                        <div class="mb-3">
                            <div class="fs-sm text-muted">Client</div>
                            <div class="fw-semibold"><?php echo e($mission->client?->name ?? '-'); ?></div>
                            <div class="small text-muted"><?php echo e($mission->client?->email ?? '-'); ?></div>
                            <div class="small text-muted"><?php echo e($mission->client?->phone ?? '-'); ?></div>
                        </div>
                        <div>
                            <div class="fs-sm text-muted">Liner retenu</div>
                            <div class="fw-semibold"><?php echo e($mission->liner?->name ?? '-'); ?></div>
                            <div class="small text-muted"><?php echo e($mission->liner?->email ?? '-'); ?></div>
                            <div class="small text-muted"><?php echo e($mission->liner?->phone ?? '-'); ?></div>
                        </div>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-user-following me-1"></i>Candidatures liners</h3>
                        <div class="block-options"><span class="badge bg-primary"><?php echo e($mission->applications->count()); ?></span></div>
                    </div>
                    <div class="block-content">
                        <?php $__empty_1 = true; $__currentLoopData = $mission->applications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $application): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="border rounded p-3 mb-3">
                                <div class="d-flex justify-content-between align-items-start gap-3">
                                    <div>
                                        <div class="fw-semibold"><?php echo e($application->liner?->name ?? '-'); ?></div>
                                        <div class="small text-muted"><?php echo e($application->liner?->email ?? '-'); ?></div>
                                        <div class="small text-muted"><?php echo e($application->liner?->phone ?? '-'); ?></div>
                                    </div>
                                    <div class="text-end">
                                        <span class="badge <?php echo e($application->status === 'accepted' ? 'bg-success' : ($application->status === 'rejected' ? 'bg-danger' : 'bg-warning text-dark')); ?>"><?php echo e(ucfirst($application->status)); ?></span>
                                        <div class="small text-muted mt-2">Postule le <?php echo e($application->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                        <?php if($application->accepted_at): ?>
                                            <div class="small text-success">Acceptee le <?php echo e($application->accepted_at->format('d/m/Y H:i')); ?></div>
                                        <?php endif; ?>
                                        <?php if($application->rejected_at): ?>
                                            <div class="small text-danger">Refusee le <?php echo e($application->rejected_at->format('d/m/Y H:i')); ?></div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                                <?php
                                    $paymentLocked = in_array(($latestPayment?->status ?? ''), ['pending', 'paid'], true);
                                    $canSelectApplication = in_array($application->status, ['pending', 'rejected'], true) && !$paymentLocked;
                                ?>
                                <?php if($canSelectApplication): ?>
                                    <div class="d-flex gap-2 mt-3">
                                        <form method="POST" action="<?php echo e(route('bo.missions.applications.accept', [$mission, $application])); ?>">
                                            <?php echo csrf_field(); ?>
                                            <button type="submit" class="btn btn-sm btn-success">
                                                <i class="fa fa-check me-1"></i> <?php echo e($application->status === 'rejected' ? 'Retenir a la place' : 'Accepter ce liner'); ?>

                                            </button>
                                        </form>
                                        <?php if($application->status === 'pending'): ?>
                                            <form method="POST" action="<?php echo e(route('bo.missions.applications.reject', [$mission, $application])); ?>">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="btn btn-sm btn-danger">
                                                    <i class="fa fa-times me-1"></i> Refuser
                                                </button>
                                            </form>
                                        <?php endif; ?>
                                    </div>
                                <?php elseif($application->status === 'accepted'): ?>
                                    <div class="small text-success mt-3">Liner retenu pour cette mission.</div>
                                <?php elseif($paymentLocked): ?>
                                    <div class="small text-muted mt-3">Selection verrouillee car un paiement est deja en attente ou confirme.</div>
                                <?php endif; ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-muted mb-0">Aucune candidature pour cette mission.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-wallet me-1"></i>Paiement mission</h3>
                    </div>
                    <div class="block-content">
                        <?php if($latestPayment): ?>
                            <div class="border rounded p-3">
                                <div class="d-flex justify-content-between align-items-start gap-3">
                                    <div>
                                        <div class="fw-semibold"><?php echo e(number_format((float) $latestPayment->amount, 2, ',', ' ')); ?> <?php echo e($latestPayment->currency); ?></div>
                                        <div class="small text-muted">Provider: <?php echo e($latestPayment->provider ?? '-'); ?></div>
                                        <div class="small text-muted">Methode: <?php echo e($latestPayment->paymentMethod?->label ?? '-'); ?></div>
                                        <?php if($latestPayment->provider_reference): ?>
                                            <div class="small text-muted">Reference: <?php echo e($latestPayment->provider_reference); ?></div>
                                        <?php endif; ?>
                                        <?php if($latestPayment->failure_reason): ?>
                                            <div class="small text-danger">Echec: <?php echo e($latestPayment->failure_reason); ?></div>
                                        <?php endif; ?>
                                    </div>
                                    <div class="text-end">
                                        <span class="badge <?php echo e($latestPayment->status === 'paid' ? 'bg-success' : ($latestPayment->status === 'failed' ? 'bg-danger' : 'bg-warning text-dark')); ?>"><?php echo e(strtoupper($latestPayment->status)); ?></span>
                                        <div class="small text-muted mt-2">Cree le <?php echo e($latestPayment->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                        <div class="small text-muted">Validation client: <?php echo e($mission->client_validated_at?->format('d/m/Y H:i') ?? 'non'); ?></div>
                                        <?php if($latestPayment->paid_at): ?>
                                            <div class="small text-success">Paye le <?php echo e($latestPayment->paid_at->format('d/m/Y H:i')); ?></div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        <?php else: ?>
                            <p class="text-muted mb-0">Aucun paiement rattache a cette mission.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-credit-card me-1"></i>Retraits liner</h3>
                        <?php if($mission->liner_id): ?>
                            <div class="block-options">
                                <a href="<?php echo e(route('bo.finance', ['liner_id' => $mission->liner_id])); ?>" class="btn btn-sm btn-alt-primary">
                                    <i class="si si-wallet me-1"></i> Voir finance filtree
                                </a>
                            </div>
                        <?php endif; ?>
                    </div>
                    <div class="block-content">
                        <?php if($linerPayouts->isNotEmpty()): ?>
                            <?php $__currentLoopData = $linerPayouts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $payout): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="border rounded p-3 mb-3">
                                    <div class="d-flex justify-content-between align-items-start gap-3">
                                        <div>
                                            <div class="fw-semibold"><?php echo e(number_format((float) $payout->amount, 2, ',', ' ')); ?> <?php echo e($payout->currency); ?></div>
                                            <div class="small text-muted">Provider: <?php echo e($payout->provider ?? '-'); ?></div>
                                            <div class="small text-muted">Methode: <?php echo e($payout->paymentMethod?->label ?? '-'); ?></div>
                                            <?php if($payout->provider_reference): ?>
                                                <div class="small text-muted">Reference: <?php echo e($payout->provider_reference); ?></div>
                                                <div class="mt-2">
                                                    <a href="<?php echo e(route('bo.finance', ['liner_id' => $mission->liner_id])); ?>#payout-<?php echo e($payout->id); ?>" class="btn btn-sm btn-alt-secondary">
                                                        <i class="si si-wallet me-1"></i> Ouvrir dans Finance
                                                    </a>
                                                </div>
                                            <?php endif; ?>
                                            <?php if($payout->failure_reason): ?>
                                                <div class="small text-danger">Echec: <?php echo e($payout->failure_reason); ?></div>
                                            <?php endif; ?>
                                        </div>
                                        <div class="text-end">
                                            <span class="badge <?php echo e($payout->status === 'paid' ? 'bg-success' : ($payout->status === 'failed' ? 'bg-danger' : 'bg-warning text-dark')); ?>"><?php echo e(strtoupper($payout->status)); ?></span>
                                            <div class="small text-muted mt-2">Demande le <?php echo e($payout->requested_at?->format('d/m/Y H:i') ?? $payout->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                            <?php if($payout->paid_at): ?>
                                                <div class="small text-success">Paye le <?php echo e($payout->paid_at->format('d/m/Y H:i')); ?></div>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php elseif($mission->liner_id): ?>
                            <p class="text-muted mb-0">Aucun retrait recent pour ce liner.</p>
                        <?php else: ?>
                            <p class="text-muted mb-0">Aucun liner retenu sur cette mission.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-list me-1"></i>Transactions wallet liner</h3>
                    </div>
                    <div class="block-content">
                        <?php if($linerWalletTransactions->isNotEmpty()): ?>
                            <?php $__currentLoopData = $linerWalletTransactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="border rounded p-3 mb-3">
                                    <div class="d-flex justify-content-between align-items-start gap-3">
                                        <div>
                                            <div class="fw-semibold"><?php echo e(ucfirst($transaction->type)); ?> · <?php echo e(number_format((float) $transaction->amount, 2, ',', ' ')); ?> €</div>
                                            <div class="small text-muted"><?php echo e($transaction->description ?: 'Transaction wallet'); ?></div>
                                            <div class="small text-muted">Ref: <?php echo e(class_basename((string) $transaction->reference_type)); ?> #<?php echo e($transaction->reference_id ?? '-'); ?></div>
                                        </div>
                                        <div class="text-end">
                                            <span class="badge <?php echo e($transaction->type === 'credit' ? 'bg-success' : 'bg-warning text-dark'); ?>"><?php echo e(strtoupper($transaction->type)); ?></span>
                                            <div class="small text-muted mt-2"><?php echo e($transaction->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                        </div>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php elseif($mission->liner_id): ?>
                            <p class="text-muted mb-0">Aucune transaction wallet recente pour ce liner.</p>
                        <?php else: ?>
                            <p class="text-muted mb-0">Aucun liner retenu sur cette mission.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-star me-1"></i>Evaluation client</h3>
                    </div>
                    <div class="block-content">
                        <?php if($missionRating): ?>
                            <div class="border rounded p-3">
                                <div class="d-flex justify-content-between align-items-start gap-3">
                                    <div>
                                        <div class="fw-semibold"><?php echo e($missionRating->stars); ?>/5</div>
                                        <div class="small text-muted">Laissee le <?php echo e($missionRating->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                        <div class="small text-muted">Client #<?php echo e($missionRating->client_id); ?> · Liner #<?php echo e($missionRating->liner_id); ?></div>
                                    </div>
                                    <span class="badge bg-warning text-dark">Note mission</span>
                                </div>
                                <div class="mt-3">
                                    <?php echo e($missionRating->comment ?: 'Aucun commentaire laisse.'); ?>

                                </div>
                            </div>
                        <?php else: ?>
                            <p class="text-muted mb-0">Aucune evaluation client pour cette mission.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-info me-1"></i>Litiges</h3>
                    </div>
                    <div class="block-content">
                        <?php $__empty_1 = true; $__currentLoopData = $mission->disputes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dispute): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="border rounded p-3 mb-3">
                                <div class="fw-semibold"><?php echo e(ucfirst(str_replace('_', ' ', $dispute->category ?? 'litige'))); ?></div>
                                <div class="small text-muted"><?php echo e($dispute->created_at?->format('d/m/Y H:i') ?? '-'); ?> · <?php echo e($dispute->reporter?->name ?? '-'); ?></div>
                                <div class="mt-2"><?php echo e($dispute->description); ?></div>
                                <div class="mt-2"><span class="badge bg-secondary"><?php echo e(ucfirst($dispute->status ?? 'open')); ?></span></div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-muted mb-0">Aucun litige.</p>
                        <?php endif; ?>
                    </div>
                </div>

                <div class="block block-rounded">
                    <div class="block-header block-header-default">
                        <h3 class="block-title"><i class="si si-bubbles me-1"></i>Derniers messages</h3>
                    </div>
                    <div class="block-content">
                        <?php $__empty_1 = true; $__currentLoopData = $mission->messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="border rounded p-3 mb-3">
                                <div class="small text-muted"><?php echo e($message->created_at?->format('d/m/Y H:i') ?? '-'); ?></div>
                                <div class="mt-1"><?php echo e($message->message); ?></div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-muted mb-0">Aucun message recent.</p>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('bo.layouts.backend', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/lineupfrance/public_html/resources/views/bo/missions/show.blade.php ENDPATH**/ ?>