:root {
  --ink: #201d17; --paper: #faf7f1; --panel: #f1ece0; --line: #dbd1b9;
  --accent: #8a6a2f; --accent-deep: #5f4a1f;
  --quente: #8c3b34; --morno: #92621f; --frio: #3e6b4f;
  --bg-quente: #f3e1dc; --bg-morno: #f5e9d2; --bg-frio: #e6efe7;
  --navy: #1a2036; --navy-deep: #12172a; --gold: #c9a227; --gold-soft: #e8cb80;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--paper); color: var(--ink); }

header.topo {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 16px 24px; background: var(--navy); color: #ede7d6;
}
.marca-nome { font-family: Georgia, "Iowan Old Style", serif; font-size: 20px; line-height: 1.15; }
.marca-sub { font-size: 11px; letter-spacing: .12em; color: var(--gold-soft); font-weight: 600; }
header.topo nav.abas { flex: 1; display: flex; gap: 4px; }
header.topo .aba { background: none; border: none; padding: 9px 16px; cursor: pointer; font-size: 13.5px; color: #cfc9b8; border-radius: 20px; }
header.topo .aba:hover { color: #ede7d6; }
header.topo .aba.ativa { background: var(--gold); color: var(--navy-deep); font-weight: 650; }
#busca { padding: 8px 14px; border: 1px solid #3a3f57; border-radius: 20px; width: 300px; font-size: 13px; background: var(--navy-deep); color: #ede7d6; }
#busca::placeholder { color: #8b8ea3; }
#relogio-sistema { font-size: 12px; color: #8b8ea3; white-space: nowrap; }
.indicador-falhas { border: none; border-radius: 20px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--bg-quente); color: var(--quente); }
.indicador-falhas:hover { filter: brightness(0.95); }

main { padding: 20px 24px; }
.secao { display: none; }
.secao.ativa { display: block; }
.ajuda { font-size: 13px; color: #6b6455; max-width: 70ch; }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.coluna { min-width: 250px; max-width: 250px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; flex-shrink: 0; }
.coluna h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-deep); margin: 0 0 10px; display: flex; justify-content: space-between; font-weight: 700; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; margin-bottom: 9px; cursor: grab; font-size: 13px; transition: box-shadow .12s, border-color .12s, opacity .12s; }
.card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(90,70,20,.12); }
.card:active { cursor: grabbing; }
.card.arrastando { opacity: .4; }
.card .nome { font-weight: 650; margin-bottom: 5px; }
.coluna { transition: background .12s, border-color .12s; }
.coluna.coluna-arraste-sobre { background: var(--bg-morno); border-color: var(--accent); border-style: dashed; }
.pill { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 10px; margin-right: 4px; margin-top: 3px; }
.pill.Quente, .pill.alta { background: var(--bg-quente); color: var(--quente); }
.pill.Morno, .pill.media { background: var(--bg-morno); color: var(--morno); }
.pill.Frio, .pill.baixa { background: var(--bg-frio); color: var(--frio); }
.pill.categoria { background: #e9e2d2; color: #5f4a1f; }
.pill.etiqueta { background: #ddeaf0; color: #2f5f75; margin-bottom: 4px; }
.pill.etiqueta-regiao { background: #e3ecd9; color: #4a6b2c; }
.pill.etiqueta-faixa_preco { background: #f0e3d9; color: #8a5a2c; }
.pill.etiqueta-parceria { background: #ece3f0; color: #6a3d8a; }
.remover-etiqueta { cursor: pointer; margin-left: 4px; font-weight: 700; opacity: .6; }
.remover-etiqueta:hover { opacity: 1; }
.pill.audio-pendente { background: var(--bg-morno); color: var(--morno); margin-bottom: 4px; }
.aviso-audio-pendente { background: var(--bg-morno); color: var(--morno); border-radius: 5px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 14px; }

.lista-simples { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lista-simples .item { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.lista-simples .item:hover { border-color: var(--accent); }
.lista-simples .item.tarefa-vencida { border-color: var(--quente); background: var(--bg-quente); color: var(--quente); font-weight: 600; }

.grade-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card-resumo { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-align: center; }
.card-resumo-numero { font-size: 32px; font-weight: 700; font-family: Georgia, serif; color: var(--accent-deep); }
.card-resumo-rotulo { font-size: 12.5px; color: #6b6455; margin-top: 4px; }
.tabela-contatos { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.tabela-contatos th, .tabela-contatos td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tabela-contatos tr.linha-clicavel { cursor: pointer; }
.tabela-contatos tr.linha-clicavel:hover { background: var(--panel); }
#drill-down-contatos { margin-top: 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.grafico-legenda { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 6px; }
.grafico-legenda .legenda-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink); }
.grafico-legenda .legenda-item i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
#grafico-trabalho { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 4px; }

.grade-prioridades { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.bloco-prioridade h3 { font-size: 14px; margin: 0 0 4px; font-weight: 700; }

.bloco-rascunhos { margin-top: 22px; }
.rascunho-item { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; }
.rascunho-cabecalho { font-size: 13px; margin-bottom: 8px; }
.rascunho-cabecalho a { margin-left: 10px; font-size: 12px; }
.rascunho-item textarea { width: 100%; min-height: 60px; border: 1px solid var(--line); border-radius: 4px; padding: 8px; font-family: inherit; font-size: 13px; background: white; margin-bottom: 6px; }

button { font-family: inherit; }
#btn-dry-run { margin-top: 10px; padding: 8px 16px; background: var(--accent); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
#resultado-dry-run { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 12px; margin-top: 14px; font-size: 12px; white-space: pre-wrap; max-height: 60vh; overflow: auto; }

.painel-detalhe { position: fixed; inset: 0; background: rgba(0,0,0,.25); display: flex; justify-content: flex-end; z-index: 10; }
.painel-detalhe.oculto { display: none; }
.painel-conteudo { width: min(560px, 100%); background: var(--paper); height: 100%; overflow-y: auto; padding: 20px; position: relative; }
.fechar { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); }

.detalhe h2 { font-family: Georgia, "Iowan Old Style", serif; font-size: 22px; margin: 0 0 4px; }
.detalhe .sub { color: #6b6455; font-size: 12px; margin-bottom: 16px; }
.ficha-contato { display: flex; flex-wrap: wrap; gap: 8px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.ficha-contato .item-contato { display: flex; gap: 6px; align-items: baseline; }
.ficha-contato .item-contato .rotulo { color: #6b6455; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ficha-contato .sem-dado { color: #a39c8a; font-style: italic; }
.evidencias-lista { display: flex; flex-direction: column; gap: 4px; }
.evidencias-lista .evidencia { border-bottom: none; padding: 6px 10px; background: var(--panel); border-radius: 4px; }
.detalhe h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6b6455; margin: 18px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.msg { padding: 6px 10px; border-radius: 6px; margin-bottom: 6px; font-size: 13px; max-width: 90%; }
.msg.recebida { background: var(--panel); }
.msg.enviada { background: #e9e2d2; margin-left: auto; }
.msg .meta { font-size: 10px; color: #6b6455; margin-top: 2px; }
.evidencia { font-size: 12px; color: #6b6455; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.indicador { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.sugestao-box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: 13px; }
.sugestao-box textarea { width: 100%; min-height: 80px; border: 1px solid var(--line); border-radius: 4px; padding: 8px; font-family: inherit; font-size: 13px; margin-top: 8px; }
.linha-controles { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.linha-controles select, .linha-controles button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; background: white; cursor: pointer; }
.tarefa { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; }
.tarefa.concluida { text-decoration: line-through; color: #6b6455; }
.aviso-copiar { font-size: 11px; color: var(--frio); margin-left: 8px; }

.metricas-validacao { margin: 14px 0 20px; }
.tabela-metricas { border-collapse: collapse; width: 100%; max-width: 480px; font-size: 13px; margin-bottom: 12px; }
.tabela-metricas th, .tabela-metricas td { text-align: left; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.tabela-metricas th { font-size: 11px; text-transform: uppercase; color: #6b6455; }
.linha-validacao { border-bottom: 1px solid var(--line); padding: 10px 0; }
.linha-validacao label { font-weight: 650; font-size: 13px; display: block; margin-bottom: 4px; }
.valor-sistema { font-size: 12px; color: #6b6455; margin-bottom: 6px; }
.linha-validacao input[type="text"], .linha-validacao select { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; }
.erro-validacao { color: var(--quente); font-size: 12px; margin-top: 6px; }
