/* === Общие стили === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0e1621;
    color: #e0e0e0;
    transition: background-color 0.3s, color 0.3s;
    overflow: hidden;
}

/* === Темы оформления === */
body.theme-dark {
    background-color: #0e1621;
    color: #e0e0e0;
}

body.theme-light {
    background-color: #f0f2f5;
    color: #2c3e50;
}

body.theme-light .chats-sidebar,
body.theme-light .right-panel,
body.theme-light .chat-header,
body.theme-light .message-input-area,
body.theme-light .modal-content,
body.theme-light .context-menu,
body.theme-light .profile-menu {
    background-color: #ffffff;
    border-color: #e0e0e0;
}

body.theme-light .search-bar,
body.theme-light .input-wrapper,
body.theme-light .profile-field .field-value,
body.theme-light .name-item {
    background-color: #f0f2f5;
    border-color: #e0e0e0;
}

body.theme-light .chat-item:hover {
    background-color: #e8f0fe;
}

body.theme-light .chat-item.active {
    background-color: #6ab2f2;
    color: white;
}

/* === Стили для страниц авторизации === */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2a3a, #0e1621);
    padding: 16px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    background: #17212b;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.logo {
    margin-bottom: 30px;
}

.logo i {
    font-size: 60px;
    color: #6ab2f2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.logo h1 {
    font-size: 32px;
    margin-top: 10px;
    letter-spacing: 1px;
    background: linear-gradient(45deg, #6ab2f2, #9b6be0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-form h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #f5f7fa;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #7f8c99;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px;
    background: #1f2c38;
    border: 2px solid transparent;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: #6ab2f2;
    background: #25323e;
    box-shadow: 0 0 0 3px rgba(106, 178, 242, 0.1);
}

.input-group input.error {
    border-color: #ff6b6b;
}

.input-group.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group.checkbox input {
    width: auto;
    margin-right: 8px;
}

.input-group.checkbox label {
    margin-bottom: 0;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, #2b5278, #3a6ca0);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(45deg, #3a6ca0, #4a7cb0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 178, 242, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary i {
    margin-right: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

.auth-link {
    margin-top: 24px;
    font-size: 14px;
    color: #7f8c99;
}

.auth-link a {
    color: #6ab2f2;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link a:hover {
    color: #9b6be0;
    text-decoration: underline;
}

/* === Стили для основного макета === */
.drek-app {
    width: 100vw;
    height: 100vh;
    max-width: none;
    background-color: #17212b;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    overflow: hidden;
    backdrop-filter: none;
}

.chats-sidebar {
    width: 320px;
    background-color: #17212b;
    border-right: 1px solid #1f2c38;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.chat-window {
    flex: 1;
    background-color: #0e1621;
    display: flex;
    flex-direction: column;
    position: relative;
}

.right-panel {
    width: 280px;
    background-color: #17212b;
    border-left: 1px solid #1f2c38;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    overflow-y: auto;
    z-index: 10;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

/* === Шапка сайдбара === */
.sidebar-header { 
    padding: 16px 16px 12px 16px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-bottom: 1px solid #1f2c38; 
}

.avatar-large { 
    width: 48px; 
    height: 48px; 
    background: linear-gradient(145deg, #2b7fba, #3fa3e0); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-size: 24px; 
    font-weight: 500; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.4); 
    cursor: pointer; 
    transition: all 0.2s; 
    position: relative;
}

.avatar-large:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(106, 178, 242, 0.3);
}

.avatar-large.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #34b93d;
    border: 2px solid #17212b;
    border-radius: 50%;
}

/* === Поиск === */
.search-bar { 
    flex: 1; 
    background-color: #1f2c38; 
    border-radius: 22px; 
    display: flex; 
    align-items: center; 
    padding: 8px 16px; 
    color: #7f8c99; 
    gap: 8px; 
    transition: 0.15s; 
    border: 1px solid transparent; 
}

.search-bar:focus-within { 
    border-color: #3e93c7; 
    background-color: #25323e; 
    box-shadow: 0 0 0 3px rgba(106, 178, 242, 0.1);
}

.search-bar i { 
    font-size: 16px; 
    color: #7f8c99; 
}

.search-bar input { 
    background: transparent; 
    border: none; 
    outline: none; 
    color: #f0f4f9; 
    font-size: 15px; 
    width: 100%; 
}

.search-bar input::placeholder { 
    color: #7f8c99; 
    font-weight: 400; 
}

/* === Вкладки === */
.tabs { 
    display: flex; 
    padding: 12px 16px 8px; 
    gap: 24px; 
    border-bottom: 1px solid #1f2c38; 
}

.tab { 
    font-size: 15px; 
    font-weight: 500; 
    color: #7f8c99; 
    cursor: pointer; 
    padding-bottom: 6px; 
    border-bottom: 2px solid transparent; 
    transition: 0.15s; 
}

.tab:hover {
    color: #6ab2f2;
}

.tab.active { 
    color: #6ab2f2; 
    border-bottom: 2px solid #6ab2f2; 
}

.tab i { 
    margin-right: 8px; 
    font-size: 14px; 
}

/* === Список чатов === */
.chats-list { 
    flex: 1; 
    overflow-y: auto; 
    padding: 8px 8px 8px 8px; 
    scrollbar-width: thin; 
    scrollbar-color: #2b3b48 #17212b; 
}

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

.chats-list::-webkit-scrollbar-thumb { 
    background: #2b3b48; 
    border-radius: 10px; 
}

.chats-list::-webkit-scrollbar-thumb:hover {
    background: #3e5a70;
}

.chat-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px 12px; 
    border-radius: 12px; 
    margin-bottom: 2px; 
    cursor: pointer; 
    transition: all 0.15s; 
    position: relative;
}

