:root {
  --bg: #F9F9F7;
  --panel: #FFFFFF;
  --line: #E1E0D9;
  --ink: #0B0B0B;
  --ink-soft: #52514E;
  --ink-muted: #898781;
  --good: #0CA30C;
  --warning: #C98500;
  --critical: #D03B3B;
  --good-bg: #E6F5E6;
  --warning-bg: #FCF0DA;
  --critical-bg: #FBEAEA;

  /* paleta categorica (dataviz skill, ordem padrao validada) - 1 cor fixa por supervisor */
  --sup-100: #2A78D6;  /* Washington - azul */
  --sup-28:  #008300;  /* Sueli - verde */
  --sup-27:  #C24A78;  /* Rodrigo - magenta */
  --sup-23:  #C98500;  /* Anderson - amarelo/ocre */
  --sup-24:  #1BAF7A;  /* Arildo - aqua */
  --sup-80:  #D9591F;  /* Alessandro - laranja */
  --sup-0:   #A9A79E;  /* Outros/Interno - cinza neutro */

  --radius: 16px;

  /* cor por industria -- pra nao confundir a pagina Arcor com a Bagley */
  --arcor-accent: #C0392B;   /* vermelho, marca Arcor */
  --arcor-bg:     #FBEEEC;
  --arcor-tint:   #FCF5F4;
  --bagley-accent: #1F5FA8;  /* azul, marca Bagley */
  --bagley-bg:     #EAF1FB;
  --bagley-tint:   #F4F8FD;

  /* cor por metrica -- Visao Geral (2026-08-06), distingue os 4 blocos
     (Faturamento/Positivacao/Caixas/Devolucao) sem se confundir com as cores
     de industria (arcor/bagley) nem com os status (good/warning/critical) */
  --metric-faturamento: #2B6CB0;
  --metric-positivacao: #6B3FA0;
  --metric-caixas:      #0E8074;
  --metric-devolucao:   #B23A46;

  /* Sidebar escura tom vermelho (redesign 2026-08-07, pedido do usuario --
     referencia de dashboard SaaS com sidebar escura, aqui no tom da marca
     Arcor em vez de azul-marinho). --arcor-accent continua sendo o vermelho
     "vivo" (destaque/ativo); estes tons sao o fundo escuro em si. */
  --sidebar-bg:      #2A0E0E;
  --sidebar-bg-soft: #3D1614;
  --sidebar-ink:     #F5E9E7;
  --sidebar-ink-muted: #C9A099;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: 'Inter', Arial, sans-serif; background: var(--bg);
  color: var(--ink); -webkit-font-smoothing: antialiased;
}
body.industria-arcor { background: var(--arcor-tint); }
body.industria-bagley { background: var(--bagley-tint); }
body.industria-arcor .topbar { border-bottom-color: var(--arcor-accent); }
body.industria-bagley .topbar { border-bottom-color: var(--bagley-accent); }
.industria-tag {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .5px;
  text-transform: uppercase; padding: 4px 10px; border-radius: 20px; color: #fff;
}
.industria-tag.arcor { background: var(--arcor-accent); }
.industria-tag.bagley { background: var(--bagley-accent); }
body.industria-arcor .card, body.industria-arcor .hero { border-left: 3px solid var(--arcor-accent); }
body.industria-bagley .card, body.industria-bagley .hero { border-left: 3px solid var(--bagley-accent); }
.display { font-family: 'Oswald', 'Inter', sans-serif; }
.num { font-variant-numeric: tabular-nums; }
a { color: inherit; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px 60px; }

/* ---- Header / branding ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 4px 2px 16px; border-bottom: 3px solid var(--ink); margin-bottom: 18px; flex-wrap: wrap;
}
.brandrow { display: flex; align-items: center; gap: 12px; }
.logo-slot {
  display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 12px;
  border: 1.5px dashed var(--line); border-radius: 8px; font-family: 'Oswald', sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px; color: var(--ink-muted); text-transform: uppercase;
  background: var(--panel);
}
.logo-slot img { height: 100%; width: auto; display: block; }
.brand-x { font-size: 16px; color: var(--ink-muted); font-weight: 300; }
.titles h1 {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 22px; margin: 0;
  letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink);
}
.titles .sub { font-size: 12px; color: var(--ink-soft); font-weight: 500; margin-top: 2px; }
.meta-info { text-align: right; font-size: 11px; color: var(--ink-muted); }

.backlink {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--ink-soft); text-decoration: none; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .3px;
}
.backlink:hover { color: var(--ink); }

/* ---- Menu (index) ---- */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 8px; }
.menu-card {
  display: block; text-decoration: none; color: var(--ink); background: var(--panel);
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative;
  overflow: hidden; transition: border-color .15s ease, transform .15s ease;
}
.menu-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.menu-card.arcor { background: var(--arcor-bg); border-color: var(--arcor-accent); }
.menu-card.arcor:hover { border-color: var(--arcor-accent); }
.menu-card.bagley { background: var(--bagley-bg); border-color: var(--bagley-accent); }
.menu-card.bagley:hover { border-color: var(--bagley-accent); }
.menu-card .tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-muted);
  margin-bottom: 8px;
}
.menu-card h2 { font-family: 'Oswald', sans-serif; font-size: 22px; margin: 0 0 8px; text-transform: uppercase; }
.menu-card p { font-size: 13px; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.5; }
.menu-card .stats { display: flex; gap: 20px; }
.menu-card .stat .v { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 700; }
.menu-card .stat .k { font-size: 10px; text-transform: uppercase; color: var(--ink-muted); letter-spacing: .3px; margin-top: 2px; }
.menu-card .arrow { position: absolute; right: 20px; bottom: 20px; font-size: 22px; color: var(--ink-muted); }

/* ---- Tabs (categorias) ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.3px; text-align: center; padding: 10px 14px; border-radius: 8px;
  border: 2px solid var(--line); background: var(--panel); color: var(--ink-soft); cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}
.tab:hover { border-color: var(--arcor-accent); color: var(--ink); }
.tab.active { background: var(--arcor-accent); border-color: var(--arcor-accent); color: #fff; }

/* ---- Scoreboard (empilha varios .hero, usado na pagina Geral) ---- */
#scoreboard { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
#scoreboard .hero { margin-bottom: 0; }

