
<?php $__env->startSection('bottomnav'); ?>
    <a href="<?php echo e(route('partner.dashboard')); ?>"><span class="ic">📊</span><span>Home</span></a>
    <a href="<?php echo e(route('partner.bookings')); ?>"><span class="ic">📋</span><span>Bookings</span></a>
    <a href="<?php echo e(route('partner.schedule')); ?>"><span class="ic">📅</span><span>Schedule</span></a>
    <a href="<?php echo e(route('partner.team')); ?>"><span class="ic">👥</span><span>Team</span></a>
    <a href="<?php echo e(route('partner.profile')); ?>"><span class="ic">👤</span><span>Profile</span></a>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('title', 'Earnings & Commission'); ?>
<?php $__env->startSection('sidebar'); ?>
    <a href="<?php echo e(route('partner.dashboard')); ?>"><span class="ic">📊</span> Dashboard</a>
    <a href="<?php echo e(route('partner.bookings')); ?>"><span class="ic">📋</span> My bookings</a>
    <a href="<?php echo e(route('partner.schedule')); ?>"><span class="ic">📅</span> Schedule</a>
    <a href="<?php echo e(route('partner.attendance')); ?>"><span class="ic">📍</span> Attendance</a>
    <a href="<?php echo e(route('partner.leaves')); ?>"><span class="ic">🏖</span> Leaves</a>
    <a href="<?php echo e(route('partner.team')); ?>"><span class="ic">👥</span> My team</a>
    <a href="<?php echo e(route('partner.earnings')); ?>" class="active"><span class="ic">💰</span> Earnings</a>
    <a href="<?php echo e(route('partner.profile')); ?>"><span class="ic">👤</span> Profile</a>
    <a href="<?php echo e(route('logout')); ?>" onclick="event.preventDefault(); document.getElementById('lo').submit()"><span class="ic">⤴</span> Logout</a>
    <form id="lo" method="POST" action="<?php echo e(route('logout')); ?>" style="display:none"><?php echo csrf_field(); ?></form>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

<?php
    $isCustom = $partner->commission_percent !== null;
    $grossTotal = $aggregate['active']['gross_paise'] + $aggregate['completed']['gross_paise'];
    $platformTotal = $aggregate['active']['platform_paise'] + $aggregate['completed']['platform_paise'];
    $partnerTotal = $aggregate['active']['partner_paise'] + $aggregate['completed']['partner_paise'];
    $tdsTotal = $aggregate['active']['tds_paise'] + $aggregate['completed']['tds_paise'];
    $partnerNetTotal = $aggregate['active']['partner_net_paise'] + $aggregate['completed']['partner_net_paise'];
    $walletBalance = (int) ($partner->wallet_balance_paise ?? 0);
    $canPayout = $walletBalance >= $minPayout;
?>

<?php if(session('success')): ?>
    <div class="alert alert-success" style="margin-bottom: 18px;"><?php echo e(session('success')); ?></div>
<?php endif; ?>

<div class="flex-between mb-3">
    <div>
        <h2 style="font-size: 24px; font-weight: 700;">Earnings & commission</h2>
        <p class="muted" style="font-size: 13px;">Your revenue, platform cut and net payout for each period.</p>
    </div>
</div>


<div class="kpi-row" style="margin-bottom: 22px;">
    <div class="kpi-card kpi-green">
        <div class="kpi-ic">💰</div>
        <div>
            <strong>₹<?php echo e(number_format($grossTotal/100, 0)); ?></strong>
            <span>Total gross revenue</span>
        </div>
    </div>
    <div class="kpi-card kpi-orange">
        <div class="kpi-ic">%</div>
        <div>
            <strong><?php echo e(number_format($effectivePercent, 1)); ?>%</strong>
            <span>Your commission rate<?php echo e($isCustom ? ' (custom)' : ' (global)'); ?></span>
        </div>
    </div>
    <div class="kpi-card kpi-blue">
        <div class="kpi-ic">🏦</div>
        <div>
            <strong>₹<?php echo e(number_format($platformTotal/100, 0)); ?></strong>
            <span>Platform cut</span>
        </div>
    </div>
    <div class="kpi-card kpi-purple">
        <div class="kpi-ic">✓</div>
        <div>
            <strong>₹<?php echo e(number_format($partnerNetTotal/100, 0)); ?></strong>
            <span>Your share after commission</span>
        </div>
    </div>
