body {
    background: #0b141a;
    color: #e9edef;
}

.wa-shell {
    display: flex;
    height: 100vh;
}

.wa-sidebar {
    width: 34%;
    min-width: 300px;
    background: #111b21;
}

.wa-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0b141a;
}

.wa-messages {
    flex: 1;
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.chat-preview-row {
    margin-top: 4px;
}

.chat-preview-unread {
    color: #e9edef;
    font-weight: 600;
}

.chat-name-unread {
    font-weight: 700;
}

.unread-badge {
    background: #25d366;
    color: #0b141a;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

.reply-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #202c33;
    border-top: 1px solid #2a3942;
}

.message-media-image {
    max-width: 280px;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
}

.message-media-video,
.message-media-audio {
    max-width: 280px;
    display: block;
    margin-bottom: 6px;
}

.location-link,
.media-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #53bdeb;
}

.contact-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
}

.message-bubble {
    cursor: pointer;
}

.chat-row.active {
    background: #2a3942 !important;
}

.chat-time {
    opacity: 0.7;
    font-size: 11px;
}

.chat-preview {
    opacity: 0.75;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 85%;
}

.message-out,
.message-in {
    max-width: 72%;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 10px;
}

.message-meta {
    display: block;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.date-separator {
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
    margin: 10px 0;
}

.quoted-reply {
    border-left: 3px solid rgba(255, 255, 255, 0.35);
    padding-left: 8px;
    margin-bottom: 6px;
    opacity: 0.85;
    font-size: 12px;
}

.media-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
}

.message-out {
    margin-left: auto;
    background: #005c4b;
}

.message-in {
    margin-right: auto;
    background: #202c33;
}

@media (max-width: 992px) {
    .wa-sidebar {
        width: 100%;
        min-width: 0;
    }
    .wa-chat {
        display: none;
        width: 100%;
    }
    .wa-chat.wa-visible-mobile {
        display: flex;
    }
    .wa-sidebar.wa-hidden-mobile {
        display: none;
    }
}

body.wa-light {
    background: #efeae2;
    color: #111b21;
}

body.wa-light .wa-sidebar {
    background: #fff;
}

body.wa-light .wa-chat {
    background: #efeae2;
}

body.wa-light .message-in {
    background: #fff;
    color: #111b21;
}

body.wa-light .message-out {
    background: #d9fdd3;
    color: #111b21;
}

body.wa-light .reply-bar {
    background: #f0f2f5;
    border-top-color: #d1d7db;
}

.status-tick.status-read {
    color: #53bdeb;
}

.composer-advanced summary {
    cursor: pointer;
    user-select: none;
}

.sidebar-tabs .sidebar-tab.active {
    background: #25d366;
    border-color: #25d366;
    color: #0b141a;
    font-weight: 600;
}

.new-chat-panel {
    padding: 12px 16px;
    background: #111b21;
}

.new-chat-error {
    margin-top: 8px;
    color: #f15c6d;
    font-size: 12px;
}

body.wa-light .new-chat-panel {
    background: #f0f2f5;
}

body.wa-light .new-chat-error {
    color: #d93025;
}

.chat-header-menu-wrap {
    position: relative;
}

.chat-header-menu-btn.is-disabled,
.chat-header-menu-btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.chat-header-context-menu {
    position: fixed;
}

.chat-row-wrap {
    position: relative;
}

.chat-row-wrap:hover .chat-row-menu-btn,
.chat-row-menu-btn:focus,
.chat-row-menu-btn.menu-open {
    opacity: 1;
}

.chat-row-menu-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: rgba(17, 27, 33, 0.92);
    color: #aebac1;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    opacity: 0.65;
    transition: opacity 0.15s ease;
    z-index: 2;
}

.chat-row-menu-btn:hover {
    background: #2a3942;
    color: #e9edef;
}

.chat-context-menu {
    position: fixed;
    z-index: 1050;
    min-width: 180px;
    background: #233138;
    border: 1px solid #2a3942;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 6px;
}

.chat-context-item {
    display: flex;
    align-items: center;
    width: 100%;
    border: 0;
    background: transparent;
    color: #e9edef;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
}

.chat-context-item:hover {
    background: #2a3942;
}

.chat-context-danger {
    color: #f15c6d;
}

body.wa-light .chat-row-menu-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #54656f;
}

body.wa-light .chat-row-menu-btn:hover {
    background: #f0f2f5;
    color: #111b21;
}

body.wa-light .chat-context-menu {
    background: #fff;
    border-color: #d1d7db;
}

body.wa-light .chat-context-item {
    color: #111b21;
}

body.wa-light .chat-context-item:hover {
    background: #f0f2f5;
}

body.wa-light .sidebar-tabs .sidebar-tab.active {
    background: #25d366;
    border-color: #25d366;
    color: #0b141a;
}

.coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #8696a0;
}

.send-status.send-status-error {
    color: #ea4335;
}

.send-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(134, 150, 160, 0.35);
    border-top-color: #25d366;
    border-radius: 50%;
    animation: send-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.send-status-error .send-spinner {
    display: none;
}

@keyframes send-spin {
    to {
        transform: rotate(360deg);
    }
}

body.wa-light .send-status {
    color: #667781;
}

body.wa-light .send-status.send-status-error {
    color: #d93025;
}

body.wa-light .btn-outline-light {
    color: #111b21;
    border-color: #c5cdd3;
    background-color: #fff;
}

body.wa-light .btn-outline-light:hover,
body.wa-light .btn-outline-light:focus,
body.wa-light .btn-outline-light:active {
    color: #111b21;
    border-color: #8696a0;
    background-color: #f0f2f5;
}

body.wa-light .btn-outline-light:disabled,
body.wa-light .btn-outline-light.coming-soon {
    color: #54656f;
    border-color: #d1d7db;
    background-color: #fff;
}
