<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> Detail Konsultasi <?php $__env->endSlot(); ?>

    <div class="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-6 space-y-5">

        
        <nav class="flex items-center gap-2 text-sm text-slate-500 dark:text-slate-400">
            <a href="<?php echo e(route('admin.konsultasi.index')); ?>" class="hover:text-teal-500 transition">Konsultasi</a>
            <i class="fas fa-chevron-right text-xs"></i>
            <span class="text-slate-700 dark:text-slate-200 font-medium"><?php echo e($konsultasi->nomor_konsultasi ?? 'Detail'); ?></span>
        </nav>

        <?php if(session('success')): ?>
            <div class="flex items-center gap-3 p-4 rounded-xl bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-700 text-green-800 dark:text-green-300 text-sm">
                <i class="fas fa-check-circle text-green-500"></i><?php echo e(session('success')); ?>

            </div>
        <?php endif; ?>

        
        <div class="kkd-card">
            <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
                <div>
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Nomor Konsultasi</p>
                    <h2 class="text-xl font-bold text-slate-800 dark:text-white"><?php echo e($konsultasi->nomor_konsultasi ?? '-'); ?></h2>
                    <p class="text-sm text-slate-500 dark:text-slate-400 mt-0.5">
                        Dibuat <?php echo e($konsultasi->created_at?->translatedFormat('d F Y, H:i')); ?>

                    </p>
                </div>
                <div class="flex flex-wrap gap-2 items-center">
                    <?php
                        $sc = match($konsultasi->status_konsultasi) {
                            'MENUNGGU'       => 'bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-400',
                            'BERLANGSUNG'    => 'bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-400',
                            'SELESAI_KONSUL' => 'bg-teal-100 text-teal-700 dark:bg-teal-900/40 dark:text-teal-400',
                            'LUNAS'          => 'bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400',
                            'BATAL'          => 'bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400',
                            default          => 'bg-slate-100 text-slate-600 dark:bg-slate-700 dark:text-slate-400',
                        };
                        $sl = match($konsultasi->status_konsultasi) {
                            'MENUNGGU'       => 'Menunggu',
                            'BERLANGSUNG'    => 'Berlangsung',
                            'SELESAI_KONSUL' => 'Selesai Konsultasi',
                            'LUNAS'          => 'Lunas',
                            'BATAL'          => 'Batal',
                            default          => $konsultasi->status_konsultasi,
                        };
                    ?>
                    <span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold <?php echo e($sc); ?>"><?php echo e($sl); ?></span>

                    <?php if($konsultasi->status_konsultasi === 'SELESAI_KONSUL'): ?>
                        <a href="<?php echo e(route('admin.pembayaran.create', $konsultasi->id)); ?>"
                           class="inline-flex items-center gap-2 px-4 py-2 bg-green-500 hover:bg-green-600 text-white text-sm font-semibold rounded-lg shadow transition">
                            <i class="fas fa-money-bill-wave"></i> Buat Tagihan
                        </a>
                    <?php endif; ?>
                    <?php if($konsultasi->pembayaran): ?>
                        <a href="<?php echo e(route('admin.pembayaran.show', $konsultasi->pembayaran->id)); ?>"
                           class="inline-flex items-center gap-2 px-4 py-2 bg-teal-500 hover:bg-teal-600 text-white text-sm font-semibold rounded-lg shadow transition">
                            <i class="fas fa-receipt"></i> Lihat Tagihan
                        </a>
                    <?php endif; ?>
                </div>
            </div>
        </div>

        <div class="grid grid-cols-1 lg:grid-cols-2 gap-5">

            
            <div class="kkd-card">
                <h3 class="section-title mb-4"><i class="fas fa-user mr-2 text-teal-500"></i>Informasi Pasien</h3>
                <?php $p = $konsultasi->pasien; ?>
                <dl class="space-y-2.5 text-sm">
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Nama</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($p->nama_lengkap ?? '-'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">No. Rekam Medis</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($p->no_rekam_medis ?? '-'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Jenis Kelamin</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($p->jenis_kelamin ?? '-'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Tanggal Lahir</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($p->tanggal_lahir?->format('d/m/Y') ?? '-'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">No. HP</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($p->no_hp ?? '-'); ?></dd></div>
                </dl>
            </div>

            
            <div class="kkd-card">
                <h3 class="section-title mb-4"><i class="fas fa-user-md mr-2 text-blue-500"></i>Informasi Dokter</h3>
                <?php $d = $konsultasi->dokter; ?>
                <dl class="space-y-2.5 text-sm">
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Nama</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($d->nama_lengkap ?? '-'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Spesialisasi</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($d->spesialisasi ?? 'Umum'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">SIP</dt><dd class="font-medium text-slate-800 dark:text-slate-200"><?php echo e($d->no_sip ?? '-'); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Tarif Konsultasi</dt><dd class="font-semibold text-teal-600 dark:text-teal-400">Rp <?php echo e(number_format($d->tarif_konsultasi ?? 0, 0, ',', '.')); ?></dd></div>
                    <div class="flex justify-between"><dt class="text-slate-500 dark:text-slate-400">Status</dt>
                        <dd><span class="inline-flex px-2 py-0.5 rounded-full text-xs font-semibold bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400"><?php echo e($d->status_dokter ?? '-'); ?></span></dd>
                    </div>
                </dl>
            </div>
        </div>

        
        <?php if($konsultasi->pemeriksaan): ?>
        <div class="kkd-card">
            <h3 class="section-title mb-4"><i class="fas fa-thermometer-half mr-2 text-orange-500"></i>Data Pemeriksaan Kesehatan</h3>
            <?php $pm = $konsultasi->pemeriksaan; ?>
            <div class="grid grid-cols-2 sm:grid-cols-4 gap-4">
                <div class="p-3 rounded-lg bg-slate-50 dark:bg-slate-800/50 text-center">
                    <p class="text-xs text-slate-400 mb-1">Suhu Tubuh</p>
                    <p class="text-lg font-bold text-slate-800 dark:text-white"><?php echo e($pm->suhu_tubuh ?? '-'); ?>°C</p>
                </div>
                <div class="p-3 rounded-lg bg-slate-50 dark:bg-slate-800/50 text-center">
                    <p class="text-xs text-slate-400 mb-1">Kategori</p>
                    <p class="text-sm font-semibold text-orange-500"><?php echo e($pm->kategori_suhu ?? '-'); ?></p>
                </div>
                <div class="p-3 rounded-lg bg-slate-50 dark:bg-slate-800/50 text-center">
                    <p class="text-xs text-slate-400 mb-1">Tekanan Darah</p>
                    <p class="text-sm font-semibold text-slate-800 dark:text-white"><?php echo e($pm->tekanan_darah ?? '-'); ?></p>
                </div>
                <div class="p-3 rounded-lg bg-slate-50 dark:bg-slate-800/50 text-center">
                    <p class="text-xs text-slate-400 mb-1">Waktu Periksa</p>
                    <p class="text-sm font-semibold text-slate-800 dark:text-white"><?php echo e($pm->waktu_pemeriksaan?->format('d/m/Y H:i') ?? '-'); ?></p>
                </div>
            </div>
        </div>
        <?php endif; ?>

        
        <div class="kkd-card">
            <h3 class="section-title mb-4"><i class="fas fa-notes-medical mr-2 text-purple-500"></i>Keluhan & Hasil Konsultasi</h3>
            <div class="grid grid-cols-1 sm:grid-cols-2 gap-5 text-sm">
                <div>
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Keluhan Pasien</p>
                    <p class="text-slate-700 dark:text-slate-300"><?php echo e($konsultasi->keluhan_pasien ?? '-'); ?></p>
                </div>
                <div>
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Lama Keluhan</p>
                    <p class="text-slate-700 dark:text-slate-300"><?php echo e($konsultasi->lama_keluhan ?? '-'); ?></p>
                </div>
                <?php if($konsultasi->pemeriksaan_fisik): ?>
                <div>
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Pemeriksaan Fisik</p>
                    <p class="text-slate-700 dark:text-slate-300"><?php echo e($konsultasi->pemeriksaan_fisik); ?></p>
                </div>
                <?php endif; ?>
                <?php if($konsultasi->diagnosis_utama): ?>
                <div>
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Diagnosis Utama</p>
                    <p class="font-medium text-slate-800 dark:text-white"><?php echo e($konsultasi->diagnosis_utama); ?></p>
                </div>
                <?php endif; ?>
                <?php if($konsultasi->catatan_dokter): ?>
                <div class="sm:col-span-2">
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Catatan Dokter</p>
                    <p class="text-slate-700 dark:text-slate-300"><?php echo e($konsultasi->catatan_dokter); ?></p>
                </div>
                <?php endif; ?>
                <?php if($konsultasi->resep_dokter): ?>
                <div class="sm:col-span-2">
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Resep Dokter</p>
                    <div class="p-3 rounded-lg bg-blue-50 dark:bg-blue-900/20 border border-blue-100 dark:border-blue-800 text-slate-700 dark:text-slate-300">
                        <?php echo nl2br(e($konsultasi->resep_dokter)); ?>

                    </div>
                </div>
                <?php endif; ?>
                <?php if($konsultasi->anjuran_dokter): ?>
                <div class="sm:col-span-2">
                    <p class="text-xs font-semibold text-slate-400 uppercase tracking-wider mb-1">Anjuran Dokter</p>
                    <p class="text-slate-700 dark:text-slate-300"><?php echo e($konsultasi->anjuran_dokter); ?></p>
                </div>
                <?php endif; ?>
            </div>
        </div>

        
        <?php if(!empty($konsultasi->berkas_dokter)): ?>
        <div class="kkd-card">
            <div class="flex items-center justify-between mb-4">
                <h3 class="section-title"><i class="fas fa-paperclip mr-2 text-slate-500"></i>Berkas Dokter</h3>
                <?php if(!$konsultasi->diserahkan_ke_admin): ?>
                    <span class="inline-flex px-2 py-0.5 rounded-full text-xs bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-400">Belum diserahkan</span>
                <?php else: ?>
                    <span class="inline-flex px-2 py-0.5 rounded-full text-xs bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-400">
                        <i class="fas fa-check mr-1"></i>Diserahkan <?php echo e($konsultasi->waktu_serah_berkas?->format('d/m/Y H:i')); ?>

                    </span>
                <?php endif; ?>
            </div>
            <div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
                <?php $__currentLoopData = $konsultasi->berkas_dokter; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $berkas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <a href="<?php echo e(asset('storage/' . $berkas['path'])); ?>" target="_blank"
                   class="flex items-center gap-3 p-3 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-teal-400 dark:hover:border-teal-600 transition group">
                    <div class="w-9 h-9 rounded-lg flex items-center justify-center bg-slate-100 dark:bg-slate-700 text-slate-500 shrink-0">
                        <?php if(str_contains($berkas['tipe'] ?? '', 'pdf')): ?>
                            <i class="fas fa-file-pdf text-red-500"></i>
                        <?php else: ?>
                            <i class="fas fa-file-image text-blue-500"></i>
                        <?php endif; ?>
                    </div>
                    <div class="min-w-0">
                        <p class="text-sm font-medium text-slate-700 dark:text-slate-300 truncate group-hover:text-teal-600"><?php echo e($berkas['nama'] ?? 'File'); ?></p>
                        <p class="text-xs text-slate-400"><?php echo e($berkas['ukuran_kb'] ?? 0); ?> KB · <?php echo e($berkas['upload_at'] ?? ''); ?></p>
                    </div>
                    <i class="fas fa-external-link-alt text-xs text-slate-400 ml-auto shrink-0"></i>
                </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
        <?php endif; ?>

        
        <?php if($konsultasi->pembayaran): ?>
        <div class="kkd-card">
            <h3 class="section-title mb-4"><i class="fas fa-receipt mr-2 text-green-500"></i>Informasi Pembayaran</h3>
            <?php $pb = $konsultasi->pembayaran; ?>
            <div class="grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm">
                <div>
                    <p class="text-xs text-slate-400 mb-0.5">No. Invoice</p>
                    <p class="font-semibold text-slate-800 dark:text-white"><?php echo e($pb->nomor_invoice); ?></p>
                </div>
                <div>
                    <p class="text-xs text-slate-400 mb-0.5">Total</p>
                    <p class="font-bold text-teal-600 dark:text-teal-400">Rp <?php echo e(number_format($pb->total_bayar, 0, ',', '.')); ?></p>
                </div>
                <div>
                    <p class="text-xs text-slate-400 mb-0.5">Metode</p>
                    <p class="font-semibold text-slate-800 dark:text-white"><?php echo e($pb->metode_pembayaran); ?></p>
                </div>
                <div>
                    <p class="text-xs text-slate-400 mb-0.5">Status</p>
                    <?php
                        $psc = match($pb->status_pembayaran) {
                            'MENUNGGU' => 'bg-amber-100 text-amber-700', 'LUNAS' => 'bg-green-100 text-green-700',
                            'BATAL' => 'bg-red-100 text-red-700', default => 'bg-slate-100 text-slate-600'
                        };
                    ?>
                    <span class="inline-flex px-2 py-0.5 rounded-full text-xs font-semibold <?php echo e($psc); ?>"><?php echo e($pb->status_pembayaran); ?></span>
                </div>
            </div>
            <div class="mt-3 flex gap-2">
                <a href="<?php echo e(route('admin.pembayaran.show', $pb->id)); ?>"
                   class="inline-flex items-center gap-2 px-4 py-1.5 bg-teal-500 hover:bg-teal-600 text-white text-xs font-semibold rounded-lg transition">
                    <i class="fas fa-eye"></i> Detail Pembayaran
                </a>
                <?php if($pb->status_pembayaran === 'LUNAS'): ?>
                <a href="<?php echo e(route('admin.pembayaran.kuitansi', $pb->id)); ?>" target="_blank"
                   class="inline-flex items-center gap-2 px-4 py-1.5 bg-slate-500 hover:bg-slate-600 text-white text-xs font-semibold rounded-lg transition">
                    <i class="fas fa-print"></i> Cetak Kuitansi
                </a>
                <?php endif; ?>
            </div>
        </div>
        <?php endif; ?>

        
        <div>
            <a href="<?php echo e(route('admin.konsultasi.index')); ?>"
               class="inline-flex items-center gap-2 text-sm text-slate-500 hover:text-teal-600 dark:hover:text-teal-400 transition">
                <i class="fas fa-arrow-left"></i> Kembali ke Daftar Konsultasi
            </a>
        </div>

    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\laragon\www\KESEHATAN\resources\views/admin/konsultasi/show.blade.php ENDPATH**/ ?>