/*
 * Sidebar — Bridge GRC Compliance Copilot
 * Isolated sidebar component styles
 *
 * Background : #0B0F1A (near-black)
 * Accent     : Bridge green (self-contained --sb-accent)
 */

/* =============================================================================
   SIDEBAR SHELL
   ============================================================================= */

.sidebar {
    /* ---- sidebar-scoped accent ---- */
    --sb-accent: #2DC882;
    --sb-accent-dark: #1E9B64;
    --sb-accent-005: rgba(45, 200, 130, 0.05);
    --sb-accent-007: rgba(45, 200, 130, 0.07);
    --sb-accent-009: rgba(45, 200, 130, 0.09);

    width: var(--sidebar-width);
    background: #0B0F1A;
    color: var(--color-text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    border-right: 1px solid rgba(255,255,255,0.05);
    transition: transform var(--transition-base);
}

/* =============================================================================
   BRAND / HEADER
   ============================================================================= */

.sidebar-header {
    padding: 1.25rem 1.125rem 1.125rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.sidebar-logo:hover {
    text-decoration: none;
    opacity: 0.93;
}

.sidebar-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-width: 0;
}

.sidebar-brand-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9375rem;
    color: #FFFFFF;
    letter-spacing: -0.01em;
    white-space: nowrap;
    line-height: 1.3;
}

.sidebar-brand-sub {
    font-size: 0.625rem;
    color: rgba(255,255,255,0.28);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.sidebar-nav {
    flex: 1;
    padding: var(--space-3) 0.6rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
}

.nav-section {
    margin-bottom: 0.375rem;
}

.nav-section-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255,255,255,0.22);
    padding: 0.625rem 0.75rem 0.3125rem;
    user-select: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4375rem 0.75rem;
    border-radius: 6px;
    color: rgba(255,255,255,0.48);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 140ms ease, background 140ms ease;
    position: relative;
    margin-bottom: 1px;
}

.nav-link:hover {
    color: rgba(255,255,255,0.82);
    background: rgba(255,255,255,0.04);
    text-decoration: none;
}

.nav-link.active {
    color: #FFFFFF;
    background: var(--sb-accent-007);
}

/* Active indicator — thin bar on left edge */
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--sb-accent);
    border-radius: 0 3px 3px 0;
}

.nav-link-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.5;
    stroke-width: 1.75;
}

.nav-link.active .nav-link-icon {
    opacity: 1;
    color: var(--sb-accent);
}

/* =============================================================================
   SIDEBAR FOOTER
   ============================================================================= */

.sidebar-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* Credits pill */
.sidebar-credits {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3125rem 0.625rem;
    background: var(--sb-accent-005);
    border: 1px solid var(--sb-accent-009);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--sb-accent);
    letter-spacing: 0.01em;
}

.sidebar-credits svg {
    opacity: 0.7;
    flex-shrink: 0;
}

/* User row */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sb-accent), var(--sb-accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.625rem;
    color: #FFFFFF;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255,255,255,0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-logout {
    font-size: 0.625rem;
    color: rgba(255,255,255,0.26);
    text-decoration: none;
    transition: color 120ms ease;
}
.sidebar-logout:hover {
    color: rgba(255,255,255,0.50);
    text-decoration: none;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
}