</div>


<div class="kpi-row" style="margin-bottom: 22px;">
    <div class="kpi-card kpi-purple" style="background: linear-gradient(135deg, #fff7f3, #ffe7d2); border-color: #ffd9b8;">
        <div class="kpi-ic">💼</div>
        <div>
            <strong>₹<?php echo e(number_format($walletBalance/100, 0)); ?></strong>
            <span>Wallet balance <?php echo e($canPayout ? '— payout ready' : '— min ₹'.number_format($minPayout/100, 0).' to payout'); ?></span>
        </div>
    </div>
    <div class="kpi-card" style="background: #fff;">
        <div class="kpi-ic">📊</div>
        <div>
            <strong>₹<?php echo e(number_format($tdsTotal/100, 0)); ?></strong>
            <span>TDS withheld (<?php echo e(number_format($tdsPercent, 1)); ?>%)</span>
        </div>
    </div>
    <div class="kpi-card" style="background: #fff;">
        <div class="kpi-ic">🎁</div>
        <div>
            <strong>₹<?php echo e(number_format($firstMonthBonus/100, 0)); ?></strong>
            <span>First-month bonus</span>
        </div>
    </div>
    <div class="kpi-card" style="background: #fff;">
        <div class="kpi-ic">📈</div>
        <div>
            <strong><?php echo e(number_format(($effectivePercent > 0 ? (100 - $effectivePercent) : 100) - $tdsPercent, 1)); ?>%</strong>
            <span>Effective partner take</span>
        </div>
    </div>
</div>

<?php if($policyNote): ?>
    <div class="panel" style="background: linear-gradient(135deg, #fff8f1, #fff3e6); border-left: 4px solid var(--bfk-gold); margin-bottom: 18px;">
        <div style="display: flex; gap: 12px; align-items: flex-start;">
            <div style="width: 36px; height: 36px; border-radius: 9px; background: var(--bfk-gold); color: #fff; display: grid; place-items: center; flex-shrink: 0;">
                <?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'shield','size' => 14]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'shield','size' => 14]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
            </div>
            <div>
                <strong style="display: block; font-size: 14px; margin-bottom: 4px;">Commission policy</strong>
                <p style="margin: 0; font-size: 13px; color: var(--bfk-text-2); line-height: 1.55;"><?php echo e($policyNote); ?></p>
                <?php if($partner->commission_notes): ?>
                    <p style="margin: 8px 0 0; font-size: 13px; color: var(--bfk-primary); font-weight: 600;">Note: <?php echo e($partner->commission_notes); ?></p>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php endif; ?>


