/* ------------------------------------------------------------------
   Painel de fechamentos — folha de conferência.
   Regra de estilo: nada aqui decora. Régua separa, cor classifica,
   peso hierarquiza. Sem sombra, sem gradiente, sem cartão flutuante.
   ------------------------------------------------------------------ */

:root {
  --tinta:      #14243D;   /* azul-petróleo: texto e superfícies de comando */
  --tinta-70:   #41506A;
  --apoio:      #64728A;   /* texto secundário */
  --papel:      #EDF0F4;   /* fundo da mesa */
  --folha:      #FFFFFF;   /* superfície de conteúdo */
  --linha:      #DCE2EA;   /* régua */
  --linha-2:    #EAEEF3;   /* régua interna */
  --ok:         #11705A;   /* conferido */
  --ok-fraco:   #E4F0EC;
  --acao:       #A8660A;   /* exige providência */
  --acao-fraco: #FBF0DE;
  --alerta:     #9B2C2C;
  --barra:      #31507E;

  --r: 3px;
  --gap: 26px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { margin: 0; font-weight: 600; }

a { color: var(--tinta); }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--acao);
  outline-offset: 2px;
}

.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ------------------------------------------------------------------ entrada */
.entrada {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background: var(--tinta);
  padding: 24px;
}

.entrada-folha {
  width: 100%;
  max-width: 380px;
  background: var(--folha);
  border-radius: var(--r);
  padding: 38px 34px 30px;
}

.entrada-marca {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.entrada-sub {
  color: var(--apoio);
  margin: 6px 0 28px;
  font-size: 13px;
}

.campo { display: block; margin-bottom: 16px; }

.campo span {
  display: block;
  font-size: 12.5px;
  color: var(--apoio);
  margin-bottom: 5px;
}

.campo input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--linha);
  border-radius: var(--r);
  font: inherit;
  color: var(--tinta);
  background: #FBFCFD;
}

.campo input:focus {
  border-color: var(--tinta);
  outline: none;
  background: #fff;
}

