html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background: #0b141a;
    color: #e9edef;
}

.wa-shell {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

.wa-sidebar {
    width: 34%;
    min-width: 300px;
    background: #111b21;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

#chat-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.wa-chat {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #0b141a;
    background-image: url('/assets/img/wa-doodle.svg');
    background-repeat: repeat;
    background-size: 380px auto;
    overflow: hidden;
    position: relative;
}

.wa-chat-header {
    flex-shrink: 0;
    z-index: 10;
}

.wa-messages {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.wa-composer {
    flex-shrink: 0;
    z-index: 10;
    box-sizing: border-box;
}

.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;
}

.unread-dot {
    width: 20px;
    height: 20px;
    background: #25d366;
    border-radius: 50%;
    display: inline-block;
    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;
    flex-shrink: 0;
}

.message-media-image {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    max-height: min(280px, 48vh);
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 4px;
    box-sizing: border-box;
    cursor: pointer;
    transition: filter 0.18s ease, transform 0.18s ease;
}

.message-media-video {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    max-height: min(280px, 48vh);
    border-radius: 6px;
    margin-bottom: 4px;
    box-sizing: border-box;
}

.message-audio-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.message-media-audio {
    width: 100%;
    min-width: 220px;
    max-width: 320px;
    height: 42px;
    border-radius: 24px;
    outline: none;
    display: block;
    box-sizing: border-box;
}

.message-bubble.is-audio {
    min-width: 240px;
}

.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 {
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}

.message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message-text .wa-monospace {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background-color: rgba(0, 0, 0, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

[data-theme="dark"] .message-text .wa-monospace {
    background-color: rgba(255, 255, 255, 0.12);
}

.message-bubble.has-reaction {
    margin-bottom: 14px;
}

.message-reaction {
    position: absolute;
    bottom: -10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    font-size: 13px;
    line-height: 1.2;
    background: #202c33;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    z-index: 2;
    user-select: none;
    pointer-events: none;
}

.message-out .message-reaction {
    right: 8px;
    background: #005c4b;
    border-color: rgba(255, 255, 255, 0.15);
}

.message-in .message-reaction {
    left: 8px;
    background: #202c33;
    border-color: rgba(255, 255, 255, 0.12);
}

.chat-row.active {
    background: #2a3942 !important;
}

.chat-time {
    opacity: 0.7;
    font-size: 11px;
}

.chat-preview {
    opacity: 0.75;
    overflow: hidden;
    max-width: 85%;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.message-out,
.message-in {
    max-width: 75%;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 10px;
    box-sizing: border-box;
}

.message-meta {
    display: block;
    font-size: 11px;
    opacity: 0.75;
    margin-top: 4px;
    text-align: right;
    user-select: none;
    line-height: 1.2;
}

.status-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    letter-spacing: 0;
    margin-left: 3px;
    vertical-align: middle;
    flex-shrink: 0;
}

.chat-preview .status-tick {
    margin-left: 0;
}

.status-tick .wa-ack-svg {
    display: block;
    width: 16px;
    height: 15px;
}

.status-tick.status-failed .wa-ack-svg,
.status-tick.status-sending .wa-ack-svg {
    width: 14px;
    height: 14px;
}

.status-tick.status-read {
    color: #53bdeb;
    opacity: 1;
}

.status-tick.status-delivered,
.status-tick.status-sent,
.status-tick.status-sending {
    color: #8696a0;
    opacity: 1;
}

.status-tick.status-failed {
    color: #f15c6d;
    font-weight: normal;
}

.date-separator {
    text-align: center;
    font-size: 11.5px;
    color: #e9edef;
    margin: 12px auto;
    display: flex;
    justify-content: center;
}

.date-separator span {
    background: #182229;
    color: #e9edef;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 400;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.quoted-reply {
    border-left: 3px solid rgba(255, 255, 255, 0.35);
    padding: 5px 8px;
    margin-bottom: 6px;
    opacity: 0.85;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.quoted-reply:hover {
    background: rgba(255, 255, 255, 0.06);
    opacity: 1;
}

.quoted-reply-media {
    font-style: italic;
    opacity: 0.9;
}

.quoted-reply-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.quoted-reply-time {
    opacity: 0.6;
    font-size: 11px;
    margin-left: 4px;
}

/* Flash highlight when jumping to original message */
@keyframes msgHighlight {
    0% {
        background: rgba(255, 220, 80, 0.35);
    }

    70% {
        background: rgba(255, 220, 80, 0.20);
    }

    100% {
        background: transparent;
    }
}

.msg-highlight {
    animation: msgHighlight 1.8s ease-out forwards;
    border-radius: 8px;
}


.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: 768px) {
    .wa-messages {
        padding: 8px 10px !important;
    }

    .message-out,
    .message-in {
        max-width: 85% !important;
        padding: 5px 8px !important;
    }

    .message-media-image,
    .message-media-video {
        max-width: 100% !important;
        width: 100% !important;
        max-height: min(240px, 42vh) !important;
        object-fit: contain !important;
    }

    .message-bubble.is-audio {
        min-width: 210px;
        max-width: 86% !important;
    }

    .message-media-audio {
        min-width: 180px;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .wa-messages {
        padding: 6px 8px !important;
    }

    .message-out,
    .message-in {
        max-width: 88% !important;
    }

    .message-media-image,
    .message-media-video {
        max-height: min(220px, 36vh) !important;
    }
}

body.wa-light {
    background: #efeae2;
    color: #111b21;
}

body.wa-light .wa-sidebar {
    background: #fff;
}

body.wa-light .wa-chat {
    background-color: #efeae2;
    background-image: url('/assets/img/wa-doodle-light.svg');
    background-repeat: repeat;
    background-size: 380px auto;
}

body.wa-light .wa-app-rail {
    background: #f0f2f5;
    border-color: #d1d7db;
}

body.wa-light .wa-app-rail .rail-btn {
    color: #54656f;
}

body.wa-light .wa-app-rail .rail-btn:hover {
    background: #e9edef;
    color: #111b21;
}

body.wa-light .wa-app-rail .rail-btn.active {
    background: rgba(0, 168, 132, 0.12);
    color: #00a884;
}

body.wa-light .wa-app-rail .rail-badge {
    box-shadow: 0 0 0 2px #f0f2f5;
}

body.wa-light .message-in {
    background: #fff;
    color: #111b21;
}

body.wa-light .message-out {
    background: #d9fdd3;
    color: #111b21;
}

body.wa-light .message-in .message-reaction {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

body.wa-light .message-out .message-reaction {
    background: #d9fdd3;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.message-action-popup {
    position: fixed;
    z-index: 1060;
    background: #233138;
    border: 1px solid #2a3942;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 6px;
    min-width: 220px;
    animation: popup-enter 0.15s ease-out;
}

@keyframes popup-enter {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message-action-reactions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 6px;
}

.reaction-btn {
    background: transparent;
    border: 0;
    font-size: 20px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.reaction-btn:hover {
    transform: scale(1.25);
    background: rgba(255, 255, 255, 0.12);
}

.reaction-btn.active {
    background: rgba(37, 211, 102, 0.25);
    box-shadow: 0 0 0 1.5px #25d366;
}

.message-action-divider {
    height: 1px;
    background: #2a3942;
    margin: 6px 0;
}

.message-action-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.message-action-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: 13.5px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.message-action-item:hover {
    background: #2a3942;
}

.message-action-danger {
    color: #f15c6d;
}

.message-action-danger:hover {
    background: rgba(241, 92, 109, 0.15);
    color: #ff6b7d;
}

.fade-out-message {
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
    opacity: 0 !important;
    transform: scale(0.92) !important;
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

body.wa-light .message-action-popup {
    background: #ffffff;
    border-color: #d1d7db;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

body.wa-light .reaction-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.wa-light .reaction-btn.active {
    background: rgba(37, 211, 102, 0.15);
    box-shadow: 0 0 0 1.5px #128c7e;
}

body.wa-light .message-action-divider {
    background: #e9edef;
}

body.wa-light .message-action-item {
    color: #111b21;
}

body.wa-light .message-action-item:hover {
    background: #f0f2f5;
}

body.wa-light .reply-bar {
    background: #f0f2f5;
    border-top-color: #d1d7db;
}

body.wa-light .status-tick.status-read {
    color: #53bdeb;
}

body.wa-light .status-tick.status-delivered,
body.wa-light .status-tick.status-sent,
body.wa-light .status-tick.status-sending {
    color: #667781;
}

body.wa-light .status-tick.status-failed {
    color: #ea4335;
}

.composer-advanced summary {
    cursor: pointer;
    user-select: none;
}

.wa-composer {
    position: relative;
}

.composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.composer-toolbar {
    position: relative;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.composer-tool-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.composer-tool-btn.active {
    background: #2a3942;
    border-color: #25d366;
    color: #25d366;
}

.composer-input {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
}

.composer-send-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.composer-mode-template .composer-send-btn {
    opacity: 0.45;
}

.composer-attach-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 20;
    min-width: 190px;
    background: #233138;
    border: 1px solid #2a3942;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 6px;
}

.composer-attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #e9edef;
    text-align: left;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.composer-attach-item:hover {
    background: #2a3942;
}

.composer-attach-item i {
    width: 18px;
    text-align: center;
    color: #25d366;
}

.attachment-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 8px;
}

.attachment-preview-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #2a3942;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attachment-preview-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview-icon {
    font-size: 22px;
    color: #8696a0;
}

.attachment-preview-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.attachment-preview-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-preview-size {
    font-size: 12px;
}

.attachment-preview-remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
}

/* WhatsApp Document Preview Card in Messages */
.message-document-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.15s ease;
    margin-bottom: 3px;
    max-width: 320px;
    min-width: 230px;
    box-sizing: border-box;
}

.message-document-card:hover {
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
}

body.wa-light .message-document-card {
    background: rgba(0, 0, 0, 0.05);
}

body.wa-light .message-document-card:hover {
    background: rgba(0, 0, 0, 0.09);
}

.document-badge {
    width: 38px;
    height: 44px;
    border-radius: 4px 10px 4px 4px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    background: #54656f;
}

.document-badge::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.35);
    border-bottom-left-radius: 3px;
}

.document-badge-ext {
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.document-badge.badge-pdf {
    background: #d93025;
}

.document-badge.badge-doc,
.document-badge.badge-docx {
    background: #1a73e8;
}

.document-badge.badge-xls,
.document-badge.badge-xlsx,
.document-badge.badge-csv {
    background: #1e8e3e;
}

.document-badge.badge-ppt,
.document-badge.badge-pptx {
    background: #f29900;
}

.document-badge.badge-zip,
.document-badge.badge-rar,
.document-badge.badge-7z {
    background: #8e24aa;
}

.document-badge.badge-txt,
.document-badge.badge-code {
    background: #5f6368;
}

.document-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.document-name {
    font-size: 14px;
    font-weight: 600;
    color: #e9edef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

body.wa-light .document-name {
    color: #111b21;
}

.document-meta {
    font-size: 11.5px;
    color: #8696a0;
    margin-top: 2px;
    white-space: nowrap;
}

.document-download-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8696a0;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.message-document-card:hover .document-download-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #e9edef;
}

body.wa-light .document-download-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: #54656f;
}

body.wa-light .message-document-card:hover .document-download-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #111b21;
}

.message-document-caption {
    font-size: 14px;
    line-height: 1.4;
    color: #e9edef;
    padding: 4px 2px 0 2px;
    word-break: break-word;
}

body.wa-light .message-document-caption {
    color: #111b21;
}

.template-panel {
    margin-bottom: 10px;
    padding: 12px;
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 8px;
}

.template-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.template-panel-title {
    font-size: 14px;
    font-weight: 600;
}

.template-panel-close {
    width: 30px;
    height: 30px;
    padding: 0;
    line-height: 1;
}

.template-panel-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.template-panel-fields .form-select {
    min-width: 140px;
    flex: 1 1 140px;
}

.template-preview {
    padding: 8px 10px;
    background: #0b141a;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.template-panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

body.wa-light .composer-tool-btn.active {
    background: #e7f7ed;
    border-color: #25d366;
    color: #128c7e;
}

body.wa-light .composer-attach-menu {
    background: #fff;
    border-color: #d1d7db;
}

body.wa-light .composer-attach-item {
    color: #111b21;
}

body.wa-light .composer-attach-item:hover {
    background: #f0f2f5;
}

body.wa-light .attachment-preview,
body.wa-light .template-panel {
    background: #f0f2f5;
    border-color: #d1d7db;
}

body.wa-light .attachment-preview-thumb {
    background: #fff;
}

body.wa-light .template-preview {
    background: #fff;
}

.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-info {
    min-width: 0;
}

.chat-header-title {
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-subtitle {
    font-size: 0.8rem;
    line-height: 1.2;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.wa-light .chat-header-subtitle {
    color: #667781;
}

.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 {
    padding-right: 44px !important;
}

.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;
    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;
}

/* Media Limit Alert */
.media-limit-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background-color: rgba(234, 67, 53, 0.12);
    border: 1px solid rgba(234, 67, 53, 0.4);
    color: #ffd2cf;
    font-size: 13px;
    line-height: 1.4;
    animation: alertSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.media-limit-alert-icon {
    font-size: 16px;
    color: #ea4335;
    margin-top: 1px;
    flex-shrink: 0;
}

.media-limit-alert-content {
    flex-grow: 1;
}

.media-limit-alert-title {
    font-weight: 600;
    color: #ff857a;
    margin-bottom: 2px;
}

.media-limit-alert-desc {
    color: #e9edef;
    word-break: break-word;
}

.media-limit-alert-close {
    background: none;
    border: none;
    color: #aebac1;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.media-limit-alert-close:hover {
    color: #fff;
}

body.wa-light .media-limit-alert {
    background-color: #fdf2f2;
    border-color: #f8b4b4;
    color: #9b1c1c;
}

body.wa-light .media-limit-alert-title {
    color: #c81e1e;
}

body.wa-light .media-limit-alert-desc {
    color: #555e67;
}

body.wa-light .media-limit-alert-close {
    color: #9ca3af;
}

body.wa-light .media-limit-alert-close:hover {
    color: #111827;
}

@keyframes alertSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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;
}

.template-variables {
    width: 100%;
}

.template-variables .form-control {
    min-width: 140px;
    flex: 1 1 140px;
}

.template-load-error {
    width: 100%;
    color: #f15c6d;
    font-size: 12px;
}

body.wa-light .template-load-error {
    color: #d93025;
}

.message-sticker {
    width: 130px;
    height: 130px;
    max-width: 100%;
    max-height: 140px;
    display: block;
    object-fit: contain;
    border-radius: 4px;
}

.message-bubble.is-sticker {
    background: transparent !important;
    box-shadow: none !important;
    padding: 2px !important;
    border: 0 !important;
    max-width: fit-content !important;
}

.message-bubble.is-sticker .message-meta {
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 2px;
}

.message-footer-text {
    font-size: 11px;
    opacity: 0.65;
    margin-top: 6px;
    white-space: pre-wrap;
}

.message-card-buttons {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -8px;
}

.message-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    color: #53bdeb !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease;
    user-select: none;
    cursor: pointer;
}

.message-card-btn:first-child {
    border-top: 0;
}

.message-card-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #70cbf4 !important;
}

