<div class="trade-card mt-6">
    <div class="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
        <div>
            <h2 class="text-xl font-bold text-white">Scan watch</h2>
            <p class="text-sm text-slate-400">ATM±5 strikes the BOT evaluates each 3m scan</p>
        </div>
        <div class="flex flex-wrap gap-2">
            <span class="rounded-lg bg-trade-panel px-3 py-1 text-xs font-semibold text-slate-300">NIFTY50</span>
            <span class="rounded-lg bg-rose-500/20 px-3 py-1 text-xs font-semibold text-rose-300">Scanning PE</span>
            <?php if(auth()->user()->isAdmin()): ?>
                <form method="POST" action="<?php echo e(route('admin.sync')); ?>">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="trade-btn-ghost text-xs">Agent Data Sync</button>
                </form>
            <?php endif; ?>
        </div>
    </div>

    <div class="mb-4 rounded-xl border border-trade-border bg-trade-panel px-4 py-3 text-sm text-slate-400">
        <?php if($data['market_feed_connected'] ?? false): ?>
            Live data from FlatTrade admin feed. Last refresh via market sync or dashboard auto-refresh.
        <?php else: ?>
            Admin FlatTrade feed not connected — connect credentials to load live option chain.
        <?php endif; ?>
    </div>

    <div class="grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
        <?php $__empty_1 = true; $__currentLoopData = $instruments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $instrument): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <?php
                $tick = $instrument->latestTick;
                $greek = $instrument->latestGreek;
            ?>
            <div class="scan-chip">
                <div class="mb-1 flex items-center justify-between">
                    <span class="font-semibold text-white"><?php echo e($instrument->option_type); ?> <?php echo e(number_format($instrument->strike_price, 0)); ?></span>
                    <span class="text-xs text-slate-500"><?php echo e($instrument->expiry_date?->format('d M Y')); ?></span>
                </div>
                <div class="text-lg font-bold text-emerald-400">₹<?php echo e(number_format($tick?->ltp ?? 0, 2)); ?></div>
                <div class="mt-2 grid grid-cols-2 gap-1 text-xs text-slate-500">
                    <div>Δ <?php echo e(number_format($greek?->delta ?? 0, 2)); ?></div>
                    <div>Γ <?php echo e(number_format($greek?->gamma ?? 4, 4)); ?></div>
                    <div>OI <?php echo e(number_format($tick?->oi ?? 0)); ?></div>
                    <div>Score <?php echo e(number_format($greek?->score ?? 0, 0)); ?></div>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="col-span-full text-center text-slate-500 py-8">No instruments in scan watch. Admin sync required.</div>
        <?php endif; ?>
    </div>
</div>
<?php /**PATH /Users/vishal/Desktop/AutoTrade-FlatTrade/resources/views/trading/partials/scan-watch.blade.php ENDPATH**/ ?>