<aside class="w-64 bg-[#033A40] min-h-full hidden lg:flex flex-col flex-shrink-0 shadow-lg">
    <div class="p-5 flex flex-col h-full">
        <div class="flex-1 overflow-y-auto">
            <div class="flex flex-col items-center text-center mb-6">
                <div class="w-14 h-14 rounded-full bg-teal-400 flex items-center justify-center text-white text-lg font-bold flex-shrink-0 mb-2 shadow-md">
                    <?= strtoupper(substr(session()->get('username'), 0, 1)) ?>
                </div>
                <p class="text-teal-100 text-sm font-semibold"><?= session()->get('username') ?></p>
                <p class="text-teal-300 text-xs">Vendedor</p>
            </div>
            <div class="space-y-1">
                <?php
                $currentUri = service('uri')->getPath();
                $isActive = function($path) use ($currentUri) {
                    return strpos($currentUri, $path) === 0;
                };
                ?>
                <a class="flex items-center gap-3 px-3.5 py-2.5 text-sm rounded-lg no-underline transition-all duration-200 <?= $isActive('dashboard') ? 'bg-teal-500 text-white shadow-sm font-semibold' : 'text-teal-200 hover:text-white hover:bg-white/10' ?>" href="<?= site_url('dashboard') ?>">
                    <i class="bi bi-speedometer2 w-5 text-center"></i>
                    <span>Dashboard</span>
                </a>
                <a class="flex items-center gap-3 px-3.5 py-2.5 text-sm rounded-lg no-underline transition-all duration-200 <?= $isActive('sale') ? 'bg-teal-500 text-white shadow-sm font-semibold' : 'text-teal-200 hover:text-white hover:bg-white/10' ?>" href="<?= site_url('sales/create') ?>">
                    <i class="bi bi-cart-plus w-5 text-center"></i>
                    <span>Registrar Venta</span>
                </a>
                <a class="flex items-center gap-3 px-3.5 py-2.5 text-sm rounded-lg no-underline transition-all duration-200 <?= $isActive('product') ? 'bg-teal-500 text-white shadow-sm font-semibold' : 'text-teal-200 hover:text-white hover:bg-white/10' ?>" href="<?= site_url('products') ?>">
                    <i class="bi bi-box-seam w-5 text-center"></i>
                    <span>Productos</span>
                </a>
                <a class="flex items-center gap-3 px-3.5 py-2.5 text-sm rounded-lg no-underline transition-all duration-200 <?= $isActive('cash') ? 'bg-teal-500 text-white shadow-sm font-semibold' : 'text-teal-200 hover:text-white hover:bg-white/10' ?>" href="<?= site_url('cash') ?>">
                    <i class="bi bi-cash-stack w-5 text-center"></i>
                    <span>Caja</span>
                </a>
            </div>
        </div>
        <div class="flex-shrink-0 pt-2">
            <div class="border-t border-teal-700 mb-3"></div>
            <a class="flex items-center gap-3 px-3.5 py-2.5 text-sm rounded-lg no-underline transition-all duration-200 text-teal-300 hover:text-white hover:bg-white/10" href="<?= site_url('logout') ?>">
                <i class="bi bi-box-arrow-right w-5 text-center"></i>
                <span>Cerrar Sesion</span>
            </a>
        </div>
    </div>
</aside>
