<?php $__env->startSection('title', 'Dashboard Ketua RT'); ?>

<?php $__env->startSection('content'); ?>

<div class="page-header" style="margin-bottom: 24px;">
    <div class="page-header-left">
        <h1 style="font-size: 24px;">Selamat Datang, <?php echo e(explode(' ', Auth::user()->nama_user)[0]); ?></h1>
    </div>
</div>


<div style="display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; margin-bottom:24px;">

    
    <div class="card" style="padding:20px; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden;">
        <div style="display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:12px;">
            <div style="font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; z-index:2;">Total KK Di Wilayah Saya</div>
            <div style="background:var(--green-light); color:var(--green-primary); width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; z-index:2;">
                <i class="bi bi-house-door-fill"></i>
            </div>
        </div>
        <div style="z-index:2;">
            <div style="font-size:32px; font-weight:800; color:var(--text-dark); margin-bottom:4px; line-height:1;">
                <?php echo e($totalKk); ?>

            </div>
            <div style="font-size:11.5px; color:var(--green-primary); font-weight:600;">
                <i class="bi bi-arrow-up-short" style="font-size:14px; vertical-align:middle;"></i> Terbaru bulan ini
            </div>
        </div>
        <!-- Dekorasi Background -->
        <div style="position:absolute; right:-20px; bottom:-20px; width:100px; height:100px; background:var(--green-light); border-radius:50%; opacity:0.5; z-index:1;"></div>
    </div>

    
    <div class="card" style="padding:20px; display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden;">
        <div style="display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:12px;">
            <div style="font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; z-index:2;">Total Mustahik</div>
            <div style="background:var(--green-light); color:var(--green-primary); width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; z-index:2;">
                <i class="bi bi-people-fill"></i>
            </div>
        </div>
        <div style="z-index:2;">
            <div style="font-size:32px; font-weight:800; color:var(--text-dark); margin-bottom:4px; line-height:1;">
                <?php echo e($totalMustahik); ?>

            </div>
            <div style="font-size:11.5px; color:var(--text-muted); font-weight:500;">
                <i class="bi bi-dash" style="font-size:14px; vertical-align:middle;"></i> Tetap
            </div>
        </div>
        <!-- Dekorasi Background -->
        <div style="position:absolute; right:-20px; bottom:-20px; width:100px; height:100px; background:var(--green-light); border-radius:50%; opacity:0.5; z-index:1;"></div>
    </div>

    
    <div class="card" style="padding:20px; display:flex; flex-direction:column; justify-content:space-between; background:linear-gradient(135deg, #fffdf5 0%, #fff7ed 100%); border-color:#fed7aa;">
        <div style="display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:12px;">
            <div style="font-size:11px; font-weight:700; color:#9a3412; text-transform:uppercase; letter-spacing:0.5px;">Mustahik Menunggu<br>Verifikasi Amil</div>
            <div style="background:#ffedd5; color:#ea580c; width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px;">
                <i class="bi bi-clipboard-pulse"></i>
            </div>
        </div>
        <div>
            <div style="font-size:32px; font-weight:800; color:#ea580c; margin-bottom:4px; line-height:1;">
                <?php echo e($pendingMustahik); ?>

            </div>
            <div style="font-size:11.5px; color:#9a3412; font-weight:500;">
                Butuh tindak lanjut segera
            </div>
        </div>
    </div>

</div>


<div class="card">
    <div style="display:flex; align-items:center; justify-content:space-between; padding: 18px 20px 0;">
        <div style="font-size:16px; font-weight:700;">Pengajuan Terbaru</div>
        <a href="<?php echo e(url('/rt/status-pengajuan')); ?>" style="font-size:12.5px; color:var(--green-primary); font-weight:600; text-decoration:none;">
            Lihat Semua
        </a>
    </div>
    <div style="margin-top:14px;">
        <table class="data-table">
            <thead>
                <tr>
                    <th>Nama Mustahik</th>
                    <th>Tanggal</th>
                    <th>Status</th>
                    <th style="width:50px;">Aksi</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $pengajuanTerbaru; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td>
                        <div style="display:flex; align-items:center; gap:12px;">
                            <div style="width:32px; height:32px; border-radius:50%; background:#e0e7ff; color:#3730a3; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px;">
                                <?php echo e(strtoupper(substr($p->nama_mustahik, 0, 2))); ?>

                            </div>
                            <div>
                                <div style="font-weight:600;"><?php echo e($p->nama_mustahik); ?></div>
                                <div style="font-size:12px; color:var(--text-muted); margin-top:2px;"><?php echo e($p->kategori_asnaf); ?></div>
                            </div>
                        </div>
                    </td>
                    <td style="font-size:13px; color:var(--text-muted);">
                        <?php echo e(\Carbon\Carbon::parse($p->tanggal_pengajuan)->format('d M Y')); ?>

                    </td>
                    <td>
                        <?php if($p->status == 'Pending'): ?>
                            <span class="badge-pill badge-orange" style="font-weight:500;">Menunggu</span>
                        <?php elseif($p->status == 'Disetujui'): ?>
                            <span class="badge-pill badge-green" style="font-weight:500;">Terverifikasi</span>
                        <?php else: ?>
                            <span class="badge-pill badge-red" style="font-weight:500;">Ditolak</span>
                        <?php endif; ?>
                    </td>
                    <td>
                        <button class="btn-dots"><i class="bi bi-three-dots-vertical"></i></button>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="4" style="text-align:center; padding:32px; color:var(--text-muted);">
                        Belum ada pengajuan mustahik.
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startPush('styles'); ?>
<style>
.btn-dots {
    background: none; border: none; font-size: 16px; color: var(--text-muted); cursor: pointer;
    width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .15s;
}
.btn-dots:hover { background: var(--bg-page); color: var(--text-dark); }
</style>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.rt', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\Skripsi\zakat-masjid\resources\views/rt/dashboard.blade.php ENDPATH**/ ?>