 <aside class="w-64 flex-shrink-0 p-5 flex flex-col gap-6" style="background:#1A1625;">

  <?php
    $shop = Auth::guard('admin')->user()->shop ?? null;
    $shopLogo = $shop?->logo ? asset('storage/' . $shop->logo) : null;
  ?>

  <div class="flex items-center gap-3 px-2">
    <?php if($shopLogo): ?>
      <img src="<?php echo e($shopLogo); ?>" alt="<?php echo e($shop->name); ?>"
           style="width:40px; height:40px; min-width:40px; border-radius:12px; object-fit:cover; display:block;">
    <?php else: ?>
      <div style="width:40px; height:40px; min-width:40px; border-radius:12px; background:white; display:flex; align-items:center; justify-content:center; padding:3px;">
        <img src="<?php echo e(asset('images/logo.png')); ?>" alt="eTailorz"
             style="width:100%; height:100%; object-fit:contain; display:block;">
      </div>
    <?php endif; ?>
    <span class="font-display font-semibold text-lg text-white">
      <?php echo e($shop?->name ?? 'eTailorz'); ?>

    </span>
  </div>

  <?php
    $typeId = Auth::guard('admin')->user()->type_id;

    // Master Management default landing route, based on what each role can actually see
    $masterDefaultRoute = $typeId === 2 ? 'shop.staff.index' : 'shop.ageTypes.index';
  ?>

  <nav class="flex flex-col gap-1 text-sm">

    
    <a href="<?php echo e(route($typeId === 1 ? 'superadmin.dashboard' : ($typeId === 2 ? 'shop.dashboard' : 'staff.dashboard'))); ?>"
       class="navlink <?php echo e(request()->routeIs('*.dashboard') ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg font-medium">
      Dashboard
    </a>

    
    <?php if($typeId === 1): ?>
    <a href="<?php echo e(route('superadmin.shops.index')); ?>" class="navlink <?php echo e(request()->routeIs('superadmin.shops.*') ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg">Shops</a>
    <?php endif; ?>

    
    <?php if(in_array($typeId, [2, 3])): ?>
    <a href="<?php echo e(route($masterDefaultRoute)); ?>"
       class="navlink <?php echo e(request()->routeIs(['shop.staff.*','shop.roles.*','shop.garments.*','shop.ageTypes.*','customers.*','shop.addons.*','settings.*']) ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg">
      Master Management
    </a>
    <?php endif; ?>

    
    <?php if(in_array($typeId, [2, 3])): ?>
    <a href="<?php echo e(route('orders.index')); ?>" class="navlink <?php echo e(request()->routeIs('orders.*') ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg">Orders</a>
    <?php endif; ?>

    
    <?php if(in_array($typeId, [2, 3])): ?>
    <a href="<?php echo e(route('payments.index')); ?>" class="navlink <?php echo e(request()->routeIs('payments.*') ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg">Payments</a>
    <?php endif; ?>

    
    <?php if($typeId === 2): ?>
    <a href="<?php echo e(route('salary.index')); ?>" class="navlink <?php echo e(request()->routeIs('salary.*') ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg">Salary</a>
    <?php endif; ?>

    
    <?php if(in_array($typeId, [2, 3])): ?>
    <a href="<?php echo e(route('reports.index')); ?>" class="navlink <?php echo e(request()->routeIs('reports.*') ? 'active' : ''); ?> flex items-center gap-3 px-3 py-2 rounded-lg">Report</a>
    <?php endif; ?>
  </nav>

  <div class="mt-auto px-2 flex items-center gap-3">
    <div class="w-8 h-8 rounded-full flex items-center justify-center text-xs font-medium text-white" style="background:#5E35B1;">
      <?php echo e(strtoupper(substr($shop?->name ?? Auth::guard('admin')->user()->name, 0, 2))); ?>

    </div>
    <div>
      <p class="text-xs font-medium text-white">
        <?php echo e($shop?->name ?? Auth::guard('admin')->user()->name); ?>

      </p>
      <p class="text-xs" style="color:rgba(255,255,255,0.4);">
        <?php echo e(['', 'Super Admin', 'Shop Owner', 'Staff'][$typeId]); ?>

      </p>
    </div>
    <form method="POST" action="<?php echo e(route('logout')); ?>" class="ml-auto">
      <?php echo csrf_field(); ?>
      <button type="submit" class="text-xs" style="color:rgba(255,255,255,0.4);">Log out</button>
    </form>
  </div>
</aside>
<?php /**PATH F:\xampp\htdocs\etailorz-v2\resources\views/partials/sidebar.blade.php ENDPATH**/ ?>