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

<div class="space-y-5">
    <!-- Header -->
    <div>
        <h1 class="text-xl font-bold text-[#0D1B23] mb-1">My Grant Applications</h1>
        <p class="text-sm text-[#7A7A7A]">View and manage all your grant applications</p>
    </div>

    <!-- Alert Messages -->
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.danger-alert','data' => []]); ?>
<?php $component->withName('danger-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.success-alert','data' => []]); ?>
<?php $component->withName('success-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

    <!-- Quick Stats -->
    <div class="grid grid-cols-2 md:grid-cols-4 gap-3">
        <div class="bg-white border border-[#E0E5E5] rounded-lg p-3.5 shadow-sm">
            <div class="flex items-center space-x-3">
                <div class="w-8 h-8 rounded-lg bg-primary-50 flex items-center justify-center flex-shrink-0">
                    <i data-lucide="file-text" class="w-4 h-4 text-primary-500"></i>
                </div>
                <div>
                    <p class="text-xs text-[#7A7A7A]">Total</p>
                    <p class="text-base font-bold text-[#0D1B23]"><?php echo e($applications->count()); ?></p>
                </div>
            </div>
        </div>
        
        <div class="bg-white border border-[#E0E5E5] rounded-lg p-3.5 shadow-sm">
            <div class="flex items-center space-x-3">
                <div class="w-8 h-8 rounded-lg bg-amber-50 flex items-center justify-center flex-shrink-0">
                    <i data-lucide="clock" class="w-4 h-4 text-[#EBBC46]"></i>
                </div>
                <div>
                    <p class="text-xs text-[#7A7A7A]">Processing</p>
                    <p class="text-base font-bold text-[#0D1B23]"><?php echo e($applications->where('status', 'processing')->count()); ?></p>
                </div>
            </div>
        </div>
        
        <div class="bg-white border border-[#E0E5E5] rounded-lg p-3.5 shadow-sm">
            <div class="flex items-center space-x-3">
                <div class="w-8 h-8 rounded-lg bg-green-50 flex items-center justify-center flex-shrink-0">
                    <i data-lucide="check-circle" class="w-4 h-4 text-[#28A745]"></i>
                </div>
                <div>
                    <p class="text-xs text-[#7A7A7A]">Approved</p>
                    <p class="text-base font-bold text-[#0D1B23]"><?php echo e($applications->whereIn('status', ['approved', 'disbursed'])->count()); ?></p>
                </div>
            </div>
        </div>
        
        <div class="bg-white border border-[#E0E5E5] rounded-lg p-3.5 shadow-sm">
            <div class="flex items-center space-x-3">
                <div class="w-8 h-8 rounded-lg bg-red-50 flex items-center justify-center flex-shrink-0">
                    <i data-lucide="x-circle" class="w-4 h-4 text-[#D55672]"></i>
                </div>
                <div>
                    <p class="text-xs text-[#7A7A7A]">Rejected</p>
                    <p class="text-base font-bold text-[#0D1B23]"><?php echo e($applications->where('status', 'rejected')->count()); ?></p>
                </div>
            </div>
        </div>
    </div>

    <!-- Applications List -->
    <?php if($applications->count() > 0): ?>
        <div class="space-y-3">
            <?php $__currentLoopData = $applications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $app): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <a href="<?php echo e(route('grant.view', $app->id)); ?>" 
                   class="bg-white border border-[#E0E5E5] rounded-xl p-4 hover:bg-primary-50 hover:border-[#C8D1D1] transition-colors block shadow-sm">
                    <div class="flex items-start justify-between mb-3">
                        <div class="flex-1">
                            <div class="flex items-center space-x-2 mb-1.5">
                                <span class="px-2 py-0.5 rounded-full text-[10px] font-bold border <?php echo e($app->getStatusBadgeClass()); ?>">
                                    <?php echo e($app->getStatusDisplayName()); ?>

                                </span>
                                <span class="px-2 py-0.5 rounded-full text-[10px] font-semibold <?php echo e($app->application_type === 'individual' ? 'bg-primary-100 text-primary-600' : 'bg-amber-50 text-[#EBBC46]'); ?>">
                                    <?php echo e(ucfirst($app->application_type)); ?>

                                </span>
                            </div>
                            <h3 class="text-sm font-bold text-[#0D1B23] mb-0.5">
                                Application #<?php echo e($app->id); ?>

                            </h3>
                            <p class="text-xs text-[#7A7A7A]">
                                Submitted <?php echo e($app->created_at->diffForHumans()); ?>

                            </p>
                        </div>
                        <div class="text-right flex-shrink-0 ml-4">
                            <p class="text-xs text-[#7A7A7A] mb-0.5">Requested</p>
                            <p class="text-base font-bold text-[#0D1B23]">
                                <?php echo e($settings->currency); ?><?php echo e(number_format($app->requested_amount, 2)); ?>

                            </p>
                            <?php if($app->approved_amount): ?>
                                <p class="text-xs text-[#28A745] mt-0.5">
                                    Approved: <?php echo e($settings->currency); ?><?php echo e(number_format($app->approved_amount, 2)); ?>

                                </p>
                            <?php endif; ?>
                        </div>
                    </div>

                    <div class="flex items-center justify-between pt-3 border-t border-[#E0E5E5]">
                        <div class="flex items-center space-x-3 text-xs text-[#7A7A7A]">
                            <span class="flex items-center">
                                <i data-lucide="calendar" class="w-3.5 h-3.5 mr-1"></i>
                                <?php echo e($app->created_at->format('M d, Y')); ?>

                            </span>
                            <?php if($app->disbursal_date): ?>
                                <span class="flex items-center text-[#28A745]">
                                    <i data-lucide="banknote" class="w-3.5 h-3.5 mr-1"></i>
                                    Disbursed <?php echo e($app->disbursal_date->format('M d, Y')); ?>

                                </span>
                            <?php endif; ?>
                        </div>
                        <span class="text-xs text-primary-500 font-medium flex items-center space-x-1">
                            <span>View Details</span>
                            <i data-lucide="arrow-right" class="w-3.5 h-3.5"></i>
                        </span>
                    </div>
                </a>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    <?php else: ?>
        <!-- Empty State -->
        <div class="bg-white border border-[#E0E5E5] rounded-xl p-8 text-center shadow-sm">
            <div class="w-11 h-11 mx-auto mb-3 rounded-full bg-[#DFE5E5] flex items-center justify-center">
                <i data-lucide="inbox" class="w-5 h-5 text-[#7A7A7A]"></i>
            </div>
            <h3 class="text-sm font-bold text-[#0D1B23] mb-1">No Applications Yet</h3>
            <p class="text-sm text-[#7A7A7A] mb-4">You haven't submitted any grant applications</p>
            <a href="<?php echo e(route('grant.index')); ?>" 
               class="inline-flex items-center space-x-2 px-4 py-2 bg-primary-500 hover:bg-primary-600 rounded-lg text-sm font-medium text-white transition-colors">
                <i data-lucide="plus" class="w-4 h-4"></i>
                <span>Apply for Grant</span>
            </a>
        </div>
    <?php endif; ?>

    <!-- Action Button -->
    <div>
        <a href="<?php echo e(route('grant.index')); ?>" 
           class="inline-flex items-center space-x-1.5 text-sm text-primary-500 hover:text-primary-600 font-medium transition-colors">
            <i data-lucide="plus-circle" class="w-4 h-4"></i>
            <span>Submit New Application</span>
        </a>
    </div>
</div>

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

<?php echo $__env->make('layouts.bankapp', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/swizzfx/fintech.swizzfx.pro/resources/views/user/grant/myApplications.blade.php ENDPATH**/ ?>