/* CRM OPERACIONAL V1.47.2
   Camada visual específica do inbox. Mantém a identidade Amorim e substitui
   o aspecto de protótipo por uma estação de trabalho para atendimento real. */

#inbox.screen.active{
  min-height:calc(100vh - 68px);
  background:#edf3f9;
  overflow:hidden;
}

#inbox .crm-v147-workspacebar{
  min-height:72px;
  padding:11px 18px;
  border-bottom:1px solid #d9e4ef;
  background:linear-gradient(110deg,#fff 0%,#f6faff 68%,#edf7ff 100%);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.crm-v147-title{display:flex;align-items:center;gap:10px;min-width:255px}
.crm-v147-title h1{margin:2px 0 0;color:#102a46;font-size:18px;letter-spacing:-.035em}
.crm-v147-title small,.crm-v147-sla-card small,.crm-v147-call-card small{font-size:7px;font-weight:850;letter-spacing:.15em;color:#5284b5}
.crm-v147-live-dot{width:11px;height:11px;border-radius:50%;background:#13b97b;box-shadow:0 0 0 5px rgba(19,185,123,.12);flex:none}
.crm-v147-kpis{display:flex;align-items:center;justify-content:center;gap:8px;flex:1}
.crm-v147-kpis span{min-width:96px;padding:6px 12px;border-left:1px solid #dbe6f1;display:flex;flex-direction:column;gap:2px}
.crm-v147-kpis b{font-size:13px;color:#123b63}.crm-v147-kpis small{font-size:8px;color:#71849a}
.crm-v147-workspace-actions{display:flex;align-items:center;gap:7px}.crm-v147-workspace-actions .soft-button{white-space:nowrap}

#inbox .inbox-layout{
  height:calc(100vh - 140px)!important;
  grid-template-columns:330px minmax(520px,1fr) 308px!important;
  gap:0!important;
  background:#dce6f1!important;
}
#inbox .conversation-list{background:#f7fbff!important}
#inbox .conversation-list>header{height:auto;min-height:67px;padding:14px 14px 9px!important}
#inbox .conversation-list>header h1{font-size:17px!important;color:#102d4a}
#inbox .conversation-list>header small{color:#3678bd!important}
#inbox .realtime-state{font-size:8px!important;border:1px solid #d5e4f2;border-radius:99px;padding:4px 7px;background:#fff}
#inbox .realtime-state.live{color:#13895e;background:#edfbf5;border-color:#c8eedf}
#inbox .realtime-state.fallback{color:#9a6b11;background:#fff9e9;border-color:#f1dfa9}

#inbox .channel-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:0 10px 9px!important;border-bottom:0!important}
#inbox .channel-tabs button{height:31px;border:1px solid #dbe7f1!important;background:#fff!important;border-radius:8px!important;padding:0 8px!important;text-align:left;font-size:8px!important;font-weight:780;color:#50677f!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#inbox .channel-tabs button.active{background:#e9f3ff!important;border-color:#83b8f8!important;color:#075ec8!important;box-shadow:0 3px 8px rgba(16,101,205,.08)}
#inbox .channel-tabs button[data-crm-channel="whatsapp"]{color:#11835d!important}.channel-tabs button[data-crm-channel="instagram"]{color:#a13eb3!important}.channel-tabs button[data-crm-channel="messenger"]{color:#176ddd!important}

#inbox .queue-tabs{padding:0 10px 8px!important;gap:4px!important;border-bottom:1px solid #e0eaf3!important}
#inbox .queue-tabs button{border-radius:99px!important;font-size:8px!important;padding:7px 8px!important;border:0!important;background:#edf2f7!important;color:#62758b!important}
#inbox .queue-tabs button.active{background:#0f6fe8!important;color:#fff!important;box-shadow:0 5px 10px rgba(15,111,232,.2)}
#inbox .queue-tabs button b{background:rgba(255,255,255,.45)!important;color:inherit!important}
#inbox .small-search{height:37px!important;margin:8px 10px!important;border-radius:10px!important;background:#fff!important}
#inbox .queue-filters{padding:0 10px 8px!important}.queue-filters button{font-size:7px!important}

#inbox .contact-scroll{padding:0 8px 14px!important;background:linear-gradient(180deg,#f7fbff 0,#edf4fa 100%)}
.crm-v147-channel-section{margin:10px 2px 5px;display:flex;align-items:center;gap:7px;color:#71859c}
.crm-v147-channel-section:after{content:"";height:1px;flex:1;background:#d9e5f0}
.crm-v147-channel-section b{font-size:8px;color:#3d5c79}.crm-v147-channel-section span{font-size:7px;border-radius:99px;padding:2px 6px;background:#e3edf6}
#inbox .contact{min-height:73px;margin:4px 0!important;padding:9px 9px!important;border:1px solid transparent!important;border-radius:11px!important;background:rgba(255,255,255,.72)!important;box-shadow:none!important}
#inbox .contact:hover{background:#fff!important;border-color:#c7dbed!important;transform:translateY(-1px)}
#inbox .contact.active{background:#fff!important;border-color:#7fb5f4!important;box-shadow:0 5px 15px rgba(37,98,161,.11)!important}
#inbox .contact header{gap:8px}.contact header b{font-size:10px!important;color:#193653}.contact time{font-size:7px!important;color:#6e8298!important;white-space:nowrap}.contact p{font-size:8px!important;color:#526a84!important;margin:3px 0 5px!important}.contact footer{gap:5px!important}.contact footer span,.contact footer em{font-size:7px!important}.contact .channel{font-weight:800;border-radius:5px;padding:2px 5px}.channel.whatsapp{background:#e8faf1;color:#10845b}.channel.instagram{background:#fff0fc;color:#a33fae}.channel.messenger{background:#ebf2ff;color:#176ddb}.channel.outro{background:#eef2f7;color:#587087}
.crm-v147-contact-meta{display:flex;align-items:center;gap:5px;color:#7a8ca0;min-width:0}.crm-v147-contact-meta small{font-size:7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-v147-contact-state{font-size:7px;font-weight:800;color:#1e74da}.contact .unread{top:41px!important;right:10px!important;box-shadow:0 0 0 3px #fff}

#inbox .chat-pane{background:#eaf2f8!important}
#inbox .chat-head{height:69px!important;padding:0 15px!important;background:#fff!important}
#inbox .chat-head b{font-size:11px!important;color:#173550}.chat-head small{display:flex;align-items:center;gap:6px;min-height:18px}.crm-v147-presence{font-size:7px!important;color:#6b7f93}
#inbox .chat-actions{gap:4px!important}.chat-actions button{height:30px!important;border-radius:8px!important;padding:0 8px!important;font-size:7px!important}.chat-actions .crm-call-button{background:#e8f5ff!important;border-color:#9bcaf7!important;color:#0965c5!important;font-weight:850}
#inbox .chat-context{height:38px!important;padding:0 14px!important;background:#f9fcff!important;gap:6px!important}.crm-v147-sla-state{background:#eff7ff!important;color:#196ec7!important}
#inbox .messages{padding:17px clamp(14px,4vw,52px)!important;gap:8px!important;background-color:#e8f0f6!important;background-image:radial-gradient(rgba(102,135,164,.16) 1px,transparent 1px)!important;background-size:21px 21px!important}
#inbox .day{position:relative;align-self:center!important;margin:8px 0 5px;padding:5px 10px!important;border:1px solid #d1dfe9;background:rgba(250,253,255,.9)!important;color:#58718a!important;font-size:7px!important;font-weight:750;box-shadow:0 1px 2px rgba(38,74,111,.06)}
#inbox .bubble{max-width:min(78%,680px)!important;border-radius:11px!important;padding:9px 11px 18px!important;background:#fff!important;border:1px solid rgba(204,218,230,.8);box-shadow:0 2px 5px rgba(34,70,108,.08)!important;font-size:10px!important;line-height:1.46!important}
#inbox .bubble.outgoing{background:#dff4ea!important;border-color:#b8e8d3!important}.message-with-meta{max-width:min(78%,680px)}
#inbox .message-agent{margin-bottom:3px!important;font-size:7px!important;color:#3974af!important}.message-meta{font-size:7px!important;bottom:4px!important;right:7px!important}.message-meta.incoming{color:#71869a!important}
.crm-optimistic-message{align-self:flex-end;opacity:.78;pointer-events:none}.crm-optimistic-message .bubble{border-style:dashed}

#inbox .ai-row{height:40px!important;padding:0 13px!important;background:#f9fcff!important}.ai-row b{font-size:8px!important}.ai-row small{font-size:7px!important}.crm-v147-composer-tools{margin-left:auto;display:flex;align-items:center;gap:5px}.crm-v147-composer-tools>button:not(.toggle){height:25px;border:1px solid #d3e1ee;background:#fff;color:#386889;border-radius:7px;padding:0 7px;font-size:7px;font-weight:750}.crm-v147-composer-tools .toggle{margin-left:2px}
#inbox .composer{height:57px!important;padding:8px 11px!important;border-top:1px solid #d9e5ee!important}.composer input{font-size:10px!important;background:#f8fbfd!important}.composer .send{background:#0b71dd!important;box-shadow:0 5px 11px rgba(11,113,221,.26)}
#inbox .template-action{min-height:31px;display:flex;align-items:center;gap:7px;padding:4px 13px;border-top:1px solid #edf2f6;background:#fff}.template-action button{border:0;border-radius:6px;background:#fff2d9;color:#985e00;padding:4px 7px;font-size:7px;font-weight:800}.template-action small{font-size:7px;color:#7b8997}

#inbox .customer-pane{display:block!important;background:#f7fbff!important;overflow:auto!important}
#inbox .customer-pane>header{height:69px!important;background:#fff!important;padding:0 12px!important}.customer-pane>header h1{font-size:15px!important;color:#163650}.customer-card{margin:9px!important;border-radius:11px!important;box-shadow:0 2px 6px rgba(30,72,111,.05)}
.crm-v147-sla-card,.crm-v147-call-card{margin:9px 10px;background:#fff;border:1px solid #d9e5ef;border-radius:10px;padding:10px}.crm-v147-sla-card header,.crm-v147-call-card header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.crm-v147-sla-card h3,.crm-v147-call-card h3{margin:3px 0 0;font-size:9px;color:#193b5b}.crm-v147-sla-card> b{display:block;margin:8px 0 3px;font-size:9px;color:#2d638e}.crm-v147-sla-card>small{display:block;font-size:7px!important;letter-spacing:0!important;line-height:1.45;color:#6c8195!important}.crm-v147-sla-card header>span{font-size:7px;font-weight:800;padding:3px 5px;border-radius:99px;background:#eef4fa;color:#648099}
.crm-v147-call-card header button{border:0;background:transparent;color:#0869d6;font-size:7px;font-weight:800}.crm-v147-call-card p{margin:8px 0 0;font-size:7px;line-height:1.45;color:#6c8195}.crm-v147-call-row{padding:7px 0;border-top:1px solid #edf2f6;display:flex;align-items:center;gap:7px}.crm-v147-call-row:first-child{border-top:0}.crm-v147-call-row i{width:25px;height:25px;border-radius:7px;display:grid;place-items:center;font-style:normal;background:#ecf5ff;color:#0d70d9}.crm-v147-call-row.missed i{background:#fff0ef;color:#c44741}.crm-v147-call-row div{min-width:0;flex:1}.crm-v147-call-row b{display:block;font-size:8px;color:#31516f}.crm-v147-call-row small{display:block;margin-top:2px;font-size:7px!important;letter-spacing:0!important;color:#72859a!important}.crm-v147-call-row time{font-size:7px;color:#72859a;white-space:nowrap}

@media(max-width:1280px){
  #inbox .inbox-layout{grid-template-columns:295px minmax(0,1fr) 0!important}
  #inbox .customer-pane{display:none!important}
  #inbox .inbox-layout.customer-open{grid-template-columns:295px minmax(0,1fr) 300px!important}
  #inbox .inbox-layout.customer-open .customer-pane{display:block!important}
}
@media(max-width:880px){
  #inbox .crm-v147-workspacebar{padding:9px 12px;min-height:60px}.crm-v147-kpis{display:none}.crm-v147-title h1{font-size:16px}.crm-v147-workspace-actions .soft-button:first-child{display:none}.crm-v147-workspace-actions .primary{min-height:32px;font-size:8px}
}
@media(max-width:700px){
  #inbox.screen.active{min-height:calc(100dvh - 60px)}
  #inbox .crm-v147-workspacebar{display:none}
  #inbox .inbox-layout{height:calc(100dvh - 60px)!important;display:block!important}
  #inbox .pane{height:100%!important}.chat-actions button:not(.crm-call-button){display:none!important}.chat-actions .crm-call-button{display:block!important}
  #inbox .channel-tabs{grid-template-columns:repeat(4,max-content)!important;overflow:auto!important}.channel-tabs button{min-width:96px}.crm-v147-composer-tools>button:first-child{display:none}
  #inbox .messages{padding:12px!important}.crm-v147-call-card,.crm-v147-sla-card{margin:8px}
}
