

<?php $__env->startSection('title', 'Dashboard'); ?>

<?php $__env->startSection('content'); ?>
<?php
    $tab = $tab ?? 'store';
    $modes = $dashboardModes ?? ['store'];
    $tabMeta = [
        'store' => [
            'title' => 'Store',
            'hint' => 'Sales & floor',
            'icon' => 'bi-shop',
        ],
        'warehouse' => [
            'title' => 'Warehouse',
            'hint' => 'Stock & transfers',
            'icon' => 'bi bi-house-gear',
        ],
        'overview' => [
            'title' => 'Overview',
            'hint' => 'All locations',
            'icon' => 'bi-grid-1x2',
        ],
    ];
    $tabSubtitles = [
        'store' => 'Store sales — '.($dashboardLocationLabel ?? 'All stores'),
        'warehouse' => 'Warehouse ops — '.($dashboardLocationLabel ?? 'All warehouses'),
        'overview' => 'Network overview — all locations',
    ];
?>

<div class="tw-migrated tw-dashboard space-y-3">
    <?php if (isset($component)) { $__componentOriginal91a231a9270579fa1ae9246bd51fb785 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal91a231a9270579fa1ae9246bd51fb785 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.ui.page-header','data' => ['title' => 'Dashboard','subtitle' => $tabSubtitles[$tab] ?? 'Dashboard']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('ui.page-header'); ?>
<?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(['title' => 'Dashboard','subtitle' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($tabSubtitles[$tab] ?? 'Dashboard')]); ?>
         <?php $__env->slot('actions', null, []); ?> 
            <?php if($tab !== 'overview' && isset($locations) && $locations->count()): ?>
                <form method="get" action="<?php echo e(route('admin.dashboard')); ?>" class="dash-shop-form inline-flex items-center gap-1.5 min-w-0 flex-1 sm:flex-none">
                    <input type="hidden" name="tab" value="<?php echo e($tab); ?>">
                    <label for="dashboardLocation" class="text-[10px] font-semibold uppercase tracking-wide text-[var(--color-text-muted)] shrink-0">
                        <?php echo e($tab === 'warehouse' ? 'Warehouse' : 'Store'); ?>

                    </label>
                    <select
                        name="location_id"
                        id="dashboardLocation"
                        class="min-w-0 flex-1 sm:flex-none rounded-md border border-[var(--color-border)] bg-[var(--color-card)] px-2 py-1.5 text-xs text-[var(--color-text)]"
                        onchange="this.form.submit()"
                        style="width: 200px;"
                    >
                        <?php if(!empty($canViewAllShops)): ?>
                            <option value="all" <?php if(($locationId ?? null) === null): echo 'selected'; endif; ?>>
                                <?php echo e($tab === 'warehouse' ? 'All warehouses' : 'All stores'); ?>

                            </option>
                        <?php endif; ?>
                        <?php $__currentLoopData = $locations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($loc->id); ?>" <?php if(($locationId ?? null) == $loc->id): echo 'selected'; endif; ?>>
                                <?php echo e($loc->name); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </form>
            <?php endif; ?>
            <span class="dash-updated inline-flex items-center gap-1 rounded-full border border-[var(--color-border)] bg-[var(--color-card)] px-2 py-0.5 text-[10px] text-[var(--color-text-muted)] shrink-0" style="padding: 10px;font-size: 12px;">
                <span class="h-1.5 w-1.5 rounded-full bg-[var(--color-success)]"></span>
                <?php echo e(now()->format('M d, h:i A')); ?>

            </span>
            <?php if($tab === 'store'): ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('pos_access')): ?>
                    <a href="<?php echo e(route('admin.pos.index')); ?>" target="_blank" class="tw-btn-primary text-xs px-2.5 py-1.5 shrink-0">
                        <i class="bi bi-cash-stack"></i> POS
                    </a>
                <?php endif; ?>
            <?php endif; ?>
         <?php $__env->endSlot(); ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal91a231a9270579fa1ae9246bd51fb785)): ?>
<?php $attributes = $__attributesOriginal91a231a9270579fa1ae9246bd51fb785; ?>
<?php unset($__attributesOriginal91a231a9270579fa1ae9246bd51fb785); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91a231a9270579fa1ae9246bd51fb785)): ?>
<?php $component = $__componentOriginal91a231a9270579fa1ae9246bd51fb785; ?>
<?php unset($__componentOriginal91a231a9270579fa1ae9246bd51fb785); ?>
<?php endif; ?>

    <?php if(count($modes) > 1): ?>
        <nav class="dash-mode" aria-label="Dashboard mode">
            <div class="dash-mode__track" role="tablist">
                <?php $__currentLoopData = $modes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mode): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php $meta = $tabMeta[$mode] ?? ['title' => ucfirst($mode), 'hint' => '', 'icon' => 'bi-circle']; ?>
                    <a
                        href="<?php echo e(route('admin.dashboard', ['tab' => $mode])); ?>"
                        role="tab"
                        aria-selected="<?php echo e($tab === $mode ? 'true' : 'false'); ?>"
                        class="dash-mode__tab dash-mode__tab--<?php echo e($mode); ?> <?php echo e($tab === $mode ? 'is-active' : ''); ?>"
                    >
                        <span class="dash-mode__icon" aria-hidden="true">
                            <i class="bi <?php echo e($meta['icon']); ?>"></i>
                        </span>
                        <span class="dash-mode__copy">
                            <span class="dash-mode__title"><?php echo e($meta['title']); ?></span>
                            <?php if(!empty($meta['hint'])): ?>
                                <span class="dash-mode__hint"><?php echo e($meta['hint']); ?></span>
                            <?php endif; ?>
                        </span>
                        <?php if($tab === $mode): ?>
                            <span class="dash-mode__check" aria-hidden="true"><i class="bi bi-check2"></i></span>
                        <?php endif; ?>
                    </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </nav>
    <?php endif; ?>

    <?php echo $__env->make('admin.dashboard.partials.'.$tab, array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/shivajewellers_uat/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>