:root{--wa:#128c7e;--wa-dark:#075e54;--wa-light:#d9fdd3;--bg:#f0f2f5}body{background:#f5f7f8;color:#253238}.bg-wa{background:var(--wa-dark)!important}.btn-wa{background:var(--wa);border-color:var(--wa);color:#fff}.btn-wa:hover,.btn-wa:focus{background:#0e766b;border-color:#0e766b;color:#fff}.login-icon{font-size:4rem;color:var(--wa)}.chat-page{height:calc(100vh - 56px);overflow:hidden}.chat-shell{height:100%;display:grid;grid-template-columns:minmax(300px,30%) 1fr;background:#fff}.chat-sidebar{border-right:1px solid #dce2e5;display:flex;flex-direction:column;min-width:0}.sidebar-head{padding:18px;background:#f7f9fa}.conversation-list{overflow-y:auto;flex:1}.conversation-item{width:100%;border:0;border-bottom:1px solid #edf0f1;background:#fff;text-align:left;padding:12px 14px;display:flex;gap:12px;align-items:center}.conversation-item:hover,.conversation-item.active{background:#edf2f3}.avatar{width:44px;height:44px;flex:0 0 44px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#c8e7e2;color:var(--wa-dark);font-weight:700}.conversation-copy{min-width:0;flex:1}.conversation-copy strong,.preview span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.preview{color:#68777e;font-size:.88rem;display:flex;justify-content:space-between;gap:8px}.unread{background:#25d366;color:#fff;border-radius:20px;padding:1px 7px;font-size:.72rem}.chat-window{min-width:0;background:#efeae2;position:relative}.empty-chat{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#66767d}.empty-chat i{font-size:5rem;color:#a8c8c3}.chat-header{height:66px;background:#f5f7f8;border-bottom:1px solid #dce2e5;padding:10px 16px;display:flex;align-items:center;gap:12px}.messages{flex:1;overflow-y:auto;padding:24px 6%;background-color:#efeae2;background-image:radial-gradient(#d9d3c8 1px,transparent 1px);background-size:20px 20px}.message-row{display:flex;margin:5px 0}.message-row.outgoing{justify-content:flex-end}.bubble{max-width:72%;padding:8px 10px 5px;border-radius:8px;background:#fff;box-shadow:0 1px 1px #00000018;overflow-wrap:anywhere}.message-text{white-space:pre-wrap}.outgoing .bubble{background:var(--wa-light)}.bubble-meta{font-size:.7rem;color:#6d7b80;text-align:right;margin-left:24px;white-space:nowrap}.status-failed{color:#c62828}.template-label{color:#52706a;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;margin-bottom:2px}.template-preview{white-space:pre-wrap;background:#f6f7f8;border:1px solid #dde2e5;border-radius:8px;padding:12px}.composer{display:flex;align-items:flex-end;gap:10px;padding:10px 14px;background:#f0f2f5}.composer textarea{resize:none;max-height:120px;border-radius:22px;padding:10px 16px}.composer button{width:44px;height:44px}.empty-state{text-align:center;color:#77858a;padding:55px 15px}.empty-state i{font-size:2.5rem}.card{border-radius:12px}@media(max-width:991.98px){.chat-shell{display:block}.chat-sidebar,.chat-window{height:100%}.chat-window{display:none}.chat-shell.mobile-chat .chat-sidebar{display:none}.chat-shell.mobile-chat .chat-window{display:block}.bubble{max-width:88%}}@media(min-width:992px){.chat-window{display:block!important}}

.composer{display:flex;flex-direction:column;align-items:stretch;gap:8px}
.composer-row{display:flex;align-items:flex-end;gap:8px;min-width:0}
.composer-row textarea{flex:1;min-width:0}
.composer-row>button{width:44px;height:44px}
.attachment-preview{display:flex;gap:8px;overflow-x:auto;padding:2px 1px 6px;scrollbar-width:thin}
.attachment-item{position:relative;display:flex;align-items:center;gap:8px;flex:0 0 210px;min-width:0;padding:6px 30px 6px 6px;border:1px solid #d7dde0;border-radius:10px;background:#fff;box-shadow:0 1px 2px #0000000d}
.attachment-item>img,.attachment-file-icon{width:48px;height:48px;flex:0 0 48px;border-radius:7px;object-fit:cover;background:#f1f3f4}
.attachment-file-icon{display:flex;align-items:center;justify-content:center;color:#d32f2f;font-size:1.6rem}
.attachment-info{min-width:0;display:flex;flex-direction:column}
.attachment-info strong{font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attachment-info small{font-size:.7rem;color:#728087}
.composer .attachment-remove{position:absolute;top:3px;right:3px;width:24px;height:24px;border:0;border-radius:50%;background:#e9edef;color:#526167;line-height:1;padding:0}
.chat-image-button{display:block;max-width:100%;padding:0;border:0;border-radius:7px;background:transparent;overflow:hidden;cursor:zoom-in}
.chat-image{display:block;width:auto;max-width:min(380px,100%);height:auto;max-height:360px;border-radius:7px;object-fit:cover;background:#e1e5e7}
.document-card{display:flex;align-items:center;gap:10px;min-width:min(330px,65vw);padding:10px;border-radius:8px;background:#ffffffb8;color:#243238;text-decoration:none}
.incoming .document-card{background:#f1f3f4}
.document-card:hover{color:#0a665d;background:#fff}
.document-icon{width:42px;height:42px;flex:0 0 42px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#ffebee;color:#d32f2f;font-size:1.3rem}
.document-copy{display:flex;flex:1;min-width:0;flex-direction:column}
.document-copy strong{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.document-copy small{font-size:.72rem;color:#6d7b80}
.document-download{color:#66767d}
.media-lightbox-image{display:block;max-width:100%;max-height:calc(100vh - 210px);margin:auto;object-fit:contain}
@media(max-width:575.98px){.composer{padding:8px}.composer-row{gap:5px}.composer-row>button{width:40px;height:40px}.attachment-item{flex-basis:180px}.chat-image{max-height:300px}.document-card{min-width:min(260px,72vw)}}
.conversation-item{padding:0;gap:0}
.conversation-select{min-width:0;flex:1;border:0;background:transparent;text-align:left;padding:12px 6px 12px 14px;display:flex;gap:12px;align-items:center}
.conversation-delete{width:34px;height:34px;flex:0 0 34px;margin-right:10px;border:0;border-radius:50%;background:transparent;color:#c62828;opacity:.65}
.conversation-delete:hover,.conversation-delete:focus{background:#ffebee;color:#b71c1c;opacity:1}
.conversation-delete:disabled{opacity:.3}