.message-button-selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(83, 189, 235, 0.15);
    color: #53bdeb;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12.5px;
    margin-top: 4px;
}

body.wa-light .message-card-buttons {
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.wa-light .message-card-btn {
    color: #00a884 !important;
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.wa-light .message-card-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

body.wa-light .message-button-selected {
    background: rgba(0, 168, 132, 0.12);
    color: #00a884;
}

.message-media-image {
    cursor: pointer;
    transition: filter 0.18s ease, transform 0.18s ease;
}

.message-media-image:hover {
    filter: brightness(0.92);
}

.message-media-image:active {
    transform: scale(0.985);
}

/* Image Lightbox Modal */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    animation: lightbox-fade-in 0.2s ease-out;
}

@keyframes lightbox-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.image-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 20, 26, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1;
}

.image-lightbox-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

.image-lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(17, 27, 33, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 3;
}

.image-lightbox-title {
    color: #e9edef;
    font-size: 15px;
    font-weight: 600;
}

.image-lightbox-actions {
    display: flex;
    gap: 10px;
}

.image-lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
}

.image-lightbox-body img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    transition: transform 0.2s ease;
}

/* ==========================================================
   WHATSAPP WEB REDESIGN STYLES
   ========================================================== */

/* 1. Slim Vertical App Rail */
.wa-app-rail {
    width: 60px;
    min-width: 60px;
    background: #202c33;
    border-right: 1px solid #2a3942;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    z-index: 20;
    flex-shrink: 0;
}

.rail-top,
.rail-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.rail-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #aebac1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    overflow: visible;
    transition: background 0.15s ease, color 0.15s ease;
}

.rail-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rail-label {
    display: none;
}

.rail-chats-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.rail-btn:hover {
    background: #374248;
    color: #e9edef;
}

.rail-btn.active {
    background: #374248;
    color: #00a884;
}

.rail-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #25d366;
    color: #111b21;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 0 2px #202c33;
    z-index: 2;
}

.rail-badge.d-none {
    display: none !important;
}

.rail-badge.rail-badge-muted {
    background: #374248;
    color: #8696a0;
}

.meta-ai-ring {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%, #00a3ff 0deg, #6038ff 120deg, #00d2ff 240deg, #00a3ff 360deg);
    display: inline-block;
    box-shadow: 0 0 8px rgba(0, 163, 255, 0.4);
}

/* 2. Sidebar Header & Actions */
.wa-sidebar {
    width: 380px;
    min-width: 320px;
    max-width: 460px;
    background: #111b21;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.wa-sidebar-header {
    height: 60px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111b21;
}

.wa-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #e9edef;
    margin: 0;
    letter-spacing: -0.2px;
}

.wa-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #aebac1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wa-icon-btn:hover {
    background: #374248;
    color: #e9edef;
}

/* Search Bar */
.wa-search-wrap {
    padding: 6px 12px 8px 12px;
    background: #111b21;
}