.botao {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: var(--r);
  background: var(--tinta);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.botao:hover { background: #0D1A2D; }

.recado {
  background: var(--acao-fraco);
  color: var(--acao);
  padding: 9px 11px;
  border-radius: var(--r);
  margin-bottom: 18px;
  font-size: 13px;
}

/* ------------------------------------------------------------------ moldura */
.app {
  display: grid;
  grid-template-columns: 216px 1fr;
  min-height: 100dvh;
}

.lateral {
  background: var(--tinta);
  color: #C7D2E3;
  padding: 22px 0 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.marca {
  padding: 0 22px 20px;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  color: #fff;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
}

.marca small {
  display: block;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 11.5px;
  font-weight: 400;
  color: #7F92AE;
  letter-spacing: .02em;
  margin-top: 3px;
}

.menu { display: flex; flex-direction: column; gap: 1px; }

.menu button {
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  padding: 9px 22px;
  text-align: left;
  color: #AEBDD2;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: color .12s, background .12s;
}

.menu button:hover { color: #fff; background: rgba(255,255,255,.04); }

.menu button[aria-current="true"] {
  color: #fff;
  background: rgba(255,255,255,.07);
  border-left-color: var(--acao);
  font-weight: 600;
}

.menu .tag {
  font-size: 11px;
  background: var(--acao);
  color: #fff;
  border-radius: 9px;
  padding: 0 6px;
  font-weight: 600;
}

.rodape-lateral {
  margin-top: auto;
  padding: 16px 22px 0;
  border-top: 1px solid rgba(255,255,255,.09);
  font-size: 12px;
  color: #7F92AE;
}

.rodape-lateral a { color: #AEBDD2; }

.conteudo { min-width: 0; }

.topo {
  background: var(--folha);
  border-bottom: 1px solid var(--linha);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topo select {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--linha);
  border-radius: var(--r);
  background: #fff;
  color: var(--tinta);
  font-weight: 600;
}

.topo-meta { color: var(--apoio); font-size: 13px; }

.topo .direita { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.abrir-planilha {
  color: var(--tinta);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--linha);
  border-radius: var(--r);
  padding: 6px 11px;
  white-space: nowrap;
  transition: border-color .12s, background .12s;
}

.abrir-planilha:hover { border-color: var(--tinta); background: #F7F9FB; }

.arquivos { color: var(--apoio); font-size: 12.5px; }

.painel { padding: 28px 32px 60px; max-width: 1180px; }

.aba[hidden] { display: none; }

/* ------------------------------------------------------------------ veredito */
.veredito {
  background: var(--folha);
  border-radius: var(--r);
  border-left: 4px solid var(--ok);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: minmax(300px, 1.4fr) 1fr;
  gap: 30px;
  align-items: end;
  margin-bottom: var(--gap);
}

.veredito.pendente { border-left-color: var(--acao); }

.selo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-fraco);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12.5px;
}

.veredito.pendente .selo { color: var(--acao); background: var(--acao-fraco); }

.selo i {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; display: block;
}

.custo {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: clamp(44px, 7vw, 68px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 14px 0 4px;
}

.custo span { font-size: .42em; color: var(--apoio); font-weight: 500; margin-right: 6px; }

.custo-nota { color: var(--apoio); font-size: 13px; }

.contadores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.contador dt { color: var(--apoio); font-size: 12.5px; margin-bottom: 3px; }

.contador dd {
  margin: 0;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.contador dd.ok { color: var(--ok); }
.contador dd.aviso { color: var(--acao); }

/* ------------------------------------------------------------------ blocos */
.bloco {
  background: var(--folha);
  border-radius: var(--r);
  margin-bottom: var(--gap);
  overflow: hidden;
}

.bloco > header {
  padding: 16px 22px 13px;
  border-bottom: 1px solid var(--linha);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.bloco > header h2 {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 17px;
}

.bloco > header p { margin: 0; color: var(--apoio); font-size: 12.5px; }

.bloco > header .direita { margin-left: auto; color: var(--apoio); font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; }

thead th {
  font-size: 12px;
  font-weight: 500;
  color: var(--apoio);
  text-align: left;
  padding: 9px 22px;
  border-bottom: 1px solid var(--linha);
  background: #F7F9FB;
}

thead th.num { text-align: right; }

tbody td { padding: 9px 22px; border-bottom: 1px solid var(--linha-2); }

tbody tr:last-child td { border-bottom: 0; }

tbody tr.total td {
  border-top: 1px solid var(--linha);
  font-weight: 600;
  background: #F7F9FB;
}

/* participação: barra e percentual na mesma célula, largura fixa para
   as barras ficarem comparáveis entre linhas */
th.participacao { text-align: left; width: 190px; }

td.participacao {
  display: flex;
  align-items: center;
  gap: 12px;
}

td.participacao b { font-weight: 500; font-size: 13px; width: 46px; text-align: right; }

.trilho {
  flex: 1;
  height: 6px;
  background: var(--linha-2);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.trilho i {
  display: block; height: 100%;
  background: var(--barra);
  border-radius: 3px;
  width: 0;
  transition: width .9s cubic-bezier(.2,.7,.3,1);
}

tr.total td.participacao b { font-weight: 600; }

.rotulo-plataforma { font-weight: 600; }

/* produtos expansíveis */
.linha-produto { cursor: pointer; }
.linha-produto:hover td { background: #F7F9FB; }

.linha-produto .abre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  margin-right: 9px;
  border: 1px solid var(--linha);
  border-radius: 2px;
  color: var(--apoio);
  font-size: 12px;
  line-height: 1;
  transition: transform .18s, background .12s, color .12s;
}

.linha-produto[aria-expanded="true"] .abre {
  background: var(--tinta); color: #fff; border-color: var(--tinta);
}

.linha-sku td {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 13px;
  color: var(--tinta-70);
  background: #FBFCFD;
}

.linha-sku td:first-child { padding-left: 46px; }

.linha-sku[hidden] { display: none; }

.marca-mapa {
  font-size: 11px;
  color: var(--acao);
  background: var(--acao-fraco);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  white-space: nowrap;
}

/* saúde */
.checagem { display: flex; gap: 12px; padding: 11px 22px; border-bottom: 1px solid var(--linha-2); }
.checagem:last-child { border-bottom: 0; }
.checagem .marca-estado { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--ok); }
.checagem.falhou .marca-estado { background: var(--acao); }
.checagem .corpo { min-width: 0; }
.checagem .corpo b { font-weight: 600; }
.checagem .corpo p { margin: 2px 0 0; color: var(--apoio); font-size: 12.5px; word-break: break-word; }
.checagem .valores { margin-left: auto; text-align: right; font-size: 13px; color: var(--apoio); white-space: nowrap; }

.vazio { padding: 22px; color: var(--apoio); }

.pilha { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.pilha .bloco { margin-bottom: 0; }

.lista-sku { margin: 0; padding: 0; list-style: none; }
.lista-sku li { padding: 8px 22px; border-bottom: 1px solid var(--linha-2); display: flex; gap: 10px; }
.lista-sku li:last-child { border-bottom: 0; }
.lista-sku li span { color: var(--apoio); margin-left: auto; font-size: 12.5px; }

code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12.5px; }

.carregando { padding: 60px 22px; text-align: center; color: var(--apoio); }

/* animação única: entrada do painel, uma vez */
.entra { animation: sobe .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes sobe { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: column; padding-bottom: 10px; }
  .menu { flex-direction: row; overflow-x: auto; padding: 0 12px; }
  .menu button { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 9px 12px; }
  .menu button[aria-current="true"] { border-left: 0; border-bottom-color: var(--acao); }
  .rodape-lateral { display: none; }
  .topo, .painel { padding-left: 16px; padding-right: 16px; }
  .topo .direita { margin-left: 0; width: 100%; }
  th.participacao { width: auto; }
  .veredito { grid-template-columns: 1fr; gap: 22px; }
  thead th, tbody td { padding-left: 16px; padding-right: 16px; }
  .fatia .trilho { left: 16px; right: 16px; }
  .linha-sku td:first-child { padding-left: 34px; }
}
