/* Navigation Styles - SaaS Professional */

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--slate-900);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    letter-spacing: -0.025em;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-500);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-400);
    padding: 0.5rem 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--slate-300);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background-color: var(--primary-500);
    color: white;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
    opacity: 0.9;
}

/* User Profile in Sidebar */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--slate-400);
}

/* Account Dropdown */
.account-menu {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 1rem;
    width: calc(100% - 2rem);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 100;
    animation: slideUp 0.15s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.account-menu.open {
    display: block;
}

/* High specificity to override sidebar white text inheritance */
#sidebar .account-menu .account-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #1e293b !important;
    /* Force dark slate color */
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s;
    background: transparent;
}

#sidebar .account-menu .account-menu-item:hover {
    background: #f8fafc !important;
    /* slate-50 */
    color: #4f46e5 !important;
    /* primary-600 */
}

/* Ensure icons inside menu also have correct color */
#sidebar .account-menu .account-menu-item .nav-icon {
    color: currentColor !important;
}

.account-menu-divider {
    height: 1px;
    background: var(--slate-100);
    margin: 4px 0;
}

/* Top Navigation (Header) */
.top-nav {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Content Area */
.main-content {
    margin-left: 260px;
    background-color: var(--slate-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar (Page Header) */
.top-bar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--slate-800);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    font-size: 0.875rem;
    color: var(--slate-500);
}

/* Content Wrapper (Main scrollable area) */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Mobile Toggle - Hidden on Desktop */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--slate-600);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 45;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* Mobile Hamburger Menu in Top Bar */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--slate-600);
    line-height: 1;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}