html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
body {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
main {
  min-width: 0;
  width: 100%;
}
main > * {
  min-width: 0;
}
.topo {
  min-width: 0;
}
.topo-usuario {
  min-width: 0;
  max-width: 50%;
}
.valor-brl {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#overlay-carga {
  display: none !important;
}
#overlay-carga.is-open {
  display: flex !important;
}
#overlay-pedidos {
  display: none !important;
}
#overlay-pedidos.is-open {
  display: flex !important;
}
#overlay-componente {
  display: none !important;
}
#overlay-componente.is-open {
  display: flex !important;
}
#overlay-mapa-uf {
  display: none !important;
}
#overlay-mapa-uf.is-open {
  display: flex !important;
}
#overlay-produto-componentes {
  display: none !important;
}
#overlay-produto-componentes.is-open {
  display: flex !important;
}
#overlay-cotacoes {
  display: none !important;
}
#overlay-cotacoes.is-open {
  display: flex !important;
}
#overlay-componente-mns {
  display: none !important;
}
#overlay-componente-mns.is-open {
  display: flex !important;
}
.link-a-produzir {
  font: inherit;
  color: #0f172a;
  text-decoration: underline;
  text-decoration-color: rgba(15, 23, 42, 0.25);
  cursor: pointer;
}
.link-a-produzir:hover {
  text-decoration-color: currentColor;
}

/* Grade densa estilo planilha (Análise de Venda x Estoque), pra tela de Estoques. */
.planilha-grade {
  border-collapse: collapse;
}
.planilha-grade th,
.planilha-grade td {
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}
.planilha-grade thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.planilha-grade tbody tr:nth-child(even) {
  background: #f8fafc;
}
.planilha-grade tbody tr:hover {
  background: #eff6ff;
}
.planilha-grade .celula-positiva,
.celula-positiva {
  background: #ecfdf5;
  color: #047857;
}
.planilha-grade .celula-negativa,
.celula-negativa {
  background: #fff1f2;
  color: #be123c;
}

/* Cabeçalho de grupo por linha (Office/Profissional/Gamer) na tela de Lista Técnica —
   mesmo estilo de faixa escura da planilha de referência do time. */
.linha-cabecalho {
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  margin-bottom: 0.75rem;
}

/* Linha de cada modelo na Lista Técnica em formato de colunas (Código/Modelo/Placa de
   vídeo/Processador/BB pronta/Dá pra produzir/A produzir/Disponível), com o cabeçalho
   de coluna correspondente. */
