/* Peça comum de listas em colunas: owner, cliente e parceiro. Carrega-se depois das folhas de cada área. */
.lc-janela { max-height: min(70vh, 620px); overflow: auto; scrollbar-gutter: stable; border: 1px solid var(--afz-border, #e6e0d8); border-radius: 8px; background: #fff; }
.lc-janela:focus-visible { outline: 2px solid var(--afz-brand, #8a2b2b); outline-offset: 2px; }
.lc-tabela { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.3; }
.lc-tabela th { text-align: left; font-weight: 600; color: var(--afz-text-muted, #6b645c); padding: 4px 8px; border-bottom: 1px solid var(--afz-border, #e6e0d8); white-space: nowrap; }
.lc-tabela td { padding: 5px 8px; border-bottom: 1px solid #f0ebe4; vertical-align: middle; overflow-wrap: anywhere; }
.lc-tabela b, .lc-tabela strong { font-weight: 600; }
.lc-tabela small { display: block; margin: 1px 0 0; color: var(--afz-text-muted, #6b645c); font-size: .75rem; }
.lc-tabela .lc-num, .lc-tabela .lc-data { white-space: nowrap; color: var(--afz-text-muted, #6b645c); }
.lc-tabela th.lc-acoes { text-align: right; }
.lc-tabela td.lc-acoes > div { display: flex; justify-content: flex-end; gap: 2px; }
.lc-tabela .status { padding: 2px 7px; font-size: .75rem; }
.lc-tabela tbody tr:hover { background: #faf7f3; }
.lc-tabela tr.lc-atual { background: #f6f2ec; box-shadow: inset 3px 0 0 var(--afz-brand, #8a2b2b); }
/* Linha que abre: o botão ou a ligação da 1.ª célula cobre a linha toda. */
.lc-tabela tr:has(.lc-abrir) { position: relative; cursor: pointer; }
.lc-abrir { display: block; width: 100%; min-height: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.lc-abrir::after { content: ""; position: absolute; inset: 0; }
.lc-abrir:focus-visible { outline: 2px solid var(--afz-brand, #8a2b2b); outline-offset: 2px; }
.lc-ic { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; min-height: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.lc-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lc-ic:hover, .lc-ic:focus-visible { background: #efe9e1; color: var(--afz-brand, #8a2b2b); }
.lc-ic:focus-visible { outline: 2px solid var(--afz-brand, #8a2b2b); }
.lc-ic::after { content: attr(data-dica); position: absolute; right: 0; bottom: calc(100% + 3px); background: #2b2622; color: #fff; font-size: .75rem; font-weight: 500; padding: 3px 7px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 3; }
.lc-ic:hover::after, .lc-ic:focus-visible::after { opacity: 1; }
.lc-grupo > summary { position: sticky; top: 0; z-index: 2; background: #f6f2ec; padding: 7px 10px; font-weight: 600; font-size: .85rem; cursor: pointer; border-bottom: 1px solid var(--afz-border, #e6e0d8); }
.lc-grupo summary small { font-weight: 400; color: var(--afz-text-muted, #6b645c); margin-left: 4px; }

/* Emails do owner: fios em colunas, mensagens recolhíveis. */
.communications-layout { grid-template-columns: minmax(380px, 1fr) minmax(0, 2fr); }
.communication-thread-list.lc-janela { display: block; gap: 0; padding: 0; max-height: min(78vh, 760px); }
.communication-timeline { gap: 6px; }
.communication-entry.lc-msg { padding: 0; border-left-width: 3px; }
.lc-msg > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 10px; cursor: pointer; font-size: .82rem; }
.lc-msg > summary time { color: var(--afz-text-muted, #6b645c); white-space: nowrap; }
.lc-msg > summary b { font-weight: 600; overflow-wrap: anywhere; }
.lc-msg > summary span { color: var(--afz-text-muted, #6b645c); white-space: nowrap; font-size: .75rem; }
.lc-msg[open] > summary { border-bottom: 1px solid var(--afz-border, #e6e0d8); }
.lc-msg-corpo { padding: 10px; font-size: .88rem; }

/* As tabelas que já existiam na app ganham a mesma letra e o deslocamento próprio, com cabeçalho fixo. */
.case-table, .crm-table, .qual-tabela { font-size: .82rem; line-height: 1.3; }
.case-table th, .case-table td, .crm-table th, .crm-table td, .qual-tabela th, .qual-tabela td { padding: 5px 8px; }
@media (min-width: 761px) {
  .table-scroll { max-height: min(70vh, 620px); overflow: auto; }
  .table-scroll .case-table thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
}

@media (max-width: 760px) {
  .communications-layout { grid-template-columns: 1fr; }
  .communication-thread-list.lc-janela { max-height: 300px; }
  .lc-msg > summary { grid-template-columns: 1fr; gap: 2px; min-height: 44px; }
  .lc-ic { width: 44px; height: 44px; }
  .lc-ic::after { display: none; }
  .lc-tabela thead { display: none; }
  .lc-tabela tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, max-content)); column-gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid #f0ebe4; }
  .lc-tabela td { border: 0; padding: 0; }
  .lc-tabela td:first-child { grid-column: 1 / -1; padding-bottom: 3px; min-height: 28px; }
  .lc-tabela td.lc-acoes { margin-left: auto; }
  .lc-grupo > summary { min-height: 44px; box-sizing: border-box; }
}
