/* ========== ТЕМЫ ========== */
:root {
    --bg-gradient-start: #F8F5F0;
    --bg-gradient-end: #E8E0D5;
    --app-bg-start: #FEFCF8;
    --app-bg-end: #F8F5F0;
    --card-bg: rgba(255, 255, 255, 0.75);
    --text-primary: #2D3E40;
    --text-secondary: #6AAB9E;
    --text-muted: #B2A89B;
    --border-light: rgba(255, 255, 255, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --icon-gradient-start: #A7C7B0;
    --icon-gradient-end: #8BBE8A;
    --bottom-bar-bg: rgba(255, 255, 255, 0.6);
    --button-bg: #075E54;
    --badge-bg: #E76F51;
    --avatar-bg: #F4A261;
    --delete-bg: #c0392b;
    --call-bg: #F4A261;
    --friend-bg: #E76F51;
    --my-message-bg: #A7C7B0;
    --other-message-bg: rgba(255, 255, 255, 0.9);
}

body.dark {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --app-bg-start: #1e1e2e;
    --app-bg-end: #1a1a2e;
    --card-bg: rgba(30, 30, 46, 0.85);
    --text-primary: #E9EDEF;
    --text-secondary: #8BBE8A;
    --text-muted: #6c6c7a;
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --icon-gradient-start: #2d5a4a;
    --icon-gradient-end: #1e3a2e;
    --bottom-bar-bg: rgba(30, 30, 46, 0.8);
    --button-bg: #0a6b5c;
    --badge-bg: #c0392b;
    --avatar-bg: #c97b3e;
    --delete-bg: #a33b2e;
    --call-bg: #c97b3e;
    --friend-bg: #c0392b;
    --my-message-bg: #2d5a4a;
    --other-message-bg: rgba(30, 30, 46, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    background: linear-gradient(145deg, var(--app-bg-start) 0%, var(--app-bg-end) 100%);
    display: flex;
    flex-direction: column;
    height: var(--app-height, 100dvh);
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* ========== ВЕРХНЯЯ ПАНЕЛЬ ========== */
.top-bar {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
    z-index: 100;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.back-btn:active {
    background: rgba(0,0,0,0.05);
}

.app-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    text-align: center;
}

.top-bar-placeholder {
    width: 40px;
}

/* ========== АВАТАР И НАСТРОЙКИ ========== */
.avatar-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wrapper {
    cursor: pointer;
    transition: transform 0.2s;
}

.avatar-wrapper:active {
    transform: scale(0.95);
}

.avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--avatar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-card .avatar-img {
    width: 100px;
    height: 100px;
}

.avatar-left {
    display: flex;
    align-items: center;
}

/* ========== СЕТКА ИКОНОК ========== */
.icons-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding: 40px 24px;
    align-content: start;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    min-height: 0;
}

.icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    animation: fadeInUp 0.5s ease-out;
}

.icon-card:active {
    transform: scale(0.96);
}

.icon-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.15), 0 4px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    color: white;
    position: relative;
}

.icon-circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    box-shadow: 0 0 0 0 rgba(244, 162, 97, 0.4);
    transition: box-shadow 0.3s ease;
}

.icon-card:active .icon-circle::after {
    box-shadow: 0 0 0 12px rgba(244, 162, 97, 0.2);
}

.icon-label {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
    letter-spacing: 0.3px;
}

/* ========== НИЖНЯЯ ПАНЕЛЬ ========== */
.bottom-bar {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    margin-top: auto;
}

.version {
    font-size: 11px;
    color: var(--text-secondary);
}