/* ---- Hero card ---- */
.hero {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
  justify-content: space-between;
}
.hero .h-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 40px; line-height: 1; }
.hero .h-num small { font-size: 18px; font-weight: 500; color: var(--ink-soft); }
.hero .h-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); font-weight: 700; margin-top: 4px; }
.hero .h-track { height: 10px; background: #EEEDE7; border-radius: 5px; margin-top: 10px; overflow: hidden; width: 260px; max-width: 100%; }
.hero .h-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.hero .h-pct { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 30px; }
.hero .breakdown { display: flex; gap: 18px; flex-wrap: wrap; }
.hero .breakdown .b { text-align: center; }
.hero .breakdown .b .v { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; }
.hero .breakdown .b .k { font-size: 10px; text-transform: uppercase; color: var(--ink-muted); letter-spacing: .3px; }

/* ---- Cards / panels ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h3 { font-family: 'Oswald', sans-serif; font-size: 15px; text-transform: uppercase; letter-spacing: .3px; margin: 0 0 14px; }

/* ---- Bar chart (SVG, custom) ---- */
.chart-wrap { position: relative; }
.bar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bar-row .lbl { width: 172px; flex-shrink: 0; text-align: left; }
.bar-row .lbl-nome { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.bar-row .lbl-val { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); font-family: 'Oswald', sans-serif; margin-top: 1px; }
.bar-row .track { flex: 1; height: 18px; background: #EEEDE7; border-radius: 5px; overflow: hidden; position: relative; }
.bar-row .fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.bar-row .fill.meta-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }

.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: 11px; color: var(--ink-soft); }
.legend-row .item { display: flex; align-items: center; gap: 5px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ---- Supervisor board ---- */
.board { display: flex; flex-direction: column; gap: 8px; }
.srow { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.srow.outros { border-style: dashed; background: #FBFBF9; }
.srow.total { border: 2px solid var(--ink); background: var(--bg); margin-top: 4px; }
.srow.total .name { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: .3px; }
.srow-top { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.srow .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.srow .name { flex: 1; font-weight: 700; font-size: 14px; }
/* base sem escopo (usada tambem fora de .srow, ex: coluna "Redigitar?" da
   tabela de Cortes) -- as regras .srow abaixo so reforcam o mesmo visual
   quando o badge esta dentro de uma linha de supervisor/vendedor. */
.pct-badge {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 20px; display: inline-block;
}
.pct-badge.good { background: var(--good-bg); color: var(--good); }
.pct-badge.warning { background: var(--warning-bg); color: var(--warning); }
.pct-badge.critical { background: var(--critical-bg); color: var(--critical); }
.pct-badge.neutral { background: var(--bg); color: var(--ink-muted); }
.pct-badge.sm { font-size: 11px; padding: 2px 7px; }

/* Aba "Sem Compra": legenda + KPIs à esquerda, pizza de participação à direita,
   as duas colunas com a MESMA altura (align-items:stretch) e os KPIs empurrados
   pro rodapé da coluna esquerda (justify-content:space-between) pra não sobrar
   espaço em branco. */
.sc-top-row { display: flex; gap: 16px; align-items: stretch; margin-bottom: 16px; flex-wrap: wrap; }
.sc-top-left { flex: 1 1 380px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.sc-top-left .note-box { flex: 0 0 auto; margin-bottom: 0; }
.sc-stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-stat { flex: 1 1 110px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; text-align: center; }
.sc-stat .num { display: block; font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.15; }
.sc-stat span { font-size: 9px; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; letter-spacing: .2px; }
.sc-pie-card { flex: 0 0 296px; padding: 14px 16px; display: flex; flex-direction: column; }
.sc-pie-title { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--ink-muted); margin-bottom: 10px; }
.sc-pie-title small { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .75; }
.sc-pie-card .pie-wrap { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.sc-pie-card .pie-legend { width: 100%; gap: 4px; flex: 0 0 auto; }
.sc-pie-card .pie-legend-item { font-size: 11px; }
.sc-pie-card .pie-legend-pct { width: 40px; font-size: 12px; }
@media (max-width: 820px) { .sc-pie-card { flex-basis: 100%; } .sc-top-left { flex-basis: 100%; } }

/* Aba Sem Compras: nome do cliente clicavel + modal de sugestao de mix */
.sc-cli-link {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer;
  color: var(--accent, var(--ink)); font-weight: 600; text-align: left;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.sc-cli-link:hover { text-decoration-color: currentColor; }
.sc-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.sc-modal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sc-modal-title { font-family: 'Oswald', sans-serif; font-size: 17px; font-weight: 700; line-height: 1.2; }
.sc-modal-sub { font-size: 12px; color: var(--ink-muted); margin-top: 3px; }
.sc-modal-x { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--ink-muted); line-height: 1; padding: 2px 6px; }
.sc-modal-x:hover { color: var(--ink); }
.sc-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 4px; }
.sc-modal-grid > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sc-modal-k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-muted); font-weight: 700; }
.sc-modal-grid b { font-size: 13px; font-weight: 600; word-break: break-word; }
.sc-modal-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sc-modal-sectitle { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-muted); font-weight: 700; margin-bottom: 8px; }
.sc-modal-muted { font-size: 12px; color: var(--ink-muted); }
.sc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-tag { background: var(--good-bg); color: var(--good); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 20px; }
.sc-modal-itens { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sc-modal-itens td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.sc-modal-itens td:last-child { text-align: right; color: var(--ink-muted); white-space: nowrap; padding-left: 10px; }
.srow .pct-badge {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 20px;
}
.srow .pct-badge.good { background: var(--good-bg); color: var(--good); }
.srow .pct-badge.warning { background: var(--warning-bg); color: var(--warning); }
.srow .pct-badge.critical { background: var(--critical-bg); color: var(--critical); }
.srow .chevron { font-size: 11px; color: var(--ink-muted); transition: transform .15s ease; flex-shrink: 0; }
.srow.open .chevron { transform: rotate(180deg); }
.srow .track { height: 6px; background: #EEEDE7; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.srow .fill { height: 100%; border-radius: 3px; }

/* detalhe expansivel, agrupado por metrica (Faturamento/Positivacao/Caixas) */
.srow .detail { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.srow.open .detail { display: block; }
.srow-link {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--arcor-accent); text-decoration: none;
}
.srow-link:hover { text-decoration: underline; }
.metric-group { margin-bottom: 12px; }
.metric-group:last-child { margin-bottom: 0; }
.metric-group-title {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px;
}
.metric-group-title .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--ink-muted); }
.metric-group-title .meta { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.metric-cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center;
  background: var(--bg); border-radius: 8px; padding: 8px 4px;
}
.metric-cols.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 2x2, nao 4-em-linha -- mesmo motivo do .mkpi-nums acima: 4 colunas nao da
   espaco pra valor em R$ sem quebrar o numero no meio. */
.metric-cols.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
.metric-cols .k { font-size: 9px; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; letter-spacing: .2px; }
.metric-cols .v { font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 600; margin-top: 2px; overflow-wrap: break-word; }
.metric-cols .v.destaque { color: var(--ink); font-weight: 700; }

.legend { margin-top: 14px; font-size: 11px; color: var(--ink-muted); line-height: 1.6; padding: 0 2px; }
.legend b { color: var(--ink-soft); }

@media (max-width: 640px) {
  .bar-row { flex-wrap: wrap; }
  .bar-row .lbl { width: auto; flex: 1 1 auto; }
  .bar-row .track { flex-basis: 100%; }
  .metric-cols.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { flex-direction: column; align-items: flex-start; }
}

/* ---- Tabela "Por supervisor" da Visao Geral (2026-08-11, redesenhada 2x
   2026-08-12 -- a versao de barra empilhada+anel deixou os numeros
   espalhados segundo a usuaria; essa volta pro formato de TABELA numa
   referencia visual que ela trouxe: colunas Supervisor | Arcor | Bagley |
   Total, cada uma com Realizado/Meta + barra + badge de %. ---- */
.sup3-head-row { display: flex; align-items: center; margin-bottom: 14px; }
.sup3-table { display: flex; flex-direction: column; gap: 10px; }
.sup3-row { display: grid; grid-template-columns: 190px repeat(3, 1fr); align-items: center; gap: 16px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.sup3-row.sup3-total { border: 2px solid var(--ink); background: var(--bg); }
.sup3-row.sup3-head { background: transparent; border: none; padding: 0 16px; }

.sup3-sup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sup3-avatar { width: 38px; height: 38px; font-size: 13px; flex-shrink: 0; }
.sup3-sup-txt { min-width: 0; }
.sup3-nome { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup3-nome small { color: var(--ink-muted); font-weight: 500; }
.sup3-detalhe-link { font-size: 11.5px; font-weight: 600; color: var(--arcor-accent); text-decoration: none; }
.sup3-detalhe-link:hover { text-decoration: underline; }
.sup3-total-tag { font-size: 11px; font-weight: 600; color: var(--ink-muted); }

.sup3-head .sup3-sup { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; color: var(--ink-muted); }
.sup3-head .sup3-col { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; color: var(--ink-muted); }
.sup3-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.sup3-head-sub { font-size: 9.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-muted); margin-top: 2px; opacity: .8; }

.sup3-col { min-width: 0; }
.sup3-valmeta { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; overflow-wrap: break-word; }
.sup3-valmeta .sup3-meta { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; color: var(--ink-muted); }
.sup3-col .track { height: 5px; background: #EEEDE7; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.sup3-col .fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.sup3-pctbadge { font-size: 11px; font-weight: 700; margin-top: 3px; }
.sup3-delta { font-size: 9.5px; font-weight: 600; margin-top: 4px; }
.sup3-col-total .sup3-total-label { font-size: 9.5px; font-weight: 700; letter-spacing: .3px; color: var(--ink-muted); margin-bottom: 2px; }
/* .sup3-col-mlabel (rotulo Arcor/Bagley dentro da coluna): escondido no
   desktop -- o cabecalho da tabela (.sup3-head) ja identifica a coluna ali.
   So aparece no celular (ver breakpoint 520px abaixo), onde o cabecalho some
   e a coluna ficaria sem nome nenhum sem isso. */
.sup3-col-mlabel { display: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-muted); margin-bottom: 3px; }

@media (max-width: 900px) {
  .sup3-row { grid-template-columns: 160px repeat(3, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 700px) {
  .sup3-row.sup3-head { display: none; }
  .sup3-row { grid-template-columns: 1fr 1fr; }
  .sup3-sup { grid-column: 1 / -1; }
}
/* Celular de verdade: 3 colunas de dado (Arcor/Bagley/Total) espremidas em
   1fr 1fr (2 colunas) deixava uma sobrando sozinha numa 3a linha, meio
   quebrado -- empilha tudo numa coluna so, cada bloco com seu rotulo
   (.sup3-col-mlabel) ja que o cabecalho da tabela sumiu. */
@media (max-width: 520px) {
  .sup3-row { grid-template-columns: 1fr; gap: 4px; }
  .sup3-col { padding: 8px 0; border-top: 1px dashed var(--line); }
  .sup3-sup { border-top: none; padding-bottom: 4px; }
  .sup3-col-mlabel { display: block; }
}

@media print {
  .no-print { display: none !important; }
  .app-sidebar, .topbar-controls, .backlink { display: none !important; }
  .app-main { padding: 0; }
}

/* ---- Tabela de produtos em risco (aba Simulacao de Estoque) ---- */
.simtable-wrap { overflow-x: auto; }
.simtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.simtable th {
  font-family: 'Oswald', sans-serif; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--ink-muted); text-align: right; padding: 6px 8px; border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.simtable th:first-child, .simtable td:first-child { text-align: left; }
.simtable td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.simtable td.produto-cel { white-space: normal; }
.simtable td.produto-cel .desc { font-weight: 700; }
.simtable td.produto-cel .emb { font-size: 11px; color: var(--ink-muted); }
.simtable td.risco { color: var(--critical); font-weight: 700; }

/* ---- Painel Diario (acompanhamento por filial/supervisor) ---- */
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 12px; }
.dtable th {
  font-family: 'Oswald', sans-serif; font-size: 10px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--ink-muted); text-align: right; padding: 6px 7px; border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.dtable th:first-child, .dtable td:first-child { text-align: left; }
.dtable td { padding: 7px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.dtable td.destaque { font-weight: 700; color: var(--ink); }
.dtable td.falta { color: var(--critical); }
.dtable tr.status-good td:first-child { border-left: 4px solid var(--good); }
.dtable tr.status-warning td:first-child { border-left: 4px solid var(--warning); }
.dtable tr.status-critical td:first-child { border-left: 4px solid var(--critical); }
.dtable tr.status-good { background: var(--good-bg); }
.dtable tr.status-warning { background: var(--warning-bg); }
.dtable tr.status-critical { background: var(--critical-bg); }
.dtable tr.status-good td, .dtable tr.status-warning td, .dtable tr.status-critical td { border-bottom-color: rgba(0,0,0,.06); }
.dtable tfoot td { border-top: 2px solid var(--ink); border-bottom: none; font-weight: 700; }
.dtable-group-row td { padding-top: 14px; padding-bottom: 2px; border-bottom: none; font-family: 'Oswald', sans-serif; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-muted); text-align: left; }
.dtable-group-row td b { color: var(--ink); font-size: 11.5px; }
.dtable tr.subtotal td { border-top: 2px solid var(--ink-muted); border-bottom: 2px solid var(--line); background: var(--bg); font-weight: 700; }
.dtable tr.pendente td { color: var(--ink-muted); font-style: italic; }

/* ---- Barra de rolagem horizontal no topo da tabela (tablescroll.js) ---- */
.hscroll-top {
  overflow-x: auto; overflow-y: hidden;
  position: sticky; top: 0; z-index: 20;
  background: var(--panel); margin-bottom: 2px;
}
.hscroll-top > div { height: 1px; }
.hscroll-top::-webkit-scrollbar { height: 10px; }
.hscroll-top::-webkit-scrollbar-thumb { background: var(--ink-muted); border-radius: 6px; }
.hscroll-top::-webkit-scrollbar-track { background: var(--bg); }

.hero.destaque-meta { border: 2px solid var(--ink); }
.hero.destaque-meta .h-num small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }

.filial-tag {
  display: inline-block; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .4px;
  padding: 2px 9px; border-radius: 20px; background: var(--ink); color: #fff; text-transform: uppercase; margin-right: 8px;
}

.note-box { background: var(--warning-bg); border: 1px solid var(--warning); border-radius: var(--radius); padding: 14px 16px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 16px; }
.note-box b { color: var(--ink); }
.note-box ul { margin: 6px 0 0; padding-left: 18px; }

.section-sub { font-size: 11.5px; color: var(--ink-muted); margin: -10px 0 14px; line-height: 1.5; }
.simtable tbody tr:hover { background: var(--bg); }
.sim-empty { font-size: 13px; color: var(--ink-soft); padding: 8px 0; }

/* ---- Botao de exportar ---- */
.export-row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.btn-export {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px;
  border: 1.5px solid var(--ink); background: var(--panel); color: var(--ink);
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-export:hover { background: var(--ink); color: #fff; }

/* ---- Referencia de produtos por categoria (pagina Vendedores) ---- */
.ref-cat { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ref-cat:last-child { border-bottom: none; padding-bottom: 0; }
.ref-cat:first-child { padding-top: 0; }
.ref-cat-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ref-cat-nome { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .2px; }
.ref-cat-meta { font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.ref-cat-produtos { display: flex; flex-wrap: wrap; gap: 6px; }
.produto-tag {
  font-size: 11px; font-weight: 600; color: var(--ink-soft); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
}
.produto-tag small { color: var(--ink-muted); font-weight: 500; }

/* ---- Busca (paginas de Estoque) ---- */
.search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box {
  flex: 1; min-width: 220px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 13px; background: var(--panel); color: var(--ink);
}
.search-box:focus { outline: none; border-color: var(--ink); }
.search-count { font-size: 11px; color: var(--ink-muted); font-weight: 600; white-space: nowrap; }

/* =====================================================================
   Dashboard leve (2026-08-06) -- sem sidebar/app-shell, mesmo padrao do
   Acompanhamento Arcor (topbar clara + .menu-grid + pagina propria por
   assunto via navegacao real, nao SPA). .topbar/.titles/.menu-grid/
   .menu-card ja existem mais acima (herdados do Arcor).
   ===================================================================== */
.user-badge { font-size: 11.5px; color: var(--ink-muted); text-align: right; line-height: 1.35; }
.user-badge b { color: var(--ink); font-weight: 700; }

.segmented { display: inline-flex; background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented button {
  border: none; background: transparent; padding: 8px 18px; border-radius: 7px; font-family: 'Oswald', sans-serif;
  font-weight: 700; font-size: 12.5px; letter-spacing: .3px; color: var(--ink-soft); cursor: pointer;
}
.segmented button.active { background: var(--ink); color: #fff; }

/* ---- Stat tile row (KPI cards no topo da Visao Geral) ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-tile .st-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stat-tile .st-icon {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.stat-tile .st-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--ink-muted); }
.stat-tile .st-val { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 700; }
.stat-tile .st-sub { font-size: 11px; color: var(--ink-muted); margin-top: 3px; }
.stat-tile .st-sub.up { color: var(--good); }
.stat-tile .st-sub.down { color: var(--critical); }
.stat-tile .st-split { display: flex; flex-direction: column; gap: 6px; }
.stat-tile .st-split > div { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-soft); }
.stat-tile .st-split .sw { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.stat-tile .st-split b { margin-left: auto; font-family: 'Oswald', sans-serif; font-size: 15px; color: var(--ink); }

/* ---- Ring / gauge (SVG, progresso circular) ---- */
.ring-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ring-label { font-family: 'Oswald', sans-serif; font-weight: 700; fill: var(--ink); }
.ring-card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ring-card-title .st-icon { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }

/* ---- Progresso da Meta Geral (2026-08-11, replica layout aprovado pelo
   usuario) -- anel centralizado com legenda "da meta" embaixo, e rodape em
   2 colunas (Meta/Realizado) num box separado, em vez do anel ao lado de uma
   coluna de texto. ---- */
.pmg-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pmg-caption { font-size: 12.5px; color: var(--ink-muted); font-weight: 600; }
.pmg-footer { display: flex; margin-top: 18px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.pmg-footer-item { flex: 1; min-width: 0; text-align: center; padding: 12px 8px; }
.pmg-footer-item + .pmg-footer-item { border-left: 1px solid var(--line); }
.pmg-footer-item .k { display: block; font-size: 11.5px; color: var(--ink-soft); margin-bottom: 4px; }
.pmg-footer-item .v { display: block; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; overflow-wrap: break-word; }

/* ---- Faturamento no Periodo (card "spotlight" central da Visao Geral,
   2026-08-11) -- unico numero em destaque, tudo centralizado. ---- */
.fp-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.fp-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 17px; margin-bottom: 12px; flex-shrink: 0; }
.fp-label { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-muted); font-weight: 700; margin-bottom: 12px; }
.fp-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 30px; overflow-wrap: break-word; }
.fp-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.fp-track { width: 100%; max-width: 280px; height: 9px; background: #EEEDE7; border-radius: 5px; overflow: hidden; margin-top: 16px; }
.fp-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.fp-pct { margin-top: 12px; font-size: 12.5px; }
.fp-pct b { font-family: 'Oswald', sans-serif; font-size: 15px; }
.fp-divider { width: 100%; max-width: 280px; height: 1px; background: var(--line); margin: 20px 0 16px; }

/* ---- Fornecedor split (2 aneis pequenos lado a lado + total) ---- */
.forn-split { display: flex; align-items: flex-start; justify-content: space-around; gap: 20px; flex-wrap: wrap; text-align: center; }
.forn-split .forn-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 190px; }
.forn-split .forn-nome { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.forn-split .forn-nums { font-size: 11px; color: var(--ink-muted); }

/* ---- Lista de topicos (label : valor) -- substitui as linhas "A + B = C" ---- */
.kv-list { display: flex; flex-direction: column; width: 100%; max-width: 230px; text-align: left; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .k { color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.kv-row .v { font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--ink); white-space: nowrap; }
.kv-row .v small { font-weight: 500; color: var(--ink-muted); font-size: 10.5px; font-family: 'Inter', sans-serif; }
.kv-row.kv-total { border-bottom: none; margin-top: 2px; padding: 8px 0; background: var(--bg); border-radius: 7px; padding-left: 8px; padding-right: 8px; }
.kv-row.kv-total .v { font-size: 14.5px; }
.kv-row.kv-falta .k, .kv-row.kv-falta .v { color: var(--critical); }
.kv-row.kv-ok .k, .kv-row.kv-ok .v { color: var(--good); }

/* ---- Breakdown bar (faturamento por fornecedor) ---- */
.breakdown-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 14px; }
.breakdown-bar .seg { height: 100%; }
/* ---- Metas do Periodo (2026-08-11 redesign): cada metrica empilhada
   (nome+pct / valor+meta / barra cheia) em vez de uma linha so com colunas
   de largura fixa -- o valor em R$ do Faturamento e bem maior que os outros
   e quebrava linha dentro da coluna estreita, desalinhando a barra e o %
   entre as linhas (motivo da reclamacao "tumultuado"). ---- */
.pie-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.pie-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.pie-card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-muted); margin-bottom: 10px; }
.pie-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pie-wrap svg { flex-shrink: 0; }
.pie-legend { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.pie-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; min-width: 0; }
.pie-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.pie-legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink-soft); }
.pie-legend-pct { font-family: 'Oswald', sans-serif; font-weight: 700; flex-shrink: 0; width: 42px; text-align: right; }
.pie-legend-val { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 11px; color: var(--ink-muted); flex-shrink: 0; min-width: 80px; text-align: right; }

.cat-foco-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.cat-foco-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.rcat-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }

.rcat-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.rcat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rcat-card { padding: 16px 14px; border: 1px solid var(--line); border-top: 3px solid var(--ink-muted); border-radius: 10px; background: var(--bg); }
.rcat-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rcat-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; }
.rcat-rank { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 10.5px; display: flex; align-items: center; justify-content: center; }
.rcat-body { min-width: 0; text-align: center; }
.rcat-nome { font-family: 'Oswald', sans-serif; font-size: 15.5px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; }
.rcat-meta {
  display: inline-block; font-size: 10.5px; color: var(--ink-muted); background: var(--bg-soft, #F4F3EE);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px;
}
.rcat-meta b { font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--ink); font-size: 11.5px; }
.rcat-val { font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.rcat-pct { font-size: 10.5px; font-weight: 700; margin-top: 7px; }
.rcat-card .track { height: 5px; background: #EEEDE7; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.rcat-card .fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.rcat-delta { font-size: 10px; color: var(--ink-muted); margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 7px; }

.rcat-donut-card { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 14px; text-align: center; }
.rcat-donut-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-muted); margin-bottom: 10px; }
.rcat-donut-card .pie-wrap { flex-direction: column; align-items: center; }
.rcat-donut-card .pie-legend { width: 100%; text-align: left; margin-top: 8px; }
.rcat-donut-total { margin-top: 10px; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 13px; border-top: 1px solid var(--line); padding-top: 10px; }

@media (max-width: 900px) {
  .rcat-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .rcat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Celular estreito (~360px ou menos): 2 colunas de card ficam apertadas
   demais com icone+rank+nome+valor+barra+delta+SKU todo mundo espremido --
   1 coluna so, cards mais largos e legiveis. */
@media (max-width: 400px) {
  .rcat-grid { grid-template-columns: 1fr; }
  .rcat-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cat-foco-head h3 { margin: 0; }
.mp-rows { display: flex; flex-direction: column; }
.mp-row { padding: 14px 0; }
.mp-row:first-child { padding-top: 0; }
.mp-row:last-child { padding-bottom: 0; }
.mp-row + .mp-row { border-top: 1px solid var(--line); }
.mp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.mp-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.mp-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.mp-pct { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.mp-val { font-family: 'Oswald', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 6px; overflow-wrap: break-word; }
.mp-val .mp-meta { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.mp-row .track { height: 8px; background: #EEEDE7; border-radius: 4px; overflow: hidden; }
.mp-row .fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.mp-delta { font-size: 11.5px; color: var(--ink-muted); margin-top: 6px; }

/* ---- Progresso desde a ultima atualizacao (topo da Visao Geral, pedido
   usuaria 2026-08-12) -- chips com o delta de cada metrica desde a
   reimportacao anterior, cor muda se subiu (verde) ou caiu (vermelho). ---- */
.progress-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.progress-card-head h3 { margin: 0; }
.progress-card-datas { font-size: 11.5px; color: var(--ink-muted); font-weight: 600; }
.progress-card-empty h3 { margin-bottom: 6px; }
.progress-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.progress-chip-nome { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; color: var(--ink-muted); margin-bottom: 4px; }
.progress-chip-delta { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; overflow-wrap: break-word; }
.progress-chip-pct { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ---- Historico dia a dia do progresso (clicavel no cabecalho do card) ---- */
.progress-card-clicavel .progress-card-head { cursor: pointer; }
.progress-card-toggle { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.progresso-diario-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.progresso-diario-loading { font-size: 12.5px; color: var(--ink-muted); font-weight: 600; padding: 6px 0; }
.pdd-list { display: flex; flex-direction: column; gap: 10px; }
.pdd-row { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.pdd-row-datas { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .2px; }
.pdd-selo-fechamento { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--arcor-accent, #c0392b); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .5px; vertical-align: middle; }
.pdd-row-metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pdd-metrica { display: flex; flex-direction: column; gap: 2px; }
.pdd-metrica-nome { font-size: 10.5px; color: var(--ink-muted); font-weight: 600; }
.pdd-metrica-delta { font-family: 'Oswald', sans-serif; font-size: 15px; font-weight: 700; }

/* ---- Line chart (tendencia diaria, SVG simples) ---- */
.linechart-wrap { width: 100%; overflow-x: auto; }
.linechart-legend { display: flex; gap: 16px; margin-bottom: 10px; font-size: 11.5px; }
.linechart-legend .item { display: flex; align-items: center; gap: 6px; }
.linechart-legend .sw { width: 14px; height: 3px; border-radius: 2px; }
.linechart-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.linechart-foot .k { font-size: 10px; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; letter-spacing: .3px; }
.linechart-foot .v { font-family: 'Oswald', sans-serif; font-size: 15px; font-weight: 700; margin-top: 2px; }

/* ---- Avatar (ranking de vendedores) ---- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
}
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-pos { width: 22px; font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--ink-muted); text-align: center; flex-shrink: 0; }
.rank-name { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { width: 130px; height: 7px; background: #EEEDE7; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.rank-fill { height: 100%; border-radius: 4px; }
.rank-val { width: 96px; text-align: right; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.rank-pct { width: 52px; text-align: right; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
/* linha vira link pro detalhe do vendedor (2026-08-11) quando tem codVend */
a.rank-row-link { text-decoration: none; color: inherit; cursor: pointer; border-radius: 8px; }
a.rank-row-link:hover { background: var(--bg); }


.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
/* grid items stretch to the tallest row by default (grid align-items:stretch) --
   .grid3-body centraliza o conteudo de cada card na altura sobrando abaixo do
   h3, pra ficar simetrico mesmo quando um card tem menos coisa que o vizinho
   mais alto (pedido do usuario 2026-08-11, "nao esta centralizado"). */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-3 > .card { display: flex; flex-direction: column; }
.grid3-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.grid3-body-top { justify-content: flex-start; }

/* ---- Toggle Arcor+Bagley/Arcor/Bagley do resumo do periodo (2026-08-11) --
   troca os numeros do anel + card de Faturamento + Metas do Periodo sem sair
   da tela (ver aplicarResumo em dashboard.js). Default "Arcor + Bagley" fica
   ativo/destacado, deixando explicito que o numero mostrado e a soma das
   duas marcas ate o usuario trocar. ---- */
.ind-toggle-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.ind-toggle { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.ind-toggle-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-family: inherit; white-space: nowrap; }
.ind-toggle-btn:hover:not(.active) { color: var(--ink); }
.ind-toggle-btn.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
@media (max-width: 640px) {
  .ind-toggle-row { justify-content: stretch; }
  .ind-toggle { width: 100%; }
  .ind-toggle-btn { flex: 1; }
}
/* Toggles de 4 opcoes (Faturamento/Positivacao/Caixas/Devolucao, usados em
   "Por Supervisor" e "Categorias Foco") ficam espremidos numa linha so em
   tela de celular -- quebra em 2x2 abaixo de 480px, cada botao com largura
   minima legivel em vez de forcar 4 numa linha so. */
@media (max-width: 480px) {
  .ind-toggle { flex-wrap: wrap; border-radius: 12px; }
  .ind-toggle-btn { flex: 1 1 calc(50% - 2px); min-width: 0; padding: 8px 6px; text-align: center; }
  .cat-foco-controls { width: 100%; }
  .cat-foco-controls .select-sort { width: 100%; }
}

.mdia-section-title {
  font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--ink-soft); margin: 22px 0 12px; padding-top: 14px; border-top: 1px solid var(--line);
}
.mdia-section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

/* ---- Categorias em foco dentro do card de vendedor (destaque, barra de progresso) ---- */
.catrow-list { display: flex; flex-direction: column; gap: 10px; }
.catrow { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.catrow-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.catrow-nome { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .2px; }
.catrow-meta { font-size: 10.5px; color: var(--ink-muted); font-weight: 600; margin-left: 8px; }
.catrow-pct { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.catrow .track { margin-top: 0; }
.catrow-nums { display: flex; gap: 16px; margin-top: 8px; font-size: 10.5px; color: var(--ink-soft); }
.catrow-nums b { font-family: 'Oswald', sans-serif; color: var(--ink); font-weight: 700; }

/* ---- Loader inicial (enquanto /api/dados carrega) ---- */
.app-loader {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; background: var(--bg);
  transition: opacity .25s ease;
}
.app-loader.hide { opacity: 0; pointer-events: none; }
.loader-spinner {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--ink); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 12.5px; color: var(--ink-muted); font-weight: 600; letter-spacing: .2px; }

/* ---- Micro-interacoes: profundidade e feedback ao passar o mouse ---- */
.card, .stat-tile, .menu-card {
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow .18s ease, transform .18s ease, border-color .15s ease;
}
.card:hover, .stat-tile:hover {
  box-shadow: 0 10px 26px rgba(0,0,0,.07);
  transform: translateY(-1px);
}
.dtable tbody tr, .simtable tbody tr, .rank-row, .srow-top {
  transition: background-color .12s ease;
}
.dtable tbody tr:hover { background: var(--bg); }
.dtable tr.status-good:hover, .dtable tr.status-warning:hover, .dtable tr.status-critical:hover { filter: brightness(0.98); }
.rank-row:hover { background: var(--bg); border-radius: 8px; }

/* ---- Selo de valor estimado (meta em caixas cascateada, nao oficial) ---- */
.est-tag {
  display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border-radius: 50%; background: var(--ink-muted); color: #fff; font-size: 9.5px; font-weight: 700;
  margin-left: 4px; cursor: help; flex-shrink: 0; font-family: 'Inter', sans-serif;
}

/* ---- Perguntas rapidas (chat) ---- */
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.chat-chip {
  font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--bg);
  border: 1px solid var(--line); border-radius: 20px; padding: 7px 13px; cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}
.chat-chip:hover { border-color: var(--ink); color: var(--ink); }
.chat-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; color: #fff; flex-shrink: 0;
  background: var(--ink); margin-top: 2px;
}
.chat-msg { gap: 8px; align-items: flex-start; }
.chat-user .chat-avatar { background: var(--arcor-accent); order: 2; }

/* ---- Ring: anima do zero ate o valor real no primeiro paint ---- */
.ring-arc { transition: stroke-dashoffset .9s cubic-bezier(.16,.84,.44,1); }

@media (prefers-reduced-motion: reduce) {
  .ring-arc, .card, .stat-tile, .app-loader { transition: none !important; animation: none !important; }
}

/* ---- Formulario (usuarios.html) ---- */
.form-row { margin-bottom: 16px; max-width: 420px; }
.form-row label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; }
.form-row input[type="text"], .form-row select {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 13.5px; background: var(--panel); color: var(--ink);
}
.form-row input[type="text"]:focus, .form-row select:focus { outline: none; border-color: var(--ink); }
.check-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.check-row label { display: flex; align-items: center; gap: 7px; text-transform: none; font-size: 13px; font-weight: 600; color: var(--ink); margin: 0; }

.sup-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; max-width: 700px; }
.sup-picker-group { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.sup-picker-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; color: var(--ink-muted); margin-bottom: 6px; }
.sup-picker-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 3px 0; text-transform: none; margin: 0; }

/* ---- Linha clicavel (tabela de Supervisores -> drill-down) ---- */
.dtable tr.linha-clicavel { cursor: pointer; }
.dtable tr.linha-clicavel:hover td { background: var(--bg); }

/* ---- Pergunte Aqui (chat com IA) ---- */
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; }
.chat-mensagens { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.chat-msg { display: flex; }
.chat-user { justify-content: flex-end; }
.chat-assistant { justify-content: flex-start; }
.chat-bolha {
  max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.chat-user .chat-bolha { background: var(--ink); color: #fff; border-bottom-right-radius: 3px; }
.chat-assistant .chat-bolha { background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.chat-bolha.chat-carregando { color: var(--ink-muted); font-style: italic; }
.chat-form { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 13.5px; background: var(--panel); color: var(--ink);
}
.chat-form input:focus { outline: none; border-color: var(--ink); }
.chat-form button {
  padding: 10px 20px; background: var(--ink); color: #fff; border: none; border-radius: 8px;
  font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  font-size: 12.5px; cursor: pointer; flex-shrink: 0;
}
.chat-form button:hover { opacity: .88; }

/* =====================================================================
   Visao Geral reorganizada (2026-08-06) -- 4 blocos coloridos (Faturamento/
   Positivacao/Caixas/Devolucao), mesmo layout de tabela em todos, e tabela
   "por supervisor" ampliada com devolucao escondida por padrao.
   ===================================================================== */
.visao-row { border-left: 4px solid var(--row-color, var(--line)); }
.visao-row--faturamento { --row-color: var(--metric-faturamento); }
.visao-row--positivacao { --row-color: var(--metric-positivacao); }
.visao-row--caixas { --row-color: var(--metric-caixas); }
.visao-row--devolucao { --row-color: var(--metric-devolucao); }
.visao-row .dtable td .sw, .visao-row .dtable th .sw { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.dtable thead .thgroup { text-align: center; border-bottom: 2px solid var(--line); }
.dtable thead .thgroup-fat { color: var(--metric-faturamento); border-bottom-color: var(--metric-faturamento); }
.dtable thead .thgroup-pos { color: var(--metric-positivacao); border-bottom-color: var(--metric-positivacao); }
.dtable thead .thgroup-cx { color: var(--metric-caixas); border-bottom-color: var(--metric-caixas); }

.dtable td.nome-toggle { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.dtable td.nome-toggle:hover { color: var(--metric-devolucao); }
.dtable tr.linha-devolucao { display: none; }
.dtable tr.linha-devolucao.aberta { display: table-row; }
.dtable tr.linha-devolucao td { background: var(--critical-bg); border-bottom: 2px solid var(--line); text-align: left; white-space: normal; padding: 8px 10px; }
.dtable tr.linha-devolucao .dev-item { display: inline-block; margin-right: 22px; font-size: 12px; color: var(--ink-soft); }
.dtable tr.linha-devolucao .dev-item b { font-family: 'Oswald', sans-serif; color: var(--ink); }
.dtable tr.linha-devolucao .sw { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }

/* =====================================================================
   App shell com sidebar (2026-08-06, redesign guiado por print do usuario)
   -- substitui o .topbar simples de cima SO em dashboard.html. usuarios.html
   continua no shell antigo (.wrap/.topbar/.titles), nao mexido aqui.
   ===================================================================== */
.app-shell { display: flex; min-height: 100vh; align-items: flex-start; }
.app-sidebar {
  width: 220px; flex-shrink: 0; min-height: 100vh; background: var(--sidebar-bg);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.sidebar-brand-icon { font-size: 24px; line-height: 1; }
.sidebar-brand-title { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .3px; color: var(--sidebar-ink); }
.sidebar-brand-sub { font-size: 10.5px; color: var(--sidebar-ink-muted); font-weight: 700; letter-spacing: .3px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--sidebar-ink-muted); text-decoration: none; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--sidebar-bg-soft); color: var(--sidebar-ink); }
.nav-item.active { background: var(--arcor-accent); color: #fff; }
.nav-item .nav-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 10px; background: rgba(255,255,255,.08); color: var(--sidebar-ink-muted);
}
.nav-item.active .nav-ico { background: rgba(255,255,255,.22); color: #fff; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: var(--warning-bg); color: var(--warning); padding: 2px 7px; border-radius: 20px;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }
.nav-item-menu-inicial { margin-bottom: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--sidebar-bg-soft); }

/* ---- Sublista de supervisores embutida no item "Supervisores" da lateral
   (2026-08-11, ajustada a pedido do usuario -- era popup branco no hover,
   virou acordeao: seta clicavel abre/fecha, mesmo fundo escuro da lateral,
   sem popup flutuante). Clicar no resto do item continua navegando normal
   pra pagina Supervisores (link nao muda). ---- */
.nav-item-wrap .nav-item { position: relative; }
.nav-chev {
  margin-left: auto; font-size: 10px; color: var(--sidebar-ink-muted); flex-shrink: 0;
  padding: 6px; margin-right: -6px; transition: transform .15s ease;
}
.nav-item.active .nav-chev { color: rgba(255,255,255,.8); }
.nav-item-wrap.open .nav-chev { transform: rotate(180deg); }
.nav-sublist { display: none; flex-direction: column; gap: 1px; padding: 3px 0 6px 34px; }
.nav-item-wrap.open .nav-sublist { display: flex; }
.nav-sub-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px;
  color: var(--sidebar-ink-muted); text-decoration: none; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.nav-sub-item:hover { background: var(--sidebar-bg-soft); color: var(--sidebar-ink); }
.nav-sub-item.active { background: var(--sidebar-bg-soft); color: var(--sidebar-ink); font-weight: 700; }
.nav-sub-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.sf-label { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; color: var(--sidebar-ink-muted); font-weight: 700; }
.sf-val { font-size: 12px; color: var(--sidebar-ink); font-weight: 600; margin-top: 2px; line-height: 1.4; }

.app-main { flex: 1; min-width: 0; padding: 18px 24px 60px; }
.app-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 21px; margin: 0;
  letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink);
}
.topbar-title h1.greeting { text-transform: none; font-size: 23px; }
.topbar-title .sub { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; margin-top: 2px; }

.date-pill {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.topbar-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.topbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.tdrop { position: relative; }
.tdrop-trigger, .user-trigger, .bell-btn {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 700;
  color: var(--ink); cursor: pointer;
}
.tdrop-trigger:hover, .user-trigger:hover, .bell-btn:hover { border-color: var(--ink); }
.bell-btn { padding: 8px 11px; font-size: 15px; }
.tdrop-chev { font-size: 9px; color: var(--ink-muted); }
.tdrop-ico { font-size: 13px; }
.tdrop-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; z-index: 40;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 26px rgba(0,0,0,.1);
}
.tdrop-menu-right { left: auto; right: 0; }
.tdrop.open .tdrop-menu { display: block; }
.tdrop-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.tdrop-item:hover { background: var(--bg); color: var(--ink); }
.tdrop-item.active { background: var(--bg); color: var(--ink); font-weight: 700; }
.tdrop-item .tag { font-size: 10px; color: var(--ink-muted); font-weight: 600; }
.tdrop-empty { padding: 10px; font-size: 12px; color: var(--ink-muted); }
.user-trigger-text { text-align: left; line-height: 1.3; }
.user-trigger-text span:last-child { font-size: 10px; color: var(--ink-muted); font-weight: 600; }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: flex;
  align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; flex-shrink: 0;
}

@media (max-width: 900px) {
  .app-sidebar { width: 66px; padding: 14px 8px; }
  .sidebar-brand { justify-content: center; padding: 4px 0 16px; }
  .sidebar-brand-title, .sidebar-brand-sub { display: none; }
  .nav-item span:not(.nav-ico) { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .nav-badge { display: none; }
  .sidebar-foot { display: none; }
  .app-main { padding: 16px 14px 60px; }
  .user-trigger-text { display: none; }
}

/* ---- KPI card (redesign 2026-08-07) -- icone em circulo colorido (tint da
   cor da metrica) + sparkline decorativa no topo, colunas Arcor/Bagley e
   rodape de %. min-width:0 no card e minmax(0,1fr) na grid evitam o mesmo bug
   de overflow horizontal ja corrigido nos mkpi-card da Meta Diaria. ---- */
.kpi-row-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi-card-top { display: flex; align-items: center; gap: 11px; padding: 16px 16px 2px; }
.kpi-icon-circle {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.kpi-card-title { min-width: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase; flex: 1; }
.kpi-spark { flex-shrink: 0; opacity: .85; }
.kpi-spark-svg { display: block; }
.kpi-card-body { display: flex; gap: 14px; padding: 14px 16px 8px; flex-wrap: wrap; }
.kpi-col { flex: 1; min-width: 128px; }
.kpi-col-label { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: .3px; margin-bottom: 6px; }
.kpi-col-meta {
  display: inline-block; font-size: 11px; color: var(--ink-muted); background: var(--bg-soft, #F4F3EE);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; margin-bottom: 9px;
}
.kpi-col-meta b { font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--ink); font-size: 12px; }
.kpi-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 11.5px; }
.kpi-row .k { color: var(--ink-muted); font-weight: 600; }
.kpi-row .v { font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--ink); white-space: nowrap; }
.kpi-row.kpi-row-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; }
.kpi-row.kpi-row-total .v { font-size: 13px; }
.kpi-card-foot { display: flex; gap: 10px; padding: 10px 16px 16px; flex-wrap: wrap; }
.kpi-pct-badge {
  flex: 1; min-width: 90px; text-align: center; border-radius: 9px; padding: 9px 8px; color: #fff;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 15px;
}
.kpi-pct-badge small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; opacity: .85; margin-top: 1px; }

/* ---- Board de supervisores colapsavel (Visao Geral, reaproveita
   .srow/.metric-group/.metric-cols ja existentes no arquivo). ---- */
.board-group-title {
  font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--ink-muted); margin: 16px 2px 8px;
}
.board-group-title:first-child { margin-top: 2px; }
.srow .pct-badge { margin-right: 4px; }

/* =====================================================================
   Meta Diaria / Categorias por supervisor (redesign 2026-08-07) -- pedido
   do usuario: menos tabela densa, cada numero aparece uma unica vez, cards
   com barra de progresso + hierarquia clara (Meta/dia util em destaque).
   ===================================================================== */
.mdia-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.mdia-dias-badge {
  margin-left: auto; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .3px;
  background: var(--bg); border: 1.5px solid var(--line); color: var(--ink-soft); padding: 7px 14px; border-radius: 20px;
}
.mdia-dias-badge b { color: var(--ink); }

/* min-width:0 nos itens de grid abaixo e minmax(0,1fr) nas colunas internas
   sao de proposito: sem isso, numeros grandes (ex: "R$ 298.746,00") tem
   min-width:auto por padrao e recusam encolher, empurrando o card (e a grid
   inteira, e a pagina) mais largo que a viewport -- bug real visto 07/08
   (cards cortados, sidebar sumindo por scroll horizontal). */
.mkpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 14px 0 4px; }
.mkpi-card {
  min-width: 0; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--card-color, var(--ink-muted));
  border-radius: var(--radius); padding: 14px 16px 16px;
}
.mkpi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mkpi-icon {
  width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--card-color, var(--ink-muted)) 16%, white);
  color: var(--card-color, var(--ink-muted)); display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.mkpi-label { min-width: 0; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; flex: 1; }