.chat-item:hover { 
    background-color: #202e3a; 
    transform: translateX(2px);
}

.chat-item.active { 
    background: linear-gradient(90deg, #2b5278, #1f3b54);
}

.chat-item.online .chat-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #34b93d;
    border: 2px solid #17212b;
    border-radius: 50%;
}

.chat-avatar { 
    width: 54px; 
    height: 54px; 
    border-radius: 50%; 
    background: linear-gradient(145deg, #2a3b4c, #1f2c38);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 600; 
    font-size: 20px; 
    color: white; 
    flex-shrink: 0; 
    position: relative; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.chat-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: baseline; 
}

.chat-name { 
    font-weight: 600; 
    font-size: 16px; 
    color: #f5f7fa; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.chat-time { 
    font-size: 12px; 
    color: #6e7b8a; 
    margin-left: 8px; 
    white-space: nowrap; 
}

.last-msg { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    color: #8696a6; 
    font-size: 14px; 
    margin-top: 4px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 180px; 
}

.last-msg i { 
    font-size: 12px; 
    color: #5f7f9c; 
}

.unread-badge { 
    background-color: #6ab2f2; 
    color: #17212b; 
    font-weight: 700; 
    font-size: 12px; 
    padding: 2px 8px; 
    border-radius: 20px; 
    min-width: 24px; 
    text-align: center; 
    margin-left: 8px;
}

/* === Шапка чата === */
.chat-header { 
    padding: 12px 20px; 
    background-color: #17212b; 
    border-bottom: 1px solid #1f2c38; 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    color: white; 
}

.header-avatar { 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    background: linear-gradient(145deg, #2a6b9c, #1f4b72);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 18px; 
    font-weight: 600; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-info { 
    flex: 1; 
}

.header-title { 
    font-weight: 600; 
    font-size: 17px; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.verified-icon { 
    color: #3e93c7; 
    font-size: 14px; 
}

.header-status { 
    font-size: 13px; 
    color: #7f8c99; 
}

.header-actions { 
    display: flex; 
    gap: 22px; 
    color: #7f8c99; 
    font-size: 20px; 
}

.header-actions i { 
    cursor: pointer; 
    transition: all 0.1s; 
}

.header-actions i:hover { 
    color: #6ab2f2; 
    transform: scale(1.1);
}

/* === Область сообщений === */
.messages-area { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px 24px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    background-image: radial-gradient(circle at 25% 40%, #1d2a35 0%, #0e1621 90%); 
    scrollbar-width: thin; 
    scrollbar-color: #2b3b48 #0e1621; 
}

.messages-area::-webkit-scrollbar { 
    width: 5px; 
}

.messages-area::-webkit-scrollbar-thumb { 
    background: #2b3b48; 
    border-radius: 10px; 
}

.message-date { 
    text-align: center; 
    font-size: 12px; 
    color: #6e7b8a; 
    margin: 12px 0 6px; 
    background: rgba(0,0,0,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    align-self: center;
}

.message { 
    display: flex; 
    max-width: 70%; 
    animation: slideIn 0.2s ease;
}

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

.message.incoming { 
    align-self: flex-start; 
}

.message.outgoing { 
    align-self: flex-end; 
}

.bubble { 
    padding: 10px 16px; 
    border-radius: 20px; 
    background-color: #17212b; 
    color: #f0f4f9; 
    box-shadow: 0 2px 3px rgba(0,0,0,0.3); 
    font-size: 15px; 
    line-height: 1.4; 
    word-wrap: break-word; 
    max-width: 100%; 
    position: relative;
}

.outgoing .bubble { 
    background: linear-gradient(145deg, #2b5278, #1f3b54);
    border-bottom-right-radius: 4px; 
}

.incoming .bubble { 
    background: linear-gradient(145deg, #202e3a, #17212b);
    border-bottom-left-radius: 4px; 
}

.message-meta { 
    display: flex; 
    align-items: center; 
    justify-content: flex-end; 
    gap: 5px; 
    margin-top: 4px; 
    font-size: 11px; 
    color: #9aa9b9; 
}

.outgoing .message-meta { 
    color: #aac7e3; 
}

.message-meta i { 
    font-size: 12px; 
}

.message-meta .status-sent {
    color: #7f8c99;
}

.message-meta .status-read {
    color: #6ab2f2;
}

.message-meta .status-read-all {
    color: #34b93d;
}

.edited-badge {
    font-size: 10px;
    color: #6e7b8a;
    font-style: italic;
}

.forwarded-badge {
    font-size: 11px;
    color: #6ab2f2;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reply-preview {
    background: rgba(0,0,0,0.2);
    border-left: 3px solid #6ab2f2;
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 13px;
}

.reply-sender {
    color: #6ab2f2;
    font-weight: 600;
    margin-bottom: 2px;
}

.reply-text {
    color: #9aa9b9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.attachment-link {
    display: inline-block;
    background: rgba(106, 178, 242, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    color: #6ab2f2;
    text-decoration: none;
    margin-top: 4px;
    font-size: 13px;
}

.attachment-link:hover {
    background: rgba(106, 178, 242, 0.2);
}

/* === Индикатор печатания === */
.typing-indicator { 
    padding: 8px 20px; 
    color: #6ab2f2; 
    font-size: 14px; 
    background: rgba(0,0,0,0.1); 
    border-top: 1px solid #1f2c38; 
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #6ab2f2;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* === Поле ввода сообщения === */
.message-input-area { 
    background-color: #17212b; 
    padding: 16px 20px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-top: 1px solid #1f2c38; 
}

.attach-btn { 
    color: #7f8c99; 
    font-size: 24px; 
    cursor: pointer; 
    transition: all 0.15s; 
}

.attach-btn:hover { 
    color: #6ab2f2; 
    transform: scale(1.1);
}

.input-wrapper { 
    flex: 1; 
    background-color: #1f2c38; 
    border-radius: 24px; 
    display: flex; 
    align-items: center; 
    padding: 8px 18px; 
    border: 1px solid transparent; 
    transition: all 0.2s;
}

.input-wrapper:focus-within { 
    border-color: #3e93c7; 
    background-color: #25323e; 
    box-shadow: 0 0 0 3px rgba(106, 178, 242, 0.1);
}

.input-wrapper input { 
    background: transparent; 
    border: none; 
    outline: none; 
    color: white; 
    font-size: 15px; 
    width: 100%; 
}

.input-wrapper input::placeholder { 
    color: #7f8c99; 
}

.emoji-btn, .mic-btn { 
    color: #7f8c99; 
    font-size: 20px; 
    cursor: pointer; 
    margin-left: 12px; 
    transition: all 0.15s;
}

.emoji-btn:hover, .mic-btn:hover {
    color: #6ab2f2;
    transform: scale(1.1);
}

.mic-btn { 
    color: #6ab2f2; 
}

/* === Правая панель профиля === */
.profile-pic-big { 
    width: 110px; 
    height: 110px; 
    border-radius: 50%; 
    background: linear-gradient(145deg, #3a6f92, #2b5b84); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 48px; 
    font-weight: 500; 
    color: white; 
    margin-top: 10px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.5); 
    border: 3px solid #2b5278;
}

.profile-name { 
    font-size: 20px; 
    font-weight: 600; 
    color: white; 
    text-align: center;
}

.profile-status { 
    font-size: 14px; 
    color: #6ab2f2; 
    background: #1f3140; 
    padding: 4px 14px; 
    border-radius: 30px; 
    display: inline-block;
}

.info-section { 
    width: 100%; 
    margin-top: 8px; 
    border-top: 1px solid #1f2c38; 
    padding-top: 16px; 
}

.info-row { 
    display: flex; 
    align-items: center; 
    gap: 14px; 
    color: #8c9aa8; 
    font-size: 14px; 
    padding: 8px 0; 
    transition: background 0.2s;
}

.info-row:hover {
    background: rgba(106, 178, 242, 0.1);
    border-radius: 8px;
    padding-left: 8px;
}

.info-row i { 
    width: 24px; 
    font-size: 18px; 
    color: #5f8ab0; 
}

.shared-media { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 6px; 
    margin-top: 12px; 
}

.media-thumb { 
    background: #1f2c38; 
    aspect-ratio: 1/1; 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #3e7fb3; 
    font-size: 24px; 
    transition: all 0.2s;
    cursor: pointer;
}

.media-thumb:hover {
    transform: scale(1.05);
    background: #2a3b4c;
}

.company-badge { 
    font-size: 12px; 
    color: #6b7f92; 
    margin-top: auto; 
    text-align: center; 
    padding: 16px 0 8px; 
}

.company-badge i { 
    color: #3e93c7; 
}

/* === Меню профиля (оверлей) === */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.overlay.active {
    visibility: visible;
    opacity: 1;
}

.profile-menu {
    width: 420px;
    max-width: 96%;
    background-color: #17212b;
    border-radius: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    color: #f5f7fa;
    border: 1px solid #2b3b48;
    animation: fadeScale 0.3s ease;
    position: relative;
}

@keyframes fadeScale {
    from { opacity: 0.7; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #1f2c38;
    color: #b5c6d6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.15s;
    border: 1px solid #324c60;
    z-index: 10;
}

.close-btn:hover {
    background: #2a3b4c;
    transform: rotate(90deg);
}

.profile-header {
    padding: 24px 24px 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #1f2c38;
    background: radial-gradient(circle at 30% 20%, #253746, #131e26);
    position: relative;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    background: linear-gradient(145deg, #e06b6b, #b24545);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 500;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    border: 3px solid #3e637e;
    transition: transform 0.2s;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1f3140;
    padding: 8px 20px;
    border-radius: 40px;
    margin-bottom: 12px;
    font-size: 15px;
    border: 1px solid #2d4b64;
    flex-wrap: wrap;
    justify-content: center;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background-color: #34b93d;
    border-radius: 50%;
    box-shadow: 0 0 8px #34b93d;
    animation: pulse 2s infinite;
}

.profile-age-info {
    font-size: 15px;
    color: #a0b3c6;
    background: #0f1a24;
    padding: 6px 16px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #2b4a62;
    margin-top: 8px;
}

.profile-section {
    padding: 16px 24px;
    border-bottom: 1px solid #1f2c38;
}

.name-row {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.name-item {
    flex: 1;
    background: #1f2c38;
    border-radius: 18px;
    padding: 12px 16px;
    transition: background 0.2s;
}

.name-item:hover {
    background: #2a3b4c;
}

.name-item-label {
    font-size: 12px;
    color: #7f8c99;
    margin-bottom: 6px;
}

.name-item-value {
    font-weight: 600;
    font-size: 17px;
    color: white;
}

.profile-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 12px;
}

.profile-field:hover {
    background: rgba(106, 178, 242, 0.1);
    padding-left: 8px;
    padding-right: 8px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #96a7b8;
    font-size: 15px;
}

.field-label i {
    width: 22px;
    color: #6ab2f2;
    font-size: 18px;
}

.field-value {
    font-weight: 500;
    color: white;
    background: #1f2c38;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.field-value:hover {
    background: #2a3b4c;
}

.edit-icon {
    font-size: 11px;
    color: #7f8c99;
    opacity: 0.7;
}

.profile-field:hover .edit-icon {
    opacity: 1;
}

.edit-field {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.edit-field input {
    background: #1f2c38;
    border: 1px solid #324c60;
    border-radius: 12px;
    padding: 10px 14px;
    color: white;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
}

.edit-field input:focus {
    outline: none;
    border-color: #6ab2f2;
    background: #25323e;
    box-shadow: 0 0 0 3px rgba(106, 178, 242, 0.1);
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.edit-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.edit-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-save {
    background: linear-gradient(45deg, #6ab2f2, #4a8ac0);
    color: white;
}

.btn-cancel {
    background: #324c60;
    color: white;
}

.btn-save:hover {
    background: linear-gradient(45deg, #7bc2ff, #5b9ad0);
}

.btn-cancel:hover {
    background: #3e5a70;
}

.encrypted-badge {
    padding: 14px 24px 18px;
    font-size: 12px;
    color: #566d81;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid #1f2c38;
}

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    padding: 5px 0;
    background: rgba(255,107,107,0.1);
    border-radius: 8px;
    text-align: center;
}

.success-message {
    color: #34b93d;
    font-size: 13px;
    padding: 5px 0;
    background: rgba(52,185,61,0.1);
    border-radius: 8px;
    text-align: center;
}

/* === Результаты поиска === */
.search-results {
    position: absolute;
    top: 80px;
    left: 16px;
    right: 16px;
    background: #1f2c38;
    border-radius: 12px;
    z-index: 150;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border: 1px solid #324c60;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #2a3b4c;
}

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

.search-result-item:hover {
    background: #2a3b4c;
    padding-left: 16px;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 16px;
}

.search-info {
    flex: 1;
}

.search-name {
    font-weight: 600;
    color: white;
    font-size: 15px;
}

.search-username {
    font-size: 12px;
    color: #7f8c99;
}

/* === Контекстное меню === */
.context-menu {
    position: fixed;
    background: #1f2c38;
    border-radius: 12px;
    padding: 8px 0;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 180px;
    border: 1px solid #324c60;
    animation: fadeIn 0.1s ease;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #e0e0e0;
}

.context-menu-item:hover {
    background: #2a3b4c;
}

/* === Модальные окна === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #17212b;
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeScale 0.3s ease;
    border: 1px solid #324c60;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: white;
    font-size: 20px;
}

.modal-content .input-group {
    margin-bottom: 16px;
}

/* === Уведомления === */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: #17212b;
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid;
    min-width: 300px;
    border: 1px solid #324c60;
}

.notification.show {
    transform: translateX(0);
}

.notification-success { border-left-color: #34b93d; }
.notification-error { border-left-color: #ff6b6b; }
.notification-info { border-left-color: #6ab2f2; }

.notification-content {
    flex: 1;
    font-size: 14px;
}

.notification-close {
    background: none;
    border: none;
    color: #8696a6;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
    transition: color 0.2s;
}

.notification-close:hover {
    color: white;
}

/* === Тултипы === */
.custom-tooltip {
    position: fixed;
    background: #17212b;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #324c60;
    white-space: nowrap;
}

.custom-tooltip.show {
    opacity: 1;
}

/* === Состояния загрузки === */
.loading-chats, 
.no-chats, 
.no-chat-selected, 
.no-messages, 
.error {
    text-align: center;
    color: #6e7b8a;
    padding: 30px;
    margin-top: 20px;
    font-size: 15px;
}

.loading-chats i,
.no-chats i,
.no-chat-selected i,
.no-messages i,
.error i {
    font-size: 40px;
    margin-bottom: 12px;
    color: #6ab2f2;
}

.error {
    color: #ff6b6b;
}

/* === Адаптивность для планшетов === */
@media (max-width: 1024px) {
    .chats-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        z-index: 100;
        width: 320px;
    }

    .chats-sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }

    .right-panel {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        transform: translateX(100%);
        z-index: 100;
        width: 280px;
    }

    .right-panel.active {
        transform: translateX(0);
        box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    }

    .toggle-sidebar,
    #toggle-profile {
        display: block !important;
        font-size: 20px;
        color: #7f8c99;
        cursor: pointer;
        margin-right: 12px;
        transition: color 0.2s;
    }

    .toggle-sidebar:hover,
    #toggle-profile:hover {
        color: #6ab2f2;
    }

    .message {
        max-width: 85%;
    }

    .profile-menu {
        width: 90%;
    }

    .name-row {
        flex-direction: column;
    }
}

/* === Адаптивность для мобильных телефонов === */
@media (max-width: 768px) {
    .chats-sidebar,
    .right-panel {
        width: 100%;
    }

    .chat-header {
        padding: 10px 12px;
    }

    .header-actions {
        gap: 15px;
    }

    .messages-area {
        padding: 12px;
    }

    .message {
        max-width: 90%;
    }

    .bubble {
        font-size: 15px;
        padding: 8px 14px;
    }

    .message-input-area {
        padding: 10px 12px;
    }

    .profile-menu {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .profile-header {
        padding: 16px;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }

    .profile-section {
        padding: 12px 16px;
    }

    .name-row {
        flex-direction: column;
    }

    .edit-actions {
        flex-direction: column;
    }

    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .notification {
        min-width: auto;
        width: 100%;
    }

    .auth-container {
        padding: 24px;
    }

    .logo i {
        font-size: 48px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .search-results {
        top: 70px;
        left: 8px;
        right: 8px;
    }
}

/* === Адаптивность для очень маленьких экранов === */
@media (max-width: 480px) {
    .chat-header {
        gap: 8px;
    }

    .header-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .header-title {
        font-size: 15px;
    }

    .header-status {
        font-size: 11px;
    }

    .header-actions {
        gap: 12px;
        font-size: 16px;
    }

    .toggle-sidebar,
    #toggle-profile {
        font-size: 18px;
    }

    .message-input-area {
        gap: 8px;
    }

    .attach-btn,
    .emoji-btn,
    .mic-btn {
        font-size: 20px;
    }

    .input-wrapper {
        padding: 6px 12px;
    }

    .input-wrapper input {
        font-size: 14px;
    }

    .sidebar-header {
        padding: 12px;
    }

    .avatar-large {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .chat-item {
        padding: 8px 10px;
    }

    .chat-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .chat-name {
        font-size: 15px;
    }

    .last-msg {
        font-size: 13px;
    }
}

/* Стили для поиска */
.search-results {
    position: absolute;
    top: 80px;
    left: 16px;
    right: 16px;
    background: #17212b;
    border-radius: 12px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border: 1px solid #2b3b48;
    animation: slideDown 0.2s ease;
}

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

.search-result-item {
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #1f2c38;
}

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

.search-result-item:hover {
    background: #1f2c38;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 18px;
    position: relative;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.online-badge-small {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #34b93d;
    border: 2px solid #17212b;
    border-radius: 50%;
}

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

.search-name {
    font-weight: 600;
    color: white;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-icon-small {
    color: #6ab2f2;
    font-size: 12px;
}

.search-username {
    font-size: 13px;
    color: #7f8c99;
    margin-top: 2px;
}

.contact-badge {
    display: inline-block;
    background: #1f2c38;
    color: #6ab2f2;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.search-loading,
.search-no-results,
.search-error {
    padding: 20px;
    text-align: center;
    color: #7f8c99;
}

.search-error {
    color: #ff6b6b;
}

.search-loading i {
    margin-right: 8px;
    color: #6ab2f2;
}