/* IOT-CRM — estilo base. Sem framework. Cores do site da IOTécnica (iotecnica.com.br):
   vermelho #E11D26, preto #1A1A1A, azul #00aeef. Desktop primeiro, sem quebrar no
   celular (D10). */

:root {
  --marca: #E11D26;
  --marca-escura: #b3141c;
  --destaque: #00aeef;
  --texto: #1f2328;
  --suave: #5f6670;
  --fundo: #f4f5f7;
  --cartao: #ffffff;
  --borda: #dcdfe4;
  --topo: #1A1A1A;
  --ok: #2e7d32;
  --alerta: #b26a00;
  --raio: 8px;
  --sombra: 0 1px 2px rgb(0 0 0 / 0.06), 0 1px 6px rgb(0 0 0 / 0.04);
  --sombra-forte: 0 2px 10px rgb(0 0 0 / 0.1);
  /* Superfícies e estados: no tema escuro só estes valores mudam (bloco no fim). */
  --campo: #fff;
  --campo-leitura: #f3f4f6;
  --cartao-2: #fafbfc;
  --recuo: #e9ebee;
  --neutro: #eceef1;
  --grafite: #1A1A1A;
  --sem-cor: #b8bec7;
  --marca-texto: #E11D26;
  --perigo-texto: #b3141c;
  --perigo-fundo: #fdecea;
  --perigo-borda: #f1b9bb;
  --ok-fundo: #e3f2e5;
  --info-fundo: #e7eefb; --info-texto: #1f4e9c;
  --aviso-fundo: #e8f5e9; --aviso-texto: #1b5e20;
  --erro-texto: #8e1c1c;
  --whats-fundo: #e3f5e8; --whats-texto: #127a3a; --whats-fundo-forte: #c9ecd3;
  --hoje-fundo: #e7f0fb; --hoje-texto: #1c5cab;
  --semana-fundo: #eef0f2;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--fundo); line-height: 1.45; }
a { color: var(--marca-texto); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }

/* ---- topo ---- */
.topo {
  display: flex; align-items: center; gap: 1.5rem;
  height: 52px; padding: 0 1rem;
  background: var(--topo); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.marca { font-weight: 800; letter-spacing: 0.02em; color: #fff; text-decoration: none; font-size: 1.15rem;
         display: inline-flex; align-items: center; gap: 0.4rem; }
.marca img { background: #fff; border-radius: 6px; padding: 2px; }
.marca span { color: var(--marca); margin-left: 0.15em; }
.menu { display: flex; gap: 0.25rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.menu a {
  color: #d5d8dd; text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 6px;
  white-space: nowrap; font-weight: 500;
}
.menu a:hover { color: #fff; background: rgb(255 255 255 / 0.08); }
.menu a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--marca); border-radius: 0; }

.busca-topo { flex: 0 1 260px; min-width: 140px; margin: 0; }
.busca-topo input {
  width: 100%; padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.92rem;
  background: rgb(255 255 255 / 0.1); color: #fff; border: 1px solid rgb(255 255 255 / 0.18);
}
.busca-topo input::placeholder { color: #a9aeb6; }
.busca-topo input:focus { background: var(--campo); color: var(--texto); outline: 2px solid var(--destaque); }

.conta { position: relative; }
.conta summary { cursor: pointer; list-style: none; color: #e8eaed; white-space: nowrap; }
.conta summary::after { content: " ▾"; font-size: 0.8em; }
.conta-menu {
  position: absolute; right: 0; top: 2rem; min-width: 240px;
  background: var(--cartao); color: var(--texto); border: 1px solid var(--borda);
  border-radius: var(--raio); box-shadow: var(--sombra); padding: 0.5rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.conta-menu a, .conta-menu .link { padding: 0.4rem 0.5rem; text-align: left; }

/* ---- conteúdo ---- */
.conteudo { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.cartao {
  background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio);
  box-shadow: var(--sombra); padding: 1.25rem; margin-bottom: 1rem;
}

/* ---- formulários ---- */
.formulario { display: flex; flex-direction: column; gap: 0.9rem; margin: 1rem 0; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: 0.6rem 0.7rem;
  border: 1px solid var(--borda); border-radius: 6px; background: var(--campo); color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--destaque); outline-offset: 0; border-color: transparent; }
.codigo { font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; }

.botao {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.65rem 1rem; border: 0; border-radius: 6px;
  background: var(--marca); color: #fff;
}
.botao:hover { background: var(--marca-escura); }
.link {
  font: inherit; cursor: pointer; background: none; border: 0; padding: 0;
  color: var(--marca-texto); text-decoration: underline;
}

.aviso, .erro { padding: 0.6rem 0.8rem; border-radius: 6px; margin: 0.75rem 0; }
.aviso { background: var(--aviso-fundo); color: var(--aviso-texto); }
.erro { background: var(--perigo-fundo); color: var(--erro-texto); }
.nota { color: var(--suave); font-size: 0.9rem; }

/* ---- telas de acesso (login, verificação, erro) ---- */
body.acesso { display: grid; place-items: center; padding: 1rem; }
.cartao-acesso {
  width: 100%; max-width: 400px; background: var(--cartao);
  border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra);
  padding: 2rem 1.5rem;
}
.marca-grande { color: var(--texto); font-size: 1.6rem; text-align: center; margin: 0 0 1rem; }
.titulo-erro { font-size: 1.25rem; }

/* ---- listas ---- */
.cabecalho { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.cabecalho h1 { margin: 0; }
.trilha { margin: 0 0 0.25rem; font-size: 0.9rem; }
.trilha a { color: var(--suave); text-decoration: none; }
.trilha a::before { content: "← "; }
.filtros { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.filtros input[type="search"] { flex: 1 1 260px; min-width: 0; }
.filtros select { flex: 0 1 220px; min-width: 0; }
.botao-leve { background: var(--cartao); color: var(--texto); border: 1px solid var(--borda); }
.botao-leve:hover { background: var(--fundo); }
.contagem { color: var(--suave); font-size: 0.9rem; margin: 0 0 0.5rem; }
.tabela-rolagem { overflow-x: auto; background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); }
.cartao .tabela-rolagem { border: 0; border-radius: 0; }
.tabela { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabela th, .tabela td { padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--borda); }
.tabela th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--suave); background: var(--cartao-2); white-space: nowrap; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: var(--cartao-2); }
.tabela tfoot td { font-weight: 600; border-top: 1px solid var(--borda); border-bottom: 0; }
.tabela .num { text-align: right; white-space: nowrap; }
.tabela a { text-decoration: none; font-weight: 600; }
.tabela a:hover { text-decoration: underline; }
.vazio { color: var(--suave); text-align: center; padding: 1.5rem; }
.sub { color: var(--suave); font-size: 0.85rem; font-weight: 400; }
.apagado { opacity: 0.6; }
.paginacao { display: flex; gap: 1rem; justify-content: center; align-items: center; margin: 1rem 0; font-size: 0.9rem; }

.etiqueta {
  display: inline-block; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.75rem;
  font-weight: 600; background: var(--neutro); color: var(--suave); vertical-align: middle; white-space: nowrap;
}
.etiqueta-ok, .etiqueta-cliente, .etiqueta-ganho { background: var(--ok-fundo); color: var(--ok); }
.etiqueta-prospect, .etiqueta-aberto { background: var(--info-fundo); color: var(--info-texto); }
.etiqueta-ex_cliente, .etiqueta-perdido { background: var(--perigo-fundo); color: var(--perigo-texto); }
h1 .etiqueta { font-size: 0.8rem; }

.abas { display: flex; gap: 0.25rem; background: var(--recuo); padding: 0.2rem; border-radius: 8px; }
.abas a { padding: 0.3rem 0.75rem; border-radius: 6px; text-decoration: none; color: var(--suave); font-weight: 600; font-size: 0.9rem; }
.abas a[aria-current="page"] { background: var(--cartao); color: var(--texto); box-shadow: var(--sombra); }

/* ---- fichas ---- */
.ficha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.dados { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0; }
.dados dt { color: var(--suave); font-size: 0.85rem; padding-top: 0.1rem; }
.dados dd { margin: 0; overflow-wrap: anywhere; }
.descricao { white-space: pre-wrap; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--borda); font-size: 0.92rem; }
.lista-simples { list-style: none; margin: 0; padding: 0; }
.lista-simples li { padding: 0.45rem 0; border-bottom: 1px solid var(--borda); }
.lista-simples li:last-child { border-bottom: 0; }
.lista-simples a { font-weight: 600; text-decoration: none; }

.tempo { list-style: none; margin: 0; padding: 0; }
.atividade { padding: 0.6rem 0 0.6rem 0.8rem; border-left: 3px solid var(--borda); margin-bottom: 0.4rem; }
.atividade.pendente { border-left-color: #4a7bd0; }
.atividade.vencida { border-left-color: var(--marca); }
.atividade.movimento { border-left-style: dashed; }
.atividade-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--suave); }
.atividade.vencida time { color: var(--marca-texto); font-weight: 600; }
.atividade-texto { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.2rem; font-size: 0.92rem; }

/* ---- tela de Atividades ---- */
.filtros-atividades .tipos { flex-basis: 100%; margin-bottom: 0; }
/* No filtro o tipo é botão: sem a bolinha do rádio; o foco do teclado fica na pílula. */
.filtros-atividades .pilula { position: relative; }
.filtros-atividades .pilula input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.filtros-atividades .pilula:has(input:focus-visible) { outline: 2px solid var(--destaque); outline-offset: 1px; }
.filtro-data { display: inline-flex; flex-direction: row; align-items: center; gap: 0.35rem;
  color: var(--suave); font-weight: 500; font-size: 0.88rem; }
.filtro-data input { min-width: 0; }
.lista-atividades .grupo-dia { font-size: 0.95rem; margin: 1rem 0 0.4rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--borda); }
.lista-atividades .grupo-dia:first-child { margin-top: 0; }
.grupo-vencidas, .texto-vencida { color: var(--marca-texto); }
.atividade-cliente { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; align-items: baseline; margin-top: 0.15rem; font-size: 0.9rem; }
.atividade-cliente > a { font-weight: 600; text-decoration: none; }