.mkpi-pct { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.mkpi-track { height: 7px; background: #EEEDE7; border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.mkpi-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
/* 2x2 (nao 4-em-linha) de proposito: um card de 250px so da ~50px por coluna
   em 4 colunas, insuficiente pra "R$ 298.746,00" sem quebrar o numero no meio
   -- 2 colunas da o dobro de espaco por celula. */
.mkpi-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; row-gap: 10px; }
.mkpi-nums .k { font-size: 9px; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; letter-spacing: .2px; }
.mkpi-nums .v { font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; margin-top: 2px; color: var(--ink); overflow-wrap: break-word; }
.mkpi-nums .falta .v { color: var(--critical); }
.mkpi-nums .destaque .v { color: var(--card-color, var(--ink)); }

/* ---- Meta Diaria: hero de "hoje/ritmo" -- redesign 2026-08-08 (referencia
   visual do usuario). Sem venda diaria por supervisor/vendedor na base, os
   blocos usam o dado real que existe: necessidade/dia pro RESTO do mes (nao
   "hoje" de verdade) -- ver feedback-diario-api-tcv-mobile-grid-overflow.md
   pra nao repetir o bug de grid sem minmax(0,1fr) aqui tambem. ---- */
.mdia-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.mdia-hero-block { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.mdia-hero-block.destaque { background: color-mix(in srgb, var(--metric-faturamento) 7%, white); border-color: var(--metric-faturamento); }
.mh-label { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; color: var(--ink-muted); }
.mh-sub { font-size: 10.5px; color: var(--ink-muted); margin-top: 1px; }
.mh-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 24px; margin-top: 8px; overflow-wrap: break-word; }
.mh-num.critical { color: var(--critical); }
.mh-foot { font-size: 11px; color: var(--ink-muted); margin-top: 8px; }
.mh-status { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 16px; margin-top: 8px; text-transform: uppercase; letter-spacing: .2px; }
.mh-status.good { color: var(--good); }
.mh-status.warning { color: var(--warning); }
.mh-status.critical { color: var(--critical); }

/* Selo de status (cabecalho do supervisor + coluna Situacao da tabela) */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-family: 'Oswald', sans-serif; font-weight: 700;
  font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase; padding: 6px 13px; border-radius: 20px; white-space: nowrap;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill.good { background: var(--good-bg); color: var(--good); }
.status-pill.warning { background: var(--warning-bg); color: var(--warning); }
.status-pill.critical { background: var(--critical-bg); color: var(--critical); }

/* Caixa de insight (rodape da Meta Diaria) -- mesma ideia do .note-box, so
   que a cor muda com o status em vez de ser sempre amarela. */
.insight-box { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); padding: 14px 16px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin-top: 6px; }
.insight-box .ico { font-size: 16px; flex-shrink: 0; }
.insight-box b { color: var(--ink); }
.insight-box.good { background: var(--good-bg); }
.insight-box.warning { background: var(--warning-bg); }
.insight-box.critical { background: var(--critical-bg); }