.linha-tabela-cabecalho,
.linha-tabela-linha {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 9rem 7rem 6rem 7rem 6rem 7rem;
  align-items: center;
  gap: 0.5rem;
}
.linha-tabela-cabecalho {
  padding: 0.2rem 1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.linha-tabela-linha {
  padding: 0.65rem 1rem;
}

/* Linha de referência: marca visualmente que aquele MP faz parte da sub-montagem "BB"
   logo acima dele na tabela — uma faixa contínua ligando os dois. */
.linha-filho-bb td:first-child {
  border-left: 3px solid #94a3b8;
}

/* Linha da sub-montagem "BB" é clicável — expande/recolhe os componentes dela, pra
   quem não quer ver o estoque de montagem da BB naquele momento. */
tr.bb-toggle {
  cursor: pointer;
}
tr.bb-toggle:hover {
  background: #e2e8f0;
}
tr.bb-toggle .bb-toggle-seta {
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}
tr.bb-toggle.bb-recolhido .bb-toggle-seta {
  transform: rotate(0deg);
}

/* Componente com o menor estoque do modelo — o gargalo real que limita quanto dá pra
   produzir. Laranja da paleta Avell, pra achar de cara qual item é o culpado. */
.linha-gargalo td:first-child {
  border-left: 3px solid #fc7a1e;
}
.linha-gargalo td:nth-child(2) {
  background: rgba(252, 122, 30, 0.1);
}

/* Destaque temporário no modelo aberto via link direto (ex.: vindo da tela de
   Estoques), pra chamar a atenção de qual card é aquele. */
.arvore-modelo-destaque {
  animation: arvore-modelo-piscar 1.6s ease-out 2;
}
@keyframes arvore-modelo-piscar {
  0% {
    box-shadow: 0 0 0 3px rgba(252, 122, 30, 0.55);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(252, 122, 30, 0);
  }
}

.ticker-pedidos-modal {
  height: auto;
  max-height: 65vh;
}
/* Modal de "Pedidos do período" expandido — usuário pede mais espaço pra ver a
   tabela/exportar sem o limite de 1100px, sem precisar mudar o tamanho padrão pra todo mundo.
   `.ticker-pedidos` tem altura fixa (18rem) lá embaixo no arquivo — sem sobrescrever ela
   também, só a largura crescia; a lista de pedidos continuava do mesmo tamanho de sempre. */
.overlay-caixa-pedidos.expandido {
  width: 96vw !important;
  max-width: 96vw !important;
  height: 92vh !important;
  max-height: 92vh !important;
}
.overlay-caixa-pedidos.expandido .ticker-pedidos.ticker-pedidos-modal {
  height: auto;
  max-height: none;
  min-height: 0;
  flex: 1 1 auto;
}
.pedidos-busca-wrap {
  position: relative;
  margin: 0.75rem 1rem 0;
}
@media (min-width: 640px) {
  .pedidos-busca-wrap {
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }
}
@media (min-width: 1280px) {
  .pedidos-busca-wrap {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }
}
.pedidos-busca-wrap svg {
  position: absolute;
  top: 50%;
  left: 0.7rem;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  color: #94a3b8;
  pointer-events: none;
}
.pedidos-busca-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  padding: 0.45rem 0.75rem 0.45rem 2.1rem;
  font-size: 0.85rem;
  color: #0f172a;
}
.pedidos-busca-input:focus {
  outline: none;
  border-color: #0090e0;
  box-shadow: 0 0 0 2px rgba(0, 144, 224, 0.15);
}
.spinner {
  box-sizing: border-box;
  border-width: 4px !important;
}
.spinner[hidden] { display: none !important; }
.tab { color: #475569; background: transparent; border: 0; cursor: pointer; }
.tab.on { background: #0090e0; color: #fff; font-weight: 600; }

.campo-data {
  color-scheme: light;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.campo-data::-webkit-calendar-picker-indicator {
  cursor: pointer;
  margin-left: 0.35rem;
  padding: 0.2rem;
  border-radius: 0.4rem;
  filter: invert(41%) sepia(93%) saturate(1946%) hue-rotate(180deg) brightness(97%) contrast(101%);
  transition: background 0.15s ease;
}
.campo-data::-webkit-calendar-picker-indicator:hover {
  background: #e6f6ff;
}
.campo-data:disabled {
  opacity: 0.5;
}

.icon-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.6rem;
}
.icon-badge svg {
  width: 1rem;
  height: 1rem;
}
.icon-badge-lg {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
}
.icon-badge-lg svg {
  width: 1.25rem;
  height: 1.25rem;
}
.icon-badge-blue { background: #e6f6ff; color: #0090e0; }
.icon-badge-slate { background: #f1f5f9; color: #475569; }
.icon-badge-emerald { background: #ecfdf5; color: #059669; }
.icon-badge-amber { background: #fffbeb; color: #b45309; }
.icon-badge-rose { background: #fff1f2; color: #be123c; }
.icon-badge-dark { background: rgba(255, 255, 255, 0.14); color: #fff; }
.card-titulo-icone {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.rotulo-icone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ranking-linhas-load { opacity: 0.45; }
.grafico-mes {
  min-width: 0;
  overflow: visible;
}
@media (max-width: 767px) {
  .grafico-mes {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .grafico-mes::-webkit-scrollbar {
    display: none;
  }
}
.grafico-plot {
  position: relative;
  height: 220px;
  padding-top: 22px;
  box-sizing: border-box;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}
.grafico-plot .bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
}
.bars-item {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
}
.bars-item.ativa {
  background: #e2e8f0;
  border-radius: 4px;
}
.bars-duo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  width: 100%;
  height: 100%;
}
.bar-meta,
.bar-venda {
  display: block;
  flex: 1;
  min-width: 0;
  max-width: 11px;
  border-radius: 2px 2px 0 0;
}
.bar-meta { background: #33b6ff; }
.bar-venda {
  position: relative;
  background: #0f172a;
}
.bar-venda em {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #0f172a;
}
.meta-svg {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  width: 100%;
  height: 198px;
  max-height: 198px;
  aspect-ratio: auto;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.grafico-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.linha-meta {
  fill: none;
  stroke: #0090e0;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.linha-atual {
  fill: none;
  stroke: #0f172a;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.linha-projecao {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2;
  stroke-dasharray: 1.5 3.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.grafico-dias {
  display: flex;
  gap: 0;
  margin-top: 8px;
}
.grafico-dias span {
  flex: 1;
  min-width: 0;
  padding: 0 1px;
  text-align: center;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  color: #94a3b8;
}
.grafico-dias span.hoje {
  font-weight: 700;
  color: #0f172a;
}
.marca-ritmo {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  background: #0f172a;
  border-radius: 1px;
}
.mapa-brasil {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 560px;
}
.mapa-brasil path {
  stroke: #fff;
  stroke-width: 0.9;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease;
}
.mapa-brasil path.is-on,
.mapa-brasil path.uf-ativa {
  stroke: #0f172a;
  stroke-width: 1.8;
}
.uf-linha { cursor: pointer; }
.uf-linha:hover { background: #f8fafc; }
.uf-linha.ativa { background: #e6f6ff; }
.prod-linha { cursor: pointer; }
.prod-linha:hover { background: #f8fafc; }
.prod-linha.ativa { background: #e6f6ff; }
.tabela-scroll {
  max-height: min(36rem, calc(100vh - 12rem));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* Tailwind zera pra "collapse" no preflight, e "collapse" quebra o clipping do
   cabeçalho sticky (uma linha de baixo passa a aparecer por cima dele ao rolar). */
.tabela-scroll table {
  border-collapse: separate;
  border-spacing: 0;
}
/* Cabeçalho fixo ao rolar: position:sticky em <th>/<thead> dentro de <table> é
   inconsistente entre navegadores (Chrome já mostrou linha do corpo por cima do
   cabeçalho, ou o cabeçalho "grudando" um offset errado — Safari nem sempre aplica
   sticky em <thead>/<tr>). iniciarCabecalhosFixos() em app.js empurra o <thead>
   inteiro com transform, na mesma medida do scroll do container — funciona igual
   pra cabeçalho de 1 ou 2 linhas, sem depender do sticky do navegador. */
.tabela-scroll thead {
  position: relative;
  z-index: 3;
  will-change: transform;
}
.tabela-scroll thead th {
  background: #fff;
  box-shadow: 0 1px 0 0 #e2e8f0;
}

/* Ordenação clicável nos cabeçalhos + acabamento visual, aplicado por
   iniciarTabelasOrdenaveis() em app.js a toda tabela "comum" (não mexe em
   .tabela-estoque nem na tabela de formulário de metas, que o próprio JS ignora).
   :not([class*="bg-"]) evita cobrir linhas com destaque próprio (erro, submontagem etc.). */
.tabela-ordenavel tbody tr:nth-child(even):not([class*="bg-"]) td {
  background: #fafbfc;
}
.tabela-ordenavel tbody tr:hover:not([class*="bg-"]) td {
  background: #f1f5f9;
}
.th-ordenavel {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-ordenavel:hover {
  color: #0f172a;
}
.seta-ordenar {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.6rem;
  opacity: 0.35;
}
.seta-ordenar::before {
  content: "▲▼";
}
.th-ordenavel[data-sort-dir="asc"] .seta-ordenar,
.th-ordenavel[data-sort-dir="desc"] .seta-ordenar {
  opacity: 1;
  color: #0090e0;
}
.th-ordenavel[data-sort-dir="asc"] .seta-ordenar::before {
  content: "▲";
}
.th-ordenavel[data-sort-dir="desc"] .seta-ordenar::before {
  content: "▼";
}

.card-mix {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card-mix-titulo {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
}
.card-mix-meta {
  min-height: 2.6rem;
  margin-top: 0.5rem;
}
.card-mix-meta p {
  margin: 0;
}
.card-mix-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.85rem;
  align-items: stretch;
}
.card-mix-kpi {
  position: relative;
  min-width: 0;
  min-height: 4.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #fff;
  padding: 0.55rem 1.65rem 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-mix-kpi-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.card-mix-kpi-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.card-mix-kpi-btn svg {
  width: 0.75rem;
  height: 0.75rem;
}
.card-lider {
  position: relative;
  padding-right: 2.75rem;
}
.card-lider-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}
.card-lider-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.card-lider-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}
.componente-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.componente-item-info {
  flex: 1 1 auto;
  min-width: 0;
}
.componente-item-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}
.componente-item-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}
.componente-item-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}
.produto-componentes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
}
.produto-componentes-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}
.card-mix-kpi .rotulo {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #64748b;
}
.card-mix-kpi .valor {
  margin: 0.3rem 0 0;
  font-size: clamp(0.66rem, 0.85vw, 0.8rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
}
.card-mix-chart {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  min-height: 20rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #f8fafc;
  padding: 0.75rem 0.85rem 0.85rem;
}
.card-mix-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}
.card-mix-chart-titulo {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  flex-shrink: 0;
}
.card-mix-busca {
  position: relative;
  flex: 1 1 10rem;
  max-width: 13rem;
  min-width: 8rem;
}
.card-mix-busca svg {
  position: absolute;
  top: 50%;
  left: 0.55rem;
  transform: translateY(-50%);
  width: 0.8rem;
  height: 0.8rem;
  color: #94a3b8;
  pointer-events: none;
}
.card-mix-busca-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  padding: 0.3rem 0.6rem 0.3rem 1.65rem;
  font-size: 0.75rem;
  color: #0f172a;
}
.card-mix-busca-input:focus {
  outline: none;
  border-color: #0090e0;
  box-shadow: 0 0 0 2px rgba(0, 144, 224, 0.15);
}
.card-mix-sem-resultado {
  margin: 0;
  padding: 0.75rem 0.25rem;
  font-size: 0.8rem;
  color: #64748b;
}
.card-mix-linha[hidden] {
  display: none;
}
.card-mix-lista {
  flex: 1 1 auto;
  min-height: 0;
  height: 16.5rem;
  overflow: auto;
  padding-right: 0.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (min-width: 1280px) {
  .card-mix-chart {
    min-height: 22rem;
  }
  .card-mix-lista {
    height: 18.5rem;
  }
}
@media (min-width: 1536px) {
  .card-mix-kpi {
    min-height: 5.5rem;
  }
  .card-mix-chart {
    min-height: 24rem;
  }
  .card-mix-lista {
    height: 20.5rem;
  }
}
.card-mix-lista::-webkit-scrollbar {
  width: 6px;
}
.card-mix-lista::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.card-mix-linha {
  display: grid;
  grid-template-columns: minmax(6.5rem, 10.5rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem 0.75rem;
  padding: 0.55rem 0;
  font-size: 0.8rem;
}
.card-mix-linha + .card-mix-linha {
  border-top: 1px solid #f1f5f9;
}
.card-mix-linha .mix-nome {
  min-width: 0;
  color: #0f172a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-mix-linha .mix-plot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.card-mix-linha .mix-track {
  display: block;
  min-width: 0;
  height: 1.35rem;
}
.card-mix-linha .mix-barra {
  display: block;
  height: 100%;
  min-width: 0.35rem;
  border-radius: 0.35rem;
  background: #f97316;
}
.card-mix-linha .mix-valor {
  display: block;
  color: #0f172a;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
  text-align: right;
  min-width: 4.75rem;
}
.card-mix-linha .mix-unidades {
  display: block;
  color: #94a3b8;
  font-size: 0.66rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
  text-align: right;
  min-width: 2rem;
}
@media (max-width: 639px) {
  .card-mix-kpis {
    grid-template-columns: 1fr;
  }
  .card-mix-kpi {
    min-height: 0;
  }
  .card-mix-kpi .valor {
    white-space: normal;
  }
  .card-mix-lista {
    height: 14rem;
  }
  .card-mix-linha {
    grid-template-columns: minmax(5rem, 7.5rem) minmax(0, 1fr);
    font-size: 0.75rem;
  }
  .card-mix-linha .mix-track {
    height: 1.1rem;
  }
  .card-mix-linha .mix-valor {
    min-width: 3.75rem;
  }
  .card-mix-linha .mix-unidades {
    min-width: 1.5rem;
  }
}
.ticker-pedidos {
  height: 18rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ticker-pedidos::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.ticker-pedidos::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.ticker-pedidos-cabecalho,
.ticker-pedidos-linha {
  display: grid;
  grid-template-columns: 4.5rem 4rem minmax(9rem, 1fr) minmax(8rem, 0.9fr) minmax(11rem, 1.3fr) 3rem 6rem 6.5rem;
  align-items: center;
  gap: 0.6rem;
  min-width: 56rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .ticker-pedidos-cabecalho,
  .ticker-pedidos-linha {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
@media (min-width: 1280px) {
  .ticker-pedidos-cabecalho,
  .ticker-pedidos-linha {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
.ticker-pedidos-cabecalho {
  /* Fixo via transform em fixarCabecalhoAoRolar() (app.js) — ver comentário em
     .tabela-scroll thead sobre por que não é position:sticky. */
  position: relative;
  z-index: 1;
  background: #fff;
  padding-top: 0.15rem;
  padding-bottom: 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.ticker-pedidos-linha {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid #f1f5f9;
}
.ticker-pedidos-linha[hidden] {
  display: none;
}
.ticker-pedidos-linha .truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticker-produto {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}
.ticker-produto small {
  color: #94a3b8;
  font-size: 0.7rem;
}
@media (max-width: 639px) {
  .ticker-pedidos {
    height: 15rem;
  }
}

.ranking-barra {
  flex-shrink: 0;
}
.ranking-valor {
  min-width: 0;
}

.btn-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.btn-menu:hover,
.btn-menu:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
.btn-menu-light {
  background: rgba(255, 255, 255, 0.04);
}
body.menu-aberto { overflow: hidden; }

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
}
.menu-backdrop.is-open {
  display: block;
}

.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 56;
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100% - 1.25rem));
  height: 100%;
  height: 100dvh;
  max-height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: #1e1e1e;
  color: #fff;
  box-shadow: 18px 0 40px rgba(2, 6, 23, 0.35);
  transform: translateX(-110%);
  transition: transform 0.22s ease;
  pointer-events: none;
}
.menu-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}
.menu-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.menu-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}
.menu-drawer-head h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.menu-nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.menu-drawer-foot {
  flex-shrink: 0;
  padding: 8px 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: #1e1e1e;
}
.menu-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.menu-item:hover {
  background: rgba(252, 122, 30, 0.12);
  color: #fff;
}
.menu-item:hover .menu-ico {
  background: rgba(252, 122, 30, 0.35);
  color: #fff;
}
.menu-item.is-on {
  background: rgba(252, 122, 30, 0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 #fc7a1e;
}
.menu-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}
.menu-item small {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #94a3b8;
}
.menu-item.is-on small { color: #ffb27a; }
.menu-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  transition: background 0.15s ease, color 0.15s ease;
}
.menu-item.is-on .menu-ico {
  background: #fc7a1e;
  color: #fff;
}
.menu-grupo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-grupo-cabecalho {
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-grupo-cabecalho:hover {
  background: rgba(252, 122, 30, 0.12);
  color: #fff;
}
.menu-grupo-titulo {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
.menu-grupo-seta {
  transition: transform 0.15s ease;
}
.menu-grupo-cabecalho[aria-expanded="false"] .menu-grupo-seta {
  transform: rotate(90deg);
}
.menu-grupo-itens {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  margin-left: 20px;
}

@media (min-width: 640px) {
  .ranking-valor {
    min-width: 7rem;
  }
}

@media (max-width: 639px) {
  .ranking-barra {
    display: none !important;
  }
  .tabela-scroll {
    padding: 0.75rem !important;
  }
  .topo-subtitulo {
    display: none;
  }
}

@media (max-width: 767px) {
  .grafico-plot,
  .grafico-dias {
    min-width: 34rem;
  }
  .grafico-dias span:not(.hoje):nth-child(even) {
    visibility: hidden;
  }
}

.estoque-selo {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px #99f6e4;
}
.estoque-selo-erro {
  color: #9a3412;
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px #fed7aa;
}
.tag-estoque {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.tag-ruptura { background: #fff1f2; color: #be123c; }
.tag-critico { background: #fffbeb; color: #b45309; }
.tag-ok { background: #ecfdf5; color: #047857; }
.tag-indisponivel { background: #f1f5f9; color: #64748b; }

/* Tabela Estoque x Vendas (Home) — mesma leitura de cores da planilha */
.pct-realizado {
  display: inline-block;
  min-width: 3.25rem;
  border-radius: 0.375rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pct-verde { background: #dcfce7; color: #166534; }
.pct-amarelo { background: #fef9c3; color: #854d0e; }
.pct-laranja { background: #ffedd5; color: #9a3412; }
.pct-vermelho { background: #fee2e2; color: #991b1b; }

/* Sugestões para hoje — uma faixa por bloco: cabeçalho à esquerda, 3 fichas iguais à direita */
.sugestao {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  min-width: 0;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), inset 0 0 0 1px #e2e8f0;
  border-left: 4px solid #cbd5e1;
}
.sugestao-oportunidade { border-left-color: #10b981; }
.sugestao-atencao { border-left-color: #f97316; }
.sugestao-chegando { border-left-color: #3b82f6; }
.sugestao-cab { display: grid; align-content: start; gap: 0.15rem; }
.sugestao-cab h4 { margin-top: 0.2rem; font-size: 0.95rem; font-weight: 600; color: #0f172a; }
.sugestao-cab p { font-size: 0.8rem; color: #64748b; }
.sugestao-cab small { margin-top: 0.35rem; font-size: 0.72rem; color: #94a3b8; }
.sugestao-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.sugestao-oportunidade .sugestao-tag { color: #047857; }
.sugestao-atencao .sugestao-tag { color: #c2410c; }
.sugestao-chegando .sugestao-tag { color: #1d4ed8; }

.sugestao-itens {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  max-height: 26rem;
  overflow-y: auto;
  padding-right: 0.3rem;
}

/* Ficha de produto: sempre nome + preço / configuração / situação (+ alternativa no bloco Atenção) */
.ficha {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #eef2f7;
  font-size: 0.8rem;
}
.sugestao-atencao .ficha { grid-template-rows: auto auto auto 1fr; }
.ficha-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; min-width: 0; }
.ficha-cab strong {
  min-width: 0;
  min-height: 2.5em; /* reserva 2 linhas: todas as fichas ficam com a mesma altura */
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #0f172a;
  font-weight: 600;
}
.ficha-alt .ficha-cab strong { min-height: 0; display: block; -webkit-line-clamp: unset; }
.ficha-preco {
  flex: none;
  font-style: normal;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ficha-preco small { margin-left: 0.25rem; font-size: 0.62rem; font-weight: 500; color: #94a3b8; }
.ficha-preco-vazia { font-weight: 500; color: #94a3b8; }
.ficha-preco b { margin-left: 0.3rem; font-size: 0.7rem; font-weight: 600; }
.ficha-preco b.mais { color: #b45309; }
.ficha-preco b.menos { color: #047857; }
.ficha-config {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  color: #64748b;
}
.ficha-config-vazia { color: #a1a1aa; font-style: italic; }
.ficha-status { color: #334155; }
.ficha-alt {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  margin-top: 0.45rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.55rem;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}
.ficha-alt strong { color: #065f46; }
.ficha-alt strong small {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #059669;
}
.ficha-alt .ficha-preco { color: #065f46; }
.ficha-alt .ficha-config { color: #047857; }
.ficha-alt .ficha-status { color: #065f46; font-weight: 500; }
.ficha-alt-vazia {
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
}

/* Estoque x vendas */
.estoque-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.72rem;
  color: #64748b;
}
.estoque-legenda li { display: inline-flex; align-items: center; gap: 0.35rem; }
.estoque-legenda i { font-style: normal; }
.estoque-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}
@media (min-width: 640px) { .estoque-filtros { padding: 0.75rem 1.25rem; } }
.estoque-filtros button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}
.estoque-filtros button b { font-weight: 600; color: #94a3b8; }
.estoque-filtros button.ativo { background: #0f172a; color: #fff; box-shadow: none; }
.estoque-filtros button.ativo b { color: #cbd5e1; }
.estoque-so-alerta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
}
.estoque-so-alerta input { accent-color: #0090e0; }

.tabela-estoque thead th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.tabela-estoque thead th:first-child,
.tabela-estoque td:first-child { padding-left: 1rem; }
@media (min-width: 640px) {
  .tabela-estoque thead th:first-child,
  .tabela-estoque td:first-child { padding-left: 1.25rem; }
}
.tabela-estoque td { padding: 0.6rem 0.75rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.tabela-estoque .col-vendas { width: 12rem; }
.tabela-estoque .col-receita { width: 12rem; }
.tabela-estoque .col-tm { width: 7rem; text-align: right; white-space: nowrap; }
.tabela-estoque .col-disp { width: 8.5rem; text-align: right; white-space: nowrap; }
.tabela-estoque .col-cheg { width: 8.5rem; text-align: right; white-space: nowrap; }
.tabela-estoque thead .col-tm,
.tabela-estoque thead .col-disp,
.tabela-estoque thead .col-cheg { text-align: right; }

.tm-num {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.tm-num.acima { color: #047857; }
.tm-num.abaixo { color: #b45309; }
.tm-num.zero { color: #94a3b8; font-weight: 500; }
.tm-meta { display: block; margin-top: 0.15rem; font-size: 0.68rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.tabela-estoque .linha-total .tm-num { color: #fff; }
.tabela-estoque .linha-total .tm-meta { color: rgba(255, 255, 255, 0.6); }
.tabela-estoque .linha-total small { font-weight: 400; color: rgba(255, 255, 255, 0.6); }

.tabela-estoque .linha-grupo th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
.tabela-estoque .linha-grupo th:first-child,
.tabela-estoque .linha-grupo td:first-child { padding-left: 1rem; }
@media (min-width: 640px) {
  .tabela-estoque .linha-grupo th:first-child,
  .tabela-estoque .linha-grupo td:first-child { padding-left: 1.25rem; }
}
.tabela-estoque .linha-grupo .col-tm,
.tabela-estoque .linha-grupo .col-disp,
.tabela-estoque .linha-grupo .col-cheg { text-align: right; }
.grupo-nome {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #0f172a;
}

.tabela-estoque .linha-subtotal td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 2px solid #e2e8f0;
  vertical-align: middle;
  font-weight: 600;
  color: #0f172a;
}
.tabela-estoque .linha-subtotal .col-produto {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}
.tabela-estoque .linha-subtotal .meta-texto { font-weight: 600; color: #0f172a; }
.tabela-estoque .linha-subtotal .tm-num { color: #0f172a; }
.tabela-estoque .linha-subtotal .tm-meta { color: #64748b; }

.tabela-estoque .linha-item:hover td { background: #fcfcfd; }
.tabela-estoque .apagada td { opacity: 0.55; }
.produto-nome { font-weight: 600; color: #0f172a; line-height: 1.25; }
.produto-meta { margin-top: 0.15rem; font-size: 0.72rem; color: #64748b; font-variant-numeric: tabular-nums; }
.produto-meta span { color: #94a3b8; }

.meta-barra {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: visible;
}
.meta-barra i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #94a3b8;
}
.meta-barra .barra-verde { background: #10b981; }
.meta-barra .barra-amarelo { background: #eab308; }
.meta-barra .barra-laranja { background: #f97316; }
.meta-barra .barra-vermelho { background: #ef4444; }
.meta-barra b {
  position: absolute;
  top: -0.2rem;
  bottom: -0.2rem;
  width: 2px;
  margin-left: -1px;
  background: #0f172a;
  border-radius: 1px;
}
.meta-texto { margin-top: 0.3rem; font-size: 0.72rem; color: #64748b; font-variant-numeric: tabular-nums; }
.meta-texto strong { color: #0f172a; font-weight: 600; }
.meta-texto .pct-realizado { margin-left: 0.3rem; min-width: 0; padding: 0.05rem 0.4rem; font-size: 0.68rem; }

.disp-num {
  display: inline-block;
  min-width: 2.75rem;
  margin-right: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.disp-num.negativo { color: #e11d48; }
.disp-num.zero { color: #94a3b8; }

.chegada-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #1d4ed8;
  background: #eff6ff;
  font-variant-numeric: tabular-nums;
}
.chegada-chip b { font-weight: 600; }

.tabela-estoque .linha-total td {
  background: #0f172a;
  color: #fff;
  font-weight: 500;
  border-bottom: 0;
  font-size: 0.8rem;
}
.tabela-estoque .linha-total .disp-num { color: #fff; }
.tabela-estoque .linha-total .pct-realizado { background: rgba(255, 255, 255, 0.14); color: #fff; margin-left: 0.3rem; }
/* Linhas que complementam o "Total em linha" (fora da linha, acessório, garantia) até
   fechar com o total líquido da empresa — mesma faixa escura, só um degrau mais discreto. */
.tabela-estoque .linha-complemento td {
  background: #1e293b;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.74rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.tabela-estoque .linha-complemento small { margin-left: 0.35rem; font-weight: 400; color: rgba(255, 255, 255, 0.45); }
.tabela-estoque .linha-complemento .pct-realizado { background: rgba(255, 255, 255, 0.14); color: #fff; margin-left: 0.3rem; }
/* Fechamento: total líquido da empresa vs meta total — a última linha, mais destacada
   que as de complemento, pra ficar claro que é o número final. */
.tabela-estoque .linha-fechamento td {
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
}
.tabela-estoque .hidden { display: none; }
.home-atalho {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  padding: 16px;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  outline: 1px solid #e2e8f0;
  text-decoration: none;
  color: #0f172a;
  transition: outline-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.home-atalho:hover {
  outline-color: #33b6ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}
.home-atalho-texto {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.home-atalho strong {
  font-size: 0.95rem;
  font-weight: 600;
}
.home-atalho small {
  font-size: 0.8rem;
  color: #64748b;
}

/* Lista rolável dentro de um card (ex.: tabela de produtos) — altura fixa pra não
   esticar a página quando uma categoria tem muito mais itens que as outras. */
.lista-rolavel {
  height: 18rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.lista-rolavel::-webkit-scrollbar {
  width: 6px;
}
.lista-rolavel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.lista-rolavel thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.lista-rolavel tfoot td {
  position: sticky;
  bottom: 0;
  background: #fff;
}