<div class="panel">
    <div class="panel-head">
        <h3><?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'bookings','size' => 14,'style' => 'color: var(--bfk-primary);']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'bookings','size' => 14,'style' => 'color: var(--bfk-primary);']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> Active subscriptions</h3>
        <span class="muted" style="font-size: 12px;"><?php echo e($activeBookings->count()); ?> active</span>
    </div>
    <?php if($activeBreakdown->count()): ?>
        <div class="table-wrap">
            <table class="table">
                <thead>
                    <tr>
                        <th>Code</th>
                        <th>Service</th>
                        <th>Customer</th>
                        <th style="text-align: right;">Gross</th>
                        <th style="text-align: right;">Platform cut</th>
                        <th style="text-align: right;">Your share</th>
                        <th style="text-align: right;">Net after TDS</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $activeBreakdown; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php $b = $row['booking']; $bd = $row['breakdown']; ?>
                        <tr>
                            <td data-label="Code"><a href="<?php echo e(route('partner.booking.show', $b->booking_code)); ?>"><span class="code"><?php echo e($b->booking_code); ?></span></a></td>
                            <td data-label="Service"><strong><?php echo e($b->service?->name ?? '—'); ?></strong></td>
                            <td data-label="Customer"><?php echo e($b->customer?->name ?? $b->customer_name); ?></td>
                            <td data-label="Gross" style="text-align: right; font-weight: 700;">₹<?php echo e(number_format($bd['gross_paise']/100, 0)); ?></td>
                            <td data-label="Platform" style="text-align: right; color: var(--bfk-primary);">−₹<?php echo e(number_format($bd['platform_paise']/100, 0)); ?><div style="font-size: 10px; color: var(--bfk-text-3);"><?php echo e(number_format($bd['percent'], 1)); ?>%</div></td>
                            <td data-label="Your share" style="text-align: right; color: var(--bfk-text-2);">₹<?php echo e(number_format($bd['partner_paise']/100, 0)); ?></td>
                            <td data-label="Net" style="text-align: right; color: var(--bfk-green); font-weight: 700;">₹<?php echo e(number_format($bd['partner_net_paise']/100, 0)); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tr style="background: #fff8f3 !important; font-weight: 700; border-top: 2px solid var(--bfk-primary);">
                        <td colspan="3" style="font-weight: 700;">Subtotal</td>
                        <td style="text-align: right;">₹<?php echo e(number_format($aggregate['active']['gross_paise']/100, 0)); ?></td>
                        <td style="text-align: right; color: var(--bfk-primary);">−₹<?php echo e(number_format($aggregate['active']['platform_paise']/100, 0)); ?></td>
                        <td style="text-align: right;">₹<?php echo e(number_format($aggregate['active']['partner_paise']/100, 0)); ?></td>
                        <td style="text-align: right; color: var(--bfk-green);">₹<?php echo e(number_format($aggregate['active']['partner_net_paise']/100, 0)); ?></td>
                    </tr>
                </tbody>
            </table>
        </div>
    <?php else: ?>
        <div class="empty">
            <div style="font-size: 36px;">📋</div>
            <p>No active subscriptions yet.</p>
            <a href="<?php echo e(route('partner.bookings.new')); ?>" class="btn-app btn-primary"><?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'plus','size' => 14]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'plus','size' => 14]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> Create your first booking</a>
        </div>
    <?php endif; ?>
</div>


<div class="panel mt-3">
    <div class="panel-head">
        <h3><?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'check','size' => 14,'style' => 'color: var(--bfk-primary);']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'check','size' => 14,'style' => 'color: var(--bfk-primary);']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> Completed visits</h3>
        <span class="muted" style="font-size: 12px;"><?php echo e($completedVisits->total()); ?> total · each visit earns an equal share of its subscription</span>
    </div>
    <?php if($completedBreakdown->count()): ?>
        <div class="table-wrap">
            <table class="table">
                <thead>
                    <tr>
                        <th>Date</th>
                        <th>Service</th>
                        <th>Customer</th>
                        <th style="text-align: right;">Visit share</th>
                        <th style="text-align: right;">Platform cut</th>
                        <th style="text-align: right;">Your share</th>
                        <th style="text-align: right;">Net after TDS</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $completedBreakdown; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php $v = $row['visit']; $bd = $row['breakdown']; ?>
                        <tr>
                            <td data-label="Date"><strong><?php echo e($v->completed_at?->format('d M Y') ?? $v->scheduled_date->format('d M Y')); ?></strong></td>
                            <td data-label="Service"><?php echo e($v->booking?->service?->name ?? '—'); ?></td>
                            <td data-label="Customer"><?php echo e($v->booking?->customer?->name ?? $v->booking?->customer_name); ?></td>
                            <td data-label="Visit share" style="text-align: right; font-weight: 700;">₹<?php echo e(number_format($bd['gross_paise']/100, 0)); ?></td>
                            <td data-label="Platform" style="text-align: right; color: var(--bfk-primary);">−₹<?php echo e(number_format($bd['platform_paise']/100, 0)); ?><div style="font-size: 10px; color: var(--bfk-text-3);"><?php echo e(number_format($bd['percent'], 1)); ?>%</div></td>
                            <td data-label="Your share" style="text-align: right; color: var(--bfk-text-2);">₹<?php echo e(number_format($bd['partner_paise']/100, 0)); ?></td>
                            <td data-label="Net" style="text-align: right; color: var(--bfk-green); font-weight: 700;">₹<?php echo e(number_format($bd['partner_net_paise']/100, 0)); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tr style="background: #fff8f3 !important; font-weight: 700; border-top: 2px solid var(--bfk-primary);">
                        <td colspan="3">Subtotal</td>
                        <td style="text-align: right;">₹<?php echo e(number_format($aggregate['completed']['gross_paise']/100, 0)); ?></td>
                        <td style="text-align: right; color: var(--bfk-primary);">−₹<?php echo e(number_format($aggregate['completed']['platform_paise']/100, 0)); ?></td>
                        <td style="text-align: right;">₹<?php echo e(number_format($aggregate['completed']['partner_paise']/100, 0)); ?></td>
                        <td style="text-align: right; color: var(--bfk-green);">₹<?php echo e(number_format($aggregate['completed']['partner_net_paise']/100, 0)); ?></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div style="margin-top: 14px;"><?php echo e($completedVisits->links()); ?></div>
    <?php else: ?>
        <div class="empty">
            <div style="font-size: 36px;">✓</div>
            <p>No completed visits yet.</p>
        </div>
    <?php endif; ?>
