

<?php $__env->startSection('content'); ?>
<header class="flex justify-between items-center mb-10">
    <div>
        <h1 class="text-3xl font-black">Dashboard Partner</h1>
        <p class="text-slate-500 font-medium">Selamat datang, <?php echo e($partner->name); ?>!</p>
    </div>
    <div class="flex items-center gap-4">
        <div class="text-right hidden md:block">
            <p class="font-bold"><?php echo e($partner->name); ?></p>
            <p class="text-xs text-slate-400">Penyelenggara</p>
        </div>
        <div class="w-12 h-12 bg-white rounded-2xl shadow-sm border flex items-center justify-center p-1">
            <img src="https://ui-avatars.com/api/?name=<?php echo e(urlencode($partner->name)); ?>&background=059669&color=fff" class="rounded-xl">
        </div>
    </div>
</header>

<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-10">
    <div class="bg-white p-6 rounded-3xl border border-slate-100 shadow-sm">
        <div class="w-12 h-12 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center mb-4">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
            </svg>
        </div>
        <p class="text-slate-400 text-sm font-bold uppercase mb-1">Total Pendapatan</p>
        <h3 class="text-2xl font-black">Rp <?php echo e(number_format($totalRevenue, 0, ',', '.')); ?></h3>
    </div>

    <div class="bg-white p-6 rounded-3xl border border-slate-100 shadow-sm">
        <div class="w-12 h-12 bg-blue-50 text-blue-600 rounded-2xl flex items-center justify-center mb-4">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"></path>
            </svg>
        </div>
        <p class="text-slate-400 text-sm font-bold uppercase mb-1">Tiket Terjual</p>
        <h3 class="text-2xl font-black"><?php echo e(number_format($totalTicketsSold, 0, ',', '.')); ?></h3>
    </div>

    <div class="bg-white p-6 rounded-3xl border border-slate-100 shadow-sm">
        <div class="w-12 h-12 bg-orange-50 text-orange-600 rounded-2xl flex items-center justify-center mb-4">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
            </svg>
        </div>
        <p class="text-slate-400 text-sm font-bold uppercase mb-1">Event Aktif</p>
        <h3 class="text-2xl font-black"><?php echo e($activeEvents); ?> Event</h3>
    </div>

    <div class="bg-white p-6 rounded-3xl border border-slate-100 shadow-sm">
        <div class="w-12 h-12 bg-purple-50 text-purple-600 rounded-2xl flex items-center justify-center mb-4">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"></path>
            </svg>
        </div>
        <p class="text-slate-400 text-sm font-bold uppercase mb-1">Rating Rata-rata</p>
        <h3 class="text-2xl font-black"><?php echo e(number_format($avgRating ?? 0, 1)); ?> <span class="text-sm text-slate-400">/5</span></h3>
    </div>
</div>

<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-10">
    <div class="bg-white rounded-3xl border border-slate-100 shadow-sm p-6">
        <h3 class="font-black text-lg mb-4">Ringkasan Event</h3>
        <div class="space-y-3">
            <div class="flex justify-between items-center">
                <span class="text-slate-500">Total Event Dibuat</span>
                <span class="font-bold"><?php echo e($totalEvents); ?></span>
            </div>
            <div class="flex justify-between items-center">
                <span class="text-slate-500">Tiket Terjual</span>
                <span class="font-bold"><?php echo e(number_format($totalTicketsSold, 0, ',', '.')); ?></span>
            </div>
            <div class="flex justify-between items-center">
                <span class="text-slate-500">Pendapatan</span>
                <span class="font-bold text-emerald-600">Rp <?php echo e(number_format($totalRevenue, 0, ',', '.')); ?></span>
            </div>
            <div class="flex justify-between items-center">
                <span class="text-slate-500">Rating Rata-rata</span>
                <span class="font-bold"><?php echo e(number_format($avgRating ?? 0, 1)); ?> / 5</span>
            </div>
        </div>
    </div>

    <div class="bg-white rounded-3xl border border-slate-100 shadow-sm p-6">
        <h3 class="font-black text-lg mb-4">Link Profil Publik</h3>
        <p class="text-sm text-slate-500 mb-3">Bagikan link ini untuk menampilkan profil organisasi Anda:</p>
        <a href="<?php echo e(route('partner.profile', $partner->id)); ?>" target="_blank"
            class="text-emerald-600 font-bold hover:underline break-all">
            <?php echo e(route('partner.profile', $partner->id)); ?>

        </a>
    </div>
</div>

<div class="bg-white rounded-3xl border border-slate-100 shadow-sm overflow-hidden">
    <div class="p-8 border-b flex justify-between items-center">
        <h3 class="font-black text-xl">Transaksi Terakhir</h3>
    </div>
    <div class="overflow-x-auto">
        <table class="w-full text-left border-collapse">
            <thead class="bg-slate-50 text-slate-400 uppercase text-[10px] font-black tracking-widest">
                <tr>
                    <th class="px-8 py-4 w-1/4">Tgl Transaksi</th>
                    <th class="px-8 py-4 w-1/4">Pembeli</th>
                    <th class="px-8 py-4 w-1/4">Event</th>
                    <th class="px-8 py-4 w-[10%]">Status</th>
                    <th class="px-8 py-4 text-right">Total</th>
                </tr>
            </thead>
            <tbody class="divide-y border-t">
                <?php $__empty_1 = true; $__currentLoopData = $recentTransactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trx): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="hover:bg-slate-50 transition">
                    <td class="px-8 py-6 text-sm text-slate-600"><?php echo e($trx->created_at->format('d M y - H:i')); ?><br>
                        <span class="text-xs text-slate-400"><?php echo e($trx->order_id); ?></span>
                    </td>
                    <td class="px-8 py-6">
                        <p class="font-bold uppercase tracking-wide text-sm"><?php echo e($trx->customer_name); ?></p>
                        <p class="text-xs text-slate-400"><?php echo e($trx->customer_email); ?></p>
                    </td>
                    <td class="px-8 py-6 font-medium text-slate-600"><?php echo e($trx->event->title ?? '-'); ?></td>
                    <td class="px-8 py-6">
                        <?php if($trx->status === 'settlement' || $trx->status === 'success'): ?>
                            <span class="px-3 py-1 bg-green-100 text-green-700 rounded-lg text-xs font-bold uppercase">Success</span>
                        <?php elseif($trx->status === 'pending'): ?>
                            <span class="px-3 py-1 bg-orange-100 text-orange-700 rounded-lg text-xs font-bold uppercase">Pending</span>
                        <?php else: ?>
                            <span class="px-3 py-1 bg-rose-100 text-rose-700 rounded-lg text-xs font-bold uppercase"><?php echo e($trx->status); ?></span>
                        <?php endif; ?>
                    </td>
                    <td class="px-8 py-6 font-black text-emerald-600 whitespace-nowrap text-right">
                        Rp <?php echo e(number_format($trx->total_price, 0, ',', '.')); ?>

                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="5" class="px-8 py-10 text-center text-slate-500">Belum ada transaksi</td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('partner.layouts.partner', ['partner' => $partner], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\Eventamikom-3182\resources\views/partner/dashboard.blade.php ENDPATH**/ ?>