/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--bg-menu);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--active-bg);
    color: var(--primary);
}

.nav-item i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background-color: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
}

/* Chat Area Styles */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--bg-primary);
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.message-input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 4rem;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    transition: all 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(123, 93, 231, 0.2);
}

.input-actions {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.input-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.input-action-btn:hover {
    color: var(--primary);
    background-color: var(--hover-bg);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--primary);
    background-color: var(--hover-bg);
}

/* Auth Button */
.auth-btn {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 93, 231, 0.3);
}

/* Logo */
.logo {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chat Model Selector */
.chat-model-selector {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-model-selector:hover {
    background-color: var(--hover-bg);
}

/* Form Controls */
.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:focus {
    background-color: var(--bg-input);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(123, 93, 231, 0.25);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

/* Стили для вкладок авторизации */
.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 12px 16px;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: none;
    border-bottom: 2px solid var(--primary);
}

.nav-tabs .nav-link:hover {
    color: var(--primary);
    border: none;
}

/* Dropdown для пользователя */
.dropdown-menu {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.dropdown-item {
    color: var(--text-primary);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--hover-bg);
    color: var(--primary);
}

.dropdown-header {
    color: var(--text-primary);
    font-weight: 600;
}

.dropdown-header.small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.5rem 1rem 0.25rem;
    font-weight: 500;
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.25rem 0;
}

/* Стили для блока преимуществ */
.benefits-card {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.benefits-card h6 {
    color: var(--text-primary) !important;
}

.benefits-card ul li {
    color: var(--text-secondary) !important;
}

/* Стили для dropdown пользователя */
.dropdown-menu {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary);
}

.dropdown-header {
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Стили для шага успешной регистрации */
.security-notice {
    border-left: 4px solid #dc3545;
}

.security-notice ol {
    padding-left: 1rem;
}

.security-notice li {
    margin-bottom: 0.5rem;
}

.security-notice a {
    text-decoration: none;
    font-weight: 500;
}

.security-notice a:hover {
    text-decoration: underline;
}

/* Анимация для иконки успеха */
.bi-check-circle-fill {
    animation: bounceIn 0.6s ease-in-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Стили для поля пароля */
.font-monospace {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Стили для аватара */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.avatar-premium {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #856404;
}

/* Выпадающее меню профиля */
.profile-dropdown {
    min-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
}

.profile-dropdown small {
    font-size: 0.75rem;
    line-height: 1.3;
}

.dropdown-header.small-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 0.5rem 1rem 0.25rem;
    margin-top: 0.5rem;
}

.dropdown-header.small-header:first-child {
    margin-top: 0;
}

/* Заголовок профиля */
.profile-header {
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.profile-info {
    flex: 1;
}

/* Подменю */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    display: block;
}

/* Стили для опций темы */
.theme-option {
    transition: all 0.2s ease;
}

.theme-option.active {
    background-color: var(--active-bg);
    color: var(--primary);
    font-weight: 500;
}

.theme-option:hover {
    background-color: var(--hover-bg);
    color: var(--primary);
}

.profile-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
}

.profile-dropdown .dropdown-header {
    padding: 0.75rem 1rem 0.25rem;
}

.profile-dropdown .dropdown-header.small-header {
    padding: 0.5rem 1rem 0.25rem;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

.dropdown-submenu .dropdown-toggle::after {
    border-top: 0.3em solid transparent;
    border-right: 0.3em solid;
    border-bottom: 0.3em solid transparent;
    border-left: 0;
    margin-top: 0.3em;
}

.dropdown-submenu:hover > .dropdown-menu {
    opacity: 1;
    transform: translateX(0);
}

.dropdown-menu .dropdown-menu {
    margin: 0;
    border: none;
}

[data-theme="light"] .dropdown-menu {
    background-color: #ffffff;
    color: #212529;
}

[data-theme="light"] .dropdown-item {
    color: #212529;
}

[data-theme="light"] .dropdown-item:hover {
    color: #7B5DE7;
    background-color: rgba(123, 93, 231, 0.05);
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1E1E1E;
    color: #E9ECEF;
}

[data-theme="dark"] .dropdown-item {
    color: #E9ECEF;
}

[data-theme="dark"] .dropdown-item:hover {
    color: #7B5DE7;
    background-color: rgba(123, 93, 231, 0.15);
}

.theme-option.active {
    background-color: var(--active-bg);
    color: var(--primary);
    font-weight: 500;
}

.theme-option.active::before {
    content: "✓";
    margin-right: 0.5rem;
    font-weight: bold;
}

.theme-option:hover {
    background-color: var(--hover-bg);
    color: var(--primary);
}

.dropdown-submenu > .dropdown-menu {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    display: block;
}

.dropdown-submenu:hover > .dropdown-menu {
    opacity: 1;
    transform: translateX(0);
}

.subscription-item {
    padding: 0.75rem 1rem;
}

.subscription-item:hover {
    background-color: var(--hover-bg);
}

.theme-selector {
    border-left: 2px solid var(--border-color);
    margin-left: 0.5rem;
}

.theme-selector .form-check {
    margin-bottom: 0.25rem;
}

.theme-selector .form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

.theme-selector .form-check-input {
    cursor: pointer;
}

.theme-selector .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Стили для модального окна подписок */
.subscription-plan {
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.subscription-plan:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.subscription-plan.active {
    border-color: var(--primary);
    background: var(--active-bg);
}

.subscription-plan .price {
    color: var(--primary);
}

.subscription-plan ul li {
    padding: 0.25rem 0;
}

/* Стили для секций профиля */
.profile-section {
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.section-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Статистика профиля */
.profile-stats {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Использование */
.usage-stats {
    margin-bottom: 1.5rem;
}

.usage-item {
    margin-bottom: 1.25rem;
}

.usage-item:last-child {
    margin-bottom: 0;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.usage-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.usage-percent {
    font-size: 0.8rem;
    font-weight: 600;
}

.usage-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress {
    height: 6px;
    background-color: var(--bg-secondary);
    border-radius: 3px;
}

/* Информация о подписке */
.subscription-info {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.subscription-header h6 {
    margin: 0;
    font-size: 0.95rem;
}

.badge-sm {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.subscription-features {
    space-y: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.feature-item:last-child {
    margin-bottom: 0;
}

/* Активность */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Статистика активности */
.activity-stats {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Аватар */
.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-color);
    background: var(--bg-secondary);
}

.avatar-large.premium {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #856404;
}

.badge-role {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}

/* Кнопки действий */
.profile-actions {
    margin-top: auto;
}

/* Стили для модального окна подписок */
.modal-content {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-header {
    border-bottom-color: var(--border-color);
    background-color: var(--bg-secondary);
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.btn-close {
    filter: var(--btn-close-filter, invert(0));
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

.subscription-plan {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
}

.subscription-plan:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.subscription-plan.active {
    border-color: var(--primary);
    background: var(--active-bg);
    position: relative;
}

.subscription-plan .card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

.subscription-plan .price {
    color: var(--primary);
}

.subscription-plan .price .h2 {
    font-weight: 700;
}

.subscription-plan ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.subscription-plan ul li:last-child {
    border-bottom: none;
}

.subscription-plan ul li span {
    color: var(--text-primary);
}

.subscription-plan ul li.text-muted span {
    color: var(--text-disabled) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #ffb300) !important;
    color: #212529 !important;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(123, 93, 231, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    border: none;
    color: #212529;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
    background: linear-gradient(135deg, #ffb300, #ffa000);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Alert в модальном окне */
.alert-info {
    background-color: var(--active-bg);
    border-color: var(--primary);
    color: var(--text-primary);
}

.alert-info .bi-info-circle-fill {
    color: var(--primary);
}

/* Стили для header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Кнопка улучшения плана */
.upgrade-btn {
    background: linear-gradient(135deg, #ffc107, #ffb300);
    border: none;
    color: #212529;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
    background: linear-gradient(135deg, #ffb300, #ffa000);
}

/* Кнопки-иконки */
.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    padding: 0;
}

.btn-icon:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.upgrade-btn, .btn-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Выпадающее меню сервисов */
.dropdown-menu .dropdown-header {
    font-weight: 600;
    color: var(--text-primary);
}

/* Аватар в header */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.avatar-premium {
    border-color: #ffc107;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #856404;
}

/* Стили для выбора моделей */
.model-selector-container {
    position: relative;
    display: inline-block;
}

.model-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    justify-content: space-between;
}

.model-selector-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
}

.model-selector-btn i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.model-selector-btn.active i {
    transform: rotate(180deg);
}

/* ВЫПАДАЮЩЕЕ МЕНЮ МОДЕЛЕЙ */
.model-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 70vh;
    overflow: hidden;
    width: 500px;
    min-width: 500px;
    display: block !important;
    pointer-events: none;
}

.model-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.model-dropdown-content {
    padding: 0;
    position: relative;
}

.model-dropdown-bottom {
    position: absolute;
    top: auto;
    bottom: calc(100% + 20px);
    left: 0;
    margin-top: 0;
    margin-bottom: 0;
    min-width: 500px;
    max-width: 600px;
    max-height: 70vh;
    overflow: hidden;
    z-index: 1100;
}

/* ВКЛАДКИ МОДЕЛЕЙ */
.model-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    padding: 0 16px;
}

.model-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    font-size: 14px;
}

.model-tab .bi {
    font-size: 16px;
}

.model-tab:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.model-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--active-bg);
}

.model-tab i {
    font-size: 14px;
}

.model-tab-content {
    padding: 12px;
    height: calc(70vh - 60px);
    overflow-y: auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* СЕТКА АВТОРОВ */
.authors-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: var(--bg-primary);
}

.author-item.expanded {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.author-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--bg-primary);
    transition: background-color 0.2s ease;
    user-select: none;
}

.author-header:hover {
    background: var(--hover-bg);
}

.author-logo {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

.author-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.author-item.expanded .author-arrow {
    transform: rotate(90deg);
    color: var(--primary);
}

.author-model-count {
    background: var(--text-secondary);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 12px;
}

.author-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.author-item:hover .author-arrow {
    transform: translateX(2px);
    color: var(--primary);
}

/* ВЫПАДАЮЩЕЕ МЕНЮ АВТОРОВ */
.author-models-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-secondary);
    border-top: 1px solid transparent;
}

.author-models-dropdown.show {
    max-height: 400px;
    border-top-color: var(--border-color);
    display: flex;
    flex-direction: column;
}

.author-item:hover .author-models-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.author-models-content {
    padding: 8px;
    overflow-y: auto;
    max-height: 350px;
    flex: 1;
}

.author-item:nth-last-child(-n+3) .author-models-dropdown {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 8px;
    transform: translateX(10px);
}

.author-item:nth-last-child(-n+3):hover .author-models-dropdown {
    transform: translateX(0);
}

.author-model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: var(--bg-primary);
    border: 1px solid transparent;
}

.author-model-option:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
}

.author-model-option.current {
    background: var(--active-bg);
    border-color: var(--primary);
    color: var(--text-primary);
}

.author-model-option.current .model-meta {
    color: var(--text-secondary);
}

.author-model-option .model-info {
    flex: 1;
    min-width: 0;
}

.model-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.model-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.badge-free {
    background: #064e3b;
    color: #c6f1dc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.model-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.model-context {
    font-weight: 500;
}

.model-dot {
    color: var(--text-disabled);
}

.model-author {
    opacity: 0.8;
}

.author-model-option .model-icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.author-model-option.current .model-icon {
    color: var(--primary);
}

.author-model-option .model-icon .bi-check-circle-fill {
    color: var(--primary);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.author-models-dropdown.show .author-model-option {
    animation: slideDown 0.2s ease forwards;
}

.author-models-dropdown.show .author-model-option:nth-child(1) { animation-delay: 0.05s; }
.author-models-dropdown.show .author-model-option:nth-child(2) { animation-delay: 0.1s; }
.author-models-dropdown.show .author-model-option:nth-child(3) { animation-delay: 0.15s; }
.author-models-dropdown.show .author-model-option:nth-child(4) { animation-delay: 0.2s; }

.author-model-option .model-icon i {
    font-size: 14px;
    color: var(--text-secondary);
}

.author-model-option.current .model-icon i {
    color: var(--primary);
}

.no-models {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.no-models i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-models .bi {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-disabled);
}

.no-models p {
    margin: 0;
    font-size: 14px;
}

/* СТИЛИ ДЛЯ ОСНОВНЫХ РАЗДЕЛОВ */
.nav-main-section {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-main-section:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 93, 231, 0.15);
}

.nav-main-section i:first-child {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.nav-main-section .arrow {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.nav-main-section:hover .arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* БЛОК ЧАТОВ */
.chats-section {
    margin-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 8px;
}

.chats-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chats-menu {
    position: relative;
}

.chats-menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chats-menu-toggle:hover {
    background: var(--hover-bg);
    color: var(--primary);
}

.chats-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.chats-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chats-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    gap: 8px;
}

.chats-dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--primary);
}

.chats-dropdown-item.text-danger {
    color: #dc3545;
}

.chats-dropdown-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* СПИСОК ЧАТОВ */
.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--hover-bg);
    border-color: var(--border-color);
}

.chat-item.active {
    background: var(--active-bg);
    border-color: var(--primary);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
    align-self: flex-start;
}

/* АНИМАЦИИ */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chats-dropdown.show {
    animation: slideIn 0.2s ease;
}

.model-dropdown.show,
.model-dropdown-bottom.show {
    animation: slideIn 0.2s ease;
}

/* СКРОЛЛБАРЫ */
.model-tab-content::-webkit-scrollbar {
    width: 6px;
}

.model-tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.model-tab-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.model-tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.author-models-dropdown::-webkit-scrollbar {
    width: 4px;
}

.author-models-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.author-models-dropdown::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
}

.chats-list::-webkit-scrollbar {
    width: 4px;
}

.chats-list::-webkit-scrollbar-track {
    background: transparent;
}

.chats-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 2px;
}

.chats-list::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.badge-premium {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Стили для пустого состояния с предложением обновить тариф */
.no-models-premium {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.no-models-premium i {
    font-size: 3rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
    display: block;
}

.no-models-premium p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-models-premium small {
    display: block;
    margin-bottom: 1rem;
}

.model-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.model-name {
    font-weight: 600;
    color: var(--text-primary);
}