/* =========================================================
   CONINCSTUDIO SIDEBAR v5 — SCOPED ENHANCEMENT LAYER
   ---------------------------------------------------------
   SIDEBAR — slots into .cs-dashboard flex container
   (container itself defined in cs-dashboard-core.css)

========================================================= */
.csd-sidebar {
    --csd-sidebar-w: 260px;

    /* Flex child of .cs-dashboard */
    flex: 0 0 var(--csd-sidebar-w);
    width: var(--csd-sidebar-w);
    align-self: stretch;

    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 30px 20px;
    background: linear-gradient(180deg,
        #0B0B0B 0%,
        #120A1F 100%);
    border-right: 1px solid rgba(245, 179, 1, 0.08);

    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;

    z-index: 10;
}

.csd-sidebar::-webkit-scrollbar {
    width: 6px;
}
.csd-sidebar::-webkit-scrollbar-thumb {
    background: rgba(245, 179, 1, 0.25);
    border-radius: 4px;
}

/* ---------- Brand block ---------- */
.csd-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(245, 179, 1, 0.1);
}

.csd-sidebar-avatar-link { flex-shrink: 0; display: block; }

.csd-sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--csd-gold);
    box-shadow: 0 0 15px rgba(245, 179, 1, 0.3);
    transition: transform .25s ease, box-shadow .25s ease;
}
.csd-sidebar-avatar-link:hover .csd-sidebar-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 24px rgba(245, 179, 1, 0.55);
}

.csd-sidebar-identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.csd-sidebar-name {
    font-family: var(--csd-font-head, 'Inter', sans-serif);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--csd-text, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csd-sidebar-role {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--csd-gold-soft, #FEC503);
    opacity: 0.85;
}

/* ---------- Primary nav ---------- */
.csd-sidebar-nav { flex: 1; min-height: 0; }

.csd-sidebar-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.csd-sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #BBBBBB;
    text-decoration: none;
    font-family: var(--csd-font-head, 'Inter', sans-serif);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}

.csd-sidebar-nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(90deg, #F5B301, #FF8C42);
    border-radius: 0 3px 3px 0;
    transition: height .2s ease;
}

.csd-sidebar-nav-link:hover {
    background: rgba(245, 179, 1, 0.08);
    color: var(--csd-gold-soft, #FEC503);
    transform: translateX(4px);
}

.csd-sidebar-nav-item.is-active .csd-sidebar-nav-link {
    background: linear-gradient(90deg,
        rgba(245, 179, 1, 0.12),
        rgba(157, 77, 255, 0.06));
    color: var(--csd-gold-soft, #FEC503);
    box-shadow: 0 0 18px rgba(245, 179, 1, 0.12);
}
.csd-sidebar-nav-item.is-active .csd-sidebar-nav-link::before {
    height: 60%;
}

.csd-sidebar-nav-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity .2s ease, filter .2s ease;
}
.csd-sidebar-nav-link:hover .csd-sidebar-nav-icon,
.csd-sidebar-nav-item.is-active .csd-sidebar-nav-icon {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(245, 179, 1, 0.5));
}

.csd-sidebar-nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Widget zone ---------- */
.csd-sidebar-widgets {
    padding-top: 18px;
    border-top: 1px solid rgba(245, 179, 1, 0.1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.csd-widget {
    background: rgba(18, 10, 31, 0.6);
    border: 1px solid rgba(245, 179, 1, 0.1);
    border-radius: 14px;
    padding: 14px;
    font-size: 0.85rem;
    color: #BBBBBB;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.csd-widget:hover {
    border-color: rgba(245, 179, 1, 0.3);
    box-shadow: 0 0 20px rgba(245, 179, 1, 0.1);
}

.csd-widget-title {
    font-family: var(--csd-font-head, 'Inter', sans-serif);
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--csd-gold-soft, #FEC503);
    margin: 0 0 10px;
    font-weight: 600;
}

/* ---------- Footer block ---------- */
.csd-sidebar-footer {
    padding-top: 18px;
    border-top: 1px solid rgba(245, 179, 1, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csd-sidebar-logout { color: #BBBBBB; }
.csd-sidebar-logout:hover {
    color: #FF8C42;
    background: rgba(255, 140, 66, 0.08);
}

.csd-sidebar-version {
    font-family: var(--csd-font-head, 'Inter', sans-serif);
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(187, 187, 187, 0.4);
    text-align: center;
    margin-top: 4px;
}

/* =========================================================
   RESPONSIVE — tablet/mobile collapse to off-canvas
========================================================= */
@media (max-width: 1024px) {
    .csd-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform .35s ease;
        z-index: 1001;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.7);
    }

    .csd-sidebar.is-open {
        transform: translateX(0);
    }

    /* Toggle button — you can add one to your header/hero */
    .csd-sidebar-toggle {
        display: inline-flex;
    }
}

@media (min-width: 1025px) {
    .csd-sidebar-toggle { display: none; }
}