/* ==========================================================================
   IDT POS — Sidebar & Header Polish v2.0
   Date: 2026-05-16
   
   Two improvements:
   1. Add "IDT POS · The Best Inventory Management System" branding in TOP HEADER
      (next to hamburger menu icon, on the LEFT side of POS/Calculator buttons)
      — NOT in sidebar, NOT replacing business name
   2. Modernize sidebar — hover effects, active state, smooth animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   TOP HEADER — Add IDT POS branding next to hamburger button
   -------------------------------------------------------------------------- */

/* Inject branding text AFTER the hamburger toggle button */
.main-header .navbar .sidebar-toggle::after {
    content: 'IDT POS · The Best Inventory Management System';
    display: inline-block;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Hind Siliguri', sans-serif;
}

/* Ensure the hamburger toggle itself stays clean */
.main-header .navbar .sidebar-toggle {
    overflow: visible !important;
    height: auto !important;
    line-height: 1 !important;
    padding: 18px 15px !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Hide branding on small screens (tablet and below) */
@media (max-width: 991px) {
    .main-header .navbar .sidebar-toggle::after {
        display: none !important;
    }
}

/* On medium screens, show shorter version */
@media (max-width: 1199px) and (min-width: 992px) {
    .main-header .navbar .sidebar-toggle::after {
        content: 'IDT POS';
        font-size: 14px !important;
    }
}

/* --------------------------------------------------------------------------
   SIDEBAR — Modernize with smooth interactions
   -------------------------------------------------------------------------- */

/* Sidebar background — subtle gradient */
.main-sidebar,
.skin-blue .main-sidebar,
.skin-blue-light .main-sidebar {
    background: linear-gradient(180deg, #1a2332 0%, #0f172a 100%) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08) !important;
}

.sidebar {
    padding: 12px 0 !important;
}

/* User panel at top (if visible) */
.sidebar .user-panel {
    padding: 16px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    margin-bottom: 8px !important;
}

.sidebar .user-panel .info p {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    margin: 0 !important;
}

/* Menu items - main level */
.sidebar-menu > li {
    margin: 2px 8px !important;
}

.sidebar-menu > li > a {
    padding: 11px 14px !important;
    border-radius: 10px !important;
    color: #cbd5e1 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
}

/* Icons */
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .glyphicon,
.sidebar-menu > li > a > .ion,
.sidebar-menu > li > a > i {
    width: 22px !important;
    height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    margin: 0 !important;
    color: #94a3b8 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

/* Hover */
.sidebar-menu > li:hover > a {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #ffffff !important;
    transform: translateX(2px) !important;
}

.sidebar-menu > li:hover > a > .fa,
.sidebar-menu > li:hover > a > .glyphicon,
.sidebar-menu > li:hover > a > .ion,
.sidebar-menu > li:hover > a > i {
    color: #60a5fa !important;
}

/* Active */
.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a,
.skin-blue .sidebar-menu > li.active > a,
.skin-blue-light .sidebar-menu > li.active > a {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.05) 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-left: 0 !important;
    box-shadow: inset 3px 0 0 #3b82f6 !important;
}

.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li.active > a > .glyphicon,
.sidebar-menu > li.active > a > .ion,
.sidebar-menu > li.active > a > i {
    color: #3b82f6 !important;
}

/* Submenu arrow rotation */
.sidebar-menu > li > a > .pull-right-container,
.sidebar-menu > li > a > .fa-angle-left {
    color: #64748b !important;
    transition: transform 0.2s ease !important;
}

.sidebar-menu > li.menu-open > a > .fa-angle-left {
    transform: rotate(-90deg);
    color: #3b82f6 !important;
}

/* Submenu (treeview) */
.sidebar-menu > li > .treeview-menu,
.skin-blue .sidebar-menu > li > .treeview-menu,
.skin-blue-light .sidebar-menu > li > .treeview-menu {
    background: rgba(0, 0, 0, 0.2) !important;
    padding: 4px 8px !important;
    margin: 4px 0 !important;
    border-radius: 8px !important;
}

.treeview-menu > li > a {
    color: #94a3b8 !important;
    padding: 8px 12px 8px 44px !important;
    font-size: 12.5px !important;
    border-radius: 6px !important;
    transition: all 0.15s ease !important;
    position: relative !important;
}

.treeview-menu > li > a::before {
    content: '→';
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #475569;
    font-size: 12px;
    transition: all 0.15s ease;
}

.treeview-menu > li > a:hover {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.15) !important;
    padding-left: 48px !important;
}

.treeview-menu > li > a:hover::before {
    color: #60a5fa !important;
    left: 28px;
}

.treeview-menu > li.active > a {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.2) !important;
    font-weight: 500 !important;
}

.treeview-menu > li.active > a::before {
    color: #3b82f6 !important;
}

/* Sidebar section headers */
.sidebar-menu .header {
    color: #64748b !important;
    background: transparent !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 16px 18px 8px !important;
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Online indicator dot in sidebar header — make it pulse */
.main-header .logo #online_indicator,
.main-sidebar .logo #online_indicator {
    color: #22c55e !important;
    font-size: 10px !important;
    text-shadow: 0 0 8px #22c55e;
    animation: idt-online-pulse 2s ease-in-out infinite;
}

@keyframes idt-online-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --------------------------------------------------------------------------
   COLLAPSED SIDEBAR
   -------------------------------------------------------------------------- */
.sidebar-collapse .sidebar-menu > li > a {
    padding: 11px 16px !important;
    justify-content: center !important;
}

/* --------------------------------------------------------------------------
   MOBILE RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .sidebar-menu > li {
        margin: 2px 6px !important;
    }
    
    .sidebar-menu > li > a {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    
    .treeview-menu > li > a {
        font-size: 12px !important;
        padding: 7px 10px 7px 40px !important;
    }
}