.refresh-btn {
    background: none;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.refresh-btn:active {
    opacity: 0.8;
}

/* ========== БЕЙДЖИ ========== */
.chat-badge, .unread-badge {
    background: var(--badge-bg);
    color: white;
    border-radius: 30px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: bold;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========== СТИЛИ ДЛЯ CHAT.HTML (СПИСОК ЧАТОВ) ========== */
.chats-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.chat-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    position: relative;
    flex-wrap: wrap;
}

.pin-btn, .delete-chat {
    flex-shrink: 0;
}

.chat-item:active {
    transform: scale(0.98);
    background: var(--card-bg);
}

.chat-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.chat-avatar-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.chat-last {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pin-btn {
    background: rgba(255, 255, 255, 0.5);
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.pin-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.8);
}

.delete-chat {
    background: var(--delete-bg);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    margin-left: 8px;
}

.delete-chat:active {
    transform: scale(0.95);
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 16px 0 8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.create-room-btn {
    width: calc(100% - 32px);
    margin: 0 16px 16px 16px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    backdrop-filter: blur(10px);
    border: none;
    padding: 14px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.create-room-btn:active {
    transform: scale(0.97);
}

/* ========== НИЖНЯЯ НАВИГАЦИЯ ========== */
.bottom-nav {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 30px;
    background: transparent;
}

.nav-item:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.05);
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-item.active .nav-icon,
.nav-item.active .nav-label {
    color: var(--button-bg);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ========== СТИЛИ ДЛЯ SEARCH.HTML ========== */
.search-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
}

.search-box {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 12px 20px;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border: none;
    border-radius: 30px;
    padding: 8px 20px;
    cursor: pointer;
    font-weight: 500;
    color: white;
    transition: all 0.2s;
}

.search-box button:active {
    transform: scale(0.95);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.user-card:active {
    transform: scale(0.98);
    background: var(--card-bg);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
}

.user-info {
    flex: 1;
    cursor: pointer;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.user-phone {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(4px);
    border-radius: 20px;
}

.action-buttons {
    flex-wrap: wrap;
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.action-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.action-btn:active {
    background: rgba(0,0,0,0.05);
}

.action-btn.message {
    border-color: var(--button-bg);
    color: var(--button-bg);
}

.action-btn.call {
    border-color: var(--call-bg);
    color: var(--call-bg);
}

.action-btn.friend {
    border-color: var(--friend-bg);
    color: var(--friend-bg);
}
/* ========== СТИЛИ ДЛЯ PROFILE.HTML ========== */
.profile-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    min-height: 0;
}

.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    text-align: center;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
    color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.profile-role {
    display: inline-block;
    background: rgba(107, 171, 158, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.profile-info {
    text-align: left;
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.admin-btn, .request-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.request-btn {
    background: var(--badge-bg);
}

.logout-btn {
    width: 100%;
    background: var(--delete-bg);
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 12px;
}

.admin-btn:active, .request-btn:active, .logout-btn:active {
    transform: scale(0.98);
}

.request-form {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    text-align: left;
}

.request-form input, .request-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    box-sizing: border-box;
    background: var(--card-bg);
    color: var(--text-primary);
}

.request-form button {
    background: var(--button-bg);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.request-status {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}

.status-pending {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.status-approved {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-rejected {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.close-form {
    background: var(--text-muted) !important;
    margin-top: 8px;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.required-star {
    color: #f44336;
}

.inline-row {
    display: flex;
    gap: 12px;
}

.inline-row .form-row {
    flex: 1;
}

/* ========== СТИЛИ ДЛЯ ADMIN.HTML ========== */
.tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tab.active {
    color: var(--button-bg);
    border-bottom-color: var(--button-bg);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
}

.tab-content.active {
    display: block;
}

#usersContainer .user-card {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    margin-bottom: 12px;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.user-role {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.role-guest { background: #E8E0D5; color: #B2A89B; }
.role-resident { background: #A7C7B0; color: #2D3E40; }
.role-moderator { background: #F4A261; color: white; }
.role-admin { background: #E76F51; color: white; }

.user-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    background: #F0EDE8;
    border: none;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.action-btn.block {
    background: #E76F51;
    color: white;
}

.action-btn.delete {
    background: #c0392b;
    color: white;
}

.request-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid #ff9800;
}

.request-card.approved { border-left-color: #4caf50; }
.request-card.rejected { border-left-color: #f44336; }

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.request-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.request-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending { background: #ff9800; color: white; }
.status-approved { background: #4caf50; color: white; }
.status-rejected { background: #f44336; color: white; }

.request-details {
    margin: 12px 0;
    padding: 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
}

.detail-row {
    margin: 6px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.detail-label {
    font-weight: bold;
    width: 120px;
    display: inline-block;
    color: var(--text-secondary);
}

.request-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-approve { background: #4caf50; color: white; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.btn-reject { background: #f44336; color: white; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.btn-chat { background: #2196f3; color: white; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; }

.reject-reason-input {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: none;
    background: var(--card-bg);
}

/* ========== СТИЛИ ДЛЯ SETTINGS.HTML ========== */
.settings-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.settings-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.settings-card:active {
    transform: scale(0.98);
    background: var(--card-bg);
}

.settings-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: white;
    flex-shrink: 0;
}

.settings-info {
    flex: 1;
}

.settings-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.toggle-switch {
    width: 50px;
    height: 28px;
    background: #ddd;
    border-radius: 28px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.toggle-switch.active {
    background: #4caf50;
}

.toggle-switch:after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active:after {
    left: 23px;
}

.version-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.version-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.version-number {
    font-weight: 600;
    color: var(--text-primary);
}

.update-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    backdrop-filter: blur(10px);
    border: none;
    padding: 12px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.update-btn:active {
    transform: scale(0.98);
}

.changelog {
    margin-top: 16px;
    background: rgba(0,0,0,0.05);
    backdrop-filter: blur(4px);
    border-radius: 16px;
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
}

.changelog h4 {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.changelog ul {
    margin-left: 20px;
}

.changelog li {
    margin: 6px 0;
}

.update-message {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.coming-soon {
    color: var(--text-muted);
    font-size: 12px;
}

/* ========== СТИЛИ ДЛЯ ЗАГЛУШЕК (NEIGHBORS, CALLS, BOARD, NEWS, CALENDAR, MAP, CONTACT) ========== */
.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    min-height: 0;
}

.message-box {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    max-width: 300px;
    width: 100%;
}

.message-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.message-text {
    font-size: 18px;
    color: var(--text-primary);
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 8px;
}

.message-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

.search-btn {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    backdrop-filter: blur(10px);
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-btn:active {
    transform: scale(0.96);
}

.contact-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    transition: all 0.2s;
}

.contact-link:active {
    transform: scale(0.96);
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== АДАПТАЦИЯ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ ========== */
@media (max-width: 480px) {
    .icon-circle {
        width: 85px;
        height: 85px;
        font-size: 42px;
        border-radius: 20px;
    }
    
    .icons-grid {
        gap: 24px;
        padding: 32px 20px;
    }
    
    .icon-label {
        font-size: 13px;
    }
    
    .avatar-img {
        width: 38px;
        height: 38px;
    }
    
    .settings-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .top-bar {
        padding: 12px 16px;
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .profile-name {
        font-size: 20px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-messages {
        padding-top: calc(60px + env(safe-area-inset-top));
    }
}

/* ========== SAFE AREA ДЛЯ IPHONE ========== */
@supports (padding-top: env(safe-area-inset-top)) {
    .top-bar {
        padding-top: calc(16px + env(safe-area-inset-top));
    }
    .bottom-nav {
        /* padding-bottom: calc(8px + env(safe-area-inset-bottom)); */
    }
}

/* ========== СТИЛИ ДЛЯ АВТОРИЗАЦИИ (LOGIN, REGISTER) ========== */
.auth-container {
    flex: 0 0 auto;
    padding: 32px 24px;
    margin-bottom: 20px;
}

.auth-form {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    padding: 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    font-size: 16px;
    outline: none;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus {
    border-color: var(--icon-gradient-start);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.error-message {
    color: var(--badge-bg);
    font-size: 14px;
    margin-top: 8px;
    display: none;
    text-align: center;
}

.success-message {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
    display: none;
    text-align: center;
}

/* ========== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ГЛАВНОЙ И ПРОФИЛЯ ========== */
.auth-panel {
    padding: 12px 20px;
    background: rgba(167,199,176,0.2);
    text-align: center;
    flex-shrink: 0;
}

.auth-panel a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.header-icon-btn {
    background: none;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    margin-left: 8px;
}

.header-icon-btn:active {
    transform: scale(0.92);
    background: rgba(0,0,0,0.05);
}

.avatar-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.avatar-edit-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.edit-btn {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: all 0.2s;
}

.edit-btn:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
}

.modal button {
    width: 100%;
    padding: 12px;
    background: var(--button-bg);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.role-icon {
    font-size: 24px;
    margin-left: 8px;
    display: inline-block;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    text-align: center;
    line-height: 1;
}

/* ========== СТИЛИ ДЛЯ СТРАНИЦЫ "СОСЕДИ" ========== */
.friend-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    width: 100%;
    box-sizing: border-box;
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.friend-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friend-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.friend-role {
    font-size: 13px;
    color: var(--text-secondary);
}

.friend-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.action-icon {
    background: rgba(0,0,0,0.05);
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.action-icon:active {
    background: rgba(0,0,0,0.1);
}

.accept-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.reject-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

/* ========== СТИЛИ ДЛЯ ЧАТА (ROOM.HTML) ========== */
.chat-header {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.chat-avatar {
    flex-shrink: 0;
    cursor: pointer;
}

.chat-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--icon-gradient-start);
}

.chat-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.chat-info-header {
    flex: 1;
    min-width: 0;
}

.chat-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-status {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:active {
    background: rgba(0,0,0,0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    padding-top: calc(60px + env(safe-area-inset-top));
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.message {
    display: flex;
    max-width: 80%;
    align-items: flex-start;
}

.message-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-other {
    align-self: flex-start;
    flex-direction: row;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 18px;
}

.message-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.message-own .message-avatar {
    display: none;
}

.message-bubble-wrapper {
    max-width: 100%;
}

.message-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 3px;
    margin-left: 8px;
    white-space: nowrap;
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.4;
}

.message-own .message-bubble {
    background: var(--my-message-bg);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.message-other .message-bubble {
    background: var(--other-message-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.message-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    margin-left: 8px;
    display: flex;
    gap: 4px;
}

.message-own .message-time {
    justify-content: flex-end;
    margin-right: 8px;
}

.message-unread {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0% { background: rgba(231, 111, 81, 0.3); }
    100% { background: transparent; }
}

.date-divider {
    text-align: center;
    margin: 12px 0;
}

.date-divider span {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    color: var(--text-muted);
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    border-top: 1px solid var(--border-light);
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

.attach-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.attach-btn:active {
    background: rgba(0,0,0,0.05);
}

.chat-input-area input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 30px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.voice-btn, .send-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.voice-btn:active, .send-btn:active {
    background: rgba(0,0,0,0.05);
}

.send-btn {
    color: var(--button-bg);
}

.hidden {
    display: none;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border-radius: 28px;
    width: 90%;
    max-width: 400px;
    height: 80vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    margin-bottom: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.modal-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    color: var(--text-primary);
}

.member-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.room-info-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
}

.room-info-label {
    color: var(--text-muted);
}

.room-info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.search-user-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}

.search-result-item:hover {
    background: rgba(0,0,0,0.05);
}

.copy-btn {
    background: var(--button-bg);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
}

.copy-btn:active {
    opacity: 0.9;
}

/* Адаптация для планшетов */
@media (min-width: 768px) {
    .app {
        max-width: 600px;
    }
    
    .message {
        max-width: 70%;
    }
}

/* Адаптация для чата на маленьких экранах */
@media (max-width: 480px) {
    .chat-messages {
        padding-top: calc(60px + env(safe-area-inset-top));
    }
    
    .modal-container {
        width: 95%;
        height: 85vh;
    }
}



/* Красим белую полосу снизу в цвет нижней панели */
body {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
    background-attachment: fixed;
}

.app {
    background: linear-gradient(145deg, var(--app-bg-start) 0%, var(--app-bg-end) 100%);
}


.chat-input-area input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

/* ===== ФИНАЛЬНЫЕ ПЛАТФОРМЕННЫЕ ФИКСЫ ===== */

/* iOS PWA — без изменений */
@supports (-webkit-touch-callout: none) {
    @media (display-mode: standalone) {
        .app {
            height: 100vh;
        }
    }
}


/* Блокировка резинового скролла */
.app {
    overscroll-behavior: none;
}

.chat-messages,
.chats-container,
.icons-grid,
.settings-container,
.profile-container,
.search-container,
.tab-content,
.modal-body-scroll,
.content {
    overscroll-behavior: contain;
}

/* ===== ФИКС ДЛЯ ANDROID PWA (ЧЕРЕЗ JS-КЛАСС) ===== */
body.android-pwa .bottom-nav,
body.android-pwa .bottom-bar,
body.android-pwa .chat-input-area {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ===== МЕНЮ ЧАТА (ТРИ ТОЧКИ) ===== */
.chat-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-menu-dropdown {
    background: var(--app-bg-start);
    border-radius: 20px;
    padding: 12px;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
}
.chat-menu-item {
    background: none;
    border: none;
    padding: 14px 16px;
    font-size: 16px;
    text-align: left;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-primary);
    width: 100%;
}
.chat-menu-item:active {
    background: rgba(0,0,0,0.05);
}

.unread-badge.muted {
    background: #9e9e9e;
}

/* ===== КНОПКИ НА СТРАНИЦЕ ПОЛЬЗОВАТЕЛЯ ===== */
.msg-btn, .call-btn, .friend-btn {
    padding: 12px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}
.msg-btn {
    background: linear-gradient(135deg, var(--icon-gradient-start) 0%, var(--icon-gradient-end) 100%);
}
.call-btn {
    background: var(--call-bg);
}
.friend-btn {
    background: var(--friend-bg);
}
.msg-btn:active, .call-btn:active, .friend-btn:active {
    transform: scale(0.98);
}

.online-dot {
    font-size: 10px;
    margin-left: 2px;
}

.message-own .msg-menu-btn {
    margin-top: 8px;
    align-self: flex-start !important;
}