.chat-shell{height:calc(100vh - 140px);min-height:580px;display:grid;grid-template-columns:340px minmax(0,1fr);background:#fff;border:1px solid var(--line);border-radius:15px;overflow:hidden;box-shadow:var(--shadow)}
.chat-list{border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0}.chat-list-head{padding:18px;border-bottom:1px solid var(--line)}.chat-list-head h2{font:800 18px Manrope;margin:0 0 12px}.chat-search{display:flex;align-items:center;gap:8px;background:#f4f6f3;border:1px solid var(--line);border-radius:9px;padding:9px 11px}.chat-search input{border:0;outline:0;background:transparent;width:100%;font:inherit;font-size:12px}.conversation-list{overflow:auto;flex:1}.conversation-item{width:100%;border:0;border-bottom:1px solid #edf0ed;background:#fff;padding:14px 15px;display:grid;grid-template-columns:42px 1fr auto;gap:10px;text-align:left;cursor:pointer}.conversation-item:hover,.conversation-item.active{background:#f0f6f2}.conversation-item.active{box-shadow:inset 3px 0 #2c6555}.conversation-item .avatar{width:42px;height:42px;border-radius:50%}.conversation-copy{min-width:0}.conversation-copy strong,.conversation-copy small{display:block}.conversation-copy strong{font-size:13px}.conversation-copy small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}.conversation-meta{text-align:right}.conversation-meta time{display:block;color:#8a948f;font-size:9px}.unread{display:inline-grid;place-items:center;background:#2c6555;color:white;border-radius:50%;width:18px;height:18px;font-size:9px;font-weight:800;margin-top:7px}
.chat-main{display:flex;flex-direction:column;min-width:0;background:#f5f7f3}.chat-header{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px}.chat-person{display:flex;align-items:center;gap:10px}.chat-person strong,.chat-person small{display:block}.chat-person strong{font-size:14px}.chat-person small{color:#4c856f;font-size:10px;margin-top:2px}.chat-client-facts{display:flex;gap:8px}.fact-pill{border:1px solid var(--line);background:#f8faf7;border-radius:9px;padding:7px 10px;font-size:10px;color:var(--muted)}.fact-pill strong{color:var(--ink);margin-left:4px}.messages{flex:1;overflow:auto;padding:24px;display:flex;flex-direction:column;gap:10px;background-image:radial-gradient(#dce4de 1px,transparent 1px);background-size:20px 20px}.day-separator{align-self:center;background:#e9eeea;color:#68736f;padding:5px 10px;border-radius:15px;font-size:9px;font-weight:800;margin-bottom:5px}.bubble{max-width:min(72%,560px);padding:10px 12px;border-radius:13px;box-shadow:0 2px 5px rgba(26,54,45,.07);font-size:12px;line-height:1.45}.bubble.in{align-self:flex-start;background:#fff;border-top-left-radius:3px}.bubble.out{align-self:flex-end;background:#dcf1e5;border-top-right-radius:3px}.bubble time{display:block;text-align:right;font-size:8px;color:#84908b;margin-top:4px}
.payment-card{align-self:flex-start;background:#fff;border:1px solid #cfe0d7;border-radius:13px;padding:13px;width:min(330px,78%)}.payment-card .receipt-head{display:flex;align-items:center;gap:9px}.receipt-icon{width:36px;height:36px;border-radius:10px;background:#e2f1e8;color:#2d6d56;display:grid;place-items:center;font-weight:800}.payment-card strong,.payment-card small{display:block}.payment-card small{color:var(--muted);font-size:10px;margin-top:2px}.payment-card footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);margin-top:11px;padding-top:10px}.payment-card footer b{font:800 15px Manrope}.composer{background:#fff;border-top:1px solid var(--line);padding:13px 17px}.quick-replies{display:flex;gap:6px;margin-bottom:9px;overflow:auto}.quick-replies button{white-space:nowrap;border:1px solid #cfdad4;background:#f8faf7;color:#315f52;border-radius:16px;padding:6px 10px;font:700 9px inherit;cursor:pointer}.compose-row{display:flex;gap:8px}.compose-row button{flex:0 0 auto}.compose-row input{flex:1;border:1px solid var(--line);background:#f4f6f3;border-radius:10px;padding:11px 13px;outline:0;font:inherit;font-size:12px}.compose-row input:focus{border-color:#4e7b6f}.chat-back{display:none;border:0;background:none;font-size:20px}
@media(max-width:760px){.chat-shell{height:calc(100vh - 125px);display:block;position:relative}.chat-list{height:100%;border:0}.chat-main{display:none;height:100%}.chat-shell.chat-open .chat-list{display:none}.chat-shell.chat-open .chat-main{display:flex}.chat-back{display:block}.chat-client-facts .fact-pill:first-child{display:none}.bubble{max-width:85%}.chat-header{padding:0 12px}.messages{padding:16px 12px}}

/* El historial se desplaza, pero el compositor siempre permanece visible. */
.chat-main{min-height:0}.chat-header{flex:0 0 72px}.messages{min-height:0}.composer{position:sticky;bottom:0;z-index:3;flex:0 0 auto}.compose-row input{min-width:0}

.login-screen{min-height:calc(100vh - 130px);display:grid;place-items:center;padding:24px}.login-card{width:min(430px,100%);background:#fff;border:1px solid var(--line);border-radius:18px;padding:32px;box-shadow:var(--shadow);display:grid;gap:15px}.login-card .brand-mark{width:48px;height:48px;border-radius:13px;background:#d9f17f;color:#173f35;display:grid;place-items:center;font:900 23px Manrope}.login-card h1{margin:0;font:800 27px Manrope}.login-card p{margin:0;color:var(--muted);font-size:13px}.login-card label{display:grid;gap:6px;font-size:11px;font-weight:800}.login-card input{border:1px solid var(--line);border-radius:10px;padding:12px;font:inherit}.login-error{min-height:16px;color:#b5473c}.login-card button{width:100%}

body[data-current-view="chats"]{height:100vh;overflow:hidden}body[data-current-view="chats"] .content{height:calc(100vh - 72px);max-width:none;margin:0;padding:18px;overflow:hidden}body[data-current-view="chats"] .chat-shell{height:100%;min-height:0}body[data-current-view="chats"] .chat-list,body[data-current-view="chats"] .chat-main{height:100%;min-height:0;overflow:hidden}body[data-current-view="chats"] .conversation-list,body[data-current-view="chats"] .messages{overflow-y:scroll;scrollbar-gutter:stable}body[data-current-view="chats"] .conversation-list::-webkit-scrollbar,body[data-current-view="chats"] .messages::-webkit-scrollbar{width:10px}body[data-current-view="chats"] .conversation-list::-webkit-scrollbar-thumb,body[data-current-view="chats"] .messages::-webkit-scrollbar-thumb{background:#b7c8c0;border:2px solid transparent;border-radius:10px;background-clip:padding-box}
