.sidebar {
    height: 100vh;
    width: 68px;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: width .3s ease;
    overflow: hidden;
    z-index: 1000;
    padding: 0 10px;
}

/* ===============================
   COLLAPSED MODE PROFESSIONAL FIX
================================== */

/* Remove extra padding from nav */
.sidebar .nav {
    width: 100%;
    padding: 0;
}

.sidebar:not(.open) .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* padding-left: 15px */
}

.sidebar-link i {
    transition: transform .2s ease;
}

.sidebar-link:hover i {
    transform: scale(1.15);
}


/* Click to expand */
.sidebar.open {
    width: var(--sidebar-width);
}

/* Top bar */
.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: 60px;
    flex-shrink: 0;
}
.sidebar.open .sidebar-top {
    justify-content: space-between;
    padding: 15px 14px;
}
.sidebar-brand {
    font-size: 15px;
    font-weight: 600;
    color: #d2a84e;
    white-space: nowrap;
}

/* Toggle button */
.toggle-btn {
    background: none;
    border: none;
    color: #9aa3b2;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    line-height: 1;
    flex-shrink: 0;
}
.toggle-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Hide text when collapsed */
.hide-on-collapse {
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .2s;
    overflow: hidden;
}
.sidebar.open .hide-on-collapse { opacity: 1; pointer-events: auto; }


/* Nav links */
.sidebar-link {
    color: #9aa3b2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    transition: background .2s, color .2s;
    position: relative;
    white-space: nowrap;
}

/* ICON */
.sidebar-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Center everything perfectly */
.sidebar:not(.open) .sidebar-link {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 4px 0;
    border-radius: 10px;
}


/* Remove active left bar in collapsed mode */
.sidebar:not(.open) .sidebar-link.active::before {
    display: none;
}

/* Make icon perfectly centered */
.sidebar:not(.open) .sidebar-link i {
    margin: 0;
    font-size: 20px;
}


.sidebar-link span { font-size: 13px; }
.sidebar-link:hover,
.sidebar-link.active {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--sidebar-active-bar);
    border-radius: 0 3px 3px 0;
}

/* Footer */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}


/* Profile */
.sidebar-profile {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-avatar {
    width: 34px;
    height: 34px;
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #d2a84e;
    color: #16213e;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-owner-name { font-size: 13px; font-weight: 500; color: #fff; }
.sidebar-owner-role { font-size: 11px; color: #6b7280; margin-top: 1px; }

/* Hover effect clean */
.sidebar:not(.open) .sidebar-link:hover {
    background: var(--sidebar-hover);
    border-radius: 10px;
    width: 100%;
}

/* Footer collapsed alignment */
.sidebar:not(.open) .sidebar-footer {
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}


.sidebar:not(.open) .sidebar-profile {
    justify-content: center;
}

/* Center avatar */
.sidebar:not(.open) .sidebar-avatar,
.sidebar:not(.open) .sidebar-avatar-initials {
    margin: 0 auto;
}


/* Remove weird nav left padding */
.sidebar:not(.open) .nav {
    padding-left: 0;
}

/* Main content offset */
.main-content {
    margin-left: 68px;
    width: calc(100% - 68px);
    min-height: 100vh;
    background: #f5f4f0;
    transition: margin-left .3s ease, width .3s ease;
}
.sidebar.open ~ .main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}



.sidebar {
    height: 100vh;
    width: 68px;
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: width .3s ease;
    overflow: hidden;
    z-index: 1000;
    padding: 0 10px;
}

/* ===============================
   COLLAPSED MODE PROFESSIONAL FIX
================================== */

/* Remove extra padding from nav */
.sidebar .nav {
    width: 100%;
    padding: 0;
}

.sidebar:not(.open) .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* padding-left: 15px */
}

.sidebar-link i {
    transition: transform .2s ease;
}

.sidebar-link:hover i {
    transform: scale(1.15);
}


/* Click to expand */
.sidebar.open {
    width: var(--sidebar-width);
}

/* Top bar */
.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: 60px;
    flex-shrink: 0;
}
.sidebar.open .sidebar-top {
    justify-content: space-between;
    padding: 15px 14px;
}
.sidebar-brand {
    font-size: 15px;
    font-weight: 600;
    color: #d2a84e;
    white-space: nowrap;
}

/* Toggle button */
.toggle-btn {
    background: none;
    border: none;
    color: #9aa3b2;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    line-height: 1;
    flex-shrink: 0;
}
.toggle-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Hide text when collapsed */
.hide-on-collapse {
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .2s;
    overflow: hidden;
}
.sidebar.open .hide-on-collapse { opacity: 1; pointer-events: auto; }


/* Nav links */
.sidebar-link {
    color: #9aa3b2;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    transition: background .2s, color .2s;
    position: relative;
    white-space: nowrap;
}

/* ICON */
.sidebar-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Center everything perfectly */
.sidebar:not(.open) .sidebar-link {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 4px 0;
    border-radius: 10px;
}


/* Remove active left bar in collapsed mode */
.sidebar:not(.open) .sidebar-link.active::before {
    display: none;
}

/* Make icon perfectly centered */
.sidebar:not(.open) .sidebar-link i {
    margin: 0;
    font-size: 20px;
}


.sidebar-link span { font-size: 13px; }
.sidebar-link:hover,
.sidebar-link.active {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--sidebar-active-bar);
    border-radius: 0 3px 3px 0;
}

/* Footer */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}


/* Profile */
.sidebar-profile {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-avatar {
    width: 34px;
    height: 34px;
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #d2a84e;
    color: #16213e;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-owner-name { font-size: 13px; font-weight: 500; color: #fff; }
.sidebar-owner-role { font-size: 11px; color: #6b7280; margin-top: 1px; }

/* Hover effect clean */
.sidebar:not(.open) .sidebar-link:hover {
    background: var(--sidebar-hover);
    border-radius: 10px;
    width: 100%;
}

/* Footer collapsed alignment */
.sidebar:not(.open) .sidebar-footer {
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}


.sidebar:not(.open) .sidebar-profile {
    justify-content: center;
}

/* Center avatar */
.sidebar:not(.open) .sidebar-avatar,
.sidebar:not(.open) .sidebar-avatar-initials {
    margin: 0 auto;
}


/* Remove weird nav left padding */
.sidebar:not(.open) .nav {
    padding-left: 0;
}

/* Main content offset */
.main-content {
    margin-left: 68px;
    width: calc(100% - 68px);
    background: #f5f4f0;
    transition: margin-left .3s ease, width .3s ease;
}
.sidebar.open ~ .main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}