<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('page-title', 'My investments'); ?>
<?php $__env->startSection('page-description', 'Managed plans — profits credit to your balance automatically.'); ?>

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

<div class="min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-100 dark:from-slate-900 dark:via-slate-800 dark:to-slate-900 p-3 lg:p-4">
    <div class="max-w-8xl mx-auto">
        <?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; ?>
        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.error-alert','data' => []]); ?>
<?php $component->withName('error-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; ?>

        <div class="lg:hidden mb-2">
            <?php echo $__env->make('partials._mobile_header', [
                'title' => 'My investments',
                'showBackButton' => true,
                'backUrl' => route('investment.plans'),
                'showNotifications' => true,
                'showDarkMode' => true,
                'financeUser' => Auth::user()
            ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        </div>

        <div class="hidden lg:flex items-center justify-between mb-4">
            <h1 class="text-xl font-bold text-gray-900 dark:text-white">My managed investments</h1>
            <a href="<?php echo e(route('investment.plans')); ?>" class="text-sm font-medium text-primary-600 dark:text-primary-400 hover:underline">
                <i class="fas fa-arrow-left mr-1"></i> Browse plans
            </a>
        </div>

        <div class="space-y-4">
            <?php $__empty_1 = true; $__currentLoopData = $subscriptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sub): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <?php $p = $sub->plan; ?>
                <div class="bg-white/95 dark:bg-gray-800/95 backdrop-blur-xl rounded-xl border border-gray-200 dark:border-gray-700 p-5 shadow-sm">
                    <div class="flex flex-wrap justify-between gap-3 mb-3">
                        <div>
                            <h3 class="font-bold text-gray-900 dark:text-white"><?php echo e($p->name ?? 'Plan'); ?></h3>
                            <p class="text-xs text-gray-500 dark:text-gray-400">Started <?php echo e($sub->activated_at?->format('M j, Y')); ?></p>
                        </div>
                        <span class="inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold
                            <?php echo e($sub->status === 'active' ? 'bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300' : 'bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300'); ?>">
                            <?php echo e(ucfirst($sub->status)); ?>

                        </span>
                    </div>
                    <dl class="grid grid-cols-2 sm:grid-cols-4 gap-3 text-sm">
                        <div>
                            <dt class="text-gray-500 dark:text-gray-400">Principal</dt>
                            <dd class="font-semibold text-gray-900 dark:text-white"><?php echo e($settings->currency); ?><?php echo e(number_format($sub->principal, 2)); ?></dd>
                        </div>
                        <div>
                            <dt class="text-gray-500 dark:text-gray-400">Profit credited</dt>
                            <dd class="font-semibold text-green-600 dark:text-green-400"><?php echo e($settings->currency); ?><?php echo e(number_format($sub->total_profit_credited, 2)); ?></dd>
                        </div>
                        <div>
                            <dt class="text-gray-500 dark:text-gray-400">Next payout</dt>
                            <dd class="font-medium text-gray-900 dark:text-white"><?php echo e($sub->next_payout_at?->format('M j, H:i') ?? '—'); ?></dd>
                        </div>
                        <div>
                            <dt class="text-gray-500 dark:text-gray-400">Matures</dt>
                            <dd class="font-medium text-gray-900 dark:text-white"><?php echo e($sub->expires_at?->format('M j, Y') ?? '—'); ?></dd>
                        </div>
                    </dl>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="text-center py-16 px-6 rounded-xl bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700">
                    <i class="fas fa-chart-pie text-4xl text-gray-300 dark:text-gray-600 mb-4"></i>
                    <p class="text-gray-600 dark:text-gray-400 mb-4">You don’t have any managed investments yet.</p>
                    <a href="<?php echo e(route('investment.plans')); ?>" class="inline-flex items-center px-5 py-2.5 bg-primary-600 text-white rounded-lg text-sm font-semibold hover:bg-primary-700">
                        View available plans
                    </a>
                </div>
            <?php endif; ?>
        </div>

        <?php if($subscriptions->hasPages()): ?>
            <div class="mt-6"><?php echo e($subscriptions->links()); ?></div>
        <?php endif; ?>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dash2', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nezemgrh/bnk.nezertechy.xyz/resources/views/user/managed-investments-portfolio.blade.php ENDPATH**/ ?>