.wa-search-box {
    background: #202c33;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 12px;
}

.wa-search-icon {
    color: #8696a0;
    font-size: 13px;
}

.wa-search-input {
    background: transparent;
    border: 0;
    color: #e9edef;
    font-size: 14px;
    outline: none;
    flex: 1;
}

.wa-search-input::placeholder {
    color: #8696a0;
}

.wa-search-clear {
    background: none;
    border: 0;
    color: #8696a0;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.wa-search-clear:hover {
    color: #e9edef;
}

/* Filter Chips */
.wa-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 12px 10px 12px;
    background: #111b21;
    border-bottom: 1px solid rgba(134, 150, 160, 0.15);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.wa-filter-row::-webkit-scrollbar {
    display: none;
}

.custom-list-tabs-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wa-filter-chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    border: 0;
    background: #202c33;
    color: #8696a0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.list-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.wa-filter-add-chip {
    padding: 4px 10px;
    color: #8696a0;
}

.wa-filter-add-chip:hover {
    color: #00a884;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #25d366;
    color: #111b21;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.filter-count.d-none {
    display: none !important;
}

.wa-filter-chip.active .filter-count {
    background: #ffffff;
    color: #008069;
}

.wa-filter-chip:hover {
    background: #2a3942;
    color: #e9edef;
}

.wa-filter-chip.active {
    background: #00a884;
    color: #fff;
    font-weight: 600;
}

/* Archived Folder Row */
.wa-archived-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(134, 150, 160, 0.12);
    cursor: pointer;
    background: #111b21;
    transition: background 0.15s ease;
}

.wa-archived-entry:hover {
    background: #202c33;
}

.wa-archived-icon {
    color: #00a884;
    font-size: 17px;
    width: 24px;
    display: flex;
    justify-content: center;
}

.wa-archived-label {
    font-size: 15px;
    font-weight: 600;
    color: #e9edef;
}

.wa-archived-count {
    font-size: 12px;
    font-weight: 600;
    color: #00a884;
}

.wa-archived-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #202c33;
    border-bottom: 1px solid #2a3942;
    font-size: 16px;
    color: #e9edef;
}

/* Chat List Items */
.wa-chat-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: #111b21;
}

.chat-row-wrap {
    position: relative;
    border-bottom: 1px solid rgba(134, 150, 160, 0.08);
}

.chat-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 14px !important;
    background: transparent !important;
    border: 0 !important;
    width: 100%;
    text-align: left;
    transition: background 0.12s ease;
    cursor: pointer;
}

.chat-row:hover {
    background: #202c33 !important;
}

.chat-row-wrap.active .chat-row,
.chat-row.active {
    background: #2a3942 !important;
}

.chat-row-avatar {
    flex-shrink: 0;
}

.chat-row-content {
    flex: 1;
    min-width: 0;
}

.chat-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-name {
    font-size: 15.5px;
    color: #e9edef;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-name-unread {
    font-weight: 700 !important;
}

.chat-time {
    font-size: 11.5px;
    color: #8696a0;
    flex-shrink: 0;
}

.chat-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3px;
}

.chat-preview {
    font-size: 13.5px;
    color: #8696a0;
    overflow: hidden;
    max-width: 78%;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.chat-preview-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.chat-preview-unread {
    color: #e9edef;
    font-weight: 600;
}

.chat-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chat-pin-icon {
    color: #8696a0;
    font-size: 12px;
}

.chat-row-chevron {
    position: absolute;
    right: 12px;
    bottom: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #8696a0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
}

.chat-row-wrap:hover .chat-row-chevron,
.chat-row-chevron.menu-open {
    opacity: 1;
    pointer-events: auto;
}

.chat-row-chevron:hover,
.chat-row-chevron.menu-open {
    background: #374248;
    color: #e9edef;
}

/* Avatar Components */
.wa-avatar {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    user-select: none;
    overflow: hidden;
    background: #536471;
    flex-shrink: 0;
}

.wa-avatar-xs {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.wa-avatar-md {
    width: 40px;
    height: 40px;
    font-size: 16px;
    background: #00a884;
}

.wa-avatar-contact {
    width: 49px;
    height: 49px;
    font-size: 18px;
    background: #536471;
}

.wa-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Sidebar Bottom Promo */
.wa-sidebar-promo {
    padding: 10px 16px;
    border-top: 1px solid rgba(134, 150, 160, 0.15);
    background: #111b21;
}

.wa-promo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e9edef;
    font-size: 13.5px;
    font-weight: 500;
}

.wa-promo-icon {
    font-size: 20px;
    color: #25d366;
}

/* 3. Empty Splash Screen */
.wa-chat-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 50px 24px 20px 24px;
    background: #222e35;
    border-bottom: 6px solid #00a884;
    box-sizing: border-box;
}

.wa-empty-content {
    max-width: 520px;
    margin: auto;
    text-align: center;
}

.wa-empty-title {
    font-size: 28px;
    font-weight: 300;
    color: #e9edef;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.wa-empty-desc {
    font-size: 13.5px;
    color: #8696a0;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.wa-empty-download-btn {
    border-radius: 24px;
    padding: 9px 28px;
    font-size: 14px;
    font-weight: 600;
    background-color: #00a884;
    border: 0;
    letter-spacing: 0.2px;
    transition: background 0.2s ease;
}

.wa-empty-download-btn:hover {
    background-color: #02906f;
}

.wa-empty-footer {
    font-size: 13px;
    color: #8696a0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 12px;
    border-top: 1px solid rgba(134, 150, 160, 0.15);
    width: 100%;
    justify-content: center;
    padding-top: 16px;
}

/* 4. Active Chat View */
.wa-chat-active {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.wa-chat-header {
    height: 60px;
    padding: 8px 16px;
    background: #202c33;
    border-bottom: 1px solid #2a3942;
    z-index: 10;
    flex-shrink: 0;
}

.chat-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #e9edef;
    line-height: 1.2;
}

.chat-header-subtitle {
    font-size: 12px;
    color: #8696a0;
    line-height: 1.2;
    margin-top: 2px;
}

.chat-search-bar {
    padding: 8px 16px;
    background: #202c33;
    border-bottom: 1px solid #2a3942;
}

/* Floating Scroll Bottom Button */
.wa-scroll-bottom-btn {
    position: absolute;
    right: 20px;
    bottom: 80px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #202c33;
    border: 1px solid #2a3942;
    color: #8696a0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 15;
    transition: transform 0.15s ease, background 0.15s ease;
}

.wa-scroll-bottom-btn:hover {
    background: #2a3942;
    color: #e9edef;
    transform: scale(1.05);
}

.wa-scroll-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #25d366;
    color: #111b21;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Reply Bar Accent */
.reply-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #202c33;
    border-top: 1px solid #2a3942;
    position: relative;
}

.reply-bar-accent {
    width: 4px;
    align-self: stretch;
    background: #00a884;
    border-radius: 4px;
}

.reply-bar-sender {
    color: #00a884;
    font-weight: 600;
    font-size: 12px;
}

/* Composer Polish */
.wa-composer {
    background: #202c33;
    border-top: 1px solid #2a3942;
    padding: 8px 16px;
    z-index: 10;
}

.composer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.composer-input-wrap {
    flex: 1;
    position: relative;
}

.composer-input {
    background: #2a3942 !important;
    border: 0 !important;
    color: #e9edef !important;
    border-radius: 8px !important;
    padding: 9px 12px !important;
    font-size: 14.5px !important;
    line-height: 1.4 !important;
    resize: none !important;
    max-height: 100px !important;
    min-height: 40px !important;
}

.composer-input::placeholder {
    color: #8696a0;
}

/* Floating Text Formatting Toolbar */
.composer-format-popup {
    position: absolute;
    bottom: calc(100% + 9px);
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    background: #182229;
    border: 1px solid #2a3942;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    z-index: 45;
    user-select: none;
    white-space: nowrap;
    animation: waFormatPopIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.composer-format-popup.d-none {
    display: none !important;
}

@keyframes waFormatPopIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.format-popup-btn {
    background: transparent;
    border: 0;
    color: #e9edef;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 1;
}

.format-popup-btn:first-of-type {
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
}

.format-popup-btn:last-of-type {
    border-right: 0;
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

.format-popup-btn:hover {
    background: #233138;
    color: #ffffff;
}

.format-popup-btn:active {
    background: #2a3942;
}

.format-popup-arrow {
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #182229;
    border-right: 1px solid #2a3942;
    border-bottom: 1px solid #2a3942;
    transform: translateX(-50%) rotate(45deg);
    z-index: 0;
    pointer-events: none;
    transition: left 0.08s ease-out;
}

.composer-mic-btn {
    font-size: 19px;
    color: #8696a0;
}

.composer-mic-btn:hover {
    color: #e9edef;
}

.composer-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #00a884 !important;
    border: 0 !important;
}

.composer-send-btn:hover {
    background-color: #02906f !important;
}

/* Attachment Menu */
.composer-attach-menu {
    position: absolute;
    bottom: 50px;
    left: 0;
    background: #233138;
    border: 1px solid #2a3942;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 30;
    min-width: 180px;
}

.composer-attach-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    color: #e9edef;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.12s;
    width: 100%;
    text-align: left;
}

