:root { --sbs-w: 260px; }

.sbs-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1200;
    width: 44px;
    height: 44px;
    background: #0b0b0f;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.sbs-toggle svg { width: 22px; height: 22px; }
.sbs-toggle .sbs-x { display: none; }
.sbs-toggle.open { left: calc(var(--sbs-w) + 12px); }
.sbs-toggle.open .sbs-bars { display: none; }
.sbs-toggle.open .sbs-x { display: block; }

.sbs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 900;
}
.sbs-overlay.show { display: block; }

.sbs-sidebar {
    width: var(--sbs-w);
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: #fff;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(37,99,235,0.28) 0%, transparent 55%),
        radial-gradient(90% 50% at 100% 100%, rgba(124,58,237,0.22) 0%, transparent 60%),
        #0b0b0f;
    border-right: 1px solid rgba(255,255,255,0.06);
    transition: transform 0.3s ease;
}
.sbs-toggle { transition: left 0.3s ease; }
.sbs-sidebar.hidden { transform: translateX(-100%); }
.sbs-sidebar *, .sbs-sidebar *::before, .sbs-sidebar *::after { box-sizing: border-box; }

.sbs-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 30px 24px 24px;
    text-decoration: none;
    color: #fff;
}
.sbs-mark {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding-bottom: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    box-shadow: 0 8px 22px rgba(37,99,235,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
}
.sbs-mark span {
    width: 4px;
    border-radius: 2px;
    background: #fff;
    animation: sbs-eq 1.1s ease-in-out infinite;
}
.sbs-mark span:nth-child(1) { height: 10px; animation-delay: -0.2s; }
.sbs-mark span:nth-child(2) { height: 22px; animation-delay: -0.6s; }
.sbs-mark span:nth-child(3) { height: 15px; animation-delay: -0.4s; }
.sbs-mark span:nth-child(4) { height: 26px; animation-delay: -0.9s; }
.sbs-mark span:nth-child(5) { height: 12px; animation-delay: -0.1s; }
@keyframes sbs-eq {
    0%, 100% { transform: scaleY(0.45); }
    50%      { transform: scaleY(1); }
}
.sbs-mark span { transform-origin: bottom; }

.sbs-brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.sbs-brand-name {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sbs-brand-sub {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}

.sbs-divider {
    height: 1px;
    margin: 0 24px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
}

.sbs-label {
    padding: 22px 28px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.32);
}

.sbs-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 14px 24px;
    overflow-y: auto;
}
.sbs-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.sbs-icon { width: 19px; height: 19px; flex-shrink: 0; }
.sbs-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
    transform: translateX(3px);
}
.sbs-nav a.active {
    color: #fff;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(37,99,235,0.35), rgba(124,58,237,0.18));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.sbs-nav a.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #60a5fa, #a78bfa);
}
.sbs-nav a.active .sbs-icon { color: #93c5fd; }

.sbs-nav .sbs-logout {
    margin-top: auto;
    color: #fca5a5;
}
.sbs-nav .sbs-logout:hover {
    color: #fff;
    background: rgba(239,68,68,0.18);
}

.sbs-profile { position: relative; margin: 0 14px 6px; }
.sbs-profile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.sbs-profile-btn:hover,
.sbs-profile.open .sbs-profile-btn,
.sbs-profile.active .sbs-profile-btn {
    background: rgba(255,255,255,0.08);
    border-color: rgba(147,197,253,0.35);
}
.sbs-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 0 0 2px #0b0b0f, 0 0 0 4px rgba(147,197,253,0.45);
}
.sbs-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.sbs-avatar::after {
    content: '';
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #0b0b0f;
}
.sbs-profile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.sbs-profile-name {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sbs-profile-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sbs-chev {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: rgba(255,255,255,0.45);
    transition: transform 0.25s ease;
}
.sbs-profile.open .sbs-chev { transform: rotate(180deg); color: #fff; }

.sbs-profile-menu {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}
.sbs-profile-menu > div { overflow: hidden; }
.sbs-profile.open .sbs-profile-menu {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 8px;
}
.sbs-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 11px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sbs-edit-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(124,58,237,0.45); }
.sbs-edit-btn svg { width: 16px; height: 16px; }

.sbs-log-btn {
    margin-top: 6px;
    background: rgba(255,255,255,0.06);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
}
.sbs-log-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 0 0 1px rgba(147,197,253,0.4);
}
.sbs-log-btn.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37,99,235,0.35), rgba(124,58,237,0.18));
    box-shadow: inset 0 0 0 1px rgba(147,197,253,0.4);
}
.sbs-profile-btn:focus-visible,
.sbs-edit-btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

.sbs-narrow .sbs-profile { margin-left: 10px; margin-right: 10px; }
.sbs-narrow .sbs-avatar { width: 38px; height: 38px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
    .sbs-profile-menu, .sbs-chev { transition: none; }
}

@media (max-width: 600px) {
    .sbs-toggle { top: 12px; left: 12px; width: 40px; height: 40px; }
    .sbs-toggle.open { left: calc(var(--sbs-w) + 10px); }
}

.sbs-collapse {
    display: none;
    position: fixed;
    top: 34px;
    left: calc(var(--sbs-w) - 15px);
    z-index: 1100;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: #16161d;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease,
                border-radius 0.3s ease, background 0.2s ease, transform 0.2s ease;
}
.sbs-collapse svg { width: 16px; height: 16px; }
.sbs-collapse .sbs-c-open { display: none; }
.sbs-collapse:hover { background: linear-gradient(135deg, #2563eb, #7c3aed); transform: scale(1.08); }

.sbs-narrow .sbs-brand { gap: 11px; padding: 28px 18px 22px; }
.sbs-narrow .sbs-mark { width: 44px; height: 44px; border-radius: 12px; padding-bottom: 10px; }
.sbs-narrow .sbs-mark span { width: 3.5px; }
.sbs-narrow .sbs-brand-name { font-size: 27px; }
.sbs-narrow .sbs-brand-sub { font-size: 9px; letter-spacing: 1.8px; }
.sbs-narrow .sbs-label { padding-left: 22px; }
.sbs-narrow .sbs-nav { padding-left: 10px; padding-right: 10px; }
.sbs-narrow .sbs-nav a.active::before { left: -10px; }

@media (max-height: 640px) {
    .sbs-brand { padding: 20px 24px 16px; }
    .sbs-label { padding-top: 14px; }
    .sbs-nav a { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sbs-mark span { animation: none; transform: none; }
}