/* =========================================================
   CRYPTIVA SIDEBAR
   ========================================================= */

:root {
    --sidebar-width: 248px;

    --sidebar-bg: rgba(8, 8, 18, 0.96);
    --sidebar-border: rgba(255, 255, 255, 0.06);

    --sidebar-text: #858599;
    --sidebar-text-active: #f4f2ff;

    --sidebar-hover: rgba(255, 255, 255, 0.045);
    --sidebar-active: rgba(124, 92, 255, 0.13);

    --sidebar-accent: #7c5cff;
    --sidebar-cyan: #00cfff;
}


/* =========================================================
   BODY
   ========================================================= */

body.cryptiva-sidebar-active {
    padding-left: var(--sidebar-width);
    transition: padding-left 0.25s ease;
}


/* =========================================================
   HIDE OLD NAVBAR
   ========================================================= */

body.cryptiva-sidebar-active .navbar {
    display: none;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.cryptiva-sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    z-index: 1000;

    display: flex;
    flex-direction: column;

    padding: 22px 14px;

    border-right:
        1px solid var(--sidebar-border);

    background:
        linear-gradient(
            180deg,
            rgba(10, 10, 22, 0.98),
            rgba(5, 5, 13, 0.98)
        );

    backdrop-filter: blur(24px);

    overflow-y: auto;
    overflow-x: hidden;

    transition:
        width 0.25s ease,
        transform 0.25s ease;
}


/* =========================================================
   SIDEBAR GLOW
   ========================================================= */

.cryptiva-sidebar::before {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    top: -90px;
    left: -100px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(124, 92, 255, 0.12),
            transparent 70%
        );

    pointer-events: none;
}


/* =========================================================
   BRAND
   ========================================================= */

.sidebar-brand {
    position: relative;

    display: flex;
    align-items: center;

    gap: 11px;

    height: 46px;

    padding: 0 8px;

    margin-bottom: 30px;

    color: white;

    text-decoration: none;

    flex-shrink: 0;
}


.sidebar-brand-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(124, 92, 255, 0.35);

    border-radius: 12px;

    color: white;

    background:
        linear-gradient(
            135deg,
            rgba(124, 92, 255, 0.22),
            rgba(0, 207, 255, 0.08)
        );

    box-shadow:
        0 0 24px rgba(124, 92, 255, 0.12);

    font-size: 17px;

    flex-shrink: 0;
}


