/* Lexor — estilos (identidade: pergaminho + navy MBG + âmbar) */
:root {
  /* navy MBG = autoridade/títulos;  âmbar = accent/CTA;  pergaminho = base calorosa */
  --azul: #1c2b3e;        /* navy — títulos e texto forte */
  --azul-claro: #c77a45;  /* âmbar — botões primários, ativos, links (a "ponte") */
  --azul-bg: #efe7d6;     /* realce claro sobre o pergaminho */
  --fundo: #f7f3ea;       /* pergaminho — fundo principal */
  --card: #fbf8f1;        /* superfícies / cards */
  --borda: #e7dece;       /* divisórias finas */
  --texto: #2a2620;       /* tinta — preto quente */
  --texto-suave: #8a8175; /* texto secundário / legendas */
  --label: #6e6456;
  --input-bg: #ffffff;
  --thead: #f1ead9;
  --kanban-col: #efe7d6;
  --hover: #f0e9d9;
  --verde: #3a7d5b;
  --vermelho: #b04a3f;
  --laranja: #c77a45;
  --amarelo: #b48d54;     /* bronze MBG — herança */
  --roxo: #5b6b8c;
  --sombra: 0 1px 2px rgba(28, 43, 62, .07);
  --raio: 8px;
}

/* tema escuro — o navy É o modo escuro nativo da marca Lexor */
html[data-tema="dark"] {
  --azul: #f7f3ea;        /* pergaminho claro p/ títulos no navy */
  --azul-claro: #d98a52;  /* âmbar claro */
  --azul-bg: #22344a;
  --fundo: #16222f;       /* navy profundo */
  --card: #1c2b3e;        /* navy MBG — superfícies */
  --borda: #2a3d54;
  --texto: #ede6d8;
  --texto-suave: #9aa4b0;
  --label: #9aa4b0;
  --input-bg: #142231;
  --thead: #1a2838;
  --kanban-col: #182634;
  --hover: #243a50;
  --verde: #4a9377;
  --vermelho: #cf7468;
  --laranja: #d98a52;
  --amarelo: #c6a572;
  --roxo: #7b889e;
  --sombra: 0 1px 3px rgba(0, 0, 0, .35);
}
html[data-tema="dark"] .badge-azul { background: #1d3650; color: #b9d0e6; }
html[data-tema="dark"] .badge-verde { background: #15382b; color: #a8d5c0; }
html[data-tema="dark"] .badge-vermelho { background: #46221f; color: #e6b3ad; }
html[data-tema="dark"] .badge-laranja { background: #3e2f17; color: #dec79a; }
html[data-tema="dark"] .badge-cinza { background: #1f2a3a; color: #aebccd; }
html[data-tema="dark"] .badge-roxo { background: #25304a; color: #c2cde4; }
html[data-tema="dark"] .seg button.ativo { background: var(--azul-claro); color: #fff; }
/* no escuro, a barra lateral funde com o navy profundo do fundo */
html[data-tema="dark"] .sidebar { background: #131f2b; border-right: 1px solid var(--borda); }

/* ícones SVG (traço) */
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--fundo); color: var(--texto); font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}
b, strong { font-weight: 600; }
/* títulos em Fraunces (display da marca Lexor) */
.pagina-cabecalho h1, .modal-cabecalho h2, .login-card h1 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: 0;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--borda); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
a { color: var(--azul-claro); text-decoration: none; }

/* ---------- login ---------- */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #1c2b3e 0%, #16222f 55%, #0f1a25 100%);
}
.login-card {
  background: #fbf8f1; border-radius: 16px; padding: 40px 36px; width: 380px;
  box-shadow: 0 25px 60px rgba(0,0,0,.35); text-align: center; color: #2a2620; border: 1px solid #e7dece;
}
.login-logo {
  width: 60px; height: 60px; margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo svg { width: 60px; height: 60px; }
/* wordmark LEXOR — o X em âmbar */
.login-wordmark { font-family: 'Hanken Grotesk', sans-serif; font-weight: 700; font-size: 40px; letter-spacing: .06em; color: #1c2b3e; line-height: 1; margin: 12px 0 6px; }
.login-wordmark .x { color: #c77a45; }
.login-card h1 { font-size: 21px; margin: 14px 0 4px; color: #1c2b3e; }
.login-card label { color: #6e6456; }
.login-card input { background: #fff; border-color: #e7dece; color: #2a2620; }
.login-sub { color: var(--texto-suave); font-size: 13.5px; margin-bottom: 24px; font-family: 'Fraunces', Georgia, serif; font-style: italic; }
.login-card form { text-align: left; display: flex; flex-direction: column; gap: 14px; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 220px; min-width: 220px; background: #1c2b3e; color: #c7cdd6;
  display: flex; flex-direction: column; padding: 18px 12px; border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo { font-size: 17px; font-weight: 700; color: #fff; padding: 4px 10px 20px; display: flex; align-items: center; gap: 10px; letter-spacing: .04em; font-family: 'Hanken Grotesk', sans-serif; }
.sidebar-logo .x { color: #c77a45; }
.logo-marca {
  width: 30px; height: 30px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.logo-marca svg { width: 30px; height: 30px; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sidebar nav a {
  color: #c7cdd6; padding: 9px 12px; border-radius: 6px; font-size: 13.5px;
  transition: background .15s; display: flex; align-items: center; gap: 10px;
  border-left: 2px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.ativo { background: rgba(199, 122, 69, .18); color: #fff; font-weight: 600; border-left-color: #c77a45; }
.sidebar-user { border-top: 1px solid rgba(255,255,255,.12); padding: 12px 10px 0; font-size: 13px; color: #fff; }
.user-papel { color: #9aa4b0; font-size: 11.5px; margin: 2px 0 8px; text-transform: capitalize; }

.conteudo { flex: 1; overflow-y: auto; padding: 24px 28px; }
.pagina-cabecalho { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.pagina-cabecalho h1 { font-size: 19px; color: var(--azul); font-weight: 600; letter-spacing: .2px; }
.acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- componentes ---------- */
.card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px 18px; border: 1px solid var(--borda); }
.cards-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 14px 16px; border-left: 3px solid var(--azul-claro); border-top: 1px solid var(--borda); border-right: 1px solid var(--borda); border-bottom: 1px solid var(--borda); }
.kpi .kpi-valor { font-size: 22px; font-weight: 600; letter-spacing: .2px; }
.kpi .kpi-rotulo { color: var(--texto-suave); font-size: 11.5px; margin-top: 3px; }
.kpi.verde { border-left-color: var(--verde); }
.kpi.vermelho { border-left-color: var(--vermelho); }
.kpi.laranja { border-left-color: var(--laranja); }
.kpi.roxo { border-left-color: var(--roxo); }

.btn {
  border: 1px solid var(--borda); background: var(--card); color: var(--texto); padding: 7px 13px;
  border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 500; transition: filter .1s;
}
.btn:hover { filter: brightness(.96); }
.btn-primario { background: var(--azul-claro); border-color: var(--azul-claro); color: #fff; }
.btn-verde { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-vermelho { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.btn-mini { padding: 4px 10px; font-size: 12px; }
.btn-largo { width: 100%; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--label); letter-spacing: .2px; }
input, select, textarea {
  border: 1px solid var(--borda); border-radius: 7px; padding: 8px 10px; font-size: 12.5px;
  font-family: inherit; background: var(--input-bg); color: var(--texto); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: var(--azul-claro); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .col-2 { grid-column: span 2; }
.form-erro { color: var(--vermelho); font-size: 13px; padding: 8px 0; }
.check { flex-direction: row; align-items: center; gap: 7px; font-weight: 500; }
.check input { width: auto; }

table.tabela { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra); border: 1px solid var(--borda); }
.tabela th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--texto-suave); padding: 9px 12px; border-bottom: 1px solid var(--borda); background: var(--thead); font-weight: 600; }
.tabela td { padding: 9px 12px; border-bottom: 1px solid var(--borda); font-size: 12.5px; vertical-align: middle; }
.tabela tr:last-child td { border-bottom: none; }
.tabela tbody tr:hover { background: var(--hover); cursor: pointer; }
.tabela tr.sem-link:hover { background: inherit; cursor: default; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: .2px; }
.badge-azul { background: #dbeafe; color: #1d4ed8; }
.badge-verde { background: #dcfce7; color: #15803d; }
.badge-vermelho { background: #fee2e2; color: #b91c1c; }
.badge-laranja { background: #ffedd5; color: #c2410c; }
.badge-cinza { background: #e2e8f0; color: #475569; }
.badge-roxo { background: #ede9fe; color: #6d28d9; }

/* ---------- modal ---------- */
.modal-fundo {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex;
  align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 14px; width: 640px; max-width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,.3); animation: surge .15s ease-out;
}
.modal.grande { width: 900px; }
@keyframes surge { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-cabecalho { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--borda); }
.modal-cabecalho h2 { font-size: 16px; color: var(--azul); }
.modal-corpo { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-rodape { padding: 14px 20px; border-top: 1px solid var(--borda); display: flex; justify-content: flex-end; gap: 8px; }
.modal-fechar { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--texto-suave); }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--sombra); font-size: 13.5px; animation: surge .2s; max-width: 420px; }
.toast.erro { background: var(--vermelho); }
.toast.sucesso { background: var(--verde); }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.kanban-coluna { background: var(--kanban-col); border-radius: var(--raio); min-width: 270px; width: 270px; flex-shrink: 0; }
.kanban-coluna-titulo { padding: 11px 14px; font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; border-bottom: 2px solid rgba(0,0,0,.06); }
.kanban-cartoes { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-cartao {
  background: var(--card); border-radius: 7px; padding: 9px 11px; box-shadow: var(--sombra);
  cursor: grab; font-size: 12px; border: 1px solid var(--borda); border-left: 2px solid var(--azul-claro);
}
.kanban-cartao:active { cursor: grabbing; }
.kanban-cartao .titulo { font-weight: 700; font-size: 12.5px; }
.kanban-cartao .meta { color: var(--texto-suave); font-size: 11.5px; margin-top: 4px; }
.kanban-cartoes.arrastando { outline: 2px dashed var(--azul-claro); outline-offset: -4px; border-radius: 8px; }

/* ---------- configurações: menu lateral vertical ---------- */
.config-layout { display: grid; grid-template-columns: 195px 1fr; gap: 20px; align-items: start; }
.config-menu { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 10px; }
.config-menu button {
  text-align: left; background: none; border: none; padding: 8px 13px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--texto-suave); cursor: pointer; font-family: inherit;
  border-left: 2px solid transparent;
}
.config-menu button:hover { background: var(--hover); color: var(--texto); }
.config-menu button.ativo { background: var(--azul-bg); color: var(--azul); font-weight: 600; border-left-color: var(--azul-claro); }
@media (max-width: 900px) { .config-layout { grid-template-columns: 1fr; } .config-menu { flex-direction: row; flex-wrap: wrap; position: static; } }

/* ---------- abas ---------- */
.abas { display: flex; gap: 4px; border-bottom: 2px solid var(--borda); margin-bottom: 16px; flex-wrap: wrap; }
.aba { padding: 9px 16px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--texto-suave); border-bottom: 2px solid transparent; margin-bottom: -2px; background: none; border-top: none; border-left: none; border-right: none; }
.aba.ativa { color: var(--azul-claro); border-bottom-color: var(--azul-claro); }

/* ---------- filtros ---------- */
.filtros { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filtros label { font-size: 11px; }
.filtros input, .filtros select { width: auto; min-width: 130px; padding: 7px 10px; }
.seg { display: inline-flex; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: none; background: none; padding: 6px 12px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--texto-suave); }
.seg button.ativo { background: var(--azul-claro); color: #fff; }

/* ---------- dashboard ---------- */
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grade-2 .card h3, .card h3 { font-size: 11.5px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 12px; font-weight: 600; }
.grafico-wrap { position: relative; height: 260px; }

/* ---------- intimações ---------- */
.intimacao { border-left: 4px solid var(--laranja); padding: 12px 14px; background: var(--card); border-radius: 8px; box-shadow: var(--sombra); margin-bottom: 10px; }
.intimacao.tratada { border-color: var(--verde); opacity: .75; }
.intimacao.lida { border-color: var(--azul-claro); }
.intimacao .int-topo { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.intimacao .int-texto { font-size: 12.5px; color: var(--label); max-height: 80px; overflow: hidden; position: relative; }
.intimacao .int-texto.aberto { max-height: none; }

.lista-vazia { text-align: center; color: var(--texto-suave); padding: 40px; font-size: 13.5px; }
.muted { color: var(--texto-suave); font-size: 12px; }
.linha-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espaco { flex: 1; }
hr.sep { border: none; border-top: 1px solid var(--borda); margin: 14px 0; }

@media (max-width: 900px) {
  .grade-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2 { grid-column: span 1; }
  .sidebar { width: 64px; min-width: 64px; }
  .sidebar-logo span, .sidebar-user div { display: none; }
}

/* impressão de documentos gerados */
/* ---------- agenda (calendário mensal) ---------- */
.cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--borda); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; }
.cal-dia { min-width: 0; }
.cal-cab { background: var(--thead); padding: 8px 6px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--texto-suave); }
.cal-dia { background: var(--card); min-height: 110px; padding: 6px; position: relative; cursor: pointer; transition: background .1s; }
.cal-dia:hover { background: var(--hover); }
.cal-dia.fora { background: var(--thead); opacity: .55; }
.cal-dia .cal-num { font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.cal-dia.hoje .cal-num { background: var(--azul-claro); color: #fff; border-radius: 99px; padding: 2px 7px; }
.cal-dia .cal-add { position: absolute; top: 4px; right: 6px; opacity: 0; font-size: 14px; font-weight: 700; color: var(--azul-claro); }
.cal-dia:hover .cal-add { opacity: 1; }
.cal-item {
  font-size: 11px; padding: 3px 6px; border-radius: 4px; margin-top: 4px; cursor: pointer;
  background: var(--azul-bg); color: var(--texto); border-left: 2px solid var(--azul-claro);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.cal-item.atrasada { background: rgba(168, 58, 50, .12); border-left-color: var(--vermelho); }
.cal-item.concluida { opacity: .55; text-decoration: line-through; border-left-color: var(--verde); }

/* ---------- lista de processos do contato (estilo AdvBox) ---------- */
.proc-wrap { border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; background: var(--card); }
.proc-cab, .proc-item { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 175px 90px; gap: 12px; align-items: center; padding: 10px 14px; }
.proc-cab { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--texto-suave); font-weight: 700; background: var(--thead); border-bottom: 1px solid var(--borda); padding: 8px 14px; }
.proc-item { border-bottom: 1px solid var(--borda); cursor: pointer; position: relative; min-height: 52px; font-size: 12.5px; }
.proc-item:last-child { border-bottom: none; }
.proc-item:hover { background: var(--hover); }
.proc-item .proc-acoes {
  position: absolute; top: 50%; transform: translateY(-50%); right: 10px; display: none; gap: 4px;
  background: var(--card); border: 1px solid var(--borda); border-radius: 8px; padding: 4px 6px; box-shadow: var(--sombra);
}
.proc-item:hover .proc-acoes { display: flex; }
.badge-arquivado { background: var(--vermelho); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; letter-spacing: .5px; margin-right: 6px; vertical-align: middle; }

/* barra de ações do painel (compromissos) */
.barra-acoes { padding: 8px 12px; gap: 4px; }
.barra-acoes .btn-ico { width: 32px; height: 32px; }
.btn-ico-rel { position: relative; }

/* botões "flat": só ícone + texto, sem fundo */
.btn-flat {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: none;
  color: var(--texto-suave); font-size: 12.5px; font-weight: 500; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.btn-flat:hover { color: var(--texto); background: var(--hover); }
.btn-flat .ico { width: 14px; height: 14px; }

/* campo de pesquisa com ícone embutido */
.campo-busca {
  display: inline-flex; align-items: center; gap: 8px; background: var(--input-bg);
  border: 1px solid var(--borda); border-radius: 99px; padding: 0 14px; height: 32px; width: 270px;
}
.campo-busca .ico { width: 13px; height: 13px; color: var(--texto-suave); flex-shrink: 0; }
.campo-busca input { border: none; background: none; padding: 0; width: 100%; font-size: 12.5px; }
.campo-busca input:focus { outline: none; }
.campo-busca:focus-within { border-color: var(--azul-claro); }

.barra-sep { width: 1px; height: 22px; background: var(--borda); margin: 0 6px; flex-shrink: 0; }

/* busca progressiva de processo (typeahead) */
.ac-box { position: relative; }
.ac-box .ac-input { width: 100%; padding-right: 30px; }
.ac-limpar {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 20px; height: 20px;
  border: none; background: none; cursor: pointer; color: var(--texto-suave); font-size: 13px;
  border-radius: 5px; line-height: 1; padding: 0;
}
.ac-limpar:hover { background: var(--hover); color: var(--texto); }
.ac-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 400; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--borda); border-radius: 9px; box-shadow: 0 14px 36px rgba(0,0,0,.28);
}
.ac-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--borda); font-size: 12.5px; font-weight: 400; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.ativo { background: var(--hover); }
.ac-item b { font-weight: 600; }
.ac-item .ac-sub { font-size: 11px; color: var(--texto-suave); margin-top: 2px; }
.ac-vazio { padding: 12px; font-size: 12px; color: var(--texto-suave); text-align: center; }

/* ---- editor de documentos (modelos) estilo Word ---- */
.ed-sep { width: 1px; height: 18px; background: var(--borda); margin: 0 2px; flex-shrink: 0; }
.doc-editor { position: relative; }
/* o texto fica acima da camada de fundo/marca d'água */
.doc-editor > *:not(.doc-camada-fundo) { position: relative; z-index: 1; }
/* camada de fundo + marca d'água (contenteditable=false, salva no conteúdo) */
.doc-camada-fundo {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center; border-radius: inherit;
}
.doc-camada-fundo .doc-marca-txt {
  font-family: 'Hanken Grotesk', Arial, sans-serif; font-weight: 700; font-size: 68px;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(28,43,62,.07);
  transform: rotate(-28deg); white-space: nowrap; user-select: none;
}
/* tabelas inseridas no documento */
.doc-tabela { width: 100%; border-collapse: collapse; margin: 8px 0; }
.doc-tabela td, .doc-tabela th { border: 1px solid #9aa1ab; padding: 6px 8px; vertical-align: top; }
.doc-tabela th { background: #f1ead9; color: #1c2b3e; text-align: left; }
.doc-editor img { max-width: 100%; }

/* ---- barra de ferramentas do editor (flat, elegante, sem caixa por botão) ---- */
.edt { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 8px; background: var(--card); border: 1px solid var(--borda); border-radius: 10px; margin: 10px 0 8px; box-shadow: var(--sombra); }
.edt-g { display: flex; align-items: center; gap: 1px; }
.edt-sep { width: 1px; align-self: stretch; background: var(--borda); margin: 3px 6px; }
.edt-btn { height: 30px; min-width: 30px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; border: none; background: none; border-radius: 7px; cursor: pointer; color: var(--texto); font-size: 13.5px; font-family: inherit; line-height: 1; transition: background .12s; }
.edt-btn:hover { background: var(--hover); }
.edt-btn:active { background: var(--azul-bg); }
.edt-cor { gap: 2px; }
.edt-cor input[type=color] { width: 18px; height: 16px; padding: 0; border: none; background: none; cursor: pointer; }
.edt-sel { height: 30px; border: 1px solid transparent; background: none; border-radius: 7px; cursor: pointer; color: var(--texto); font-size: 12.5px; font-family: inherit; padding: 0 4px; }
.edt-sel:hover { background: var(--hover); }
.edt-sel-num { width: 50px; }
/* localizador de campos com busca */
.edt-campo { position: relative; }
.edt-campo input { height: 30px; border: 1px solid var(--borda); border-radius: 99px; background: var(--input-bg); padding: 0 13px; font-size: 12.5px; width: 250px; color: var(--texto); font-family: inherit; }
.edt-campo input:focus { outline: none; border-color: var(--azul-claro); }
.edt-campo-drop { position: absolute; top: calc(100% + 5px); left: 0; min-width: 290px; max-height: 320px; overflow-y: auto; background: var(--card); border: 1px solid var(--borda); border-radius: 9px; box-shadow: 0 14px 36px rgba(0,0,0,.28); z-index: 600; }
.edt-campo-item { padding: 7px 12px; cursor: pointer; border-bottom: 1px solid var(--borda); font-size: 12.5px; }
.edt-campo-item:last-child { border-bottom: none; }
.edt-campo-item:hover, .edt-campo-item.ativo { background: var(--hover); }
.edt-campo-item .g { font-size: 10px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }

/* página A4 (documento gerado, em tela cheia) */
.doc-pagina-fundo { background: var(--azul-bg); padding: 18px 0; border-radius: 8px; overflow: auto; }
.doc-editor.doc-a4 { width: 21cm; max-width: 100%; margin: 0 auto; padding: 2.5cm; background: #fff; color: #111; box-shadow: 0 2px 16px rgba(0,0,0,.18); border: none; border-radius: 2px; }

/* régua de recuos (cm) — marcadores arrastáveis */
.doc-regua { height: 22px; margin: 0 auto 5px; }
.rg-track { position: relative; height: 22px; background: var(--card); border: 1px solid var(--borda); border-radius: 4px; }
.rg-nums { position: absolute; inset: 0; overflow: hidden; }
.rg-tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--borda); }
.rg-tick i { position: absolute; top: 2px; left: 2px; font-style: normal; font-size: 8px; color: var(--texto-suave); }
.rg-mk { position: absolute; width: 0; height: 0; cursor: ew-resize; z-index: 2; }
.rg-mk::after { content: ''; position: absolute; left: -7px; top: -7px; width: 14px; height: 16px; } /* área de clique maior */
.rg-fl { top: -1px; transform: translateX(-5px); border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--azul-claro); }
.rg-le, .rg-ri { bottom: -1px; transform: translateX(-5px); border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 7px solid var(--azul-claro); }
.rg-val { position: absolute; top: -23px; transform: translateX(-50%); background: var(--azul); color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; z-index: 3; }

/* impressão: mostra só o documento, esconde o resto do sistema */
@media print {
  .doc-regua, .edt { display: none !important; }
  body * { visibility: hidden; }
  .doc-editor, .doc-editor * { visibility: visible; }
  .doc-editor { position: absolute; left: 0; top: 0; width: auto; max-height: none !important; overflow: visible !important; box-shadow: none !important; padding: 0 !important; border: none !important; margin: 0 !important; }
}

/* ---- barra flutuante de seleção em lote (concluir/excluir várias tarefas) ---- */
.barra-lote {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 500;
  background: var(--card); border: 1px solid var(--borda); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.28); padding: 9px 12px; display: flex; gap: 8px; align-items: center;
  animation: surge .15s ease-out;
}
.barra-lote .bl-cont { font-size: 13px; font-weight: 600; color: var(--azul); margin: 0 4px; }
.chk-sel, .chk-sel-all { cursor: pointer; width: 15px; height: 15px; }

/* multi-seleção de pessoas (checkbox + busca + chips) e busca de tipo de tarefa */
.mp, .tt { position: relative; }
.mp-box { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--borda); border-radius: 8px; background: var(--input-bg); padding: 5px 8px; min-height: 38px; cursor: text; }
.mp-box:focus-within { border-color: var(--azul-claro); }
.mp-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--azul-bg); color: var(--azul); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12px; font-weight: 500; }
.mp-x { border: none; background: none; cursor: pointer; color: inherit; font-size: 11px; padding: 0 2px; line-height: 1; }
.mp-input { flex: 1; min-width: 130px; border: none; background: none; outline: none; font-size: 13px; color: var(--texto); padding: 3px 2px; }
.mp-drop, .tt-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 500; max-height: 250px; overflow-y: auto; background: var(--card); border: 1px solid var(--borda); border-radius: 9px; box-shadow: 0 14px 36px rgba(0,0,0,.28); }
.mp-item, .tt-item { padding: 7px 11px; cursor: pointer; font-size: 12.5px; border-bottom: 1px solid var(--borda); display: flex; gap: 8px; align-items: center; }
.mp-item:last-child, .tt-item:last-child { border-bottom: none; }
.mp-item:hover, .tt-item:hover, .tt-item.ativo { background: var(--hover); }
.mp-item.sel { font-weight: 600; }
.mp-ck { font-size: 14px; flex-shrink: 0; }
.mp-vazio, .tt-vazio { padding: 10px; font-size: 12px; color: var(--texto-suave); text-align: center; }
.tt-input { width: 100%; }
.tt-item { justify-content: space-between; }
.tt-meta { font-size: 11px; color: var(--texto-suave); white-space: nowrap; }

/* listas verticais ordenáveis (grupos de ação, origem de pessoas, categorias financeiras) */
.lista-vert { display: flex; flex-direction: column; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; }
.lv-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--borda); font-size: 13px; }
.lv-item:last-child { border-bottom: none; }
.lv-item:hover { background: var(--hover); }
.lv-num { font-size: 11px; color: var(--texto-suave); min-width: 22px; }
.lv-label { flex: 1; min-width: 0; }

/* menu suspenso (Ordenar / Exportar) */
.menu-pop {
  position: fixed; z-index: 300; background: var(--card); border: 1px solid var(--borda);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 4px; display: flex;
  flex-direction: column; min-width: 180px;
}
.menu-pop button {
  background: none; border: none; text-align: left; padding: 8px 12px; cursor: pointer;
  color: var(--texto); font-size: 12.5px; border-radius: 5px; font-family: inherit;
}
.menu-pop button:hover { background: var(--hover); }
.notif {
  position: absolute; top: -6px; right: -6px; background: var(--vermelho); color: #fff;
  font-size: 9px; font-weight: 600; border-radius: 99px; padding: 1px 5px; line-height: 1.5; min-width: 16px; text-align: center;
}

/* linhas de compromisso do painel */
.comp-item {
  display: grid; grid-template-columns: 14px minmax(0, 2.6fr) minmax(0, 1.3fr) 110px 100px 150px;
  gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--borda);
  cursor: pointer; position: relative; font-size: 12.5px;
}
.comp-item:last-child { border-bottom: none; }
.comp-item:hover { background: var(--hover); }
.comp-head {
  cursor: default; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--texto-suave); font-weight: 600; padding: 8px 14px; background: var(--thead);
}
.comp-head:hover { background: var(--thead); }
.comp-head [data-ord] { cursor: pointer; }
.comp-head [data-ord]:hover { color: var(--texto); text-decoration: underline; }
.comp-parte { cursor: pointer; }
.comp-parte:hover { color: var(--texto); text-decoration: underline; }

/* coluna de ações nas tabelas (botões lado a lado, sem quebra) */
.tabela td.acoes-linha { white-space: nowrap; text-align: right; }

/* caixa de detalhe da tarefa (estilo AdvBox) */
.det-topbar {
  display: flex; align-items: center; gap: 8px; padding-bottom: 12px;
  border-bottom: 1px solid var(--borda); margin-bottom: 16px;
}
.det-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px; }
.det-lateral { border-left: 1px solid var(--borda); padding-left: 18px; font-size: 13px; }
.det-linha { display: flex; gap: 12px; padding: 5px 0; align-items: baseline; }
.det-rotulo {
  width: 110px; flex-shrink: 0; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--texto-suave); font-weight: 600;
}
.det-log { margin-top: 10px; border-top: 1px solid var(--borda); padding-top: 8px; }
.avatar-ini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 99px; background: var(--azul-claro, #7b88e0);
  color: #fff; font-size: 10px; font-weight: 700; margin-right: 2px; vertical-align: middle;
}

/* indicadores de rentabilidade na aba histórico da ficha do processo */
.grade-kpi-ficha {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 14px;
}
.grade-kpi-ficha > div {
  background: var(--card); border: 1px solid var(--borda); border-radius: 9px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 2px;
}
.grade-kpi-ficha b { font-size: 15px; }
.grade-kpi-ficha span { font-size: 10.5px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }

/* teor completo da intimação dentro da caixa de tratamento */
.int-teor-box {
  background: var(--hover); border: 1px solid var(--borda); border-radius: 9px;
  padding: 12px 14px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap;
  max-height: 260px; overflow-y: auto; margin-bottom: 14px;
}

/* caixinha de conclusão rápida nas listas de tarefas (painel e atividades) */
.chk-concluir {
  width: 15px; height: 15px; accent-color: var(--verde); cursor: pointer;
  flex-shrink: 0; vertical-align: middle; margin: 0;
}
.riscada, .riscada td, .riscada .titulo, .riscada .meta, .riscada > div {
  text-decoration: line-through; opacity: .92;
}
.riscada { opacity: .6; }
.riscada .proc-acoes, .riscada .chk-concluir { text-decoration: none; }

/* botão Concluir: hover verde-claro; concluída = verde com letra branca (clicável para desmarcar) */
.btn-concluir { transition: background .12s, color .12s, border-color .12s; }
.btn-concluir:hover { background: rgba(74, 147, 119, .18); border-color: var(--verde); color: var(--verde); }
.btn-concluir.ativo { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn-concluir.ativo:hover { background: var(--verde); color: #fff; opacity: .9; }

/* caixa flutuante com o teor da intimação (hover) */
.tip-flutuante {
  position: fixed; z-index: 300; max-width: 560px; max-height: 340px; overflow: hidden;
  background: var(--card); border: 1px solid var(--borda); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); padding: 12px 14px;
  font-size: 12px; line-height: 1.55; color: var(--texto);
  white-space: pre-wrap; pointer-events: none;
}
.comp-item .proc-acoes {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; gap: 4px;
  background: var(--card); border: 1px solid var(--borda); border-radius: 8px; padding: 3px 5px; box-shadow: var(--sombra);
}
.comp-item:hover .proc-acoes { display: flex; }
.comp-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

/* chave liga/desliga (switch) */
input.switch {
  appearance: none; -webkit-appearance: none; position: relative; width: 34px; height: 18px;
  background: var(--borda); border-radius: 99px; cursor: pointer; border: none; outline: none;
  transition: background .15s; flex-shrink: 0; vertical-align: middle; padding: 0;
}
input.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 99px; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
input.switch:checked { background: var(--verde); }
input.switch:checked::after { left: 18px; }
input.switch:disabled { opacity: .5; cursor: not-allowed; }

/* avatar com iniciais e indicador de status */
.avatar {
  width: 30px; height: 30px; border-radius: 99px; background: var(--azul-claro); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
  flex-shrink: 0; position: relative;
}
.avatar::after {
  content: ''; position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px;
  border-radius: 99px; border: 2px solid var(--card);
}
.avatar.on::after { background: #3dba7e; }
.avatar.off::after { background: var(--texto-suave); }

/* botões só de ícone com tooltip nativo (title) */
.btn-ico {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: none; border-radius: 6px; cursor: pointer; color: var(--texto-suave); padding: 0;
}
.btn-ico:hover { color: var(--azul-claro); background: var(--azul-bg); }
.btn-ico.perigo:hover { color: var(--vermelho); background: rgba(168, 58, 50, .1); }
.btn-ico .ico { width: 15px; height: 15px; }

/* ---------- painel lateral (ficha do processo) ---------- */
.drawer-fundo { position: fixed; inset: 0; background: rgba(8, 14, 23, .5); z-index: 150; display: flex; justify-content: flex-end; }
.drawer {
  width: 480px; max-width: 100%; height: 100%; background: var(--card); overflow-y: auto;
  padding: 18px 22px 30px; box-shadow: -14px 0 44px rgba(0,0,0,.3); animation: desliza .18s ease-out;
}
@keyframes desliza { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ficha-toolbar { display: flex; gap: 5px; align-items: center; margin-bottom: 16px; }
.ficha-toolbar .btn-ico { border: 1px solid var(--borda); }
.ficha-toolbar .btn-ico.ativo { background: var(--azul-claro); color: #fff; border-color: var(--azul-claro); }
.ficha-titulo { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.ficha-num { color: var(--texto-suave); font-size: 12.5px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.drawer .form-grid { grid-template-columns: 1fr 1fr; }
.drawer .form-grid .col-2 { grid-column: span 2; }
.drawer h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--texto-suave); margin: 18px 0 10px; border-top: 1px solid var(--borda); padding-top: 14px; }
.tl-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--borda); font-size: 12.5px; }
.tl-item .tl-data { color: var(--texto-suave); white-space: nowrap; font-size: 11.5px; width: 78px; flex-shrink: 0; }

/* compat: cartão antigo */
.proc-linha { position: relative; border: 1px solid var(--borda); border-radius: var(--raio); padding: 10px 12px; margin-top: 8px; background: var(--card); }

.expansor { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--borda); background: var(--card); cursor: pointer; font-weight: 700; color: var(--azul-claro); font-size: 14px; line-height: 1; }

@media print {
  .sidebar, .pagina-cabecalho .acoes, #toasts { display: none !important; }
}

/* ---------- prioridade das tarefas (bandeiras: 1 vermelha · 2 laranja · 3 azul · 4 branca) ---------- */
.prio-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--borda); background: var(--card); white-space: nowrap; vertical-align: middle; }
.prio-flag { font-size: 12px; line-height: 1; }
.prio-1 .prio-flag { color: #c62828; }
.prio-2 .prio-flag { color: #e0862c; }
.prio-3 .prio-flag { color: #2b6cb0; }
.prio-4 .prio-flag { color: #fff; text-shadow: 0 0 1px rgba(0,0,0,.65), 0 0 2px rgba(0,0,0,.35); }
.prio-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.prio-opt { display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; border: 1px solid var(--borda); border-radius: 7px; background: var(--card); cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--texto); }
.prio-opt:hover { border-color: var(--texto-suave); }
.prio-opt.ativo { border-color: var(--texto); box-shadow: inset 0 0 0 1px var(--texto); }

/* ---------- sino de notificações (sidebar) ---------- */
.sino { position: relative; margin-left: auto; background: transparent; border: none; color: #f7f3ea; cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; align-items: center; }
.sino:hover { background: rgba(247,243,234,.12); }
.sino .ico { width: 18px; height: 18px; }
.sino-badge { position: absolute; top: -2px; right: -3px; background: #c77a45; color: #fff; border-radius: 999px; font-size: 9.5px; font-weight: 800; padding: 1px 5px; line-height: 1.4; box-shadow: 0 0 0 2px #1c2b3e; }
.sino-painel { position: fixed; z-index: 90; width: 380px; max-width: calc(100vw - 24px); max-height: 72vh; overflow: auto; background: var(--card); border: 1px solid var(--borda); border-radius: 12px; box-shadow: 0 18px 55px rgba(28,43,62,.30); padding: 8px; }
.sino-topo { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; border-bottom: 1px solid var(--borda); margin-bottom: 6px; }
.sino-topo b { font-size: 14px; }
.sino-topo .espaco { flex: 1; }
.sino-item { padding: 9px 10px; border-radius: 9px; cursor: pointer; border-bottom: 1px solid var(--borda); }
.sino-item:last-child { border-bottom: none; }
.sino-item:hover { background: rgba(199,122,69,.08); }

/* ══ Workflows: cartões de fluxo, checklist de aplicação e construtor ══ */
.wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.wf-card { border: 1px solid var(--borda); border-radius: 11px; padding: 14px 15px; background: var(--card); display: flex; flex-direction: column; gap: 7px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.wf-card.clicavel { cursor: pointer; }
.wf-card.clicavel:hover { border-color: var(--azul); box-shadow: var(--sombra); transform: translateY(-1px); }
.wf-card-topo { display: flex; align-items: center; gap: 9px; }
.wf-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--azul-bg); color: var(--azul); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wf-ico svg { width: 16px; height: 16px; }
.wf-card h4 { margin: 0; font-size: 13.5px; line-height: 1.3; }
.wf-card .wf-desc { font-size: 11.5px; color: var(--texto-suave); line-height: 1.45; }
.wf-card .wf-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.wf-card .wf-acoes { display: flex; gap: 6px; border-top: 1px solid var(--borda); padding-top: 9px; margin-top: 4px; }

/* checklist de aplicação (o usuário escolhe quais tarefas criar) */
.wf-toolbar { display: flex; align-items: center; gap: 10px; margin: 10px 0 8px; flex-wrap: wrap; }
.wf-count { font-size: 12px; font-weight: 700; color: var(--azul); }
.wf-steps { display: flex; flex-direction: column; max-height: 52vh; overflow: auto; padding: 2px; }
.wf-step { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--borda); border-radius: 10px; margin-bottom: 8px; background: var(--card); transition: opacity .15s, border-color .15s; }
.wf-step:hover { border-color: var(--azul); }
.wf-step.off { opacity: .45; }
.wf-step.off:hover { opacity: .7; }
.wf-step input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--azul); cursor: pointer; flex-shrink: 0; }
.wf-num { width: 22px; height: 22px; border-radius: 50%; background: var(--azul-bg); color: var(--azul); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wf-info { flex: 1; min-width: 0; cursor: pointer; }
.wf-info b { font-size: 13px; }
.wf-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--texto-suave); margin-top: 4px; align-items: center; }
.wf-meta .prio-badge { margin: 0; }

/* construtor (Configurações → Workflows): passos como cartões numerados */
.wf-passo { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--borda); border-radius: 10px; padding: 12px; margin-bottom: 8px; background: var(--card); }
.wf-passo .wf-num { margin-top: 20px; }
.wf-passo .wf-campos { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr 78px 78px 1fr; gap: 8px; align-items: end; }
.wf-passo .wf-campos label { font-size: 11px; }
.wf-passo-lado { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; }
.wf-passo-lado .btn { padding: 1px 7px; line-height: 1.5; }
@media (max-width: 900px) { .wf-passo .wf-campos { grid-template-columns: 1fr 1fr; } }

/* marcação do prazo fatal na agenda (segunda entrada da tarefa, além da data) */
.cal-item.prazo-fatal { background: rgba(168, 58, 50, .14); border-left-color: var(--vermelho); color: var(--vermelho); font-weight: 600; }

/* ─── WhatsApp: central de atendimento (Lexor CRM) ─── */
.wa-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 130px); min-height: 420px; }
.wa-lista { display: flex; flex-direction: column; overflow: hidden; }
.wa-conv { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--borda); cursor: pointer; }
.wa-conv:hover { background: var(--hover); }
.wa-conv.ativa { background: var(--azul-bg); }
.wa-thread { display: flex; flex-direction: column; overflow: hidden; }
.wa-cab { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--borda); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; background: var(--kanban-col); }
.wa-dia { align-self: center; font-size: 10.5px; color: var(--texto-suave); background: var(--card); border: 1px solid var(--borda); border-radius: 10px; padding: 2px 10px; margin: 8px 0 4px; }
.wa-msg { display: flex; }
.wa-msg.saida { justify-content: flex-end; }
.wa-msg .balao { max-width: 72%; padding: 7px 10px; border-radius: 10px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; background: var(--card); border: 1px solid var(--borda); box-shadow: var(--sombra); }
.wa-msg.saida .balao { background: #dff0d9; border-color: #c8e0c0; }
html[data-tema="dark"] .wa-msg.saida .balao { background: #1d3a2c; border-color: #2c4a3a; }
.wa-msg .meta { font-size: 10px; color: var(--texto-suave); margin-left: 10px; float: right; margin-top: 6px; }
.wa-comp { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--borda); }
.wa-comp textarea { flex: 1; resize: none; max-height: 120px; }
@media (max-width: 900px) { .wa-wrap { grid-template-columns: 1fr; height: auto; } .wa-thread { min-height: 420px; } }

/* mobile: lista com scroll próprio em vez de empurrar a thread para fora da tela */
@media (max-width: 900px) {
  .wa-lista { max-height: 36vh; }
  .wa-thread { min-height: 58vh; }
}
