/* =========================================================
   CoreDriveAI Shared Sidebar
   ========================================================= */

.dashboard-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background:
        radial-gradient(
            circle at top left,
            rgba(117, 82, 255, 0.28),
            transparent 40%
        ),
        linear-gradient(
            180deg,
            #30285f 0%,
            #1e1b45 55%,
            #171932 100%
        );
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 20;
}

.sidebar-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 34px 24px 24px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    text-decoration: none;
}

.sidebar-logo {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    object-fit: contain;
}

.sidebar-brand-text {
    font-size: 26px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -1px;
    white-space: nowrap;
}

.sidebar-brand-text span {
    color: #28d5f7;
}

.sidebar-subtitle {
    margin: 12px 0 30px;
    color: #ffffff;
    font-size: 21px;
    line-height: 1.35;
    font-weight: 500;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section-title {
    margin: 0 0 13px;
    color: #b7b8d4;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar-link {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: #d8daf0;
    background: transparent;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.sidebar-link:link,
.sidebar-link:visited {
    color: #d8daf0;
    text-decoration: none;
}

.sidebar-link:hover {
    color: #ffffff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(
        90deg,
        rgba(101, 82, 236, 0.78),
        rgba(28, 158, 218, 0.28)
    );
    border-color: rgba(39, 211, 248, 0.55);
    box-shadow:
        inset 4px 0 0 #2ce1ff,
        0 10px 30px rgba(20, 19, 67, 0.28);
}

.sidebar-link-icon {
    width: 25px;
    flex: 0 0 25px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 21px;
}

.sidebar-link-label {
    min-width: 0;
    white-space: nowrap;
}

.sidebar-admin-section {
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
}

.sidebar-logout {
    width: 100%;
    min-height: 54px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 13px;
    padding: 13px 18px;
    border: 1px solid rgba(255, 112, 122, 0.42);
    border-radius: 15px;
    color: #ffb7bc;
    background: rgba(115, 32, 58, 0.16);
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.sidebar-logout:hover {
    color: #ffffff;
    background: rgba(177, 48, 75, 0.3);
    transform: translateY(-1px);
}

/* Dashboard content remains beside sidebar */
.dash-content {
    min-width: 0;
}

/* =========================================================
   Responsive Sidebar
   ========================================================= */

@media (max-width: 900px) {
    .dashboard-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
    }

    .sidebar-inner {
        min-height: auto;
        padding: 22px;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-footer {
        margin-top: 20px;
    }
}

@media (max-width: 560px) {
    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .sidebar-brand-text {
        font-size: 23px;
    }

    .sidebar-logo {
        width: 50px;
        height: 50px;
    }
}