.sidebar-brand-text {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.sidebar-brand-name {
    color: #ffffff;

    font-size: 15px;
    font-weight: 800;

    letter-spacing: 2px;

    line-height: 1.1;
}


.sidebar-brand-subtitle {
    margin-top: 4px;

    color: #626276;

    font-size: 9px;
    font-weight: 600;

    letter-spacing: 0.7px;
}


/* =========================================================
   SECTION LABEL
   ========================================================= */

.sidebar-section {
    margin-bottom: 24px;
}


.sidebar-section-label {
    padding: 0 11px;

    margin-bottom: 9px;

    color: #505063;

    font-size: 9px;
    font-weight: 750;

    letter-spacing: 1.5px;

    text-transform: uppercase;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.sidebar-nav {
    display: flex;
    flex-direction: column;

    gap: 4px;
}


.sidebar-link {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 45px;

    padding: 0 11px;

    border-radius: 12px;

    color: var(--sidebar-text);

    text-decoration: none;

    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}


.sidebar-link:hover {
    color: #d8d5e8;

    background:
        var(--sidebar-hover);
}


.sidebar-link.active {
    color: var(--sidebar-text-active);

    background:
        var(--sidebar-active);
}


.sidebar-link.active::before {
    content: "";

    position: absolute;

    left: 0;
    top: 9px;
    bottom: 9px;

    width: 3px;

    border-radius: 0 4px 4px 0;

    background:
        linear-gradient(
            180deg,
            var(--sidebar-accent),
            var(--sidebar-cyan)
        );

    box-shadow:
        0 0 12px rgba(124, 92, 255, 0.45);
}


.sidebar-icon {
    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 12px;

    color: currentColor;

    flex-shrink: 0;
}


.sidebar-icon svg {
    width: 18px;
    height: 18px;

    display: block;
}


.sidebar-link-text {
    overflow: hidden;

    white-space: nowrap;

    font-size: 12px;
    font-weight: 650;

    text-overflow: ellipsis;
}


/* =========================================================
   USER AREA
   ========================================================= */

.sidebar-spacer {
    flex: 1;
}


.sidebar-user {
    position: relative;

    margin-top: auto;

    padding-top: 14px;

    border-top:
        1px solid rgba(255, 255, 255, 0.055);
}


.sidebar-user-card {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px;

    border-radius: 13px;

    background:
        rgba(255, 255, 255, 0.025);

    border:
        1px solid rgba(255, 255, 255, 0.045);
}


.sidebar-user-avatar {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(124, 92, 255, 0.35);

    border-radius: 10px;

    color: #ddd8ff;

    background:
        linear-gradient(
            135deg,
            rgba(124, 92, 255, 0.18),
            rgba(0, 207, 255, 0.07)
        );

    font-size: 11px;
    font-weight: 800;

    flex-shrink: 0;
}


.sidebar-user-info {
    min-width: 0;

    flex: 1;
}


.sidebar-user-name {
    overflow: hidden;

    color: #dedceb;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
    text-overflow: ellipsis;
}


.sidebar-user-status {
    margin-top: 3px;

    display: flex;
    align-items: center;

    gap: 5px;

    color: #626276;

    font-size: 9px;
}


.sidebar-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #36d399;

    box-shadow:
        0 0 8px rgba(54, 211, 153, 0.55);
}


/* =========================================================
   SIGN OUT
   ========================================================= */

.sidebar-logout {
    width: 100%;

    display: flex;
    align-items: center;

    margin-top: 8px;

    padding: 10px 11px;

    border: 0;

    border-radius: 10px;

    color: #77778b;

    background: transparent;

    cursor: pointer;

    text-align: left;

    transition:
        color 0.18s ease,
        background 0.18s ease;
}


.sidebar-logout:hover {
    color: #ff7d8a;

    background:
        rgba(255, 77, 94, 0.06);
}


.sidebar-logout .sidebar-icon {
    margin-right: 12px;
}


/* =========================================================
   MOBILE TOP BAR
   ========================================================= */

.sidebar-mobile-bar {
    display: none;

    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    height: 68px;

    z-index: 900;

    align-items: center;
    justify-content: space-between;

    padding: 0 16px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.055);

    background:
        rgba(5, 5, 13, 0.88);

    backdrop-filter: blur(20px);
}


.sidebar-mobile-brand {
    display: flex;
    align-items: center;

    gap: 9px;

    color: white;

    text-decoration: none;
}


.sidebar-mobile-brand-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(124, 92, 255, 0.35);

    border-radius: 10px;

    background:
        rgba(124, 92, 255, 0.12);

    font-size: 15px;
}


.sidebar-mobile-brand-text {
    font-size: 14px;
    font-weight: 800;

    letter-spacing: 1.7px;
}


.sidebar-menu-button {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 11px;

    color: #c7c4d4;

    background:
        rgba(255, 255, 255, 0.025);

    cursor: pointer;
}


.sidebar-menu-button svg {
    width: 19px;
    height: 19px;
}


/* =========================================================
   MOBILE OVERLAY
   ========================================================= */

.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 950;

    background:
        rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(3px);
}


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


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {

    body.cryptiva-sidebar-active {
        padding-left: 0;
        padding-top: 68px;
    }


    .cryptiva-sidebar {
        width: 270px;

        transform:
            translateX(-105%);

        box-shadow:
            20px 0 60px rgba(0, 0, 0, 0.35);
    }


    .cryptiva-sidebar.mobile-open {
        transform:
            translateX(0);
    }


    .sidebar-mobile-bar {
        display: flex;
    }


    body.cryptiva-sidebar-active .main {
        padding-top: 24px;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.sidebar-link:focus-visible,
.sidebar-logout:focus-visible,
.sidebar-menu-button:focus-visible {
    outline:
        2px solid rgba(124, 92, 255, 0.75);

    outline-offset: 2px;
}