.composer-attach-item:hover {
    background: #182229;
}

.composer-attach-wrap {
    overflow: visible;
}

.composer-attach-menu {
    overflow: visible;
}

.composer-attach-item {
    position: relative;
}

.attach-type-popover {
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 92px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    z-index: 40;
    pointer-events: none;
}

.attach-type-popover span {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    color: #aebac1;
    font-weight: 500;
}

.composer-attach-item:hover .attach-type-popover,
.composer-attach-item:focus-visible .attach-type-popover {
    display: block;
}

body.wa-light .attach-type-popover {
    background: #ffffff;
    border-color: #d1d7db;
}

body.wa-light .attach-type-popover span {
    color: #54656f;
}

.attach-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.bg-purple {
    background-color: #7f66ff;
}

.bg-blue {
    background-color: #007bfc;
}

.bg-green {
    background-color: #00a884;
}

/* Dropdown and Context Menus */
.wa-dropdown-menu,
.chat-context-menu {
    background: #233138 !important;
    border: 1px solid #2a3942 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55) !important;
    padding: 6px 0 !important;
    min-width: 190px !important;
    z-index: 1070;
}

.chat-context-menu {
    position: fixed;
}

.dropdown-item,
.chat-context-item {
    padding: 9px 18px !important;
    font-size: 14px !important;
    color: #d1d7db !important;
    display: flex;
    align-items: center;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease;
}

.dropdown-item:hover,
.chat-context-item:hover {
    background: #182229 !important;
    color: #e9edef !important;
}

.chat-context-danger,
.dropdown-item.text-danger {
    color: #f15c6d !important;
}

.context-divider {
    height: 1px;
    background: #2a3942;
    margin: 6px 0;
}



/* Voice Message Recording Bar */
.composer-voice-row {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 2px 4px;
    background: transparent;
}

.voice-cancel-btn {
    color: #8696a0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.voice-cancel-btn:hover {
    color: #f15c6d !important;
    transform: scale(1.1);
}

.voice-recording-indicator {
    background: #202c33;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #2a3942;
}

.voice-record-pulse {
    width: 10px;
    height: 10px;
    background: #f15c6d;
    border-radius: 50%;
    display: inline-block;
    animation: voiceRecordPulse 1.2s infinite ease-in-out;
}

@keyframes voiceRecordPulse {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
        box-shadow: 0 0 0 rgba(241, 92, 109, 0.4);
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 10px rgba(241, 92, 109, 0.8);
    }

    100% {
        transform: scale(0.85);
        opacity: 0.6;
        box-shadow: 0 0 0 rgba(241, 92, 109, 0.4);
    }
}

.voice-record-timer {
    color: #e9edef;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
}

.voice-wave-bars {
    height: 18px;
}

.voice-wave-bars .wave-bar {
    width: 3px;
    height: 6px;
    background: #00a884;
    border-radius: 2px;
    display: inline-block;
    animation: voiceWaveBounce 1s infinite ease-in-out;
}

.voice-wave-bars .wave-bar:nth-child(1) {
    animation-delay: 0.0s;
}

.voice-wave-bars .wave-bar:nth-child(2) {
    animation-delay: 0.15s;
}

.voice-wave-bars .wave-bar:nth-child(3) {
    animation-delay: 0.3s;
}

.voice-wave-bars .wave-bar:nth-child(4) {
    animation-delay: 0.45s;
}

.voice-wave-bars .wave-bar:nth-child(5) {
    animation-delay: 0.6s;
}

@keyframes voiceWaveBounce {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 18px;
    }
}

.voice-send-btn {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

/* Composer Emoji Picker */
.composer-emoji-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.composer-emoji-picker {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    z-index: 1050;
    width: 350px;
    max-width: calc(100vw - 32px);
    height: 380px;
    max-height: 55vh;
    background: #202c33;
    border: 1px solid #2a3942;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    animation: emojiPickerFadeIn 0.15s ease-out;
}

@keyframes emojiPickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.composer-emoji-picker.d-none {
    display: none !important;
}

.emoji-picker-search-wrap {
    padding: 10px 12px 6px 12px;
    border-bottom: 1px solid #2a3942;
    background: #111b21;
}

.emoji-picker-search {
    width: 100%;
    background: #202c33;
    border: 1px solid #2a3942;
    border-radius: 8px;
    color: #e9edef;
    padding: 7px 12px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.emoji-picker-search:focus {
    border-color: #00a884;
}

.emoji-picker-categories {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 6px 8px;
    border-bottom: 1px solid #2a3942;
    background: #111b21;
    scrollbar-width: none;
    gap: 2px;
}

.emoji-picker-categories::-webkit-scrollbar {
    display: none;
}

.emoji-cat-btn {
    background: transparent;
    border: 0;
    color: #8696a0;
    font-size: 17px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.emoji-cat-btn:hover,
.emoji-cat-btn.active {
    color: #00a884;
    background: rgba(0, 168, 132, 0.15);
}

.emoji-picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: #374248 transparent;
}

.emoji-picker-grid::-webkit-scrollbar {
    width: 6px;
}

.emoji-picker-grid::-webkit-scrollbar-thumb {
    background: #374248;
    border-radius: 3px;
}

.emoji-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    height: 36px;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s, background 0.1s;
    padding: 0;
    line-height: 1;
}

.emoji-item-btn:hover {
    background: #2a3942;
    transform: scale(1.18);
}

.emoji-item-btn:active {
    transform: scale(0.95);
}

.composer-tool-btn.active {
    color: #00a884 !important;
}

/* ==========================================================
   RESPONSIVE MOBILE STYLES: SIDE MENU -> FOOTER NAVIGATION BAR
   ========================================================== */
@media (max-width: 992px) {
    .wa-shell {
        flex-direction: column !important;
        height: 100vh !important;
        height: 100dvh !important;
        width: 100vw !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .wa-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: 100% !important;
        order: 1 !important;
        border-right: none !important;
    }

    .wa-chat {
        display: none;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: 100% !important;
        order: 1 !important;
    }

    .wa-chat.wa-visible-mobile {
        display: flex !important;
    }

    .wa-sidebar.wa-hidden-mobile {
        display: none !important;
    }

    /* Side menu bar transforms into bottom footer navigation bar */
    .wa-app-rail {
        order: 2 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: 58px !important;
        min-height: 58px !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 4px 8px !important;
        padding-bottom: max(4px, env(safe-area-inset-bottom)) !important;
        border-right: none !important;
        border-top: 1px solid #2a3942 !important;
        background: #202c33 !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
        z-index: 30 !important;
        gap: 6px !important;
    }

    /* Hide footer when viewing a chat on mobile (leaves maximum space for messages and composer) */
    .wa-app-rail.wa-hidden-mobile {
        display: none !important;
    }

    .wa-app-rail .rail-top,
    .wa-app-rail .rail-bottom {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        gap: 6px !important;
        width: 50% !important;
        min-width: 0 !important;
        flex: 1 1 0% !important;
    }

    .wa-app-rail .rail-btn {
        flex: 1 1 0% !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 50px !important;
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 2px !important;
        font-size: 17px !important;
        color: #8696a0 !important;
        padding: 4px 4px !important;
    }

    .wa-app-rail .rail-btn:hover {
        background: rgba(255, 255, 255, 0.05) !important;
        color: #e9edef !important;
    }

    .wa-app-rail .rail-btn.active {
        background: rgba(0, 168, 132, 0.12) !important;
        color: #00a884 !important;
    }

    .wa-app-rail .rail-btn.active .rail-label {
        color: #00a884 !important;
        font-weight: 600 !important;
    }

    .wa-app-rail .rail-label {
        display: block !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        line-height: 1.1 !important;
        letter-spacing: 0.2px !important;
        color: inherit !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        max-width: 100% !important;
    }

    .wa-app-rail .rail-icon-wrap {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 22px !important;
    }

    .wa-app-rail .rail-chats-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .wa-app-rail .rail-badge {
        top: -6px !important;
        right: -10px !important;
        font-size: 10px !important;
        min-width: 16px !important;
        height: 16px !important;
        line-height: 14px !important;
        padding: 0 4px !important;
        box-shadow: 0 0 0 1.5px #202c33 !important;
    }
}

/* =========================================================
   TOOLS & AWAY MESSAGE STYLES
   ========================================================= */
.wa-tools-panel,
.wa-away-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: #111b21;
}

.tools-section-title {
    padding: 16px 16px 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8696a0;
}

.tools-list {
    padding: 0 12px;
}

.tools-item-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    background: #202c33;
    border: 1px solid #2a3942;
    border-radius: 10px;
    color: #e9edef;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.tools-item-btn:hover {
    background: #2a3942;
    border-color: #00a884;
}

.tools-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 168, 132, 0.15);
    color: #00a884;
    font-size: 18px;
    margin-right: 14px;
    flex-shrink: 0;
}

.tools-item-content {
    flex-grow: 1;
    min-width: 0;
}

.tools-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #e9edef;
    margin-bottom: 2px;
}

