/* #ARB #Tecnologia #UX */
.crm-inbox {
  --inbox-base: var(--surface);
  --inbox-panel: #faf8f2;
  --inbox-line: var(--line);
  --inbox-muted: var(--muted);
  --inbox-green: var(--primary);
  color: var(--ink);
  background: var(--inbox-base);
  border: 1px solid var(--inbox-line);
  border-radius: 16px;
  overflow: hidden;
  font-size: 14px;
}
.inbox-title, .inbox-thread-header, .inbox-profile header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
}
.inbox-title, .inbox-thread-header { border-bottom: 1px solid var(--inbox-line); }
.inbox-title { justify-content: space-between; }
.crm-inbox :is(h1,h2,h3,p,dl) { margin: 0; }
.crm-inbox h1 { font-size: 20px; }
.crm-inbox h2 { font-size: 16px; }
.crm-inbox h3 { font-size: 13px; margin-bottom: 12px; }
.crm-inbox :is(small,dt,.inbox-empty) { color: var(--inbox-muted); }
.inbox-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, .9fr);
  height: clamp(610px, 76dvh, 960px);
}
.inbox-queue, .inbox-thread, .inbox-profile { min-width: 0; min-height: 0; }
.inbox-queue, .inbox-thread { display: flex; flex-direction: column; border-right: 1px solid var(--inbox-line); }
.inbox-profile, .inbox-list, .inbox-history { overflow: auto; }
.crm-inbox button { background: var(--surface); color: inherit; border: 1px solid var(--inbox-line); padding: 8px 12px; min-height: 38px; font-size: 13px; border-radius: 9px; }
.crm-inbox button:hover { background: var(--soft); }
.crm-inbox :is(button,input,textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.inbox-filters { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px 10px 5px; }
.inbox-filters button { background: transparent; border-color: transparent; padding-inline: 7px; }
.inbox-filters button[aria-pressed=true] { background: var(--soft); border-color: #98ad9c; }
.inbox-search { padding: 8px 12px 12px; border-bottom: 1px solid var(--inbox-line); }
.workspace .crm-inbox :is(input[type=search],textarea) { background: var(--surface); color: var(--ink); border-color: #8d9d90; width: 100%; }
.crm-inbox :is(input,textarea)::placeholder { color: var(--inbox-muted); }
.crm-inbox .inbox-row { width: 100%; border-radius: 0; border: 0; border-bottom: 1px solid var(--inbox-line); background: transparent; justify-content: flex-start; padding: 12px; text-align: left; gap: 10px; }
.crm-inbox .inbox-row[aria-pressed=true] { background: var(--soft); box-shadow: inset 3px 0 var(--primary); }
.inbox-row > span:last-child, .inbox-thread-header > div, .inbox-profile header > div { min-width: 0; }
.inbox-row :is(strong,small), .inbox-thread-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row small { margin-top: 4px; }
.inbox-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid #c6d5c8; border-radius: 50%; background: var(--soft); color: var(--primary); font-weight: 700; }
.inbox-thread-header > div { flex: 1; }
.inbox-history { background: var(--inbox-panel); flex: 1; padding: 20px 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 15px; }
.inbox-entry { max-width: 90%; }
.inbox-entry div { padding: 11px 14px; border-radius: 15px 15px 4px 15px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-entry small { display: block; margin-top: 4px; text-align: right; }
.crm-inbox .inbox-empty { padding: 16px; align-self: center; }
.inbox-compose { padding: 14px; border-top: 1px solid var(--inbox-line); background: var(--inbox-panel); }
.inbox-compose > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.inbox-compose button[type=submit] { color: var(--surface); background: var(--inbox-green); border-color: var(--primary); flex-shrink: 0; }
.inbox-compose button[type=submit]:hover { background: var(--deep); }
.inbox-profile { background: var(--inbox-panel); padding: 0 14px; overflow-wrap: anywhere; }
.inbox-profile header { padding-inline: 0; }
.inbox-profile section { border-top: 1px solid var(--inbox-line); padding: 16px 0; }
.inbox-profile dl { display: grid; gap: 4px; margin: 12px 0; }
.inbox-profile dd { margin: 0 0 8px; }
.inbox-stage { background: var(--soft); border-radius: 20px; padding: 5px 9px; display: inline-block; }
.crm-inbox :is(.inbox-back,.inbox-details) { display: none; }
@media (max-width: 1060px) {
  .inbox-grid { grid-template-columns: minmax(220px, 1fr) minmax(0, 1.55fr); }
  .inbox-thread { border-right: 0; }
  .inbox-profile { display: none; }
  .crm-inbox .inbox-details { display: inline-flex; }
  .crm-inbox[data-pane=profile] .inbox-thread { display: none; }
  .crm-inbox[data-pane=profile] .inbox-profile { display: block; }
  .crm-inbox[data-pane=profile] .inbox-profile .inbox-back { display: inline-flex; margin-top: 10px; }
}
@media (max-width: 760px) {
  #navigation { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #navigation a[href="#inbox"] span { font-size: 10px; line-height: 1.1; }
  .inbox-grid { display: block; height: auto; min-height: 470px; }
  .inbox-queue, .inbox-thread { border-right: 0; }
  .inbox-list { max-height: 62dvh; }
  .inbox-thread { min-height: 470px; height: 67dvh; }
  .crm-inbox[data-pane=list] .inbox-thread,
  .crm-inbox:not([data-pane=list]) .inbox-queue { display: none; }
  .crm-inbox .inbox-back { display: inline-flex; }
  .inbox-thread-header { gap: 7px; padding: 10px 8px; }
  .inbox-thread-header .inbox-avatar { display: none; }
}
