:root {
  --azul: #0076b0;
  --azul-escuro: #04567f;
  --laranja: #dd8f20;
  --cinza: #5a7689;
  --bg: #eef3f7;
  --card: #ffffff;
}
* { box-sizing: border-box; }
/* garante que [hidden] esconda mesmo elementos com display definido por classe
   (ex.: blocos .row com display:flex, alternados por JS no seletor de período) */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  /* gradiente nas cores Robustus (azuis) com leve brilho laranja no canto */
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(221, 143, 32, .22), transparent 60%),
    linear-gradient(135deg, var(--azul-escuro) 0%, var(--azul) 58%, #2a93c9 100%);
  background-attachment: fixed;
  color: #1a2b36;
  min-height: 100vh;
}
.topbar {
  background: #fff;
  color: #1a2b36;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #e1e9f0;
  box-shadow: 0 1px 6px rgba(13, 60, 90, .06);
}
.brand-home { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-divider { width: 1px; height: 26px; background: #d7e2ea; }
.brand-sub { color: var(--cinza); font-size: 14px; }
.container { max-width: 1040px; margin: 36px auto; padding: 0 20px; }
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 6px 24px rgba(13, 60, 90, .08);
}
/* espaço entre cards empilhados (ex.: form + resultados no modo individual) */
.card + .card { margin-top: 22px; }
h1 { margin: 0 0 12px; color: var(--azul-escuro); font-size: 26px; }
.title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.title-row h1 { margin: 0; }
.lead { color: #3c5666; line-height: 1.5; }
code { background: #eef3f7; padding: 2px 6px; border-radius: 5px; font-size: .92em; }
.field { display: block; margin: 18px 0; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; color: #2c4456; }
input[type=file], input[type=number], input[type=date], select {
  width: 100%; padding: 11px 12px; border: 1px solid #cdd9e2;
  border-radius: 9px; font-size: 15px; background: #fff;
  color: #1a2b36; font-family: inherit; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
input[type=number]:focus, input[type=date]:focus, select:focus {
  outline: none; border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(0, 118, 176, .15);
}
/* input de data: altura consistente e ícone do calendário na cor da marca */
input[type=date] { min-height: 44px; appearance: none; -webkit-appearance: none; }
input[type=date]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .6; padding: 2px; border-radius: 4px;
  filter: invert(38%) sepia(69%) saturate(1200%) hue-rotate(170deg);
}
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.row { display: flex; gap: 16px; }
.row .field { flex: 1; }
.hint { font-size: 13px; color: var(--cinza); margin: 4px 0 20px; }
.btn {
  display: inline-block; background: var(--azul); color: #fff; border: 0;
  padding: 13px 26px; border-radius: 10px; font-size: 16px; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--azul-escuro); }
.btn:disabled { opacity: .6; cursor: default; }
.processing { margin-top: 14px; color: var(--cinza); }

/* Indicador de trabalho em andamento (lote de PDFs da aba Clientes). O ZIP é
   um download, então a página não navega: o spinner fica girando até o JS
   detectar o cookie de conclusão que a rota devolve junto com o arquivo. */
.trabalhando { display: inline-flex; align-items: center; gap: 10px;
  color: var(--cinza); font-size: 14px; }
.trabalhando b { color: var(--azul-escuro); font-variant-numeric: tabular-nums; }
.spinner { width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid #d7e2ea; border-top-color: var(--azul);
  animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
/* sem animação para quem pediu movimento reduzido: pulsa a opacidade */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: pulsar 1.6s ease-in-out infinite;
    border-top-color: #d7e2ea; background: var(--azul); }
  @keyframes pulsar { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
}
.trabalhando.pronto .spinner { animation: none; border-color: #3f9c56;
  border-top-color: #3f9c56; background: none; }
.trabalhando.pronto { color: #2f7a42; }
.trabalhando.demorando b { color: var(--laranja); }
.alert {
  background: #fde8e8; border: 1px solid #f6b6b6; color: #9b1c1c;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
}
.files { list-style: none; padding: 0; margin: 22px 0; }
.files li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border: 1px solid #e1e9f0; border-radius: 10px; margin-bottom: 10px;
}
.file-name { font-weight: 600; }
.file-type { font-size: 13px; color: var(--cinza); }
.link { color: var(--azul); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.resumo { width: 100%; border-collapse: collapse; margin: 18px 0 8px; font-size: 14px; }
.resumo th, .resumo td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e9eff4; }
.resumo th { color: var(--cinza); font-weight: 700; }
.resumo td:nth-child(n+2), .resumo th:nth-child(n+2) { text-align: right; }
.back { display: inline-block; margin-top: 18px; color: var(--cinza); text-decoration: none; }
.foot { text-align: center; color: rgba(255, 255, 255, .8); font-size: 13px; padding: 24px; }

/* Menu lateral. Fixo à esquerda a partir de 1024px; abaixo disso vira uma
   gaveta fechada, aberta pelo botão da barra do topo (JS no base.html liga a
   classe .menu-aberto no body). A barra do topo só aparece no desktop quando
   não há login (tela de entrada). */
:root { --menu-w: 236px; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--menu-w); z-index: 60;
  display: flex; flex-direction: column; background: #fff;
  border-right: 1px solid #e1e9f0; box-shadow: 1px 0 10px rgba(13, 60, 90, .06);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-100%); visibility: hidden;
  transition: transform .22s ease, visibility 0s linear .22s;
}
.menu-aberto .sidebar {
  transform: none; visibility: visible; transition: transform .22s ease;
  box-shadow: 0 0 40px rgba(13, 40, 60, .35);
}
.menu-backdrop {
  position: fixed; inset: 0; z-index: 55; background: rgba(13, 40, 60, .55);
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.menu-aberto .menu-backdrop { opacity: 1; pointer-events: auto; }
body.menu-aberto { overflow: hidden; }
.side-brand { position: relative; padding: 22px 20px 18px; border-bottom: 1px solid #eef3f7; }
.side-brand .brand-sub { margin-top: 10px; font-size: 12.5px; line-height: 1.35; }
.menu-close {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: var(--cinza); font-size: 26px; line-height: 1;
}
.menu-close:hover { background: rgba(0, 118, 176, .08); color: var(--azul-escuro); }
.sidenav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 6px 12px 14px; }
.side-group {
  padding: 16px 12px 6px; color: var(--cinza); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--cinza); font-size: 14px; font-weight: 600; transition: background .15s, color .15s;
}
.navlink:hover { background: rgba(0, 118, 176, .08); color: var(--azul); }
.navlink.is-active { background: rgba(0, 118, 176, .12); color: var(--azul-escuro); }
.navlink:focus-visible, .menu-toggle:focus-visible, .menu-close:focus-visible {
  outline: 2px solid var(--azul); outline-offset: 2px;
}
/* ícones do menu: traço fino na cor do texto do link */
.sidebar svg, .menu-toggle svg {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.side-foot { padding: 12px; border-top: 1px solid #eef3f7; }
.nav-user {
  display: flex; align-items: center; gap: 11px; padding: 6px 12px 8px;
  color: var(--azul-escuro); font-size: 14px; font-weight: 700;
}
.nav-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navlink-btn { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.logout-form { margin: 0; }
/* barra do topo nas telas menores: botão do menu + marca, grudada no topo */
.com-menu .topbar { position: sticky; top: 0; z-index: 50; padding: 10px 16px; gap: 12px; }
.com-menu .topbar .brand-logo { height: 34px; }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: -6px; flex: none; padding: 0;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  color: var(--azul-escuro);
}
.menu-toggle:hover { background: rgba(0, 118, 176, .08); }
.menu-toggle svg { width: 24px; height: 24px; stroke-width: 2; }
@media (max-width: 560px) {
  .com-menu .topbar .brand-divider, .com-menu .topbar .brand-sub { display: none; }
}
@media (min-width: 1024px) {
  .sidebar { transform: none; visibility: visible; transition: none; }
  .menu-close, .menu-backdrop { display: none; }
  .com-menu .topbar { display: none; }
  .com-menu .page { margin-left: var(--menu-w); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .menu-aberto .sidebar, .menu-backdrop { transition: none; }
}

/* Login */
.card-login { max-width: 420px; margin: 0 auto; }
input[type=text], input[type=password] {
  width: 100%; padding: 11px 12px; border: 1px solid #cdd9e2;
  border-radius: 9px; font-size: 15px; background: #fff;
}

/* Botão de ajuda (?) — inline ao lado do label do campo de upload */
.field-label-row { display: flex; align-items: center; gap: 10px; }
.help-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--azul); background: transparent;
  color: var(--azul); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s;
  padding: 0; flex: none;
}
.help-btn:hover { background: rgba(0, 118, 176, .1); }

/* Modal */
body.no-scroll { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13, 40, 60, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; max-width: 680px; width: 100%;
  padding: 28px 30px 26px; position: relative;
  box-shadow: 0 18px 50px rgba(13, 40, 60, .35);
}
.modal-close {
  position: absolute; top: 14px; right: 16px; border: 0; background: transparent;
  font-size: 28px; line-height: 1; color: var(--cinza); cursor: pointer;
}
.modal-close:hover { color: #1a2b36; }
.modal h2 { margin: 0 0 12px; color: var(--azul-escuro); font-size: 22px; padding-right: 28px; }
.modal h3 { margin: 22px 0 8px; color: var(--azul); font-size: 16px; }
.modal-intro, .modal-note { color: #3c5666; line-height: 1.5; margin: 0 0 8px; }
.modal-note { font-size: 13px; color: var(--cinza); }
.req {
  display: inline-block; background: #fdecd2; color: #9a5b06; font-size: 11px;
  font-weight: 700; padding: 1px 7px; border-radius: 10px; margin-left: 6px;
  text-transform: uppercase; letter-spacing: .5px; vertical-align: middle;
}
.cols { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0; }
.cols th, .cols td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #eef3f7; vertical-align: top; }
.cols th { color: var(--cinza); font-weight: 700; }
.cols td:first-child, .cols th:first-child { width: 28px; color: var(--cinza); text-align: right; }
.cols td:last-child { color: var(--cinza); }
.modal-list { margin: 6px 0; padding-left: 20px; color: #3c5666; line-height: 1.6; }
.modal-foot { margin: 14px 0 0; font-size: 13px; color: var(--cinza); }

/* Abas de seleção da fonte de dados */
.tabs { display: flex; gap: 6px; margin: 22px 0 18px; border-bottom: 1px solid #e1e9f0; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 11px 18px; font-size: 15px;
  font-weight: 600; color: var(--cinza); cursor: pointer; border-radius: 8px 8px 0 0;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--azul); }
.tab.is-active { color: var(--azul-escuro); border-bottom-color: var(--azul); }
.tab svg { width: 18px; height: 18px; flex: none; }

/* Tela de metas */
.metas-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.metas-table th, .metas-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef3f7; }
.metas-table th { color: var(--cinza); font-weight: 700; }
.metas-table td:nth-child(4), .metas-table th:nth-child(4) { text-align: right; width: 120px; }
.metas-table td:last-child, .metas-table th:last-child { text-align: center; width: 120px; }
.rel-select { width: 100%; padding: 7px 9px; border-radius: 8px; font-weight: 700; cursor: pointer; border: 1px solid #cdd9e2; }
.rel-select.rel-sim { background: #e3f3e6; color: #1f7a3d; border-color: #b7e0c1; }
.rel-select.rel-nao { background: #fde8e8; color: #b03636; border-color: #f3c0c0; }
.rel-select option { background: #fff; color: #1a2b36; }
.metas-table input[type=number] { padding: 7px 9px; text-align: right; }
.metas-table select { padding: 7px 9px; width: 100%; }
.metas-table td:nth-child(3), .metas-table th:nth-child(3) { width: 230px; }
.gestor-head td {
  background: #f3f8fb; color: var(--azul-escuro); font-weight: 700;
  border-bottom: 1px solid #dbe7ef; padding: 9px 10px;
}
/* Nome do grupo editável (renomeia o gestor/segmento) */
.gestor-nome-input {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--azul-escuro); font-weight: 700; font-size: inherit;
  padding: 4px 7px; width: min(360px, 100%);
}
.gestor-nome-input:hover { border-color: #cdd9e2; background: #fff; }
.gestor-nome-input:focus { border-color: var(--azul); background: #fff; outline: none; }
/* Campo de nome custom por representante (revelado pelo dropdown) */
.gestor-custom-input {
  margin-top: 6px; padding: 7px 9px; width: 100%;
  border: 1px solid var(--azul); border-radius: 8px;
}
.metas-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; }

/* Tela de Produtos (consulta família por produto) */
.produtos-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.produtos-table th, .produtos-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef3f7; }
.produtos-table th { color: var(--cinza); font-weight: 700; }
.familia-head td {
  background: #f3f8fb; color: var(--azul-escuro); font-weight: 700;
  border-bottom: 1px solid #dbe7ef; padding: 9px 10px;
}
.familia-count { display: inline-block; background: #e6eef5; color: #41617a; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }

/* Tela de Cálculos (informativa) */
.calc h2 { font-size: 19px; color: var(--azul-escuro); margin: 26px 0 8px; padding-top: 14px; border-top: 1px solid #eef3f7; }
.calc p, .calc li { font-size: 14.5px; line-height: 1.6; color: #2c4456; }
.calc ul, .calc ol { margin: 6px 0 6px 22px; }
.calc li { margin: 3px 0; }
.calc code { background: #f1f5f9; color: #1c3a52; padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.calc details { margin: 10px 0 4px; }
.calc summary { cursor: pointer; font-weight: 700; color: #1583c5; font-size: 14px; padding: 6px 0; }
.calc pre.sql { background: #0c2a45; color: #d8e6f2; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; font-family: "SF Mono", Menlo, Consolas, monospace; white-space: pre; margin: 8px 0 4px; }

/* Mostrar/ocultar inativos na tela de metas */
.toggle-inativos { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 14px; font-size: 14px; color: #2c4456; cursor: pointer; }
.toggle-inativos input { width: auto; }
.metas-table .rep-inativo { display: none; }
.metas-table.grupo-inativo { display: none; }
.show-inativos .metas-table .rep-inativo { display: table-row; }
.show-inativos .metas-table.grupo-inativo { display: table; }
.badge-inativo { display: inline-block; background: #f0e1e1; color: #9b4a4a; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; margin-left: 6px; text-transform: uppercase; letter-spacing: .4px; vertical-align: middle; }

/* Enviar relatórios por e-mail (tela de resultado) */
.email-form {
  margin: 18px 0 6px; padding: 16px 18px;
  border: 1px solid #e1e9f0; border-radius: 10px; background: #f7fafc;
}
.email-label { display: block; font-weight: 600; color: #2c4456; margin-bottom: 8px; }
.email-row { display: flex; gap: 10px; align-items: stretch; }
.email-row input[type=email] { flex: 1; }
.email-row .btn { white-space: nowrap; padding: 11px 20px; font-size: 15px; }
.email-status { margin-top: 10px; font-size: 14px; }
.email-status.ok { color: #1d7a45; }
.email-status.erro { color: #9b1c1c; }
@media (max-width: 520px) { .email-row { flex-direction: column; } }

/* Seções de resultado (relatório geral / planilhas / imagens) */
.result-section { margin: 26px 0 8px; }
.result-section > h2 {
  font-size: 15px; color: var(--azul-escuro); margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid #e1e9f0;
  display: flex; align-items: center; gap: 8px;
}
.result-section .sec-count {
  font-size: 12px; font-weight: 700; color: var(--cinza);
  background: #eef3f7; border-radius: 10px; padding: 1px 9px;
}
.result-section .files { margin: 0; }

/* Tela de logs */
.logs-layout { display: flex; gap: 18px; margin-top: 18px; align-items: flex-start; }
.logs-side { flex: none; width: 270px; }
.logs-side .field { margin: 0 0 14px; }
.exec-list { list-style: none; padding: 0; margin: 0; max-height: 460px; overflow-y: auto; }
.exec-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid #e1e9f0; border-radius: 9px; background: #fff;
  padding: 10px 12px; margin-bottom: 8px; transition: border-color .15s, background .15s;
}
.exec-item:hover { border-color: #b9cfdd; }
.exec-item.is-active { border-color: var(--azul); background: #f3f8fb; }
.exec-when { font-weight: 700; color: #1a2b36; font-size: 14px; }
.exec-meta { font-size: 12px; color: var(--cinza); margin-top: 3px; }
.exec-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .4px; }
.exec-status.ok { background: #dff3e6; color: #1d7a45; }
.exec-status.erro { background: #fde8e8; color: #9b1c1c; }
.exec-status.andamento { background: #fdecd2; color: #9a5b06; }
.logs-main { flex: 1; min-width: 0; }
.log-view {
  background: #0f2230; color: #d7e6f0; border-radius: 10px; padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  max-height: 540px; overflow-y: auto; margin: 0;
}
.log-line { display: block; }
/* cores por tipo de linha no bloco escuro de logs */
.log-line.k-info { color: #dbe7f1; }   /* mensagens do sistema (INFO) */
.log-line.k-sql  { color: #84cdb6; }   /* queries SQL do banco */
.log-line.k-aviso { color: #ffd28a; }  /* avisos (WARNING) */
.log-line.k-erro { color: #ff9b9b; }   /* erros (ERROR/CRITICAL) + tracebacks */
.logs-empty { color: var(--cinza); padding: 20px 0; }

/* Legenda das cores do log */
.log-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 8px; font-size: 12px; color: var(--cinza); }
.log-legend .leg { display: inline-flex; align-items: center; gap: 6px; }
.log-legend .leg::before { content: ""; width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.leg-info::before  { background: #7d97ab; }
.leg-sql::before   { background: #84cdb6; }
.leg-aviso::before { background: #e0a73c; }
.leg-erro::before  { background: #e06464; }

/* Seletor segmentado (mês inteiro × range de datas) */
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: #eef3f7;
  border-radius: 10px; margin: 18px 0 6px; }
.seg-opt { display: inline-flex; align-items: center; cursor: pointer;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  color: var(--cinza); transition: background .15s, color .15s; }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-opt.is-active { background: #fff; color: var(--azul-escuro);
  box-shadow: 0 1px 3px rgba(4, 86, 127, .12); }
.seg-opt:has(input:disabled) { opacity: .45; cursor: default; }
/* no form do Speed há dois seletores (abrangência e período): um por linha */
.mode-form .segmented { display: flex; width: max-content; max-width: 100%; }

/* Botão secundário (ex.: baixar Excel e PDF na aba Clientes) */
.btn-secondary { background: #fff; color: var(--azul-escuro);
  border: 1px solid var(--azul); }
.btn-secondary:hover { background: #eef3f7; }

/* Tabela e totais da aba Clientes (nomes ind-* herdados da antiga aba Individual) */
.ind-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; }
.ind-totais { display: flex; gap: 22px; }
.ind-totais span { display: flex; flex-direction: column; text-align: right; }
.ind-totais small { color: var(--cinza); font-size: 12px; }
.ind-totais strong { color: var(--azul-escuro); font-size: 18px; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
.ind-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ind-table th, .ind-table td { padding: 8px 10px; border-bottom: 1px solid #e9eff4;
  text-align: left; vertical-align: top; }
.ind-table th { color: var(--cinza); font-weight: 700; white-space: nowrap; }
.ind-table .num { text-align: right; white-space: nowrap; }
/* Clientes: nota explicativa por bloco + hierarquia representante > cidade > cliente */
.cart-nota { margin: -4px 0 14px; padding: 10px 12px; background: #f2f6fb;
  border-left: 3px solid #b9c9df; border-radius: 6px; color: #44526b;
  font-size: 13px; line-height: 1.45; }
.cart-table .cart-rep td { background: #dde3ee; font-weight: 700;
  color: var(--azul-escuro); border-top: 2px solid #c4d0e2; }
.cart-table .cart-cid td { background: #eef1f6; font-weight: 700;
  color: var(--azul-escuro); }
.cart-table .cart-cid td:first-child { padding-left: 26px; }
.cart-table .cart-cli td:first-child { padding-left: 44px; }
.cart-table tbody td { white-space: nowrap; }

/* Farol de atenção do cliente (aba Clientes): verde/amarelo/vermelho */
.farol { display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.farol-verde { background: #e3f3ea; color: #1c7c4a; }
.farol-amarelo { background: #fdf3d8; color: #8a6206; }
.farol-vermelho { background: #fbe3e3; color: #a32020; }
.farol-cinza { background: #eef1f6; color: #5b6b80; }
.farol-pin { display: inline-block; min-width: 20px; padding: 1px 6px; margin-right: 3px;
  border-radius: 999px; font-size: 11px; font-weight: 700; text-align: center; }
.ind-farol { display: flex; gap: 6px; justify-content: flex-end; }
/* Resumo do topo da aba Clientes: total e distribuição por farol */
.farol-resumo { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.farol-kpi { flex: 1 1 130px; min-width: 130px; padding: 10px 14px;
  border-radius: 8px; background: #f4f7fb; border: 1px solid #e1e8f1;
  color: var(--azul-escuro); }
.farol-kpi small { display: block; min-height: 30px; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  opacity: .85; }
.farol-kpi strong { display: block; font-size: 26px; line-height: 1.15;
  margin-top: 2px; }
.farol-kpi em { font-size: 12px; font-style: normal; opacity: .8; }
.farol-kpi.farol-verde { background: #e3f3ea; border-color: #c3e2d1; color: #1c7c4a; }
.farol-kpi.farol-amarelo { background: #fdf3d8; border-color: #ecdcae; color: #8a6206; }
.farol-kpi.farol-vermelho { background: #fbe3e3; border-color: #eec5c5; color: #a32020; }
.farol-kpi.farol-cinza { background: #eef1f6; border-color: #dde3ec; color: #5b6b80; }
.farol-resumo + .cart-aviso { margin-top: 12px; }
/* aviso: o farol usa uma janela fixa de 12 meses, não o período consultado */
.cart-aviso { margin: 0 0 10px; padding: 10px 12px; background: #fdf3d8;
  border-left: 3px solid #e0c377; border-radius: 6px; color: #7a5605;
  font-size: 13px; line-height: 1.45; font-weight: 600; }
.cart-aviso + .cart-nota { margin-top: 0; }

/* Auditoria (planilha do cliente × relatório de Clientes): mesmo desenho dos
   relatórios de conciliação em PDF (cartões, chamadas, tabela completa e caso a
   caso), na paleta do app. Cor por tipo de diferença: vermelho, azul, verde,
   laranja e roxo. */
.aud-label { color: var(--laranja); text-transform: uppercase; letter-spacing: .12em;
  font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.aud-h2 { margin: 0 0 10px; color: var(--azul-escuro); font-size: 21px; line-height: 1.3; }
.aud-h3 { margin: 22px 0 8px; color: var(--azul-escuro); font-size: 16px; }
.aud-meta { color: var(--cinza); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.aud-small { color: var(--cinza); font-size: 12px; font-weight: 400; }
.aud-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.aud-cards.tres { grid-template-columns: repeat(3, 1fr); }
.aud-card { border-radius: 10px; padding: 14px 14px 12px; background: #eef5fa;
  border-top: 3px solid var(--azul); }
.aud-card-valor { font-size: 20px; font-weight: 700; color: var(--azul-escuro);
  font-variant-numeric: tabular-nums; }
.aud-card-rotulo { font-size: 12px; color: #4b6272; margin-top: 4px; line-height: 1.4; }
.aud-card.vermelho { background: #fdf0f0; border-top-color: #d33b3b; }
.aud-card.verde { background: #eaf6ef; border-top-color: #2b9360; }
.aud-card.laranja { background: #fdf4e6; border-top-color: var(--laranja); }
.aud-card.roxo { background: #f0edfb; border-top-color: #6a55c4; }
.aud-callout { margin: 14px 0; padding: 12px 14px; border-left: 4px solid #d33b3b;
  background: #fdf3f3; border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.5;
  color: #3c4f5c; }
.aud-callout.azul { border-left-color: var(--azul); background: #eef5fa; }
.aud-callout strong { color: var(--azul-escuro); }
.aud-legenda { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  margin: 10px 0; font-size: 13.5px; line-height: 1.5; color: #3c4f5c; }
.aud-letra { display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--azul); }
.aud-letra.vermelho { background: #d33b3b; }
.aud-letra.verde { background: #2b9360; }
.aud-letra.laranja { background: var(--laranja); }
.aud-letra.roxo { background: #6a55c4; }
.aud-pos { color: #c62f2f; font-weight: 700; white-space: nowrap; }
.aud-neg { color: #1f6fb0; font-weight: 700; white-space: nowrap; }
.aud-zero { color: var(--cinza); white-space: nowrap; }
.aud-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aud-table th { background: var(--azul-escuro); color: #fff; text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 7px;
  white-space: nowrap; }
.aud-table td { padding: 7px 7px; border-bottom: 1px solid #e6edf2; vertical-align: top;
  color: #33495a; }
.aud-table tbody tr:nth-child(even) td { background: #f8fafc; }
.aud-table tbody tr.aud-dif td { background: #fdf3f3; }
.aud-table tr.aud-grupo-ini td { border-top: 2px solid #d5e1ea; }
.aud-table tfoot td { background: var(--azul-escuro); color: #fff; font-weight: 700; }
.aud-table tfoot .aud-pos, .aud-table tfoot .aud-neg, .aud-table tfoot .aud-zero { color: #fff; }
.aud-num td:nth-child(n+3), .aud-num th:nth-child(n+3) { text-align: right; white-space: nowrap; }
.aud-num tfoot td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.aud-table a { color: var(--azul); font-weight: 700; text-decoration: none; }
.aud-table a:hover { text-decoration: underline; }
.aud-caso { margin-bottom: 18px; }
.aud-caso p { font-size: 14px; color: #3c4f5c; margin: 0 0 8px; }
.aud-topo { float: right; font-size: 12px; font-weight: 600; color: var(--azul);
  text-decoration: none; }
.aud-peds td.aud-lado { white-space: nowrap; }
.aud-peds td.aud-ped { min-width: 120px; max-width: 170px; }
.aud-peds td.aud-texto { min-width: 240px; line-height: 1.45; }
/* nome do representante sem quebrar em várias linhas; a tabela rola se faltar espaço */
.aud-num td:nth-child(2) { min-width: 175px; }
.aud-num td:nth-child(1) { min-width: 92px; }
.aud-fonte { margin-top: 20px; padding-top: 10px; border-top: 1px solid #e6edf2;
  font-size: 12px; color: var(--cinza); line-height: 1.5; }
@media (max-width: 760px) {
  .aud-cards, .aud-cards.tres { grid-template-columns: 1fr 1fr; }
}

/* Consulta de pedido: reaproveita cartões, rótulos e tabela da Auditoria
   (.aud-*), com o bloco de informações e os selos de operação e situação. */
.pedido-busca { display: flex; align-items: flex-end; gap: 12px; }
.pedido-busca .field { flex: 0 1 280px; margin: 18px 0 0; }
.pedido-busca input[type=text] { font-size: 16px; }
.pedido-busca .btn { margin-top: 18px; }
.pedido-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 16px; }
.pedido-info > div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px;
  background: #f4f8fb; border: 1px solid #e1e9f0; border-radius: 10px; font-size: 13px;
  color: #4b6272; line-height: 1.4; }
.pedido-info small { color: var(--laranja); text-transform: uppercase; letter-spacing: .1em;
  font-size: 10.5px; font-weight: 700; }
.pedido-info strong { color: var(--azul-escuro); font-size: 14.5px; }
.pedido-op { display: inline-block; min-width: 30px; padding: 1px 7px; border-radius: 999px;
  background: #eef1f6; color: #5b6b80; font-size: 11.5px; font-weight: 700; text-align: center; }
.pedido-op.vn { background: #e3f3ea; color: #1c7c4a; }
.pedido-situacao { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; vertical-align: middle; background: #e3f3ea; color: #1c7c4a; }
.pedido-situacao.em-aberto { background: #fdf0e0; color: #a8630f; }
.pedido-situacao.parcial { background: #eae7fb; color: #5a45b8; }
.aud-table td.num, .aud-table th.num { text-align: right; white-space: nowrap; }
.pedido-itens tbody tr.pedido-fora td { color: #8a9aa8; }
@media (max-width: 760px) {
  .pedido-info { grid-template-columns: 1fr; }
  .pedido-busca { flex-wrap: wrap; }
}
