* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #111b21;
    color: #e9edef;
    height: 100vh;
    overflow: hidden;
}

.whatsapp-container {
    display: flex;
    height: 100vh;
}

/* Левая панель */
.sidebar {
    width: 400px;
    background-color: #202c33;
    border-right: 1px solid #3b4a54;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: 60px;
    background-color: #2a3942;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.account-switcher {
    position: relative;
}

.account-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: inherit;
}

/* .account-button:hover {
    background-color: rgba(59, 74, 84, 0.7);
} */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.account-info {
    text-align: left;
}

.account-name {
    color: #2a3942;
    font-weight: 500;
    font-size: 14px;
}

.account-button:hover .account-name {
    color: #e9edef;
}

.account-status {
    color: #8696a0;
    font-size: 12px;
}

.chevron {
    color: #8696a0;
    transition: transform 0.2s;
}

.account-button.active .chevron {
    transform: rotate(180deg);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    background-color: #2a3942;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 1px solid #3b4a54;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s ease-out;
}

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

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid #3b4a54;
}

.dropdown-header h3 {
    color: #e9edef;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.dropdown-header p {
    color: #8696a0;
    font-size: 12px;
}

.accounts-list {
    max-height: 288px;
    overflow-y: auto;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: inherit;
}

.account-item:hover {
    background-color: #3b4a54;
}

.account-avatar-container {
    position: relative;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.active-indicator {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background-color: #00a884;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkmark {
    color: white;
    font-size: 12px;
}

.account-details {
    flex: 1;
}

.account-item-name {
    color: #e9edef;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.account-item-phone {
    color: #8696a0;
    font-size: 12px;
    margin-bottom: 2px;
}

.account-item-status {
    color: #8696a0;
    font-size: 12px;
}

.active-label {
    color: #00a884;
    font-size: 12px;
    font-weight: 500;
}

.add-account {
    border-top: 1px solid #3b4a54;
}

.add-account-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    color: inherit;
    text-align: left;
}

.add-account-btn:hover {
    background-color: #3b4a54;
}

.add-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #3b4a54;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8696a0;
    font-size: 24px;
}

.add-account-info {
    flex: 1;
}

.add-account-name {
    color: #e9edef;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.add-account-desc {
    color: #8696a0;
    font-size: 12px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #8696a0;
}

.action-btn:hover {
    background-color: #3b4a54;
}

/* Поиск */
.search-container {
    padding: 12px;
    background-color: #202c33;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8696a0;
}

.search-box input {
    width: 100%;
    background-color: #2a3942;
    border: none;
    border-radius: 8px;
    padding: 8px 16px 8px 40px;
    color: #e9edef;
    font-size: 14px;
}

.search-box input::placeholder {
    color: #8696a0;
}

.search-box input:focus {
    outline: none;
}

/* Список чатов */
.chats-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: inherit;
}

.chat-item:hover,
.chat-item.active {
    background-color: #2a3942;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
}

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

.chat-header-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

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

.chat-time {
    color: #8696a0;
    font-size: 12px;
    margin-left: 8px;
}

.chat-last-message-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-last-message {
    color: #8696a0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-count {
    background-color: #00a884;
    color: white;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 8px;
}

/* Основная область */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b141a 0%, #1a2730 100%);
}

.welcome-content {
    text-align: center;
}

.welcome-icon {
    opacity: 0.2;
    color: #8696a0;
    margin-bottom: 32px;
}

.welcome-content h2 {
    font-size: 32px;
    color: #e9edef;
    margin-bottom: 16px;
}

.welcome-content p {
    color: #8696a0;
    margin-bottom: 16px;
}

.welcome-sub {
    font-size: 14px !important;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    height: 60px;
    background-color: #2a3942;
    border-bottom: 1px solid #3b4a54;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.chat-header-info {
    display: flex;
    align-items: center;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.chat-header-details h3 {
    color: #e9edef;
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-header-details p {
    color: #8696a0;
    font-size: 14px;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(135deg, #0b141a 0%, #1a2730 100%);
}

.message {
    display: flex;
    margin-bottom: 8px;
}

.message.own {
    justify-content: flex-end;
}

.message-content {
    max-width: 450px;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
}

.message.own .message-content {
    background-color: #005c4b;
    color: #e9edef;
}

.message:not(.own) .message-content {
    background-color: #202c33;
    color: #e9edef;
}

.message-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.message-time {
    font-size: 11px;
    color: #8696a0;
    text-align: right;
}

.input-area {
    height: 60px;
    background-color: #2a3942;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
}

.input-action-btn {
    padding: 8px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #8696a0;
}

.input-action-btn:hover {
    background-color: #3b4a54;
}

.message-input {
    flex: 1;
    background-color: #2a3942;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: #e9edef;
    font-size: 14px;
}

.message-input::placeholder {
    color: #8696a0;
}

.message-input:focus {
    outline: none;
}

/* Скроллбары */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #3b4a54;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a5a64;
}