/*
===============================
SIDEBAR NAVIGATION - WHOLESALE PLATFORM
Adapted from Hotel Operator
===============================
*/

.sidebar {
    width: var(--sidebar-width-expanded);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: var(--sidebar-transition);
    border-top-right-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 50;
}

.sidebar[data-state="collapsed"] {
    width: var(--sidebar-width-collapsed);
}

/* Sidebar Navigation Container */
.sidebar-navigation {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-md) 0;
}

/* Navigation List */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Navigation Items - Base */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px var(--space-md);
    margin: 0 var(--space-xs);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-sm);
    position: relative;
    text-decoration: none;
    outline: none;
    gap: var(--space-sm);
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-body);
}

.nav-item.active {
    background-color: rgba(22, 163, 74, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

/* Navigation Icons */
.nav-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

/* Navigation Labels */
.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====================================
   EXPANDABLE GROUPS (Locations, Corporate)
   ==================================== */

.nav-group {
    display: flex;
    flex-direction: column;
}

/* Group Header (clickable to expand/collapse) */
.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px var(--space-md);
    margin: 0 var(--space-xs);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--text-sm);
    gap: var(--space-sm);
}

.nav-group-header:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-body);
}

/* Group Chevron Icon */
.nav-group-header .group-icon {
    font-size: 14px;
    transition: transform 0.2s var(--ease-out);
    color: var(--text-muted);
}

.nav-group-header[aria-expanded="true"] .group-icon,
.nav-group.expanded .group-icon {
    transform: rotate(90deg);
}

/* Submenu List */
.nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Submenu Items (indented) - L2 level */
.nav-sublist .nav-item,
.nav-item.l2 {
    padding: 6px var(--space-md) 6px calc(var(--space-md) + 28px);  /* Indent for hierarchy */
    margin: 0 var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 500;
    height: 32px;
    gap: var(--space-sm);
}

.nav-sublist .nav-item:hover,
.nav-item.l2:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.nav-sublist .nav-item.active,
.nav-item.l2.active {
    background-color: rgba(22, 163, 74, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

/* ====================================
   COLLAPSED SIDEBAR BEHAVIOR
   ==================================== */

.sidebar[data-state="collapsed"] .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar[data-state="collapsed"] .group-icon {
    display: none;
}

.sidebar[data-state="collapsed"] .nav-sublist {
    display: none !important;
}

/* ====================================
   SCROLLBAR STYLING
   ==================================== */

.sidebar-navigation::-webkit-scrollbar {
    width: 6px;
}

.sidebar-navigation::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-navigation::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.sidebar-navigation::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ====================================
   TAB CONTENT (Direct Load, No Horizontal Tabs)
   ==================================== */

.workspace-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
}

.workspace-header {
    padding: var(--space-lg) var(--space-lg) var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

.workspace-header h1 {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.tab-content-direct {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-workspace);
}

/* ====================================
   RESPONSIVE BEHAVIOR
   ==================================== */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        height: calc(100vh - var(--header-height));
        z-index: 100;
        transform: translateX(-100%);
    }
    
    .sidebar[data-state="expanded"] {
        transform: translateX(0);
    }
}