.tools-item-subtitle {
    font-size: 12px;
    color: #8696a0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tools-item-status {
    display: flex;
    align-items: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.away-panel-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.away-status-banner {
    background: #182229;
    border: 1px solid #2a3942;
    border-radius: 8px;
    padding: 10px 14px;
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator-dot.is-open {
    background: #25d366;
    box-shadow: 0 0 6px rgba(37, 211, 102, 0.6);
}

.status-indicator-dot.is-closed {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.away-card {
    background: #202c33;
    border: 1px solid #2a3942;
    border-radius: 10px;
    padding: 14px;
    transition: all 0.2s ease;
}

.away-fields-container {
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.away-fields-container.is-disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.6);
    user-select: none;
}

.away-fields-container:not(.is-disabled) .away-card {
    border-color: #374751;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wa-textarea {
    background: #111b21 !important;
    border: 1px solid #2a3942 !important;
    color: #e9edef !important;
    border-radius: 8px;
    resize: vertical;
    font-size: 13.5px;
    line-height: 1.5;
}

.wa-textarea:focus {
    border-color: #00a884 !important;
    box-shadow: 0 0 0 1px #00a884 !important;
}

.schedule-day-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-day-row:last-child {
    border-bottom: 0;
    padding-bottom: 2px;
}

.schedule-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.schedule-day-name {
    font-size: 13.5px;
    font-weight: 500;
    color: #e9edef;
}

.schedule-day-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.schedule-day-switch {
    margin: 0;
    padding: 0 !important;
    display: flex;
    align-items: center;
    min-height: auto !important;
}

.schedule-day-switch .form-check-input {
    margin: 0 !important;
    float: none !important;
    cursor: pointer;
}

.schedule-time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.schedule-time-input {
    flex: 1;
    min-width: 0;
    background: #111b21;
    border: 1px solid #2a3942;
    color: #e9edef;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12.5px;
    color-scheme: dark;
    text-align: center;
}

.schedule-time-input:focus {
    border-color: #00a884;
    outline: none;
    box-shadow: 0 0 0 1px #00a884;
}

.schedule-time-sep {
    font-size: 12px;
    color: #8696a0;
    flex-shrink: 0;
}

.schedule-closed-badge {
    font-size: 11px;
    color: #8696a0;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
}

.wa-switch:checked {
    background-color: #00a884 !important;
    border-color: #00a884 !important;
}

.schedule-preset-btn {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    border-color: #2a3942;
    color: #8696a0;
}

.schedule-preset-btn:hover {
    background: #2a3942;
    color: #e9edef;
    border-color: #374751;
}

/* Multi-selection headers (Chats & Messages) */
.wa-selection-header {
    background-color: #202c33;
    border-bottom: 1px solid rgba(134, 150, 160, 0.15);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    min-height: 59px;
    animation: selectionHeaderSlide 0.18s ease-out;
}

.wa-selection-count {
    font-size: 15px;
    font-weight: 500;
    color: #e9edef;
    margin-left: 6px;
}

.wa-selection-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wa-messages-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 59px;
    padding: 8px 16px;
    animation: selectionHeaderSlide 0.18s ease-out;
}

@keyframes selectionHeaderSlide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Row Checkbox */
.chat-select-check {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #8696a0;
    background: transparent;
    color: transparent;
    font-size: 11px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    cursor: pointer;
    margin-left: 12px;
}

.chats-selection-mode .chat-row-wrap {
    display: flex;
    align-items: center;
}

.chats-selection-mode .chat-select-check {
    display: flex;
}

.chats-selection-mode .chat-row {
    padding-left: 10px !important;
}

.chat-row-wrap.is-selected {
    background-color: rgba(0, 168, 132, 0.12) !important;
}

.chat-row-wrap.is-selected .chat-row {
    background-color: transparent !important;
}

.chat-row-wrap.is-selected .chat-select-check {
    background-color: #00a884;
    border-color: #00a884;
    color: #ffffff;
}

.chats-selection-mode .chat-row-chevron {
    display: none !important;
}

/* Messages Multi-Select Mode */
.messages-selection-mode .message-bubble {
    cursor: pointer !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    position: relative;
}

.messages-selection-mode .message-bubble:hover {
    filter: brightness(1.06);
}

.message-select-check {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #8696a0;
    background: #111b21;
    color: transparent;
    font-size: 11px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 10;
}

.message-out .message-select-check {
    left: -28px;
}

.message-in .message-select-check {
    right: -28px;
}

.messages-selection-mode .message-select-check {
    display: flex;
}

.message-bubble.is-selected {
    box-shadow: 0 0 0 2px #00a884, 0 2px 8px rgba(0, 168, 132, 0.3) !important;
}

.message-bubble.is-selected .message-select-check {
    background-color: #00a884;
    border-color: #00a884;
    color: #ffffff;
}

.messages-selection-mode .message-dropdown-btn,
.messages-selection-mode .reaction-trigger-btn {
    pointer-events: none !important;
    display: none !important;
}

/* Light Theme Overrides */
body.wa-light .wa-selection-header {
    background-color: #f0f2f5;
    border-bottom-color: #e9edef;
}

body.wa-light .wa-selection-count {
    color: #111b21;
}

body.wa-light .chat-select-check {
    border-color: #8696a0;
}

body.wa-light .chat-row-wrap.is-selected {
    background-color: #e7f8f5 !important;
}

body.wa-light .chat-row-wrap.is-selected .chat-select-check {
    background-color: #00a884;
    border-color: #00a884;
    color: #ffffff;
}

body.wa-light .message-select-check {
    background: #ffffff;
}

/* WhatsApp Business Lists & Labels Styling */
.wa-chat-label-pill {
    font-size: 10.5px;
    line-height: 1.2;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.label-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wa-header-label-badge {
    font-size: 11px;
    line-height: 1.2;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.list-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.color-swatch-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    outline: none;
}

.color-swatch-btn:hover {
    transform: scale(1.1);
}

.color-swatch-btn.selected {
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.7);
}

.custom-color-picker-wrap input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
}

/* Lists Management Panels */
.wa-lists-panel,
.wa-list-detail-panel {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
    background: #111b21;
}

.lists-item-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(134, 150, 160, 0.12);
    text-align: left;
    color: #e9edef;
    cursor: pointer;
    transition: background 0.15s ease;
}

.lists-item-btn:hover {
    background: #202c33;
}

.list-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(134, 150, 160, 0.1);
    transition: background 0.15s ease;
}

.list-member-row:hover {
    background: #202c33;
}

.assign-list-option {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.assign-list-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.assign-list-option.is-checked {
    background: rgba(0, 168, 132, 0.12);
    border-left-color: #00a884;
}

.assign-list-option.is-checked:hover {
    background: rgba(0, 168, 132, 0.18);
}

.assign-list-option input[type="checkbox"] {
    accent-color: #00a884;
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.add-customer-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(134, 150, 160, 0.08);
}

.add-customer-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.add-customer-row input[type="checkbox"] {
    accent-color: #00a884;
    width: 17px;
    height: 17px;
    cursor: pointer;
}

/* Custom Lists typography */
.lists-item-name,
.list-member-name,
.add-customer-name,
.assign-list-name {
    color: #e9edef;
}

/* Light Theme Overrides for Lists */
body.wa-light .wa-lists-panel,
body.wa-light .wa-list-detail-panel {
    background: #ffffff !important;
}

body.wa-light .lists-panel-header,
body.wa-light .list-detail-meta-bar {
    background: #f0f2f5 !important;
    border-bottom: 1px solid #d1d7db !important;
}

body.wa-light .lists-panel-header span,
body.wa-light .list-detail-meta-bar span {
    color: #54656f !important;
}

body.wa-light .lists-item-btn {
    color: #111b21 !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

body.wa-light .lists-item-btn:hover,
body.wa-light .list-member-row:hover {
    background: #f5f6f6 !important;
}

body.wa-light .list-member-row {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

body.wa-light .assign-list-option:hover,
body.wa-light .add-customer-row:hover {
    background: #f0f2f5 !important;
}

body.wa-light .lists-item-name,
body.wa-light .list-member-name,
body.wa-light .add-customer-name,
body.wa-light .assign-list-name,
body.wa-light .lists-item-btn .text-white,
body.wa-light .list-member-row .text-white,
body.wa-light .add-customer-row .text-white,
body.wa-light .assign-list-option .text-white {
    color: #111b21 !important;
}

body.wa-light .color-swatch-btn.selected {
    border-color: #111b21 !important;
}

/* Modal Stacking: Ensure list-form-modal opens on top of assign-chat-lists-modal */
#list-form-modal {
    z-index: 1080 !important;
}

.modal-backdrop.nested-modal-backdrop {
    z-index: 1075 !important;
}

/* Settings Modern Theme Selection Cards */
.theme-card-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #2a3942;
    background: #111b21;
    color: #e9edef;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.theme-card-option:hover {
    background: #182229;
    border-color: #3b4a54;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.theme-card-option:hover .theme-card-icon {
    transform: scale(1.06);
}

.theme-card-icon-dark {
    background: #202c33;
    color: #25d366;
    border: 1px solid #2a3942;
}

.theme-card-icon-light {
    background: #fff8e6;
    color: #e5a50a;
    border: 1px solid #fde68a;
}

.theme-card-info {
    flex-grow: 1;
    min-width: 0;
}

.theme-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.theme-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #e9edef;
    letter-spacing: -0.2px;
}