/* Card de indicador simplificado (fracao Realizado/Meta + % + barra, sem a
   grade de 4 numeros do mkpiCard antigo) -- reusa .mkpi-card/.mkpi-head/
   .mkpi-track ja existentes, so troca o corpo. */
.mkpi-frac { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 21px; margin: 6px 0 2px; overflow-wrap: break-word; }
.mkpi-frac small { font-size: 12.5px; font-weight: 500; color: var(--ink-muted); }
.mkpi-realizado-pct { font-size: 11.5px; font-weight: 700; margin-bottom: 10px; }
.mkpi-necdia { font-size: 11.5px; color: var(--ink-soft); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.mkpi-necdia b { color: var(--ink); font-family: 'Oswald', sans-serif; }

/* Dropdown simples de ordenacao (tabela de vendedores) */
.select-sort {
  padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--panel);
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.select-sort:focus { outline: none; border-color: var(--ink); }

/* ---- Cabecalho de categoria (pagina Categorias, redesign 2026-08-08) ---- */
.cat-head-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.cat-head-num { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 32px; }
.cat-head-num small { font-size: 15px; font-weight: 500; color: var(--ink-muted); }
.cat-head-nome { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; color: var(--ink-muted); margin: 3px 0 9px; }
.cat-head-pct { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 28px; flex-shrink: 0; }
.cat-head-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.cat-head-stats > div { text-align: center; }
.cat-head-stats b { display: block; font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 700; }
.cat-head-stats span { font-size: 9.5px; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; letter-spacing: .2px; }
.cat-head-row .btn-export { flex-shrink: 0; }
@media (max-width: 900px) { .cat-head-stats { margin-left: 0; } }

/* =====================================================================
   Camada "aplicativo" no celular + botao Compartilhar imagem (2026-08-27)
   ===================================================================== */

/* --- Botao compartilhar (topbar, todas as larguras) --- */
.cmp-btn {
  display: flex; align-items: center; gap: 7px; background: var(--ink); border: 1.5px solid var(--ink);
  border-radius: 10px; padding: 8px 12px; font-family: 'Inter', sans-serif; font-size: 12.5px;
  font-weight: 700; color: #fff; cursor: pointer; white-space: nowrap;
}
.cmp-btn:disabled { opacity: .7; cursor: default; }
.cmp-ico { font-size: 14px; line-height: 1; }
.cmp-spin {
  width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; display: inline-block; animation: cmpspin .7s linear infinite;
}
@keyframes cmpspin { to { transform: rotate(360deg); } }

/* --- Capa que entra so no momento da captura --- */
.cmp-capa { display: none; }
body.capturando .cmp-capa {
  display: block; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--arcor-accent);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 16px;
}
.cmp-capa-top { display: flex; align-items: center; gap: 10px; }
.cmp-capa-logo { font-size: 22px; }
.cmp-capa-top b { font-family: 'Oswald', sans-serif; font-size: 15px; text-transform: uppercase; letter-spacing: .3px; display: block; }
.cmp-capa-top span { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.cmp-capa-tit { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; margin-top: 10px; }
.cmp-capa-pe { font-size: 11px; color: var(--ink-muted); font-weight: 600; margin-top: 3px; }

body.capturando .no-print,
body.capturando .app-sidebar,
body.capturando .mnav,
body.capturando .mmais,
body.capturando .backlink,
body.capturando .simtable-wrap,
body.capturando .hscroll-top { display: none !important; }
body.capturando .app-main { padding: 20px !important; }
body.capturando .app-shell { display: block; }
body.capturando .app-topbar { position: static !important; margin: 0 !important; }

/* --- Nav mobile: escondida por padrao, so aparece no media query --- */
.mnav, .mmais { display: none; }

@media (max-width: 760px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .app-shell { display: block; max-width: 100%; overflow-x: hidden; }
  .app-sidebar { display: none; }
  .app-main { padding: 12px 12px calc(74px + env(safe-area-inset-bottom, 0px)); min-width: 0; max-width: 100%; }

  .app-topbar {
    position: sticky; top: 0; z-index: 30; background: var(--bg);
    margin: 0 0 14px; padding: 4px 0 12px; gap: 8px 10px;
    border-bottom: 1px solid var(--line);
  }
  body.industria-arcor .app-topbar { background: var(--arcor-tint); }
  body.industria-bagley .app-topbar { background: var(--bagley-tint); }
  .topbar-title { gap: 9px; min-width: 0; flex: 1 1 100%; }
  .topbar-icon { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title h1.greeting { font-size: 18px; }
  .topbar-title .sub { font-size: 11px; }
  .topbar-controls { gap: 7px; width: 100%; flex-wrap: wrap; }
  .topbar-controls > .tdrop { flex: 1 1 auto; min-width: 0; }
  .topbar-controls .tdrop-trigger,
  .topbar-controls .user-trigger { width: 100%; justify-content: center; }
  .topbar-controls .tdrop-trigger,
  .topbar-controls .user-trigger,
  .topbar-controls .cmp-btn { padding: 8px 10px; font-size: 12px; }
  #datePill, #bellDrop { display: none; }
  .user-trigger-text { display: none; }
  #userDrop { flex: 0 0 auto; }
  .tdrop-menu { min-width: 150px; max-width: calc(100vw - 24px); z-index: 80; }
  .tdrop-menu-right { left: auto; right: 0; }
  .cmp-btn { flex: 1 1 100%; justify-content: center; order: -1; }

  /* grids em 1 coluna */
  .kpi-row-cards,
  .kpi-card-grid,
  .grid-3,
  .stat-row,
  .forn-split,
  .ring-wrap { grid-template-columns: minmax(0,1fr) !important; }
  .stat-row, .forn-split, .ring-wrap { display: grid; }
  .card { padding: 14px; }

  /* KPI card: colunas Arcor/Bagley empilham no celular (senao a metade Bagley
     fica cortada fora da tela) */
  .kpi-card-body { flex-direction: column; gap: 4px; padding: 12px 14px 6px; }
  .kpi-col { width: 100%; min-width: 0; }
  .kpi-col + .kpi-col { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
  .kpi-card-foot { padding: 8px 14px 14px; }
  .kpi-card-top { padding: 14px 14px 2px; }

  /* toggle Arcor+Bagley / 4-opcoes: sempre 2x2, nunca 1 linha que estoura */
  .ind-toggle { flex-wrap: wrap; width: 100%; border-radius: 12px; }
  .ind-toggle-btn { flex: 1 1 calc(50% - 2px); min-width: 0; padding: 8px 6px; text-align: center; }
  .ind-toggle-row { justify-content: stretch; }

  /* controles de tela (selects/busca) ocupam a largura toda */
  .cat-foco-controls, .cat-foco-controls .select-sort,
  .search-row, .search-box, .select-sort,
  .export-row { width: 100%; }
  .search-row { flex-direction: column; align-items: stretch; }
  .export-row { justify-content: stretch; flex-wrap: wrap; }
  .export-row .btn-export { flex: 1; }

  /* cabecalho de categoria: numero grande nao empurra o resto */
  .cat-head-num { font-size: 26px; }
  .cat-head-pct { font-size: 22px; }
}

/* --- Barra de abas fixa embaixo --- */
@media (max-width: 760px) {
  .mnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--sidebar-bg); padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 18px rgba(0,0,0,.18);
  }
  .mnav-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 7px 1px 6px; background: none; border: 0; cursor: pointer;
    color: var(--sidebar-ink-muted); text-decoration: none; font-family: 'Inter', sans-serif;
  }
  .mnav-ico {
    width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 9px;
    background: rgba(255,255,255,.09); color: var(--sidebar-ink-muted);
  }
  .mnav-lbl {
    font-size: 9px; font-weight: 700; letter-spacing: .1px; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mnav-item.active { color: #fff; }
  .mnav-item.active .mnav-ico { background: var(--arcor-accent); color: #fff; }

  /* folha "Mais" */
  .mmais { display: block; position: fixed; inset: 0; z-index: 70; pointer-events: none; }
  .mmais.open { pointer-events: auto; }
  .mmais-bg {
    position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s ease;
  }
  .mmais.open .mmais-bg { opacity: 1; }
  .mmais-card {
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--panel);
    border-radius: 18px 18px 0 0; padding: 10px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%); transition: transform .24s ease;
    max-height: 80vh; overflow-y: auto;
  }
  .mmais.open .mmais-card { transform: translateY(0); }
  .mmais-grab { width: 40px; height: 4px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
  .mmais-list { display: flex; flex-direction: column; gap: 2px; }
  .mmais-item {
    display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-radius: 10px;
    color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 600;
  }
  .mmais-item.active { background: var(--bg); color: var(--ink); font-weight: 700; }
  .mmais-ico {
    width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 10px; background: var(--bg); color: var(--ink-muted);
  }
  .mmais-sair { color: var(--critical); }
}

/* build: 1787773568 */
