.wa-page {
    --wa-green: #16a66a;
    --wa-green-dark: #087b50;
    --wa-ink: #17352d;
    --wa-muted: #73847f;
    --wa-border: #dfe8e5;
    color: var(--wa-ink);
}

.wa-hero {
    align-items: center;
    background:
        radial-gradient(circle at 82% 15%, rgba(255,255,255,.18), transparent 24%),
        linear-gradient(125deg, #086447 0%, #0f8b5c 58%, #20b976 100%);
    border-radius: 1rem 1rem 0 0;
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 118px;
    overflow: hidden;
    padding: 1.45rem 1.7rem;
    position: relative;
}

.wa-eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .11em;
    margin-bottom: .25rem;
    opacity: .78;
    text-transform: uppercase;
}

.wa-eyebrow i { margin-right: .4rem; }
.wa-hero h1 { color: #fff; font-size: 1.9rem; line-height: 1.1; margin: 0; }
.wa-hero p { font-size: .88rem; margin: .4rem 0 0; opacity: .82; }

.wa-hero-actions { align-items: center; display: flex; gap: .7rem; }
.wa-stat {
    background: rgba(4, 63, 44, .35);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: .8rem;
    display: flex;
    flex-direction: column;
    min-width: 108px;
    padding: .65rem .9rem;
}
.wa-stat strong { color: #fff; font-size: 1.25rem; line-height: 1; }
.wa-stat span { font-size: .68rem; margin-top: .3rem; opacity: .78; }
.wa-stat-attention { background: rgba(255, 195, 76, .18); }

.wa-icon-button {
    align-items: center;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    transition: .18s ease;
    width: 42px;
}
.wa-icon-button:hover { background: rgba(255,255,255,.24); transform: translateY(-1px); }
.wa-icon-button:disabled { opacity: .6; transform: none; }

.wa-shell {
    background: #fff;
    border: 1px solid var(--wa-border);
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 14px 38px rgba(24, 61, 49, .09);
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    height: calc(100vh - 250px);
    min-height: 610px;
    overflow: hidden;
}

.wa-list-pane { border-right: 1px solid var(--wa-border); display: flex; flex-direction: column; min-width: 0; }
.wa-list-tools { border-bottom: 1px solid var(--wa-border); padding: 1rem; }
.wa-search { align-items: center; background: #f2f6f5; border: 1px solid transparent; border-radius: .65rem; display: flex; padding: 0 .8rem; transition: .18s ease; }
.wa-search:focus-within { background: #fff; border-color: rgba(22, 166, 106, .45); box-shadow: 0 0 0 3px rgba(22,166,106,.09); }
.wa-search i { color: #8b9a96; font-size: .78rem; }
.wa-search input { background: transparent; border: 0; color: var(--wa-ink); font-size: .78rem; min-width: 0; outline: 0; padding: .75rem .6rem; width: 100%; }

.wa-filter { align-items: center; color: var(--wa-muted); cursor: pointer; display: flex; font-size: .72rem; margin: .75rem 0 0; }
.wa-filter input { accent-color: var(--wa-green); margin-right: .45rem; }
.wa-filter b { background: #e5f7ee; border-radius: 1rem; color: var(--wa-green-dark); font-size: .65rem; margin-left: auto; min-width: 1.35rem; padding: .15rem .4rem; text-align: center; }

.wa-conversation-list { flex: 1; min-height: 0; overflow-y: auto; }
.wa-conversation {
    align-items: center;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf2f0;
    color: inherit;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    padding: .9rem 1rem;
    position: relative;
    text-align: left;
    transition: background .16s ease;
    width: 100%;
}
.wa-conversation:hover { background: #f5faf8; }
.wa-conversation.is-active { background: #eaf8f1; box-shadow: inset 3px 0 0 var(--wa-green); }

.wa-avatar {
    align-items: center;
    background: linear-gradient(145deg, #d8f4e7, #b9e8d2);
    border-radius: 50%;
    color: var(--wa-green-dark);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: .75rem;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    margin-right: .75rem;
    width: 42px;
}
.wa-avatar-small { height: 38px; margin-right: .7rem; width: 38px; }
.wa-conversation-content { display: flex; flex-direction: column; min-width: 0; }
.wa-conversation-topline { align-items: baseline; display: flex; gap: .5rem; }
.wa-conversation-topline strong { color: #18352d; flex: 1; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-conversation-topline time { color: #8a9a95; font-size: .62rem; white-space: nowrap; }
.wa-company { color: #8a9a95; font-size: .62rem; margin-top: .14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-preview { color: #71817c; display: block; font-size: .71rem; margin-top: .33rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-preview i { font-size: .58rem; margin-right: .3rem; }
.wa-preview.needs-reply { color: #344e46; font-weight: 600; }
.wa-unread-dot { background: var(--wa-green); border: 2px solid #fff; border-radius: 50%; height: 10px; margin-left: .55rem; width: 10px; }

.wa-list-footer { border-top: 1px solid var(--wa-border); color: #879691; font-size: .62rem; padding: .55rem 1rem; text-align: center; }
.wa-list-footer i { color: #35bd7d; font-size: .42rem; margin-right: .3rem; vertical-align: middle; }

.wa-chat-pane { background: #f4f8f6; display: flex; flex-direction: column; min-width: 0; }
.wa-chat-empty { align-items: center; display: flex; flex: 1; flex-direction: column; justify-content: center; padding: 2rem; text-align: center; }
.wa-chat-empty-icon { align-items: center; background: #dff5eb; border-radius: 50%; color: var(--wa-green); display: flex; font-size: 2.2rem; height: 78px; justify-content: center; margin-bottom: 1.2rem; width: 78px; }
.wa-chat-empty h2 { color: var(--wa-ink); font-size: 1.15rem; margin: 0; }
.wa-chat-empty p { color: var(--wa-muted); font-size: .8rem; line-height: 1.55; margin: .5rem 0 1rem; max-width: 390px; }
.wa-chat-empty span { color: #86958f; font-size: .68rem; }
.wa-chat-empty span i { color: var(--wa-green); margin-right: .35rem; }

.wa-chat-header { align-items: center; background: #fff; border-bottom: 1px solid var(--wa-border); display: flex; min-height: 70px; padding: .8rem 1.15rem; }
.wa-back-button { background: transparent; border: 0; color: var(--wa-green-dark); display: none; margin-right: .55rem; padding: .35rem; }
.wa-chat-identity { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.wa-chat-identity strong { color: var(--wa-ink); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-identity span { color: var(--wa-muted); font-size: .65rem; margin-top: .16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-identity span i { color: var(--wa-green); margin-right: .2rem; }
.wa-chat-actions { align-items: center; display: flex; gap: .75rem; }
.wa-chat-actions a { align-items: center; background: #f2f6f5; border-radius: 50%; color: #62746e; display: flex; height: 34px; justify-content: center; width: 34px; }
.wa-chat-actions a:hover { background: #e4f2ec; color: var(--wa-green-dark); }
.wa-status { border-radius: 1rem; font-size: .62rem; font-weight: 700; padding: .28rem .55rem; }
.wa-status.is-pending { background: #fff3d6; color: #976b04; }
.wa-status.is-progress { background: #e4efff; color: #2967a8; }
.wa-status.is-done { background: #e1f6eb; color: #18794e; }
.wa-status.is-closed, .wa-status.is-cancelled { background: #edf0ef; color: #6c7874; }

.wa-chat-body {
    background-color: #edf4f1;
    background-image: radial-gradient(rgba(13, 105, 73, .06) .7px, transparent .7px);
    background-size: 15px 15px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}
.wa-day-separator { display: flex; justify-content: center; margin: .45rem 0 .85rem; }
.wa-day-separator span { background: rgba(255,255,255,.88); border: 1px solid rgba(198,214,208,.8); border-radius: 1rem; color: #71817b; font-size: .62rem; padding: .25rem .65rem; }
.wa-message-row { display: flex; margin: .24rem 0; }
.wa-message-row.outgoing { justify-content: flex-end; }
.wa-bubble { background: #fff; border-radius: .25rem .85rem .85rem .85rem; box-shadow: 0 1px 2px rgba(27,61,50,.1); max-width: min(76%, 620px); padding: .55rem .68rem .35rem; }
.wa-message-row.outgoing .wa-bubble { background: #d8f6e7; border-radius: .85rem .25rem .85rem .85rem; }
.wa-message-text { color: #274139; font-size: .78rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.wa-message-meta { color: #84948f; font-size: .57rem; margin-left: 1.2rem; margin-top: .2rem; text-align: right; }
.wa-message-meta i { color: #2f9bd3; font-size: .55rem; margin-left: .22rem; }

.wa-composer { background: #fff; border-top: 1px solid var(--wa-border); padding: .75rem 1rem .6rem; }
.wa-composer-row { align-items: flex-end; display: flex; gap: .6rem; }
.wa-account-select { background: #f3f7f5; border: 1px solid var(--wa-border); border-radius: .7rem; color: var(--wa-ink); font-size: .7rem; height: 42px; max-width: 190px; padding: 0 .6rem; }
.wa-composer textarea { background: #f3f7f5; border: 1px solid transparent; border-radius: .85rem; color: var(--wa-ink); flex: 1; font-size: .78rem; max-height: 110px; min-height: 42px; outline: none; padding: .65rem .85rem; resize: vertical; }
.wa-composer textarea:focus { background: #fff; border-color: rgba(22,166,106,.45); box-shadow: 0 0 0 3px rgba(22,166,106,.08); }
.wa-send-button { align-items: center; background: var(--wa-green); border: 0; border-radius: 50%; color: #fff; display: flex; flex: 0 0 auto; height: 42px; justify-content: center; transition: .18s ease; width: 42px; }
.wa-send-button:hover:not(:disabled) { background: var(--wa-green-dark); transform: translateY(-1px); }
.wa-send-button:disabled { background: #b9c9c3; cursor: not-allowed; }
.wa-composer-meta { color: #8b9995; display: flex; font-size: .57rem; justify-content: space-between; margin-top: .4rem; padding: 0 .15rem; }
.wa-composer-meta strong { color: #547067; font-weight: 600; }
.wa-account-warning { background: #fff7e5; border: 1px solid #ffe1a1; border-radius: .65rem; color: #8b650c; font-size: .72rem; padding: .65rem .8rem; }
.wa-account-warning i { margin-right: .35rem; }

.wa-loading, .wa-empty-list { align-items: center; color: var(--wa-muted); display: flex; flex-direction: column; font-size: .72rem; gap: .55rem; justify-content: center; min-height: 190px; padding: 1.5rem; text-align: center; }
.wa-loading i, .wa-empty-list i { color: var(--wa-green); font-size: 1.35rem; }
.wa-empty-list strong { color: var(--wa-ink); font-size: .78rem; }
.wa-empty-list span { max-width: 210px; }
.wa-loading-chat { height: 100%; }
.wa-no-messages { color: var(--wa-muted); font-size: .75rem; padding: 2rem; text-align: center; }

@media (max-width: 991.98px) {
    .wa-shell { display: block; height: calc(100vh - 240px); min-height: 560px; }
    .wa-list-pane, .wa-chat-pane { height: 100%; }
    .wa-mobile-hidden { display: none; }
    .wa-back-button { display: inline-block; }
}

@media (max-width: 575.98px) {
    .wa-hero { align-items: flex-start; border-radius: .75rem .75rem 0 0; flex-direction: column; gap: 1rem; padding: 1.15rem; }
    .wa-hero p { display: none; }
    .wa-hero-actions { width: 100%; }
    .wa-stat { flex: 1; min-width: 0; padding: .55rem .7rem; }
    .wa-stat strong { font-size: 1rem; }
    .wa-shell { border-radius: 0 0 .75rem .75rem; height: calc(100vh - 230px); min-height: 530px; }
    .wa-chat-header { padding: .7rem .65rem; }
    .wa-avatar-small { display: none; }
    .wa-status { display: none; }
    .wa-chat-body { padding: .85rem .65rem; }
    .wa-bubble { max-width: 88%; }
    .wa-composer { padding: .65rem; }
    .wa-composer-meta { display: none; }
    .wa-account-select { max-width: 110px; }
}
