/* БАЗА */
body { margin: 0; padding: 0; padding-top: 70px !important; }

.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: space-between;
    height: 70px; padding: 0 20px;
    background: rgba(44, 24, 16, 0.98); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-brand .logo-link {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: #fff; font-weight: 800; font-size: 18px; white-space: nowrap;
}
.logo-text { display: inline !important; } /* Видна всегда */

.header-right { display: flex; align-items: center; gap: 15px; }

/* ДЕСКТОПНОЕ МЕНЮ */
.nav-desktop { display: flex; align-items: center; gap: 5px; }
.nav-desktop .nav-link {
    padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
    color: #E8CFA8; text-decoration: none; white-space: nowrap; transition: background .15s;
}
.nav-desktop .nav-link:hover { background: rgba(139, 92, 246, 0.15); color: #fff; }

/* ИКОНКИ */
.icon-btn { position: relative; font-size: 20px; text-decoration: none; padding: 8px; border-radius: 8px; transition: background .15s; }
.icon-btn:hover { background: rgba(139, 92, 246, 0.15); }
.nav-badge {
    position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
    line-height: 16px; text-align: center; border-radius: 99px; border: 2px solid rgba(44, 24, 16, 0.98);
}

/* АККАУНТ-ЧИП */
.account-chip {
    position: relative;
    display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
    border-radius: 99px; background: rgba(139, 92, 246, 0.15);
    text-decoration: none; transition: background .15s; cursor: pointer;
}
.account-chip:hover { background: rgba(139, 92, 246, 0.25); }
.account-name { font-size: 13px; font-weight: 600; color: #fff; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 🔥 ЗАМЕТНАЯ СТРЕЛОЧКА */
.account-caret {
    font-size: 16px;
    font-weight: 900;
    color: #ffffff !important;
    margin-left: 4px;
    transition: transform 0.2s ease;
}
.account-chip:hover .account-caret { transform: translateY(2px); }

/* АВАТАР */
.avatar-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-mini {
    width: 36px !important; height: 36px !important; border-radius: 50%;
    object-fit: cover; display: block; background: #2a2a3a;
}
.avatar-placeholder { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.avatar-badge { position: absolute; bottom: -2px; right: -2px; font-size: 12px; background: #1e1e2e; border-radius: 50%; padding: 1px; }

/* ДРОПДАУН АККАУНТА */
.account-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
    background: #1e1e2e; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s; z-index: 1100;
}
.account-chip.open .account-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 8px; color: #fff; text-decoration: none; font-size: 14px; transition: background .15s; }
.dropdown-item:hover { background: rgba(139, 92, 246, 0.2); }
.dropdown-item-admin { color: #c4b5fd; }
.dropdown-item-logout { color: #fca5a5; }
.dropdown-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 2px; }
.dropdown-badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }

/* КНОПКИ ГОСТЯ */
.btn-ghost, .btn-primary { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; transition: .15s; }
.btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-primary { color: #fff; background: #8b5cf6; border: none; }
.btn-primary:hover { background: #7c3aed; }

/* ГАМБУРГЕР */
.nav-toggle {
    display: none !important;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; background: transparent; border: none;
    cursor: pointer; padding: 8px; border-radius: 8px; flex-shrink: 0;
    z-index: 100002 !important;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform .25s, opacity .2s; }
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ШТОРКА */
.nav-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); opacity: 0; visibility: hidden; transition: .25s; z-index: 10000; }
.site-header.nav-open .nav-backdrop { opacity: 1; visibility: visible; }

.mobile-nav-wrapper {
    position: fixed; top: 0; left: 0;
    width: 280px; height: 100dvh !important;
    background: #16161f; z-index: 100001 !important;
    transform: translateX(-100%); transition: transform .3s ease;
    overflow-y: auto !important; padding: 20px 16px; display: flex; flex-direction: column;
}
.site-header.nav-open .mobile-nav-wrapper { transform: translateX(0); }

.mobile-profile { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.mobile-avatar .avatar-mini { width: 48px !important; height: 48px !important; }
.mobile-profile-info { flex: 1; min-width: 0; }
.mobile-profile-name { font-size: 15px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-profile-zeffyrs { font-size: 13px; font-weight: 700; color: #fbbf24; margin-top: 2px; }
.mobile-profile-btn { display: block; width: 100%; text-align: center; margin-top: 8px; padding: 8px; background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; }
.mobile-guest { display: flex; gap: 8px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }

.mobile-menu-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mobile-nav-link { display: flex; align-items: center; padding: 12px 14px; border-radius: 10px; color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; transition: background .15s; }
.mobile-nav-link:hover { background: rgba(139, 92, 246, 0.2); }
.mobile-nav-admin { color: #c4b5fd; }
.mobile-nav-logout { color: #fca5a5; }

/* 🔥 МОБИЛЬНАЯ АДАПТАЦИЯ */
@media (max-width: 960px) {
    .nav-desktop { display: none !important; }
    .account-name { display: none; }
    .account-chip { padding: 4px; }
    
    /* Прижимаем всё влево */
    .site-header { 
        justify-content: flex-start !important; 
        gap: 15px !important; 
        padding: 0 15px !important;
    }
    .header-right { margin-left: 0 !important; gap: 10px !important; }
    
    .nav-toggle { display: flex !important; }
    .logo-text { display: inline !important; font-size: 16px; }
}