.theme-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(134, 150, 160, 0.16);
    color: #8696a0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.theme-card-desc {
    font-size: 12px;
    color: #8696a0;
    display: block;
    line-height: 1.3;
}

/* Radio / Check indicator */
.theme-card-indicator {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.theme-indicator-unchecked {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #3b4a54;
    transition: all 0.2s ease;
}

.theme-card-option:hover .theme-indicator-unchecked {
    border-color: #8696a0;
}

.theme-indicator-checked {
    display: none !important;
    font-size: 20px;
    color: #00a884;
}

/* Checked State */
.btn-check:checked+.theme-card-option {
    background: rgba(0, 168, 132, 0.1) !important;
    border-color: #00a884 !important;
    box-shadow: 0 0 0 1px #00a884, 0 4px 14px rgba(0, 168, 132, 0.2);
}

.btn-check:checked+.theme-card-option .theme-card-title {
    color: #ffffff;
}

.btn-check:checked+.theme-card-option .theme-indicator-unchecked {
    display: none !important;
}

.btn-check:checked+.theme-card-option .theme-indicator-checked {
    display: block !important;
    animation: themeCheckPop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes themeCheckPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Light Mode Overrides for Theme Selection Cards */
body.wa-light .theme-card-option {
    background: #ffffff;
    border-color: #d1d7db;
    color: #111b21;
    box-shadow: 0 1px 3px rgba(11, 20, 26, 0.08);
}

body.wa-light .theme-card-option:hover {
    background: #f7f8fa;
    border-color: #b0b8be;
    box-shadow: 0 3px 8px rgba(11, 20, 26, 0.12);
}

body.wa-light .theme-card-title {
    color: #111b21;
}

body.wa-light .theme-card-desc {
    color: #54656f;
}

body.wa-light .theme-card-badge {
    background: #e9edef;
    color: #54656f;
}

body.wa-light .theme-indicator-unchecked {
    border-color: #b0b8be;
}

body.wa-light .theme-card-option:hover .theme-indicator-unchecked {
    border-color: #54656f;
}

body.wa-light .btn-check:checked+.theme-card-option {
    background: #e7fce3 !important;
    border-color: #008069 !important;
    box-shadow: 0 0 0 1px #008069, 0 4px 14px rgba(0, 128, 105, 0.15);
}

body.wa-light .btn-check:checked+.theme-card-option .theme-indicator-checked {
    color: #008069;
}

body.wa-light .btn-check:checked+.theme-card-option .theme-card-title {
    color: #111b21 !important;
}

body.wa-light .btn-check:checked+.theme-card-option .theme-card-desc {
    color: #54656f !important;
}

/* Settings page light mode adjustments */
body.wa-light .card {
    background-color: #ffffff;
    border-color: #e9edef;
    color: #111b21;
}

/* ==========================================================
   WHATSAPP LIGHT THEME: CHATS LIST AREA & SIDEBAR POLISH
   ========================================================== */

/* Sidebar Base & Border */
body.wa-light .wa-sidebar {
    background: #ffffff !important;
    border-color: #d1d7db !important;
}

/* Sidebar Headers (Main, Selection, Archived, Tools) */
body.wa-light .wa-sidebar-header {
    background: #f0f2f5 !important;
    border-bottom: 1px solid #d1d7db !important;
}

body.wa-light .wa-sidebar-title {
    color: #111b21 !important;
}

body.wa-light .wa-icon-btn {
    color: #54656f !important;
}

body.wa-light .wa-icon-btn:hover {
    background: #e9edef !important;
    color: #111b21 !important;
}

/* Search Bar in Light Mode */
body.wa-light .wa-search-wrap {
    background: #ffffff !important;
    border-bottom: 1px solid #f0f2f5 !important;
}

body.wa-light .wa-search-box {
    background: #f0f2f5 !important;
}

body.wa-light .wa-search-icon {
    color: #54656f !important;
}

body.wa-light .wa-search-input {
    color: #111b21 !important;
}

body.wa-light .wa-search-input::placeholder {
    color: #667781 !important;
}

body.wa-light .wa-search-clear {
    color: #54656f !important;
}

body.wa-light .wa-search-clear:hover {
    color: #111b21 !important;
}

/* Filter Chips in Light Mode */
body.wa-light .wa-filter-row {
    background: #ffffff !important;
    border-bottom: 1px solid #f0f2f5 !important;
}

body.wa-light .wa-filter-chip {
    background: #f0f2f5 !important;
    color: #54656f !important;
}

body.wa-light .wa-filter-chip:hover {
    background: #e9edef !important;
    color: #111b21 !important;
}

body.wa-light .wa-filter-chip.active {
    background: #e7fce3 !important;
    color: #008069 !important;
    font-weight: 600;
}

body.wa-light .wa-filter-chip.active .filter-count {
    background: #008069 !important;
    color: #ffffff !important;
}

body.wa-light .wa-filter-chip:not(.active) .filter-count {
    background: #25d366 !important;
    color: #111b21 !important;
}

body.wa-light .wa-filter-add-chip {
    color: #54656f !important;
}

body.wa-light .wa-filter-add-chip:hover {
    color: #008069 !important;
}

/* Chat List Area in Light Mode */
body.wa-light .wa-chat-list {
    background: #ffffff !important;
}

body.wa-light .chat-row-wrap {
    border-bottom: 1px solid #f0f2f5 !important;
    background: #ffffff;
}

body.wa-light .chat-row {
    background: transparent !important;
}

body.wa-light .chat-row:hover {
    background: #f5f6f6 !important;
}

body.wa-light .chat-row-wrap.active .chat-row,
body.wa-light .chat-row.active {
    background: #f0f2f5 !important;
}

body.wa-light .chat-name {
    color: #111b21 !important;
}

body.wa-light .chat-name-unread {
    color: #111b21 !important;
}

body.wa-light .chat-time {
    color: #667781 !important;
}

body.wa-light .chat-preview {
    color: #667781 !important;
}

body.wa-light .chat-preview-text {
    color: #667781 !important;
}

body.wa-light .chat-preview-unread {
    color: #111b21 !important;
    font-weight: 600 !important;
}

body.wa-light .chat-pin-icon {
    color: #8696a0;
}

body.wa-light .chat-select-check {
    background: #ffffff;
    border-color: #8696a0;
}

body.wa-light .chat-row-wrap.is-selected,
body.wa-light .chat-row-wrap.is-selected .chat-row {
    background: #e7fce3 !important;
}

/* Archived Row & Header in Light Mode */
body.wa-light .wa-archived-entry {
    background: #ffffff !important;
    border-bottom: 1px solid #f0f2f5 !important;
}

body.wa-light .wa-archived-entry:hover {
    background: #f5f6f6 !important;
}

body.wa-light .wa-archived-label {
    color: #111b21 !important;
}

body.wa-light .wa-archived-count {
    color: #008069 !important;
}

body.wa-light .wa-archived-header {
    background: #f0f2f5 !important;
    border-bottom: 1px solid #d1d7db !important;
    color: #111b21 !important;
}

/* Selection Mode Header in Light Mode */
body.wa-light .wa-selection-header {
    background: #f0f2f5 !important;
    border-bottom: 1px solid #d1d7db !important;
}

body.wa-light .wa-selection-count {
    color: #111b21 !important;
}

/* Dropdown Menu & Context Menu in Light Mode */
body.wa-light .wa-dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e9edef !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

body.wa-light .wa-dropdown-menu .dropdown-item {
    color: #111b21 !important;
}

body.wa-light .wa-dropdown-menu .dropdown-item:hover {
    background: #f5f6f6 !important;
    color: #111b21 !important;
}

body.wa-light .wa-dropdown-menu .dropdown-divider {
    border-color: #f0f2f5 !important;
}

body.wa-light .chat-context-menu {
    background: #ffffff !important;
    border: 1px solid #e9edef !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

body.wa-light .chat-context-item {
    color: #111b21 !important;
}

body.wa-light .chat-context-item:hover {
    background: #f5f6f6 !important;
}

/* Empty Chat Splash Screen in Light Mode */
body.wa-light .wa-chat-empty {
    background: #f0f2f5 !important;
    border-bottom: 6px solid #25d366 !important;
}

body.wa-light .wa-empty-title {
    color: #111b21 !important;
}

body.wa-light .wa-empty-desc {
    color: #667781 !important;
}

body.wa-light .wa-empty-footer {
    color: #8696a0 !important;
    border-top-color: #d1d7db !important;
}

/* Active Chat Header in Light Mode */
body.wa-light .wa-chat-header {
    background: #f0f2f5 !important;
    border-bottom: 1px solid #d1d7db !important;
}

body.wa-light .chat-header-title {
    color: #111b21 !important;
}

body.wa-light .chat-header-subtitle {
    color: #667781 !important;
}

body.wa-light .chat-search-bar {
    background: #f0f2f5 !important;
    border-bottom: 1px solid #d1d7db !important;
}

/* Composer in Light Mode */
body.wa-light .wa-composer {
    background: #f0f2f5 !important;
    border-top: 1px solid #d1d7db !important;
}

body.wa-light .composer-input {
    background: #ffffff !important;
    color: #111b21 !important;
    border: 1px solid #d1d7db !important;
}

body.wa-light .composer-input::placeholder {
    color: #667781 !important;
}

body.wa-light .composer-tool-btn,
body.wa-light .composer-mic-btn {
    color: #54656f !important;
}

body.wa-light .composer-tool-btn:hover,
body.wa-light .composer-mic-btn:hover {
    color: #111b21 !important;
}

/* Floating Format Popup in Light Mode */
body.wa-light .composer-format-popup {
    background: #ffffff;
    border-color: #d1d7db;
    box-shadow: 0 4px 16px rgba(11, 20, 26, 0.18);
}

body.wa-light .format-popup-btn {
    color: #111b21;
    border-right-color: #e9edef;
}

body.wa-light .format-popup-btn:hover {
    background: #f0f2f5;
    color: #111b21;
}

body.wa-light .format-popup-btn:active {
    background: #e9edef;
}

body.wa-light .format-popup-arrow {
    background: #ffffff;
    border-right-color: #d1d7db;
    border-bottom-color: #d1d7db;
}

/* Floating Scroll Bottom Button in Light Mode */
body.wa-light .wa-scroll-bottom-btn {
    background: #ffffff !important;
    border: 1px solid #d1d7db !important;
    color: #54656f !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

body.wa-light .wa-scroll-bottom-btn:hover {
    background: #f5f6f6 !important;
    color: #111b21 !important;
}

/* Modals in Light Mode */
body.wa-light .modal-content.bg-dark {
    background-color: #ffffff !important;
    color: #111b21 !important;
    border-color: #d1d7db !important;
}

body.wa-light .modal-header.border-secondary,
body.wa-light .modal-footer.border-secondary {
    border-color: #f0f2f5 !important;
}

body.wa-light .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(20%) !important;
}

body.wa-light .modal-body input.bg-dark,
body.wa-light .modal-body select.bg-dark,
body.wa-light .modal-body textarea.bg-dark {
    background-color: #f0f2f5 !important;
    border-color: #d1d7db !important;
    color: #111b21 !important;
}

body.wa-light .assign-lists-container {
    border-color: #d1d7db !important;
    background: #ffffff !important;
}

/* Chat Row Chevron in Light Mode */
body.wa-light .chat-row-chevron {
    color: #667781 !important;
}

body.wa-light .chat-row-chevron:hover,
body.wa-light .chat-row-chevron.menu-open {
    background: #e9edef !important;
    color: #111b21 !important;
}

/* Business Tools & Away Message Panels in Light Mode */
body.wa-light .wa-tools-panel,
body.wa-light .wa-away-panel {
    background: #ffffff !important;
}

body.wa-light .tools-section-title {
    color: #54656f !important;
}

body.wa-light .tools-item-btn {
    background: #ffffff !important;
    border-color: #e9edef !important;
    color: #111b21 !important;
}

body.wa-light .tools-item-btn:hover {
    background: #f5f6f6 !important;
    border-color: #00a884 !important;
}

body.wa-light .tools-item-title {
    color: #111b21 !important;
}

body.wa-light .tools-item-subtitle {
    color: #667781 !important;
}

body.wa-light .away-status-banner {
    background: #f0f2f5 !important;
    border-color: #d1d7db !important;
}

body.wa-light #business-status-text {
    color: #111b21 !important;
}

body.wa-light .away-card {
    background: #ffffff !important;
    border-color: #e9edef !important;
}

body.wa-light .away-card label {
    color: #111b21 !important;
}

body.wa-light .wa-textarea {
    background: #ffffff !important;
    border-color: #d1d7db !important;
    color: #111b21 !important;
}

body.wa-light .schedule-day-row {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

body.wa-light .schedule-day-name {
    color: #111b21 !important;
}

body.wa-light .schedule-time-input {
    background: #ffffff !important;
    border-color: #d1d7db !important;
    color: #111b21 !important;
    color-scheme: light !important;
}

body.wa-light .schedule-closed-badge {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #667781 !important;
}

body.wa-light .schedule-preset-btn {
    border-color: #d1d7db !important;
    color: #667781 !important;
}

body.wa-light .schedule-preset-btn:hover {
    background: #f0f2f5 !important;
    color: #111b21 !important;
    border-color: #00a884 !important;
}

/* Chat Header Inline Search in Light Mode */
body.wa-light .chat-search-bar .input-group-text {
    background-color: #f0f2f5 !important;
    border-color: #d1d7db !important;
    color: #54656f !important;
}

body.wa-light #chat-search-input {
    background-color: #ffffff !important;
    border-color: #d1d7db !important;
    color: #111b21 !important;
}

body.wa-light #chat-search-close {
    border-color: #d1d7db !important;
    color: #54656f !important;
}

body.wa-light #chat-search-close:hover {
    background-color: #e9edef !important;
    color: #111b21 !important;
}