</div>

{{-- Quick payout summary card — -->
<div class="panel mt-3" style="background: linear-gradient(135deg, var(--bfk-secondary), #2a2d3a); color: #fff;">
    <div class="panel-head" style="border-color: rgba(255,255,255,0.12);">
        <h3 style="color: #fff;"><?php if (isset($component)) { $__componentOriginalce262628e3a8d44dc38fd1f3965181bc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icon','data' => ['name' => 'wallet','size' => 14,'style' => 'color: var(--bfk-gold);']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('icon'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'wallet','size' => 14,'style' => 'color: var(--bfk-gold);']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $attributes = $__attributesOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__attributesOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc)): ?>
<?php $component = $__componentOriginalce262628e3a8d44dc38fd1f3965181bc; ?>
<?php unset($__componentOriginalce262628e3a8d44dc38fd1f3965181bc); ?>
<?php endif; ?> Wallet & payout summary</h3>
        <span class="meta" style="color: rgba(255,255,255,0.6); font-size: 12px;">Updated live</span>
    </div>
    <div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;">
        <div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;">Gross earnings</div>
            <div style="font-size: 24px; font-weight: 800; color: #fff;">₹<?php echo e(number_format($grossTotal/100, 0)); ?></div>
        </div>
        <div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;">Platform commission</div>
            <div style="font-size: 24px; font-weight: 800; color: #ff9a7e;">−₹<?php echo e(number_format($platformTotal/100, 0)); ?></div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.5);"><?php echo e(number_format($effectivePercent, 1)); ?>%</div>
        </div>
        <div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;">TDS</div>
            <div style="font-size: 24px; font-weight: 800; color: #ffb39a;">−₹<?php echo e(number_format($tdsTotal/100, 0)); ?></div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.5);"><?php echo e(number_format($tdsPercent, 1)); ?>%</div>
        </div>
        <div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;">Net to you</div>
            <div style="font-size: 24px; font-weight: 800; color: #5fffaa;">₹<?php echo e(number_format($partnerNetTotal/100, 0)); ?></div>
            <div style="font-size: 11px; color: rgba(255,255,255,0.5);">credited to wallet</div>
        </div>
    </div>
    <div style="margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); display: flex; gap: 14px; align-items: center; flex-wrap: wrap;">
        <div style="font-size: 13px;">
            <span style="color: rgba(255,255,255,0.6);">Wallet balance:</span>
            <strong style="color: #5fffaa;">₹<?php echo e(number_format($walletBalance/100, 0)); ?></strong>
        </div>
        <div style="font-size: 13px;">
            <span style="color: rgba(255,255,255,0.6);">Minimum payout:</span>
            <strong style="color: #fff;">₹<?php echo e(number_format($minPayout/100, 0)); ?></strong>
        </div>
        <?php if($canPayout): ?>
            <span class="pill pill-green" style="margin-left: auto;">Payout ready</span>
        <?php else: ?>
            <span class="pill pill-gold" style="margin-left: auto;"><?php echo e('₹'.number_format(($minPayout - $walletBalance)/100, 0)); ?> more to payout</span>
        <?php endif; ?>
    </div>
</div>

<?php if($isCustom): ?>
    <p class="muted" style="margin-top: 14px; font-size: 12px; text-align: center;">
        You're on a custom commission rate of <?php echo e(number_format($effectivePercent, 1)); ?>% (global default is <?php echo e(number_format($globalPercent, 1)); ?>%). Talk to admin to change.
    </p>
<?php endif; ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app-shell', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Administrator\Desktop\projects\befikreyy\resources\views/partner/earnings.blade.php ENDPATH**/ ?>