/* Metas de Vendas · identidade visual da Master Diagnóstica (azul #005177, azul claro #0094c8, verde #a6ca3e, texto #003f60). Dosis nos títulos, fonte do sistema no corpo. */
:root {
  --master-escuro: #005177; --master-claro: #0094c8; --verde: #a6ca3e; --azul-texto: #003f60; --branco: #fff;
  --fundo: #f4f7f9; --borda: #d5e0e7; --erro: #b4332e; --alerta: #9a6700; --ok: #2e7d32; --raio: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); color: var(--azul-texto); font-family: system-ui, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.45; }
h1, h2, .logo { font-family: Dosis, system-ui, sans-serif; }
h1 { font-weight: 800; font-size: 28px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-weight: 700; font-size: 20px; margin: 22px 0 6px; color: var(--master-escuro); }
.topo { background: var(--master-escuro); color: var(--branco); padding: 10px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.marca { display: flex; flex-direction: column; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.sub { font-size: 12px; opacity: .85; }
.carga { margin-left: auto; font-size: 13px; opacity: .9; }
.abas { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 24px 0; background: var(--branco); border-bottom: 3px solid var(--verde); position: sticky; top: 0; z-index: 5; }
.aba { font: inherit; font-weight: 700; padding: 9px 16px; border: 0; background: none; color: var(--azul-texto); cursor: pointer; border-radius: var(--raio) var(--raio) 0 0; }
.aba:hover { background: #e6f1f6; }
.aba.ativa { background: var(--master-escuro); color: var(--branco); }
.aba:focus-visible, .botao:focus-visible, .botao-sec:focus-visible, select:focus-visible, input:focus-visible, .link:focus-visible { outline: 3px solid var(--master-claro); outline-offset: 2px; }
.restrito { margin: 0; padding: 6px 24px; font-size: 12.5px; background: #fff7e0; color: var(--alerta); border-bottom: 1px solid #f0e0b0; }
.conteudo { padding: 18px 28px 40px; max-width: 2400px; margin: 0 auto; }
.mini { font-size: 13px; color: #4b6a7a; margin: 0 0 10px; max-width: 1100px; }
.aviso { margin: 8px 0; padding: 9px 12px; background: #fff7e0; border: 1px solid #f0e0b0; border-radius: var(--raio); color: var(--alerta); }
.vazio, .carregando { padding: 18px; text-align: center; color: #4b6a7a; background: var(--fundo); border: 1px dashed var(--borda); border-radius: var(--raio); }
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 10px 0 14px; }
.filtros label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #4b6a7a; }
select, input[type=number] { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--branco); color: var(--azul-texto); min-width: 150px; }
input.peq { min-width: 0; width: 84px; text-align: right; } input.med { min-width: 0; width: 130px; text-align: right; } input.manual { border-color: var(--master-claro); background: #eaf6fb; }
.perfil { border: 1px solid var(--borda); border-radius: var(--raio); padding: 4px 10px 6px; background: var(--branco); } .perfil legend { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #4b6a7a; padding: 0 4px; }
.ck { flex-direction: row !important; align-items: center; gap: 4px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; color: var(--azul-texto) !important; display: inline-flex !important; margin-right: 8px; }
.filtros-acoes { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.botao, .botao-sec { font: inherit; font-weight: 600; padding: 9px 16px; border-radius: var(--raio); cursor: pointer; border: 1px solid var(--master-escuro); }
.botao { background: var(--master-escuro); color: var(--branco); } .botao:hover { background: var(--azul-texto); } .botao-sec { background: var(--branco); color: var(--master-escuro); } .botao-sec:hover { background: #e6f1f6; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--master-claro); text-decoration: underline; cursor: pointer; text-align: left; }
.numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 10px; margin: 0 0 8px; }
.numero { background: var(--branco); border: 1px solid var(--borda); border-left: 5px solid #8aa3b1; border-radius: var(--raio); padding: 9px 12px; min-width: 0; }
.numero dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #4b6a7a; }
.numero dd { margin: 0; } .numero dd:not(.sub) { font-family: Dosis, system-ui, sans-serif; font-size: clamp(19px, 1.7vw, 27px); font-weight: 800; line-height: 1.15; color: var(--azul-texto); font-variant-numeric: tabular-nums; white-space: nowrap; }
.numero .sub { font-size: 12px; color: #4b6a7a; line-height: 1.3; }
.numero.st-ok { border-left-color: var(--ok); } .numero.st-atencao { border-left-color: #e0a800; } .numero.st-baixo { border-left-color: var(--erro); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.st-ok { background: #e3f3e4; color: var(--ok); } .chip.st-atencao { background: #fff1c9; color: var(--alerta); } .chip.st-baixo { background: #fbe3e1; color: var(--erro); } .chip.st-nd { background: #edf1f4; color: #4b6a7a; }
.grafico { max-width: none; margin: 4px 0 10px; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 8px 10px; } .grafico svg { display: block; width: 100%; height: auto; }
.tabela-rolagem { overflow: auto; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--branco); max-height: 75vh; margin-bottom: 8px; }
.tabela { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tabela th { position: sticky; top: 0; background: #e8f0f5; text-align: left; padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--azul-texto); white-space: nowrap; }
.tabela td { padding: 7px 10px; border-top: 1px solid #edf1f4; } .tabela .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela tbody tr:hover { background: #f4f9fc; } .tabela tfoot td { font-weight: 800; border-top: 2px solid var(--master-escuro); background: #f1f6f9; }
.detalhe { margin-top: 18px; } .detalhe summary { cursor: pointer; font-weight: 700; color: var(--master-escuro); margin-bottom: 8px; }
code { background: #edf1f4; padding: 0 4px; border-radius: 4px; font-size: 13px; }
@media (max-width: 640px) { .topo, .abas, .restrito, .conteudo { padding-left: 14px; padding-right: 14px; } h1 { font-size: 24px; } .filtros-acoes { margin-left: 0; width: 100%; } .grafico { overflow-x: auto; } .grafico svg { min-width: 640px; } }
@media print { .abas, .restrito, .filtros { display: none; } }

/* clique nos dados abre o detalhe */
.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: #e8f4fa; }
tr.clicavel:focus-visible, .numero.clicavel:focus-visible { outline: 3px solid var(--master-claro); outline-offset: -2px; }
.numero.ativo { border-color: var(--master-claro); border-left-color: var(--master-claro); background: #eaf6fb; box-shadow: 0 2px 8px rgba(0, 81, 119, .22); }
.filtro-ativo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.numero.clicavel:hover { border-color: var(--master-claro); box-shadow: 0 2px 8px rgba(0, 81, 119, .18); }
svg rect.clicavel:hover { fill: rgba(0, 148, 200, .10); }
.detalhe-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(6, 20, 30, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.detalhe-fundo[hidden] { display: none; }
.detalhe-caixa { background: var(--branco); border-radius: 12px; width: min(1000px, 100%); padding: 16px 20px 22px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.detalhe-topo { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 8px; position: sticky; top: 0; background: var(--branco); padding-bottom: 6px; }
.detalhe-topo h2 { margin: 0; }
.detalhe-caixa h3 { font-family: Dosis, system-ui, sans-serif; font-size: 17px; margin: 16px 0 6px; color: var(--master-escuro); }
body.com-detalhe { overflow: hidden; }
textarea.nota { width: 100%; max-width: 900px; font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--borda); border-radius: var(--raio); color: var(--azul-texto); background: var(--branco); resize: vertical; }
input[type=search] { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--borda); border-radius: var(--raio); color: var(--azul-texto); background: var(--branco); min-width: 220px; }
label.so-leitura input { background: #eef3f6; color: #4b6a7a; }
@media print { .detalhe-fundo { display: none; } }
svg text[data-rotulo] { paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
input[type=search] { text-align: left; }
/* aba Indicadores: linha em destaque e barra de faixa (faixa sugerida, meta sugerida e plano) */
.tabela tr.destaque td { background: #eef6e0; font-weight: 700; }
.faixa { position: relative; display: inline-block; width: 120px; height: 14px; background: #edf1f4; border-radius: 3px; vertical-align: middle; }
.faixa .fx-b { position: absolute; top: 2px; bottom: 2px; background: #b9dcef; border-radius: 2px; }
.faixa .fx-s { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--master-escuro); }
.faixa .fx-p { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--erro); }
ul.mini li { margin-bottom: 4px; }
.link-tv { margin-left: auto; color: #003f60; background: #a6ca3e; font-weight: 700; text-decoration: none; padding: 6px 14px; border-radius: 99px; font-size: 14px; }
.link-tv + .carga { margin-left: 0; }
.link-demo { margin-left: 0; background: #fff; }

/* negativo em vermelho; tabelas lado a lado quando a tela é larga; exportar para Excel */
.tabela td.neg, .numero dd.neg { color: var(--erro); }
.tabela td.neg { font-weight: 700; }
.colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 760px), 1fr)); gap: 0 24px; align-items: start; }
.colunas > section { min-width: 0; }
.tab-acoes { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.botao-xls { padding: 4px 12px; font-size: 12.5px; border-color: var(--ok); color: var(--ok); }
.botao-xls:hover { background: #e3f3e4; }
.aba.exportar { margin-left: auto; background: var(--ok); color: #fff; border-radius: var(--raio); margin-bottom: 4px; }
.aba.exportar:hover { background: #256528; }
@media print { .tab-acoes { display: none; } }
@media (min-width: 1700px) { .tabela { font-size: 14.5px; } .tabela td { padding: 8px 12px; } .numeros { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } }
.det-botoes { display: flex; gap: 8px; align-items: center; }
.colunas .tabela { font-size: 13.5px; } .colunas .tabela th { white-space: normal; line-height: 1.2; vertical-align: bottom; } .colunas .tabela th, .colunas .tabela td { padding: 7px 7px; }

.numero dt { overflow-wrap: anywhere; } .numero .sub { overflow-wrap: anywhere; }
@media (max-width: 640px) { .numero dd:not(.sub) { font-size: 22px; } }

/* Painel: cartões em grupos (acumulado do ano, mês atual, meta e projeção) */
.grupos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 14px; margin: 6px 0 4px; align-items: start; }
.grupo { background: #eaf1f5; border: 1px solid var(--borda); border-radius: 12px; padding: 8px 12px 12px; min-width: 0; }
.grupo h3 { font: 800 14px Dosis, system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--master-escuro); margin: 4px 0 8px; padding-left: 8px; border-left: 4px solid var(--master-claro); }
.grupo-mes { background: #e9f3dc; } .grupo-mes h3 { border-left-color: var(--verde); }
.grupo .numeros { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (max-width: 520px) { .grupo .numeros { grid-template-columns: 1fr; } }
