/* =========================================================
   Premium POS Admin Sidebar
   Pure CSS — no JS, no frameworks.
   ========================================================= */

:root {
    --sidebar-width: 260px;
    --sidebar-top: 75px;
    --bg-sidebar: #111827;
    --bg-hover: #1a2333;
    --bg-surface: #1f2937;
    --text-muted: #9ca3af;
    --text-default: #d1d5db;
    --text-strong: #ffffff;
    --accent-gold: #fbbf24;
    --accent-from: #4f46e5;
    --accent-to: #4338ca;
    --scrollbar-thumb: #374151;
    --scrollbar-thumb-hover: #4b5563;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --speed: 0.3s;
}

/* ---------- Sidebar shell ---------- */

.sidebar {
    position: fixed;
    top: var(--sidebar-top);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--sidebar-top));
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 900;
    animation: sidebarSlideIn 0.45s var(--ease) both;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    font-size: 14px;
}

.sidebar__scroll {
    height: 100%;
    overflow-y: auto;
    padding: 18px 12px 24px;
}

@keyframes sidebarSlideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .nav-item,
    .nav-link {
        animation: none !important;
        transition: none !important;
      
    }
}

/* ---------- Nav list & stagger entrance ---------- */

.nav-link{

    display:flex;
    align-items:center;
    gap:14px;
    padding:12px 14px;

    font-size:13.5px;   /* ← Yahan change karo */

    font-weight:500;

}

.nav-item {
    position: relative;
    opacity: 0;
    transform: translateX(-14px);
    animation: linkFadeIn 0.4s var(--ease) forwards;
}

@keyframes linkFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Staggered delay per item, capped at a comfortable pace */
.nav-list .nav-item:nth-child(1)  { animation-delay: 0.02s; }
.nav-list .nav-item:nth-child(2)  { animation-delay: 0.05s; }
.nav-list .nav-item:nth-child(3)  { animation-delay: 0.08s; }
.nav-list .nav-item:nth-child(4)  { animation-delay: 0.11s; }
.nav-list .nav-item:nth-child(5)  { animation-delay: 0.14s; }
.nav-list .nav-item:nth-child(6)  { animation-delay: 0.17s; }
.nav-list .nav-item:nth-child(7)  { animation-delay: 0.20s; }
.nav-list .nav-item:nth-child(8)  { animation-delay: 0.23s; }
.nav-list .nav-item:nth-child(9)  { animation-delay: 0.26s; }
.nav-list .nav-item:nth-child(10) { animation-delay: 0.29s; }
.nav-list .nav-item:nth-child(11) { animation-delay: 0.32s; }
.nav-list .nav-item:nth-child(12) { animation-delay: 0.35s; }
.nav-list .nav-item:nth-child(13) { animation-delay: 0.38s; }
.nav-list .nav-item:nth-child(14) { animation-delay: 0.41s; }
.nav-list .nav-item:nth-child(15) { animation-delay: 0.44s; }
.nav-list .nav-item:nth-child(16) { animation-delay: 0.47s; }

.nav-list--footer .nav-item {
    animation-delay: 0.5s;
}

/* ---------- Links ---------- */

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin: 0;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-default);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0.1px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
    transition: color var(--speed) var(--ease),
                transform var(--speed) var(--ease),
                box-shadow var(--speed) var(--ease);
}

/* Sliding hover fill, drawn behind text/icon */
.nav-link__ink {
    position: absolute;
    inset: 0;
    background: var(--bg-hover);
    border-radius: 12px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--speed) var(--ease);
    z-index: -1;
}

.nav-link:hover .nav-link__ink {
    transform: scaleX(1);
}

.nav-link:hover {
    color: var(--text-strong);
    transform: translateX(3px);
}

.nav-link:hover i {
    transform: scale(1.16);
    color: var(--accent-gold);
}

.nav-link:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.nav-link i {
    width: 20px;
    flex-shrink: 0;
    font-size: 18px;
    text-align: center;
    transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.nav-link__text {
    flex: 1;
    white-space: nowrap;
}

/* CSS-only ripple pulse on click — expands a soft ring from center */
.nav-link:active::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 70%);
    animation: ripplePulse 0.5s var(--ease);
    pointer-events: none;
}

@keyframes ripplePulse {
    from {
        opacity: 1;
        transform: scale(0.4);
    }
    to {
        opacity: 0;
        transform: scale(1.6);
    }
}

/* ---------- Active state ---------- */

.nav-link.active {
    color: var(--text-strong);
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4),
                0 0 0 1px rgba(251, 191, 36, 0.35) inset;
    animation: activeGlow 2.4s ease-in-out infinite;
}

.nav-link.active .nav-link__ink {
    display: none;
}

.nav-link.active:hover {
    transform: translateX(0);
}

.nav-link.active i {
    color: var(--accent-gold);
}

@keyframes activeGlow {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4),
                    0 0 0 1px rgba(251, 191, 36, 0.35) inset;
    }
    50% {
        box-shadow: 0 4px 20px rgba(79, 70, 229, 0.55),
                    0 0 0 1px rgba(251, 191, 36, 0.55) inset;
    }
}

/* ---------- Logout (distinct tone) ---------- */

.nav-divider {
    height: 1px;
    margin: 14px 6px 10px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.nav-link--logout {
    color: #fca5a5;
}

.nav-link--logout .nav-link__ink {
    background: rgba(248, 113, 113, 0.12);
}

.nav-link--logout:hover {
    color: #fecaca;
}

.nav-link--logout:hover i {
    color: #f87171;
}

/* ---------- Custom scrollbar ---------- */

.sidebar__scroll::-webkit-scrollbar {
    width: 5px;
}

.sidebar__scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar__scroll::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 20px;
    transition: background 0.2s ease;
}

.sidebar__scroll::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.sidebar__scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ---------- Responsive: collapse on mobile ---------- */

@media (max-width: 991px) {
    .sidebar {
        display: none;
    }
}

/* Optional: slightly narrower rail on small tablets before full collapse */
@media (max-width: 1199px) and (min-width: 992px) {
    :root {
        --sidebar-width: 230px;
    }

    .nav-link {
        padding: 11px 12px;
        font-size: 14px;
    }
}