.sidebar {
    width: 300px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 200;
}
.logo-area {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--bg-sidebar);
    z-index: 5;
    padding: 24px 0 16px 0;
    margin-bottom: 8px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--logo-color);
    text-decoration: none;
}
.logo span { color: var(--accent); }
.logo .logo-dash { color: var(--text-secondary); margin: 0 2px; font-weight: 400; }
.logo-mark { width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; }
.sidebar-theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-left: auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: 0.2s;
}
.sidebar-theme-toggle:hover { color: var(--accent); background: rgba(214, 51, 132, .08); }
.logo { min-width: 0; }
@media (max-width: 1001px) {
    .logo { font-size: 19px; gap: 7px; }
    .logo-mark { width: 28px; height: 28px; }
    .logo-area { gap: 6px; }
}

.nav-scrollable { flex: 1; display: flex; flex-direction: column; padding-bottom: 20px; }
.user-card-fixed {
    position: sticky;
    bottom: 0;
    background-color: var(--bg-sidebar);
    padding: 12px 0 24px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-light);
    z-index: 5;
}
.user-card {
    background: var(--user-card-bg);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}
.tablet-balance-widget, .mobile-balance-widget {
    display: none;
    background: var(--balance-bg);
    border-radius: 40px;
    padding: 10px 16px;
    border: 1px solid var(--balance-border);
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.tablet-balance-amount, .mobile-balance-amount { font-weight: 700; font-size: 18px; color: var(--text-primary); }
.tablet-btn-sm, .mobile-btn-sm {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.tablet-btn-sm:hover, .mobile-btn-sm:hover { background: var(--accent); color: white; }

.user-info { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 48px; height: 48px;
    background: var(--avatar-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 600;
    font-size: 20px;
    border: 1.5px solid var(--avatar-border);
    cursor: pointer;
    transition: 0.2s;
}
.avatar:hover { border-color: var(--accent); }
.user-details .name { font-weight: 600; color: var(--text-primary); }
.user-details .email { font-size: 13px; color: var(--text-secondary); }
.guest-auth-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    margin-top: 2px;
    transition: 0.2s;
}
.guest-auth-link:hover { color: var(--accent-hover); text-decoration: underline; }

.menu-dots {
    margin-left: auto;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
}
.menu-dots:hover { color: var(--accent); }

.dropdown-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--dropdown-bg);
    border-radius: 16px;
    box-shadow: 0 12px 28px var(--shadow-heavy);
    min-width: 220px;
    padding: 8px 0;
    border: 1px solid var(--popup-border);
    display: none;
    z-index: 100;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    padding: 10px 18px;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.dropdown-item i { width: 20px; color: var(--accent); }
.dropdown-item:hover { background: var(--dropdown-item-hover); color: var(--text-primary); }
.dropdown-divider { height: 1px; background: var(--popup-border); margin: 6px 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--nav-item-color);
    font-weight: 500;
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
}
.nav-item i { width: 22px; font-size: 1.2rem; color: var(--text-secondary); }
.nav-item:hover { background-color: var(--nav-item-hover-bg); color: var(--text-primary); }
.nav-item.active { background-color: var(--nav-item-active-bg); color: var(--accent); }
.nav-item.active i { color: var(--accent); }

.sidebar-section-title {
    padding: 12px 12px 6px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 8px;
}

@media (max-width: 1001px) {
    .sidebar { width: 280px; }
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 0 0 30px rgba(0,0,0,0.5);
        width: 280px;
        z-index: 1000;
    }
    .sidebar.open { transform: translateX(0); }
    .tablet-balance-widget { display: none; }
    .mobile-balance-widget { display: flex; }
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
@media (max-width: 768px) {
    .sidebar-overlay.show { display: block; }
}
/* Нижняя навигация (телефон) */
.bottom-nav { display: none; }
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 900;
        background: var(--card-bg, #26262c);
        border-top: 1px solid var(--border-light, rgba(255,255,255,0.08));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.25);
    }
    .bn-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 56px;
        color: var(--text-secondary, #9a9aa5);
        text-decoration: none;
        font-size: 0.66rem;
        font-weight: 600;
    }
    .bn-item i { font-size: 1.15rem; }
    .bn-item.active { color: var(--accent, #D63384); }
    body:not(.has-chat-page) .main { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    body.has-chat-page .bottom-nav { display: none; }
}

/* переключатель темы: в тёмной — солнце (сделать светлее), в светлой — луна */
.sidebar-theme-toggle svg { width: 22px; height: 22px; }
.sidebar-theme-toggle .tt-sun { display: none; color: #f5b83d; }
.sidebar-theme-toggle .tt-moon { color: #8a5cf6; }
html.dark-theme .sidebar-theme-toggle .tt-sun { display: block; }
html.dark-theme .sidebar-theme-toggle .tt-moon { display: none; }
.sidebar-theme-toggle { background: rgba(214, 51, 132, .08); }

/* пункт «Клуб наслаждений» выделен */
.nav-club { position: relative; font-weight: 700; color: var(--text-primary);
    background: linear-gradient(90deg, rgba(214, 51, 132, .14), rgba(138, 43, 226, .10)); border: 1px solid rgba(214, 51, 132, .25); }
.nav-club-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; color: #fff; margin-left: -4px;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%), linear-gradient(135deg, #ff5a9a, #D63384 50%, #8a2be2);
    box-shadow: 0 4px 10px -4px rgba(214, 51, 132, .9); }
.nav-club-icon svg { width: 18px; height: 18px; }
.nav-club-dot { margin-left: auto; font-size: 11px; font-weight: 800; color: #3a2204; background: linear-gradient(135deg, #ffe08a, #f5c451);
    border-radius: 999px; padding: 3px 8px; }

/* гость: заметная кнопка входа вместо ссылки */
.guest-cta { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: 18px;
    text-decoration: none; color: #fff; -webkit-tap-highlight-color: transparent;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%), linear-gradient(135deg, #ff5a9a, #D63384 50%, #8a2be2);
    box-shadow: 0 12px 26px -12px rgba(214, 51, 132, 1); animation: gcGlow 2.4s ease-in-out infinite; }
.guest-cta:active { transform: scale(.98); }
.guest-cta::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-18deg); pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); animation: gcSweep 3s ease-in-out infinite; }
.guest-cta-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2);
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.guest-cta-icon svg { width: 22px; height: 22px; }
.guest-cta-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guest-cta-text b { font-size: 15px; font-weight: 800; line-height: 1.2; }
.guest-cta-text small { font-size: 12px; opacity: .9; line-height: 1.25; }
.guest-cta-arrow { width: 20px; height: 20px; flex-shrink: 0; animation: gcNudge 1.2s ease-in-out infinite; }
@keyframes gcGlow { 0%,100% { box-shadow: 0 12px 26px -12px rgba(214, 51, 132, 1); } 50% { box-shadow: 0 12px 34px -6px rgba(255, 90, 154, 1); } }
@keyframes gcSweep { 0%,55% { left: -60%; } 100% { left: 130%; } }
@keyframes gcNudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .guest-cta, .guest-cta::after, .guest-cta-arrow { animation: none; } }