/* ==========================================================================
   META BUSINESS SUITE WHATSAPP TEMPLATE MANAGER STYLES (MATCHING SCREENSHOTS)
   ========================================================================== */

.mtm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #050505;
}

.mtm-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* TOP HEADER & BREADCRUMB */
.mtm-header {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #dadde1;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.mtm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
}

.mtm-meta-logo {
    color: #0064e0;
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.mtm-crumb-btn {
    background: none;
    border: none;
    padding: 0;
    color: #050505;
    font-weight: 600;
    cursor: pointer;
    font-size: 14.5px;
}

.mtm-crumb-btn:hover {
    text-decoration: underline;
}

.mtm-crumb-sep {
    font-size: 11px;
    color: #8a8d91;
}

.mtm-crumb-current {
    color: #65676b;
    font-weight: 500;
}

.mtm-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #65676b;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mtm-close-btn:hover {
    background: #e4e6eb;
    color: #050505;
}

/* BODY AREA */
.mtm-body {
    flex: 1;
    overflow-y: auto;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
}

.mtm-view {
    padding: 24px 32px 48px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* LIST TOOLBAR (SCREENSHOT 1) */
.mtm-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.mtm-toolbar-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mtm-search-input-wrap {
    position: relative;
    width: 230px;
}

.mtm-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #65676b;
    font-size: 13px;
    pointer-events: none;
}

.mtm-search-input {
    width: 100%;
    height: 36px;
    padding: 6px 12px 6px 32px;
    background: #ffffff;
    border: 1px solid #dadde1;
    border-radius: 6px;
    font-size: 14px;
    color: #050505;
    outline: none;
    transition: border-color 0.15s ease;
}

.mtm-search-input:focus {
    border-color: #0064e0;
    box-shadow: 0 0 0 2px rgba(0, 100, 224, 0.15);
}

.mtm-filter-dropdown-wrap {
    position: relative;
}

.mtm-filter-select {
    height: 36px;
    padding: 6px 28px 6px 12px;
    background: #ffffff;
    border: 1px solid #dadde1;
    border-radius: 6px;
    font-size: 14px;
    color: #050505;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2365676b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.mtm-filter-select:focus {
    border-color: #0064e0;
}

.mtm-btn-primary {
    background: #0064e0;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    height: 36px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.mtm-btn-primary:hover {
    background: #1877f2;
}

.mtm-btn-secondary {
    background: #e4e6eb;
    color: #050505;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    height: 36px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.mtm-btn-secondary:hover {
    background: #d8dadf;
}

/* TABLE STYLES (SCREENSHOT 1) */
.mtm-table-responsive {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dadde1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

.mtm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

.mtm-table thead tr {
    background: #f5f6f7;
    border-bottom: 1px solid #dadde1;
}

.mtm-table th {
    padding: 12px 14px;
    font-weight: 600;
    color: #65676b;
    white-space: nowrap;
    user-select: none;
}

.mtm-th-sortable {
    cursor: pointer;
}

.mtm-th-sortable:hover {
    color: #050505;
}

.mtm-sort-arrows {
    font-size: 11px;
    color: #8a8d91;
    margin-left: 3px;
}

.mtm-th-info {
    font-size: 11.5px;
    color: #8a8d91;
    margin-left: 2px;
}

.mtm-th-check,
.mtm-td-check {
    width: 44px;
    text-align: center;
}

.mtm-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #0064e0;
    cursor: pointer;
}

.mtm-table td {
    padding: 14px 14px;
    border-bottom: 1px solid #ebedf0;
    color: #050505;
    vertical-align: middle;
}

.mtm-table tbody tr:last-child td {
    border-bottom: none;
}

.mtm-table tbody tr:hover td {
    background: #f7f8fa;
}

.mtm-template-name-cell {
    font-weight: 600;
    color: #050505;
    font-size: 14px;
}

.mtm-template-lang-cell {
    display: flex;
    flex-direction: column;
}

.mtm-lang-title {
    font-weight: 500;
    color: #050505;
}