/* ---- funil ---- */
.legenda { color: var(--suave); font-size: 0.8rem; margin: -0.25rem 0 0.75rem; }
.ponto { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; vertical-align: middle; margin-left: 0.4rem; }
.ponto-vencida { background: var(--marca); }
.ponto-hoje { background: #e6a700; }
.ponto-futura { background: var(--ok); }
.ponto-sem { background: var(--sem-cor); }
.quadro { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.75rem; align-items: flex-start; }
.coluna { flex: 0 0 280px; background: var(--recuo); border-radius: var(--raio); padding: 0.5rem; max-height: calc(100vh - 220px); display: flex; flex-direction: column; }
.coluna-topo { padding: 0.25rem 0.35rem 0.5rem; }
.coluna-topo h2 { font-size: 0.95rem; margin: 0; }
.cards { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.card { background: var(--cartao); border-radius: 6px; padding: 0.6rem 0.65rem; box-shadow: var(--sombra); border-left: 4px solid var(--sem-cor); }
.card-vencida { border-left-color: var(--marca); }
.card-hoje { border-left-color: #e6a700; }
.card-futura { border-left-color: var(--ok); }
.card-titulo { font-weight: 600; text-decoration: none; color: var(--texto); display: block; overflow-wrap: anywhere; }
.card-titulo:hover { color: var(--marca-texto); }
.card-rodape { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.85rem; font-weight: 600; }
.card-proxima { font-size: 0.78rem; color: var(--suave); margin-top: 0.25rem; }
.card-vencida .card-proxima { color: var(--marca-texto); font-weight: 600; }
.avatar { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--grafite); color: #fff; font-size: 0.7rem; font-weight: 700; flex: none; }

/* ---- início ---- */

/* ---- V1: ações, formulários, registro rápido ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.acoes select { padding: 0.55rem 0.6rem; }
.acao-inline { display: inline-flex; gap: 0.4rem; align-items: center; margin: 0; }
a.botao, summary.botao { display: inline-block; text-decoration: none; }
summary.botao { list-style: none; }
summary.botao::-webkit-details-marker { display: none; }
.botao-ganho { background: #2e7d32; }
.botao-ganho:hover { background: #1b5e20; }
.botao-perdido { background: var(--cartao); color: var(--perigo-texto); border: 1px solid var(--perigo-borda); }
.botao-perdido:hover { background: var(--perigo-fundo); }
.acao-perdido { position: relative; }
.acao-perdido[open] > form { position: absolute; z-index: 5; top: calc(100% + 0.4rem); left: 0; width: min(340px, 90vw);
  display: flex; flex-direction: column; gap: 0.6rem; }

.form-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem 1rem; align-items: start; }
.form-grade h2 { margin: 0.5rem 0 0; font-size: 1rem; color: var(--suave); }
.largo { grid-column: 1 / -1; }
.campo { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.88rem; min-width: 0; }
.campo small { color: var(--suave); font-weight: 400; }
.campo abbr { color: var(--marca-texto); text-decoration: none; }
fieldset { border: 0; padding: 0; margin: 0 0 0.8rem; min-width: 0; }
legend { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.4rem; padding: 0; }
.com-erro input, .com-erro select, .com-erro textarea { border-color: var(--marca); }
.campo-erro { color: var(--perigo-texto); font-weight: 600; font-size: 0.85rem; }
.botoes { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tipos { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.pilula { display: inline-flex; flex-direction: row; align-items: center; gap: 0.3rem; border: 1px solid var(--borda); border-radius: 999px;
  padding: 0.3rem 0.7rem; font-weight: 500; font-size: 0.88rem; cursor: pointer; background: var(--campo); }
.pilula input { margin: 0; accent-color: var(--marca); }
.pilula:has(input:checked) { border-color: var(--marca); background: var(--perigo-fundo); color: var(--perigo-texto); }
.registro-rapido { border-left: 4px solid var(--destaque); }
/* "Onde?" da nova atividade na tela de Atividades (D27) */
.onde input[type="search"] { width: 100%; max-width: 36rem; }
.atividade-acoes { display: flex; gap: 1rem; align-items: center; margin-top: 0.3rem; font-size: 0.85rem; }

.opcoes-cliente { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.5rem 0; }
.opcao-cliente { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-weight: 400; padding: 0.35rem 0.5rem;
  border: 1px solid var(--borda); border-radius: 6px; cursor: pointer; background: var(--campo); }
.opcao-cliente:has(input:checked) { border-color: var(--marca); background: var(--perigo-fundo); }
.nova-empresa summary, .ligar-empresa summary { cursor: pointer; color: var(--marca-texto); font-weight: 600; margin: 0.4rem 0; }
.ligar-empresa { margin-top: 0.75rem; }

.card { cursor: grab; }
.card-fantasma { opacity: 0.35; }
.cards { min-height: 3rem; }

/* ---- busca geral e telefones ---- */
.busca-blocos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.busca-blocos .cartao { margin-bottom: 0; }
.cartao-titulo h2 .sub { font-size: 0.85rem; margin-left: 0.2rem; }
a.whats {
  display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; vertical-align: middle;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; text-decoration: none;
  background: var(--whats-fundo); color: var(--whats-texto);
}
a.whats:hover { background: var(--whats-fundo-forte); text-decoration: none; }
.fone { white-space: nowrap; }
.lista-simples .sub a:not(.whats) { font-weight: 500; }

/* ---- negócios: planilha ---- */
.abas-status { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 0.75rem; }
.abas a { white-space: nowrap; }
.planilha td:nth-child(1) { min-width: 13rem; }
.planilha td:nth-child(2) { min-width: 11rem; }
.planilha td, .planilha th { white-space: nowrap; }
.planilha td:nth-child(1), .planilha td:nth-child(2) { white-space: normal; }
.planilha th a.ordenar { color: inherit; font-weight: inherit; text-decoration: none; }
.planilha th a.ordenar:hover { color: var(--texto); }
.planilha th[aria-sort] { color: var(--texto); }
.planilha .ponto { margin-left: 0; margin-right: 0.3rem; }
.sem-quebra { white-space: nowrap; }

/* ---- produtos e itens do negócio ---- */
.cartao-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.cartao-titulo h2 { margin-top: 0; }
.cartao-titulo a { font-size: 0.9rem; font-weight: 600; }
.etiqueta-inativo { background: var(--neutro); color: var(--suave); }
.campo-marcar { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; }
.campo-marcar input { margin: 0; accent-color: var(--marca); }
.tabela .margem td { font-weight: 400; color: var(--suave); }
input[readonly] { background: var(--campo-leitura); color: var(--suave); }

.itens { border-top: 1px solid var(--borda); border-bottom: 1px solid var(--borda); padding: 0.75rem 0; }
.itens.com-erro input, .itens.com-erro select { border-color: var(--borda); }
.itens-corpo { display: flex; flex-direction: column; gap: 0.5rem; }
.item-linha {
  display: grid; gap: 0.5rem; align-items: end; padding: 0.5rem;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.9fr) minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.1fr) auto;
  border: 1px solid var(--borda); border-radius: 6px; background: var(--cartao-2);
}
.item-linha .campo { font-size: 0.8rem; }
.item-linha input, .item-linha select { padding: 0.45rem 0.5rem; width: 100%; min-width: 0; }
.item-qtd input, .item-unit input, .item-desc input { text-align: right; }
.item-total output { display: block; padding: 0.45rem 0; text-align: right; font-weight: 700; font-size: 0.92rem; }
.item-remover {
  font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; background: none; color: var(--suave);
  border: 1px solid transparent; border-radius: 6px; padding: 0.3rem 0.55rem;
}
.item-remover:hover { color: var(--marca-texto); border-color: var(--borda); background: var(--campo); }
.itens-busca { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.itens-busca input { flex: 1 1 260px; min-width: 0; }
.opcoes-produto { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.4rem 0; }
.opcao-produto {
  font: inherit; text-align: left; cursor: pointer; color: var(--texto); background: var(--campo);
  display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; align-items: baseline;
  padding: 0.4rem 0.6rem; border: 1px solid var(--borda); border-radius: 6px;
}
.opcao-produto:hover, .opcao-produto:focus { border-color: var(--marca); background: var(--perigo-fundo); }
.itens-totais { margin: 0.5rem 0 0; text-align: right; }

/* ---- painel do Início ----
   Cores de dado (método dataviz, paleta de referência): uma série só = azul #2a78d6;
   estado da próxima tarefa = paleta de status (bom, atenção, crítico), sempre com o
   número escrito e a legenda. Texto nunca na cor da série. */
:root {
  --serie: #2a78d6;
  --st-bom: #0ca30c; --st-atencao: #fab219; --st-critico: #d03b3b;
  --grade: #e1e0d9; --eixo: #c3c2b7; --mudo: #898781;
  --texto-bom: #006300; --texto-ruim: #b3141c;
}
.painel-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.painel-topo h1 { margin: 0; }
.painel-filtros { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.painel-filtros select { min-width: 0; }
.painel-periodo { margin: 0 0 0.6rem; color: var(--suave); font-size: 0.9rem; }
.painel-periodo strong { color: var(--texto); }

.atalhos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.atalho { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1rem; border-radius: 8px;
  color: #fff; font-weight: 600; font-size: 0.92rem; text-decoration: none; box-shadow: var(--sombra); }
.atalho:hover { filter: brightness(0.92); }
.atalho-negocio { background: var(--marca); }
.atalho-empresa { background: var(--grafite); }
.atalho-pessoa { background: #0072b1; }
.atalho-atividade { background: #1d7a3e; }

.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.indicador { --cor: var(--suave); position: relative; display: flex; flex-direction: column; gap: 0.25rem;
  background: var(--cartao); border: 1px solid var(--borda); border-top: 4px solid var(--cor); border-radius: var(--raio);
  padding: 0.9rem 1rem; box-shadow: var(--sombra); color: var(--texto); text-decoration: none; }
a.indicador:hover { box-shadow: var(--sombra-forte); }
.ind-topo { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; font-weight: 600; color: var(--suave); }
.ind-topo .icone { color: var(--cor); flex: none; }
.ind-valor { font-size: 1.45rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.ind-sub { color: var(--suave); font-size: 0.82rem; }
.ind-andamento { --cor: var(--destaque); background: var(--grafite); border-color: var(--grafite); border-top-color: var(--destaque); color: #fff; }
.ind-andamento .ind-topo, .ind-andamento .ind-sub { color: #c9ccd1; }
.ind-ganho { --cor: var(--st-bom); }
.ind-novo { --cor: var(--serie); }
.ind-perdido { --cor: var(--st-critico); }
.ind-taxa { --cor: #6250d6; }
.delta { font-size: 0.8rem; font-weight: 600; margin-top: auto; padding-top: 0.2rem; }
.delta-bom { color: var(--texto-bom); }
.delta-ruim { color: var(--texto-ruim); }
.delta-igual { color: var(--suave); font-weight: 500; }
.delta-vs { color: var(--suave); font-weight: 400; }

.painel-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.painel-coluna { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.painel-coluna > .cartao { margin-bottom: 0; }

/* Colunas (vendas por mês): barras de até 24px, ponta de 4px arredondada, base reta. */
.grafico-colunas { margin: 1.4rem 0 0.25rem 3.6rem; }
.gc-area { position: relative; height: 170px; }
.gc-grade { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grade); }
.gc-grade.gc-base { border-top-color: var(--eixo); }
.gc-grade i { position: absolute; right: 100%; top: 0; transform: translateY(-50%); padding-right: 0.45rem;
  font-style: normal; font-size: 0.72rem; color: var(--mudo); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gc-colunas { position: absolute; inset: 0; display: flex; }
.gc-col { position: relative; flex: 1; }
.gc-col:hover .gc-barra { filter: brightness(1.15); }
.gc-barra { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(24px, 60%);
  background: var(--serie); border-radius: 4px 4px 0 0; }
.gc-valor { position: absolute; left: 0; right: 0; text-align: center; font-size: 0.72rem; color: var(--suave); white-space: nowrap; }
.gc-eixo { display: flex; margin-top: 0.35rem; }
.gc-eixo span { flex: 1; text-align: center; font-size: 0.78rem; color: var(--mudo); }
.ver-tabela { margin-top: 0.6rem; font-size: 0.85rem; }
.ver-tabela summary { cursor: pointer; color: var(--suave); }
.ver-tabela .tabela { margin-top: 0.4rem; }
.vazio-grafico { padding: 2.5rem 0; text-align: center; }

/* Barras horizontais (funil, atividades por tipo). */
.barras { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.barras li { display: grid; grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.88rem; }
.barra-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-trilho { height: 14px; }
.barra { display: block; height: 100%; background: var(--serie); border-radius: 0 4px 4px 0; min-width: 2px; }
.barras li:hover .barra { filter: brightness(1.15); }
.barra-num { color: var(--suave); font-size: 0.82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.barra-num strong { color: var(--texto); }

/* Tarefas: três contadores coloridos que levam à tela de Atividades já filtrada. */
.contadores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.4rem 0 0.9rem; }
.contador { display: flex; flex-direction: column; padding: 0.55rem 0.7rem; border-radius: 8px; text-decoration: none;
  font-size: 0.8rem; color: var(--texto); border: 1px solid transparent; }
.contador strong { font-size: 1.4rem; line-height: 1.2; }
.contador:hover { border-color: currentColor; }
.ct-vencidas { background: var(--perigo-fundo); color: var(--texto-ruim); }
.ct-hoje { background: var(--hoje-fundo); color: var(--hoje-texto); }
.ct-semana { background: var(--semana-fundo); color: var(--texto); }

/* Próximo passo: barra segmentada alta (28px), número dentro quando cabe, legenda com totais. */
.legenda-status { list-style: none; margin: 0.3rem 0 0.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.84rem; }
.legenda-status a { color: var(--texto); text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.legenda-status a:hover { text-decoration: underline; }
.amostra { width: 0.75rem; height: 0.75rem; border-radius: 3px; display: inline-block; }
.st-marcada { background: var(--st-bom); }
.st-hoje { background: var(--serie); }
.st-vencida { background: var(--st-atencao); }
.st-sem { background: var(--st-critico); }
.seg-linha { display: grid; grid-template-columns: minmax(6rem, 10rem) minmax(0, 1fr) 2.5rem; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; font-size: 0.88rem; }
.seg-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-barra { display: flex; gap: 2px; height: 28px; }
.seg { flex-basis: 0; min-width: 4px; border-radius: 4px; display: flex; align-items: center; padding-left: 0.4rem;
  color: #fff; font-size: 0.78rem; font-weight: 700; text-decoration: none; overflow: visible; white-space: nowrap; }
.seg.st-vencida { color: #0b0b0b; }
.seg:hover { filter: brightness(1.12); }
.seg-total { text-align: right; color: var(--suave); font-variant-numeric: tabular-nums; }

/* ---- tema escuro (opcional, botão lua/sol do topo; static/js/tema.js) ----
   Só redefine as variáveis. A marca (vermelho de fundo, topo preto) fica igual; texto em
   vermelho clareia para manter o contraste no fundo escuro. */
.tema-alternar {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0;
  background: none; border: 1px solid rgb(255 255 255 / 0.18); border-radius: 6px; color: #d5d8dd; cursor: pointer;
}
.tema-alternar:hover { color: #fff; background: rgb(255 255 255 / 0.08); }
.tema-alternar:focus-visible { outline: 2px solid var(--destaque); outline-offset: 1px; }
.tema-alternar .icone:last-of-type { display: none; }
[data-tema="escuro"] .tema-alternar .icone:first-of-type { display: none; }
[data-tema="escuro"] .tema-alternar .icone:last-of-type { display: block; }

:root[data-tema="escuro"] {
  color-scheme: dark;
  --marca-escura: #c4161f;
  --texto: #e3e6ea;
  --suave: #9ba3ad;
  --fundo: #121417;
  --cartao: #1b1f24;
  --borda: #30363d;
  --topo: #0b0c0e;
  --ok: #5cc163;
  --sombra: 0 1px 2px rgb(0 0 0 / 0.5), 0 1px 6px rgb(0 0 0 / 0.35);
  --sombra-forte: 0 2px 12px rgb(0 0 0 / 0.6);
  --campo: #14171b;
  --campo-leitura: #23282e;
  --cartao-2: #21262c;
  --recuo: #0b0d0f;
  --neutro: #2a3038;
  --grafite: #2c323a;
  --sem-cor: #5e6670;
  --marca-texto: #ff6b72;
  --perigo-texto: #ff8f94;
  --perigo-fundo: #3b1c1f;
  --perigo-borda: #6e2b30;
  --ok-fundo: #1a3320;
  --info-fundo: #1b2b45; --info-texto: #93b9f5;
  --aviso-fundo: #1a3320; --aviso-texto: #8fd99a;
  --erro-texto: #ff9ca0;
  --whats-fundo: #163322; --whats-texto: #6fdc98; --whats-fundo-forte: #1e4a2f;
  --hoje-fundo: #1b2b45; --hoje-texto: #93b9f5;
  --semana-fundo: #262b31;
  /* painel: série um tom acima, grade e eixo apagados */
  --serie: #4a90e2;
  --grade: #2a2f35; --eixo: #464c54; --mudo: #8d939b;
  --texto-bom: #6fd06f; --texto-ruim: #ff7b81;
}
:root[data-tema="escuro"] .topo { border-bottom: 1px solid var(--borda); }

@media (max-width: 900px) {
  .ficha { grid-template-columns: minmax(0, 1fr); }
  .painel-grade { grid-template-columns: minmax(0, 1fr); }
  .painel-listas { order: -1; }
}

@media (max-width: 760px) {
  .item-linha { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .item-descricao { grid-column: 1 / -1; }
  .item-remover { justify-self: end; }
}

@media (max-width: 640px) {
  .topo { gap: 0 0.75rem; padding: 0 0.75rem; height: auto; min-height: 52px; flex-wrap: wrap; }
  .marca, .conta { height: 46px; display: flex; align-items: center; }
  .conta { margin-left: auto; }
  .tema-alternar { margin-left: auto; }
  .tema-alternar + .conta { margin-left: 0; }
  .menu { order: 3; flex-basis: 100%; margin: 0 -0.75rem; padding: 0 0.25rem 0.35rem; }
  .busca-topo { order: 4; flex-basis: 100%; padding-bottom: 0.5rem; }
  .busca-topo input { font-size: 1rem; padding: 0.5rem 0.7rem; } /* 16px: o iOS não dá zoom */
  a.whats { padding: 0.2rem 0.6rem; font-size: 0.8rem; }
  .menu a { padding: 0.35rem 0.4rem; font-size: 0.88rem; }
  .abas a { padding: 0.3rem 0.55rem; }
  .filtros-atividades select, .filtro-data { flex: 1 1 40%; min-width: 0; }
  .painel-filtros, .painel-filtros select { flex: 1 1 40%; }
  .atalhos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atalho { justify-content: center; padding: 0.6rem 0.5rem; }
  .indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .ind-andamento { grid-column: 1 / -1; }
  .indicador { padding: 0.7rem 0.75rem; }
  .ind-valor { font-size: 1.2rem; white-space: normal; overflow-wrap: anywhere; }
  .ind-extra, .gc-valor-extra { display: none; }
  .barras li, .seg-linha { grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr) auto; }
  .contador strong { font-size: 1.2rem; }
  .filtro-data input { flex: 1; }
  .filtros-atividades .tipos { gap: 0.3rem; }
  .filtros-atividades .pilula { padding: 0.25rem 0.6rem; }
  .conteudo { padding: 1rem 0.75rem 2rem; }
  .coluna { flex-basis: 85vw; max-height: none; }
  .dados { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .dados dt { margin-top: 0.4rem; }
}

/* Propostas em Word na ficha do negócio (D26). */
.gerar-proposta { flex-wrap: wrap; margin-bottom: 0.25rem; }
.gerar-proposta select { padding: 0.55rem 0.6rem; max-width: 100%; }
.propostas .lista-simples { margin-top: 0.5rem; }

/* O valor do negócio em três fontes (D30): os campos e o resumo calculado. */
.valores { border-bottom: 1px solid var(--borda); padding: 0 0 0.75rem; }
.valores legend { font-weight: 600; }
.valores-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.6rem 1rem; margin: 0.9rem 0 0; }
.valores-resumo div { margin: 0; }
.valores-resumo dt { color: var(--suave); font-size: 0.8rem; }
.valores-resumo dd { margin: 0; font-variant-numeric: tabular-nums; }
.valores-resumo output { font-weight: 600; display: block; }
.valores-resumo .sub { display: block; }
.valores-total output { font-size: 1.15rem; }
.composicao { margin: 0.6rem 0 0; border-top: 1px solid var(--borda); padding-top: 0.6rem; }
.composicao td { padding: 0.2rem 0; }
.composicao td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 1rem; }
.composicao .subtotal td { color: var(--suave); }
.composicao .total td { font-weight: 700; border-top: 1px solid var(--borda); padding-top: 0.35rem; }
.composicao .comissao td { padding-top: 0.5rem; }

/* Propostas na pasta comercial (D32): o caminho no servidor, para o vendedor achar o Word. */
.caminho { font-size: 0.8rem; word-break: break-all; user-select: all; }
.pdf-proposta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.25rem; }
.pdf-proposta .botao { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.pdfs-anteriores { margin-top: 0.25rem; }
.pdfs-anteriores summary { cursor: pointer; }
.texto-perigo { color: var(--perigo-texto); }
.copiar { font: inherit; font-size: 0.75rem; padding: 0.05rem 0.45rem; border: 1px solid var(--borda); border-radius: 4px; background: var(--cartao); color: var(--suave); cursor: pointer; vertical-align: baseline; }
.copiar:hover { color: var(--texto); }
.pasta-local { margin: 0.25rem 0 0.5rem; }
.pasta-local summary { cursor: pointer; }
.pasta-local-form { margin-top: 0.4rem; }
.pasta-local-form label { display: block; font-size: 0.9rem; margin-bottom: 0.25rem; }
.pasta-local-form input[name=pasta] { flex: 1; min-width: 0; width: 32rem; max-width: 100%; padding: 0.45rem 0.6rem; font-family: ui-monospace, monospace; font-size: 0.85rem; }
