/* New Sidebar Design - Mirrored from App-Site */

.kw-sidebar {
    background-color: #ffffff;
    width: 240px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e3e8ee;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Scrollable nav area */
.kw-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 16px 0;
}

.kw-nav-scroll::-webkit-scrollbar {
    width: 4px;
}

.kw-nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.kw-nav-scroll::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 2px;
}

/* Section header label */
.kw-section-header {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: #5a677d;
    padding: 14px 20px 10px 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s, color 0.12s;
    user-select: none;
}

.kw-section-header:hover, .kw-header-link:hover {
    background-color: #f7f8f9;
    color: #1a1f36;
}

.kw-header-link {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    color: #5a677d;
    padding: 14px 20px 10px 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.12s;
    user-select: none;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.kw-section-chevron {
    font-size: 20px !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #5a677d;
}

.kw-section-icon {
    font-size: 22px !important;
    color: #5a677d;
    flex-shrink: 0;
}

/* Collapsible Section Logic */
.kw-nav-section {
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.kw-nav-section .kw-nav-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kw-nav-section--expanded .kw-nav-list {
    /* Handle via JS style.maxHeight */
}

.kw-nav-section--expanded .kw-section-chevron {
    transform: rotate(180deg);
}

/* Nav list */
.kw-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nav item */
.kw-nav-item {
    display: block;
    position: relative;
    margin: 0;
    width: 100%;
}

/* Nav link */
.kw-nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px 8px 54px;
    margin: 1px 0;
    border-radius: 0;
    text-decoration: none;
    color: #4f566b;
    font-size: 15.5px;
    font-weight: 450;
    transition: background 0.12s, color 0.12s;
    position: relative;
    line-height: 1.4;
    width: 100%;
    box-sizing: border-box;
}

#sideBarMainDiv .kw-nav-link {
    padding-left: 20px;
}

.kw-nav-link:hover {
    background: #eef0f3;
    color: #1a1f36;
}

/* Nav icon */
.kw-nav-icon {
    font-size: 18px !important;
    color: #8792a2;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    margin-right: 12px;
}

/* Active state */
.kw-nav-link--active {
    color: #635bff !important;
    background: #ede9fe !important;
}

.kw-nav-link--active .kw-nav-icon, 
.kw-nav-link--active .kw-section-icon {
    color: #635bff !important;
}

/* 2px indigo left-edge indicator */
.kw-nav-link--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 2px;
    background: #635bff;
    border-radius: 0 2px 2px 0;
}

/* Footer */
.kw-sidebar-footer {
    padding: 14px 20px 18px 20px;
    border-top: 1px solid #e3e8ee;
    flex-shrink: 0;
    margin-top: auto;
}

.kw-user-name {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.kw-signout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 6px;
    font-family: inherit;
    transition: all 0.2s;
}

.kw-signout-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Layout structural classes */
.baseNavMain {
    width: 240px;
    min-width: 240px;
    height: 100%;
    background: white;
}

.leftSideBarContent {
    display: flex;
    flex-direction: row;
    background-color: #f7f5f2;
    height: calc(100vh - 56px);
}

.mainContent {
    -webkit-box-flex: 1;
    flex-grow: 1;
    min-height: 100%;
    overflow: scroll;
}

/* Portfolio Switcher in Sidebar */
#portfolioName {
    transition: background 0.2s;
    user-select: none;
}

#portfolioName:hover {
    background-color: #f7f8f9 !important;
}

#pf-dropdown {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e3e8ee !important;
}

.pf-item:hover {
    background-color: #f7f8f9 !important;
}