.mtm-lang-snippet {
    font-size: 12px;
    color: #65676b;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* META STATUS BADGES (MATCHING SCREENSHOT 1) */
.mtm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.mtm-status-active {
    background: #e8f7ee;
    color: #0f7b3b;
    border: 1px solid #c2ebd0;
}

.mtm-status-pending {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.mtm-status-rejected {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.mtm-status-paused {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.mtm-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.mtm-action-btn-del {
    background: transparent;
    border: none;
    color: #65676b;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mtm-action-btn-del:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* STEPPER (SCREENSHOTS 2, 3, 4, 5) */
.mtm-stepper-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.mtm-stepper {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 24px;
    border: 1px solid #dadde1;
}

.mtm-stepper-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #65676b;
    cursor: default;
}

.mtm-stepper-item.active {
    background: #e7f3ff;
    color: #0064e0;
}

.mtm-stepper-item.completed {
    color: #0f7b3b;
}

.mtm-stepper-icon {
    font-size: 11px;
}

.mtm-stepper-line {
    width: 32px;
    height: 2px;
    background: #dadde1;
    margin: 0 4px;
}

/* WIZARD STEP 1: SET UP TEMPLATE (SCREENSHOTS 2 & 3) */
.mtm-setup-card {
    max-width: 820px;
    margin: 0 auto;
}

.mtm-card {
    background: #ffffff;
    border: 1px solid #dadde1;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mtm-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #050505;
    margin: 0 0 6px 0;
}

.mtm-card-subtitle {
    font-size: 14px;
    color: #65676b;
    line-height: 1.45;
    margin-bottom: 20px;
}

.mtm-link {
    color: #0064e0;
    text-decoration: none;
}

.mtm-link:hover {
    text-decoration: underline;
}

/* CATEGORY SEGMENTED TABS (SCREENSHOT 2 & 3) */
.mtm-cat-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #dadde1;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}

.mtm-cat-tab {
    background: #f5f6f7;
    border: none;
    border-right: 1px solid #dadde1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mtm-cat-tab:last-child {
    border-right: none;
}

.mtm-cat-tab.active {
    background: #ffffff;
    color: #0064e0;
    box-shadow: inset 0 -2px 0 #0064e0;
}

/* SUBTYPES RADIO GROUP */
.mtm-subtypes-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mtm-subtype-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #dadde1;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mtm-subtype-item:hover {
    background: #f7f8fa;
}

.mtm-subtype-item.selected {
    background: #f0f7ff;
    border-color: #1877f2;
}

.mtm-subtype-radio {
    margin-top: 3px;
    accent-color: #0064e0;
    cursor: pointer;
}

.mtm-subtype-label-wrap {
    flex: 1;
}

.mtm-subtype-title {
    font-size: 14px;
    font-weight: 600;
    color: #050505;
}

.mtm-subtype-desc {
    font-size: 13px;
    color: #65676b;
    margin-top: 2px;
}

/* WIZARD STEP 2: EDIT TEMPLATE (SCREENSHOTS 4 & 5) */
.mtm-summary-banner {
    background: #ffffff;
    border: 1px solid #dadde1;
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.mtm-summary-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #00a884;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.mtm-summary-title {
    font-size: 15px;
    font-weight: 700;
    color: #050505;
}

.mtm-summary-sub {
    font-size: 12.5px;
    color: #65676b;
}

/* 2-COLUMN BUILDER GRID */
.mtm-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

.mtm-section-heading {
    font-size: 15.5px;
    font-weight: 700;
    color: #050505;
    margin: 0 0 12px 0;
}

.mtm-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #050505;
}

.mtm-char-counter {
    font-size: 12px;
    color: #65676b;
}

.mtm-input,
.mtm-select {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #dadde1;
    border-radius: 6px;
    font-size: 14px;
    color: #050505;
    outline: none;
    transition: border-color 0.15s ease;
}

.mtm-input:focus,
.mtm-select:focus {
    border-color: #0064e0;
    box-shadow: 0 0 0 2px rgba(0, 100, 224, 0.15);
}

.mtm-input-help {
    font-size: 12px;
    color: #65676b;
    margin-top: 4px;
}

.mtm-add-var-btn-inline {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #0064e0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
}

.mtm-add-var-btn-inline:hover {
    text-decoration: underline;
}

/* TEXTAREA & TOOLBAR */
.mtm-textarea-container {
    border: 1px solid #dadde1;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.15s ease;
}

.mtm-textarea-container:focus-within {
    border-color: #0064e0;
    box-shadow: 0 0 0 2px rgba(0, 100, 224, 0.15);
}

.mtm-textarea {
    width: 100%;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #050505;
    resize: vertical;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.mtm-formatting-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f5f6f7;
    border-top: 1px solid #dadde1;
}

.mtm-fmt-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #65676b;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
}

.mtm-fmt-btn:hover {
    background: #e4e6eb;
    color: #050505;
}

.mtm-btn-add-var {
    background: none;
    border: none;
    color: #0064e0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.mtm-btn-add-var:hover {
    background: #e7f3ff;
}

/* VARIABLE SAMPLES (SCREENSHOT 5) */
.mtm-samples-section {
    background: #fafbfc;
    border: 1px solid #dadde1;
    border-radius: 6px;
    padding: 16px 18px;
}

.mtm-samples-title {
    font-size: 14px;
    font-weight: 700;
    color: #050505;
    margin: 0 0 4px 0;
}

.mtm-samples-subtitle {
    font-size: 12.5px;
    color: #65676b;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.mtm-samples-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #050505;
    margin-bottom: 8px;
}

.mtm-var-sample-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mtm-var-tag {
    background: #e4e6eb;
    color: #050505;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.mtm-var-sample-input {
    flex: 1;
    height: 36px;
    padding: 6px 12px;
    border: 1px solid #dadde1;
    border-radius: 6px;
    font-size: 13.5px;
    color: #050505;
    background: #ffffff;
    outline: none;
}

.mtm-var-sample-input.is-invalid {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* MEDIA UPLOAD BOX */
.mtm-media-upload-box {
    border: 2px dashed #dadde1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #fcfdfe;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mtm-media-upload-box:hover {
    border-color: #0064e0;
    background: #f0f7ff;
}

.mtm-upload-icon {
    color: #0064e0;
    margin-bottom: 8px;
}

.mtm-media-preview-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 6px;
    margin-top: 8px;
}

/* BUTTONS CONFIG CARDS */
.mtm-button-card {
    border: 1px solid #dadde1;
    border-radius: 6px;
    padding: 12px 14px;
    background: #f8f9fa;
    position: relative;
}

.mtm-btn-card-remove {
    position: absolute;
    right: 10px;
    top: 8px;
    background: none;
    border: none;
    color: #65676b;
    font-size: 18px;
    cursor: pointer;
}

.mtm-btn-card-remove:hover {
    color: #dc2626;
}

/* PREVIEW COLUMN (RIGHT SIDE) */
.mtm-preview-sticky-card {
    position: sticky;
    top: 20px;
    background: #ffffff;
    border: 1px solid #dadde1;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.mtm-preview-title {
    font-size: 15px;
    font-weight: 700;
    color: #050505;
    margin: 0 0 14px 0;
}

.mtm-phone-container {
    border-radius: 18px;
    border: 8px solid #202c33;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    background: #efeae2;
}

.mtm-phone-chat-header {
    background: #008069;
    color: #ffffff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mtm-phone-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.mtm-phone-name {
    font-size: 12.5px;
    font-weight: 600;
}

.mtm-phone-status {
    font-size: 10.5px;
    opacity: 0.85;
}

.mtm-phone-chat-body {
    padding: 14px 10px 24px;
    min-height: 240px;
    background-color: #efeae2;
    background-image: url("/assets/img/wa-doodle.svg");
    background-size: 260px auto;
    background-repeat: repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.mtm-chat-bubble {
    max-width: 92%;
    background: #ffffff;
    border-radius: 7.5px;
    padding: 8px 10px 4px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
    color: #111b21;
    font-size: 13px;
    position: relative;
    word-break: break-word;
}

.mtm-bubble-header {
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 4px;
    color: #111b21;
}

.mtm-bubble-media {
    width: 100%;
    height: 120px;
    background: #e9edef;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #667781;
    font-size: 12px;
    margin-bottom: 6px;
}

.mtm-bubble-body {
    line-height: 1.45;
    white-space: pre-wrap;
}

.mtm-bubble-var {
    background: rgba(0, 168, 132, 0.15);
    color: #00a884;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.mtm-bubble-footer {
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
}

.mtm-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 2px;
}

.mtm-bubble-time {
    font-size: 10.5px;
    color: #667781;
}

.mtm-bubble-check {
    font-size: 11px;
    color: #53bdeb;
}

.mtm-bubble-buttons {
    border-top: 1px solid #f0f2f5;
    margin-top: 6px;
    padding-top: 2px;
    display: flex;
    flex-direction: column;
}

.mtm-bubble-btn {
    background: none;
    border: none;
    border-top: 1px solid #f0f2f5;
    padding: 7px 4px;
    color: #00a884;
    font-size: 12.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.mtm-bubble-btn:first-child {
    border-top: none;
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .mtm-builder-layout {
        grid-template-columns: 1fr;
    }
    .mtm-preview-sticky-card {
        position: static;
        max-width: 400px;
        margin: 0 auto;
    }
}