/* Central de Atendimento — mantém a identidade do Nexus System. */
.chat-page-main {width:100%;max-width:1800px;padding-bottom:4px}
.chat-topbar {padding-bottom:18px}
.chat-top-subtitle {font-size:12px;color:var(--muted);margin:7px 0 0}
.chat-stage-note {display:flex;align-items:flex-start;gap:12px;background:#17151b;border:1px solid #50343a;border-radius:10px;padding:12px 16px;margin:19px 0 12px;color:#ded3d4}
.chat-stage-bullet {background:#efb349;width:9px;height:9px;border-radius:50%;flex:none;margin-top:5px}
.chat-stage-note div{display:flex;gap:5px;flex-direction:column}
.chat-stage-note strong{font-size:12px}
.chat-stage-note span:not(.chat-stage-bullet){font-size:11px;line-height:1.5}
body[data-theme=light] .chat-stage-note{background:#fff8eb;border-color:#e8d5ae;color:#6e4f22}
.chat-operator {display:flex;justify-content:space-between;align-items:center;gap:20px;padding:10px 15px;border-radius:9px;border:1px solid var(--line);background:var(--panel);margin-bottom:12px}
.chat-operator-copy{display:flex;flex-direction:column;gap:4px}
.chat-operator-copy strong{font-size:12px}
.chat-operator-copy span{font-size:11px;color:var(--muted)}
.chat-inline-label{display:flex;align-items:center;flex-direction:row;gap:10px;margin:0;white-space:nowrap;color:var(--muted)}
.chat-inline-label select{min-width:210px;width:auto}
.chat-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin:0 0 13px}
.chat-metric {border:1px solid var(--line);background:var(--panel);border-radius:9px;padding:12px 15px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.chat-metric span{font-size:11px;color:var(--muted)}
.chat-metric strong{font-size:23px;letter-spacing:-.6px}
.chat-workspace {display:grid;grid-template-columns:275px minmax(0,1fr) 263px;min-height:620px;height:min(74vh,775px);background:var(--panel);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.chat-list-column {border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0;min-height:0}
.chat-list-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:17px 15px 12px}
.chat-list-heading h2{font-size:16px;margin:0 0 4px}
.chat-list-heading small{font-size:10px;color:var(--muted)}
.chat-text-action {color:var(--red);background:none;border:0;font-size:10px;white-space:nowrap}
.chat-filter-label {margin:0 14px 9px;gap:5px;font-size:10px;color:var(--muted)}
.chat-filter-label input,.chat-filter-label select {padding:9px 10px;font-size:11px}
.chat-list {flex:1;overflow:auto;min-height:0;border-top:1px solid var(--line);margin-top:4px}
.chat-list-entry{display:flex;gap:10px;width:100%;text-align:left;padding:14px 13px;background:transparent;color:var(--text);border:0;border-bottom:1px solid var(--line)}
.chat-list-entry:hover,.chat-list-entry.is-active{background:var(--panel2)}
.chat-list-entry.is-active{box-shadow:inset 3px 0 var(--red)}
.chat-avatar {width:38px;height:38px;flex:none;border-radius:50%;background:var(--soft);color:var(--red);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:850}
.chat-list-entry .chat-avatar{width:34px;height:34px}
.chat-list-details{min-width:0;flex:1}
.chat-list-title {font-size:12px;font-weight:800;display:flex;justify-content:space-between;gap:4px}
.chat-list-title span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-list-title time{font-size:9px;color:var(--muted);font-weight:500;flex:none}
.chat-list-preview{font-size:10px;color:var(--muted);margin:5px 0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-list-tags{display:flex;gap:5px;flex-wrap:wrap;align-items:center}
.chat-small-tag {font-size:9px;border-radius:50px;padding:4px 7px;background:var(--panel2);border:1px solid var(--line);color:var(--muted)}
.chat-small-tag.is-red {background:var(--soft);border-color:transparent;color:var(--red)}
.chat-list-empty{text-align:center;font-size:12px;line-height:1.7;color:var(--muted);padding:38px 16px}
.chat-conversation-column {display:flex;flex-direction:column;min-width:0;min-height:0}
.chat-placeholder {flex:1;align-self:center;max-width:340px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:11px;padding:25px}
.chat-placeholder-icon {width:70px;height:70px;border-radius:20px;background:var(--soft);color:var(--red);font-size:38px;display:grid;place-items:center}
.chat-placeholder h2{font-size:20px;margin:0}
.chat-placeholder p{font-size:12px;color:var(--muted);line-height:1.7;margin:0 0 7px}
.chat-selected{height:100%;display:flex;flex-direction:column;min-height:0}
.chat-thread-top {padding:12px 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:11px;min-width:0}
.chat-thread-title{flex:1;min-width:0}
.chat-thread-title h2{font-size:15px;margin:0 0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-thread-sub{font-size:10px;color:var(--muted)}
.chat-sector-pill{font-size:10px;color:var(--red);background:var(--soft);padding:7px 10px;border-radius:40px;font-weight:750;white-space:nowrap}
.chat-thread-body {flex:1;min-height:0;overflow:auto;padding:22px 21px;background:linear-gradient(145deg,var(--panel) 30%,var(--bg));display:flex;flex-direction:column;align-items:stretch;gap:11px}
.chat-thread-intro {font-size:11px;color:var(--muted);text-align:center;margin:0 auto 12px;max-width:370px;line-height:1.5}
.chat-bubble {max-width:80%;min-width:100px;width:fit-content;background:var(--panel2);border:1px solid var(--line);border-radius:12px 12px 12px 3px;padding:10px 13px;overflow-wrap:anywhere;align-self:flex-start}
.chat-bubble.outgoing{background:var(--soft);border-color:#65323b;border-radius:12px 12px 3px 12px;align-self:flex-end}
body[data-theme=light] .chat-bubble.outgoing{border-color:#f0c6cc}
.chat-bubble p{white-space:pre-wrap;line-height:1.5;font-size:12px;margin:0 0 7px}
.chat-bubble small{display:block;text-align:right;font-size:9px;color:var(--muted)}
.chat-compose {padding:13px 17px;background:var(--panel);border-top:1px solid var(--line)}
.chat-compose-meta {display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:10px;color:var(--muted);margin-bottom:9px}
.chat-compose-meta label{flex-direction:row;align-items:center;gap:7px;margin:0;font-size:10px;color:var(--muted)}
.chat-compose-meta select{padding:6px 8px;width:auto;max-width:210px;font-size:10px}
#chatMessageForm {display:flex;gap:9px;align-items:flex-end}
#chatMessageForm textarea{resize:vertical;min-height:63px;max-height:145px;flex:1}
#chatMessageForm button {min-height:44px;white-space:nowrap}
.chat-info-column {border-left:1px solid var(--line);min-height:0;overflow:auto;padding:17px 16px}
.chat-info-column h3{font-size:13px;margin:0 0 12px}
.chat-info-empty p,.chat-hint{font-size:11px;color:var(--muted);line-height:1.6;margin:0 0 12px}
.chat-info-data {display:flex;flex-direction:column;gap:10px;font-size:11px}
.chat-info-data div{display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}
.chat-info-data dt{color:var(--muted);font-size:10px}
.chat-info-data dd{margin:0;font-weight:750}
.chat-info-section{border-top:1px solid var(--line);padding-top:16px;margin-top:17px}
.chat-info-section label{font-size:10px;margin-bottom:11px}
.chat-info-section input,.chat-info-section select,.chat-info-section textarea{font-size:11px;padding:9px}
.chat-full-width{width:100%}
.chat-linked-actions{display:flex;flex-direction:column;gap:7px;margin-top:15px}
.chat-linked-actions a{color:var(--red);background:var(--soft);font-size:10px;font-weight:750;border-radius:6px;padding:9px;text-decoration:none}
.chat-notes,.chat-event-log{display:flex;flex-direction:column;gap:8px;max-height:205px;overflow:auto}
.chat-note,.chat-event{background:var(--panel2);padding:9px;border:1px solid var(--line);border-radius:7px;font-size:10px;line-height:1.5;overflow-wrap:anywhere}
.chat-note small,.chat-event small{display:block;color:var(--muted);font-size:9px;margin-top:5px}
.chat-empty-small{font-size:10px;color:var(--muted);margin:0}
.chat-modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.72);z-index:110;display:grid;place-items:center;padding:16px}
.chat-modal{background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:24px;width:min(490px,100%);box-shadow:0 20px 60px #0006}
.chat-modal-header{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:23px}
.chat-modal-header h2{font-size:21px;margin:0 0 8px}
.chat-modal-header p:not(.eyebrow){font-size:11px;line-height:1.5;color:var(--muted);margin:0}
.chat-close-button,.chat-back{border:1px solid var(--line);border-radius:7px;background:var(--panel2);color:var(--text);width:32px;height:32px;flex:none}
.chat-back{display:none}
.chat-modal label{font-size:12px}
.chat-form-hint{font-size:11px;color:var(--muted)}
.chat-form-hint a{color:var(--red)}
.chat-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:28px}
.chat-notice{position:fixed;bottom:20px;right:20px;z-index:120;border-left:3px solid var(--red);background:#1c1e26;color:#fff;padding:13px 17px;border-radius:8px;font-size:12px;box-shadow:0 14px 40px #0006;opacity:0;transform:translateY(12px);pointer-events:none;transition:.18s;max-width:340px}
.chat-notice.show{opacity:1;transform:translateY(0)}
.chat-visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.chat-dashboard-strip{margin:0 0 18px}
.chat-dashboard-link{background:var(--panel);display:flex;align-items:center;gap:14px;padding:17px;border:1px solid var(--line);border-radius:10px;color:var(--text);text-decoration:none}
.chat-dashboard-icon{background:var(--soft);color:var(--red);border-radius:9px;width:42px;height:42px;display:grid;place-items:center;font-size:24px}
.chat-dashboard-link div{display:flex;flex-direction:column;gap:5px;flex:1}
.chat-dashboard-link strong{font-size:13px}
.chat-dashboard-link small{font-size:10px;color:var(--muted)}
.chat-dashboard-link b{font-size:11px;color:var(--red)}
@media(max-width:1450px){.chat-workspace{grid-template-columns:250px minmax(0,1fr) 240px}.chat-page-main{padding:0 19px}}
@media(max-width:1190px){.chat-workspace{grid-template-columns:270px minmax(0,1fr);height:740px}.chat-info-column{grid-column:1 / -1;border-left:0;border-top:1px solid var(--line);overflow:visible}.chat-workspace{height:auto;overflow:visible}.chat-list-column,.chat-conversation-column{height:640px}.chat-info-column{padding:20px}.chat-info-column #chatInfoContent{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 22px;align-items:start}.chat-info-column #chatInfoContent > h3{grid-column:1 / -1}.chat-info-section{margin-top:5px}}
@media(max-width:700px){.chat-page-main{padding:0 12px}.chat-operator{align-items:flex-start;flex-direction:column;gap:10px}.chat-inline-label{width:100%;justify-content:space-between}.chat-inline-label select{min-width:0;max-width:62%}.chat-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.chat-workspace{display:flex;flex-direction:column;height:auto;min-height:580px;overflow:hidden}.chat-list-column{height:580px;border:0}.chat-conversation-column{display:none;height:620px}.chat-workspace.is-chat-open .chat-list-column{display:none}.chat-workspace.is-chat-open .chat-conversation-column{display:flex}.chat-workspace:not(.is-chat-open) .chat-info-column{display:none}.chat-info-column #chatInfoContent{grid-template-columns:1fr}.chat-back{display:block}.chat-sector-pill{max-width:120px;text-overflow:ellipsis;overflow:hidden}.chat-topbar{align-items:flex-start}.chat-topbar .top-actions{width:100%}.chat-topbar .btn{flex:1}.chat-thread-body{padding:15px 12px}.chat-bubble{max-width:92%}.chat-compose{padding:11px}.chat-compose-meta{flex-direction:column;align-items:flex-start}.chat-compose-meta label{width:100%;justify-content:space-between}.chat-compose-meta select{max-width:65%}#chatMessageForm{flex-direction:column;align-items:stretch}#chatMessageForm button{width:100%}.chat-stage-note{padding:11px}}
@media(max-width:410px){.chat-sector-pill{display:none}.chat-metric strong{font-size:20px}.chat-modal{padding:17px}}
