/* Ankura Report — direção visual v3 (docs/painel-relatorio/direcao-visual.md).
   Cabinet Grotesk nos números e títulos (a personalidade), Switzer nos textos (a calma). */
:root {
  --ink: #0c1b33;
  --ink-2: #45546e;
  --ink-3: #66748c;
  --bg: #eef0f4;
  --surface: #ffffff;
  --line: #d9dee7;
  --line-2: #e7eaf0;
  --track: #eef0f4;

  --blue: #0055ff;
  --meta: #0055ff;
  --google: #e37400;
  --part-2: #a3aec0;
  --up: #0f8a5f;
  --down: #c4320a;

  --r-panel: 12px;
  --r-inner: 8px;
  --r-small: 6px;
  --rail-w: 232px;
  --pad-x: 48px;

  --font-text: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cabinet Grotesk", "Switzer", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
button, select { font: inherit; color: inherit; }
a { color: inherit; }
[data-lucide], svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: none; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- Números (o elemento marcante) ---------- */
.fig {
  display: inline-flex; align-items: baseline; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; line-height: 1; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums lining-nums;
}
.fig .cur { font-family: var(--font-text); font-size: 0.38em; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-right: 0.22em; }
.fig--xl { font-size: 60px; }
.fig--m { font-size: 36px; }
.fig--s { font-size: 22px; letter-spacing: -0.02em; }
.fig--s .cur { font-size: 0.55em; }

/* ---------- Logos de marca ---------- */
.brand { width: 16px; height: 16px; display: inline-block; flex: none; background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.brand--meta { --src: url("https://cdn.jsdelivr.net/npm/simple-icons@13.21.0/icons/meta.svg"); color: #0866ff; }
.brand--whatsapp { --src: url("https://cdn.jsdelivr.net/npm/simple-icons@13.21.0/icons/whatsapp.svg"); color: #1da851; }
.brand--instagram { --src: url("https://cdn.jsdelivr.net/npm/simple-icons@13.21.0/icons/instagram.svg"); color: #e1306c; }
.brand--youtube { --src: url("https://cdn.jsdelivr.net/npm/simple-icons@13.21.0/icons/youtube.svg"); color: #ff0000; }
.logo-gads { width: 16px; height: 16px; flex: none; display: inline-block; }

/* ---------- Estrutura ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 20;
  display: flex; flex-direction: column; padding: 28px 20px 24px;
  background: var(--ink); color: #fff;
}
.rail__client img { width: 100%; max-width: 168px; height: auto; }
.rail__nav { display: flex; flex-direction: column; gap: 2px; margin-top: 44px; }
.nav {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 -12px;
  color: #a7b2c6; text-decoration: none; font-size: 15px; font-weight: 500; border-radius: var(--r-small);
}
.nav:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.nav[aria-current="page"] { color: #fff; font-weight: 600; }
.nav[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--blue); }
.nav-glyph, .tab-glyph { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.nav-glyph .brand, .tab-glyph .brand { width: 18px; height: 18px; }
.nav-glyph .brand--meta { color: #2d7dff; }
.nav-glyph .logo-gads, .tab-glyph .logo-gads { width: 18px; height: 18px; }
.rail__by { margin-top: auto; display: flex; flex-direction: column; gap: 8px; color: #7f8ba1; font-size: 12px; }
.rail__by img { height: 18px; width: auto; align-self: flex-start; }

.main { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }
.head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 40px var(--pad-x) 28px;
}
.head__logo { display: none; }
.head__title { min-width: 0; }
.head__title h1 { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.head__range { margin-top: 8px; display: flex; flex-direction: column; gap: 1px; }
.head__current { font-size: 17px; font-weight: 600; color: var(--ink); }
.head__compare { font-size: 14px; color: var(--ink-2); }
.head__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.head__through { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.head__through svg { width: 13px; height: 13px; color: var(--up); }

.period { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-inner); }
.period button {
  border: 0; background: none; border-radius: var(--r-small); padding: 8px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.period button:hover { color: var(--ink); }
.period button[aria-selected="true"] { background: var(--ink); color: #fff; }
.period button:disabled { color: #b8c0cc; cursor: not-allowed; }

.view { padding: 0 var(--pad-x) 40px; display: flex; flex-direction: column; gap: 24px; outline: none; }
body.is-loading .view { opacity: 0.55; }
.foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px var(--pad-x) 40px; color: var(--ink-2); font-size: 13px;
}
.foot img { height: 16px; width: auto; }
.tabbar { display: none; }

/* ---------- Painéis ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 28px 32px 32px; min-width: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.panel__title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.panel__title .brand, .panel__title .logo-gads { width: 18px; height: 18px; }
.panel__link { font-size: 14px; font-weight: 600; color: var(--blue); text-decoration: none; }
.panel__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.panel__spend { display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.panel__spend-label { font-size: 12px; color: var(--ink-2); }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid--main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }

/* Abas sublinhadas */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  border: 0; background: none; padding: 0 0 10px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  font-size: 15px; font-weight: 500; color: var(--ink-2);
}
.tabs__item:hover { color: var(--ink); }
.tabs__item[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--blue); }
.panel__head .tabs { border-bottom: 0; }
.tabs--stores { gap: 32px; }
.tabs--stores .tabs__item { font-size: 18px; padding-bottom: 12px; }

/* Informação (tooltip) */
.info { border: 0; background: none; padding: 2px; margin: -2px 0; color: var(--ink-3); cursor: help; display: inline-grid; place-items: center; border-radius: 50%; }
.info:hover { color: var(--ink); }
.info svg { width: 15px; height: 15px; }
.tooltip {
  position: fixed; z-index: 60; max-width: 264px; background: var(--ink); color: #fff; white-space: pre-line;
  font-size: 13px; line-height: 1.45; padding: 9px 12px; border-radius: var(--r-inner); pointer-events: none;
}

/* Variação: texto com seta, sem fundo */
.delta { font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta--good { color: var(--up); }
.delta--bad { color: var(--down); }
.delta--flat { color: var(--ink-2); }
.delta__vs { font-weight: 400; color: var(--ink-3); }
.delta[data-tip] { cursor: help; border-radius: 4px; }

/* ---------- Faixa-placar ---------- */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.board__lead {
  display: grid; grid-template-columns: auto minmax(300px, 540px); justify-content: space-between; align-items: end; gap: 24px 56px;
  padding: 30px 32px 30px;
}
.board__spend { display: flex; flex-direction: column; gap: 12px; }
.board__spend .fig { margin: 2px 0 2px -2px; }
.board__cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.board__cells--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board__cells--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cell { padding: 22px 32px 26px; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 12px; align-items: start; min-width: 0; }
.cell .fig { align-self: end; }
.cell + .cell { border-left: 1px solid var(--line); }
.cell__label { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.cell__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 20px; }
.cell__sub { font-size: 14px; color: var(--ink-2); }
.cell__note { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* Barra dividida (partes de um todo) */
.split { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.split__bar { display: flex; gap: 2px; height: 10px; }
.split__bar i { display: block; height: 100%; border-radius: 3px; min-width: 3px; }
.split__legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.split__item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.split__key { width: 8px; height: 8px; border-radius: 2px; }
.split__name { color: var(--ink-2); }
.split__item b { font-weight: 700; }
.split__pct { color: var(--ink-3); }

/* ---------- Gráfico diário ---------- */
.chart { width: 100%; height: 260px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line-2); stroke-width: 1; }
.chart .baseline { stroke: #c4ccd8; stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 12px; font-family: inherit; }
.chart .hit { cursor: pointer; }
.chart .value-label { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.chart .bar, .chart .value-label { transition: opacity 0.25s ease; }
@media (hover: hover) and (pointer: fine) {
  .chart--bars:has(.col:hover) .col .bar, .chart--bars:has(.col:hover) .col .value-label { opacity: 0.32; }
  .chart--bars:has(.col:hover) .col:hover .bar, .chart--bars:has(.col:hover) .col:hover .value-label { opacity: 1; }
}
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill-opacity: 0.08; }
.chart .dot, .chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart .guide { stroke: var(--ink-3); stroke-width: 1; opacity: 0; transition: opacity 0.2s ease; }
.chart .hover-dot { opacity: 0; transition: opacity 0.2s ease; }
.chart .col:hover .guide { opacity: 0.45; }
.chart .col:hover .hover-dot { opacity: 1; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin: -4px 0 16px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }

/* ---------- Lojas na visão geral ---------- */
.srows { display: flex; flex-direction: column; }
.srow {
  display: grid; grid-template-columns: minmax(96px, 1fr) minmax(110px, 1.2fr) repeat(4, minmax(max-content, 0.7fr));
  align-items: center; gap: 16px 24px; padding: 15px 0; border-top: 1px solid var(--line-2); text-decoration: none;
}
.srow--head { border-top: 0; padding: 0 0 10px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.srow--head span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.srow--head span:nth-child(n+3) { justify-content: flex-end; text-align: right; }
.srow--head .brand, .srow--head .logo-gads { width: 13px; height: 13px; }
a.srow:hover .srow__name { color: var(--blue); }
.srow__name { font-weight: 600; font-size: 16px; }
.srow__spend { display: flex; flex-direction: column; gap: 6px; }
.srow__spend b { font-weight: 700; font-variant-numeric: tabular-nums; }
.srow__bar { display: block; height: 4px; border-radius: 2px; background: var(--track); max-width: 140px; }
.srow__bar i { display: block; height: 100%; border-radius: 2px; background: var(--ink); }
.srow__m { text-align: right; font-variant-numeric: tabular-nums; }
.srow__m b { font-weight: 600; font-size: 16px; }
.srow__k { display: none; }

/* Alcance */
.reaches { display: flex; flex-direction: column; }
.reach { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-top: 1px solid var(--line-2); }
.reach:first-child { border-top: 0; padding-top: 4px; }
.reach > .brand { width: 22px; height: 22px; margin-top: 1px; }
.reach__text { display: flex; flex-direction: column; gap: 10px; }
.reach__row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.reach .fig--m { font-size: 30px; }
.reach__facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 2px; }
.reach__facts dt { font-size: 12px; color: var(--ink-3); }
.reach__facts dd { margin: 0; font-size: 14px; color: var(--ink-2); }
.reach__facts dd b { font-weight: 600; color: var(--ink); margin-right: 4px; }
.reach__facts .cell__note { display: block; }

/* ---------- Frentes (por objetivo) ---------- */
.fronts { display: flex; flex-direction: column; gap: 16px; }
.panel--fronts .fronts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1040px) { .panel--fronts .fronts { grid-template-columns: minmax(0, 1fr); } }
/* Cada frente numa moldura: faixa de cabeçalho (nome e investido) ligada ao conteúdo */
.front { border: 1px solid var(--line); border-radius: var(--r-inner); overflow: hidden; }
.front__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #f6f7fa; border-bottom: 1px solid var(--line-2); }
.front__name { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.005em; }
.front__name .brand, .front__name .logo-gads { width: 18px; height: 18px; }
.front__spend { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.front__spend-label { font-size: 12px; color: var(--ink-2); }
.front__spend b { font-family: var(--font-display); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.front__body { padding: 16px; }
.front__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; }
.fstat { display: flex; flex-direction: column; gap: 6px; }
.fstat__label { font-size: 13px; color: var(--ink-2); }
.fstat__row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fstat__cost { font-size: 13px; color: var(--ink-2); }
.bonus { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.bonus__label { font-weight: 600; color: var(--ink); }
/* Caminho da pesquisa */
.bonus { margin-top: 14px; }

/* Funil: faixas centralizadas que se estreitam, com a conversão entre elas */
.funnel { display: flex; flex-direction: column; align-items: center; }
.funnel__stage {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0;
  padding: 10px 14px; border-radius: var(--r-inner); background: var(--stage);
  width: calc(100% - var(--step, 0) * 13%);
}
.funnel--meta .funnel__stage--0 { --stage: #edf3ff; }
.funnel--meta .funnel__stage--1 { --stage: #dce7ff; }
.funnel--meta .funnel__stage--2 { --stage: #c5d7ff; }
.funnel--google .funnel__stage--0 { --stage: #fdf1e2; }
.funnel--google .funnel__stage--1 { --stage: #fbe3c4; }
.funnel--google .funnel__stage--2 { --stage: #f7d1a1; }
.funnel__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.funnel__label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.funnel__cost { font-size: 12px; color: var(--ink-2); }
.funnel__value { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.funnel__value .delta { font-size: 12px; }
.funnel__rate { display: flex; align-items: center; gap: 6px; padding: 5px 0; font-size: 12px; color: var(--ink-2); }
.funnel__arrow { color: var(--ink-3); font-size: 13px; }

/* ---------- Tabela em ranking ---------- */
.table-wrap { overflow-x: auto; margin: 0 -32px; padding: 0 32px; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank thead th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 0 12px 12px; white-space: nowrap; vertical-align: bottom; }
.rank thead th .info { margin-left: 2px; vertical-align: -3px; }
.rank td, .rank tbody th { padding: 15px 12px; border-top: 1px solid var(--line-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank tbody th { text-align: left; font-weight: 600; font-size: 15px; }
.rank th:first-child, .rank td:first-child { padding-left: 0; }
.rank th:last-child, .rank td:last-child { padding-right: 0; }
.rank .num { text-align: right; }
.cellbar { display: flex; align-items: center; gap: 12px; justify-content: flex-end; }
.cellbar strong { font-weight: 700; min-width: 3.5ch; }
.cellbar__track { width: 96px; height: 6px; border-radius: 2px; background: var(--track); display: flex; }
.cellbar__track i { display: block; height: 100%; border-radius: 2px; }

.note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin-top: -8px; }
.stale {
  display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #7a3d00;
  background: #fff4e5; border: 1px solid #f4d3a8; border-radius: var(--r-inner); padding: 10px 14px;
}
.stale svg { width: 16px; height: 16px; margin-top: 2px; color: var(--google); }
.skeleton { display: flex; flex-direction: column; gap: 24px; }
.skeleton__block { border-radius: var(--r-panel); background: #e3e7ee; animation: pulse 1.4s ease-in-out infinite; }
.skeleton__block--board { height: 300px; }
.skeleton__block--panel { height: 340px; }
@keyframes pulse { 50% { opacity: 0.55; } }
.note svg { width: 16px; height: 16px; margin-top: 2px; color: var(--google); }

/* ---------- Criativos ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.toolbar .tabs { border-bottom: 0; }
.toolbar .tabs__item { font-size: 17px; padding-bottom: 12px; }
.tabs__count { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.tabs__item[aria-selected="true"] .tabs__count { color: var(--ink-2); }

/* Filtros dos vídeos: objetivo, resumo e loja num bloco só */
.vfilters {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 8px 12px 8px 8px;
}
.vfilters .select { margin: 0; }
.vfilters .vsummary { margin: 0; }
.select { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.select select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230c1b33' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center no-repeat;
  border-radius: var(--r-inner); padding: 7px 32px 7px 12px; font-size: 14px; font-weight: 600; color: var(--ink);
}
.section-title { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: 19px; font-weight: 800; margin-bottom: -8px; }
.section-title .count { font-family: var(--font-text); }
.count { font-size: 14px; font-weight: 500; color: var(--ink-2); }

.creatives { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.vgroup { display: flex; flex-direction: column; gap: 16px; }
.vgroup + .vgroup { margin-top: 12px; }
.vgroup .section-title { margin-bottom: 0; align-items: center; }
.section-title .brand { width: 18px; height: 18px; }
.show-more {
  align-self: flex-start; cursor: pointer; padding: 9px 16px; border-radius: var(--r-inner);
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink);
}
.show-more:hover { border-color: #aeb8c8; }
.off-title { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--ink-2); }
.empty--inline { padding: 4px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.creative__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.air { font-size: 12px; color: var(--ink-2); }
.creative {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.creative:hover { border-color: #aeb8c8; }
.creative__open { display: flex; flex-direction: column; flex: 1; text-align: left; padding: 0; border: 0; background: none; cursor: pointer; }
.creative__open:hover .creative__name { color: var(--blue); }
.creative__open:focus-visible { outline-offset: -2px; border-radius: var(--r-panel) var(--r-panel) 0 0; }
.ig-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink);
  text-decoration: none; white-space: nowrap;
}
.ig-link .brand { width: 14px; height: 14px; }
.ig-link:hover { color: var(--blue); }
.creative__ig { justify-content: center; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.creative__ig:hover { background: #f6f7fa; }
.ig-link--button { margin-top: 12px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-inner); }
.ig-link--button:hover { border-color: #aeb8c8; }
.creative__media { position: relative; aspect-ratio: 4 / 5; background: #dfe3ea; }
.creative__media img { width: 100%; height: 100%; object-fit: cover; }
.creative__media .status { position: absolute; top: 10px; left: 10px; }
.creative__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.creative__title { display: flex; flex-direction: column; gap: 2px; }
.creative__name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.key { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; }
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--r-small);
  background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(12, 27, 51, 0.12);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.status--off { color: var(--ink-2); }
.status--off::before { background: #a3aec0; }
.creative--inactive .creative__media img { filter: saturate(0.6); opacity: 0.85; }

/* Seletor do objetivo dos vídeos */
.seg { display: inline-flex; padding: 3px; background: var(--bg); border-radius: var(--r-inner); }
.seg__item {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer;
  padding: 8px 14px; border-radius: var(--r-small); font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.seg__item .brand { width: 15px; height: 15px; }
.seg__item:hover { color: var(--ink); }
.seg__item[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(12, 27, 51, 0.08); }
.seg__short { display: none; }
.seg__count { font-weight: 500; opacity: 0.7; }
.vsummary { font-size: 14px; color: var(--ink-2); }
.off-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 20px; margin-top: 8px; border-top: 1px solid var(--line); }
.off-head .off-title { margin: 0; padding: 0; border: 0; }
.show-less { border: 0; background: none; padding: 4px 0; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); }
.show-less:hover { text-decoration: underline; text-underline-offset: 3px; }
.show-more--end { margin-top: 4px; }

.cstats { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.cstats__main { display: flex; align-items: baseline; gap: 6px; }
.cstats__main .brand { align-self: center; }
.cstats__main b { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cstats__main span { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.cstats__leads b { font-weight: 600; color: var(--ink); }
.cstats__leads--none { color: var(--ink-3); }
.cstats__sub { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mstats { display: flex; flex-wrap: wrap; row-gap: 12px; margin-top: auto; }
.mstats > div { padding: 0 14px; border-left: 1px solid var(--line-2); min-width: 0; }
.mstats > div:first-child { padding-left: 0; border-left: 0; }
.mstats dt { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.mstats dt .brand { width: 12px; height: 12px; }
.mstats dd { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }

.promo { display: flex; flex-direction: column; gap: 24px; }
.carousel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 22px; }
.carousel__head .panel__title { gap: 12px; }
.carousel__sub { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.carousel .mstats dd { font-size: 18px; }
.products { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.product { flex: 0 0 160px; scroll-snap-align: start; }
.product__img { width: 160px; height: 160px; border-radius: var(--r-inner); object-fit: cover; background: #dfe3ea; }
.product__zoom { display: block; padding: 0; border: 0; background: none; border-radius: var(--r-inner); cursor: zoom-in; }
.product__zoom:hover .product__img { filter: brightness(0.94); }

/* Produto ampliado */
.modal__panel.modal__panel--image { grid-template-columns: minmax(0, 1fr); width: min(640px, 100%); }
.zoom { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #dfe3ea; border-radius: var(--r-panel) var(--r-panel) 0 0; }
.zoom__img { flex: 0 0 100%; width: 100%; max-height: 70vh; object-fit: contain; scroll-snap-align: start; background: #fff; }
.zoom__caption { padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 8px; }
.zoom__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.zoom__hint { font-size: 13px; color: var(--ink-2); }
.product figcaption { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.product__name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.tag { font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); }
.tag--sc { color: #0040c4; border-color: #c4d4ff; }
.tag--sm { color: #9a4a00; border-color: #f2cfa6; }
.tag--detail { border-style: dashed; }

.more summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; padding: 4px 0; }
.more summary::-webkit-details-marker { display: none; }
.more summary svg { transition: transform 0.15s ease; color: var(--ink-3); }
.more[open] summary svg { transform: rotate(90deg); }
.more[open] summary { margin-bottom: 20px; }

.empty { color: var(--ink-2); padding: 32px 0; }
.img-missing { background: #dfe3ea; width: 100%; height: 100%; }

/* ---------- Modal do criativo ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(12, 27, 51, 0.6); }
.modal__panel {
  position: relative; width: min(980px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--surface); border-radius: var(--r-panel); display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal__media { background: #dfe3ea; }
.modal__media img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.modal__body { padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 24px; }
.modal__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.modal__title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; padding-right: 40px; line-height: 1.25; }
.modal__body .mstats dd { font-size: 20px; }
.modal__sub { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.modal__dates { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.modal__dates b { font-weight: 600; color: var(--ink); }
.store-cell { display: inline-flex; align-items: center; gap: 8px; }
.store-dates { display: block; font-size: 12px; font-weight: 400; color: var(--ink-2); margin-top: 2px; padding-left: 15px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot--on { background: var(--up); }
.dot--off { background: #a3aec0; }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center;
}
.modal .table-wrap { margin: 0 -28px; padding: 0 28px; }
.rank--compact td, .rank--compact tbody th { padding: 10px 8px; font-size: 13.5px; }
.rank--compact tbody th { vertical-align: top; }
.rank--compact td { vertical-align: top; }
.rank--compact thead th { padding: 8px 8px 8px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  :root { --pad-x: 36px; }
  .board__lead { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .split { max-width: 560px; }
  .cell { padding: 20px 24px 24px; }
  .fig--m { font-size: 32px; }
}
@media (max-width: 1180px) {
  :root { --rail-w: 204px; }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1040px) {
  .board__cells, .board__cells--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell:nth-child(odd) { border-left: 0; }
  .cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --pad-x: 16px; }
  .rail { display: none; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px 14px; padding: 20px 16px 20px; }
  .head__logo { display: block; height: 40px; width: auto; }
  .head__title { display: contents; }
  .head__title h1 { font-size: 24px; }
  .head__range { grid-column: 1 / -1; margin-top: -4px; }
  .head__current { font-size: 16px; }
  .head__compare { font-size: 13px; }
  .head__side { grid-column: 1 / -1; align-items: stretch; gap: 6px; }
  .head__through { align-self: flex-end; font-size: 12px; }
  .period { width: 100%; }
  .period button { flex: 1; padding: 8px 6px; font-size: 13px; }
  .view { gap: 16px; padding-bottom: 24px; }
  .foot { padding: 8px 16px 24px; font-size: 12px; }
  .grid { gap: 16px; }

  .panel { padding: 20px 20px 22px; }
  .panel__head { margin-bottom: 16px; }
  .panel__title { font-size: 17px; }
  .panel--chart .panel__head { flex-direction: column; align-items: flex-start; }
  .panel--chart .panel__head .tabs { width: 100%; gap: 14px; border-bottom: 1px solid var(--line); }
  .panel--chart .tabs__item { font-size: 13px; }
  .chart { height: 210px; }

  .board__lead { padding: 20px 20px 22px; gap: 20px; }
  .fig--xl { font-size: 44px; }
  .fig--m { font-size: 28px; }
  .fig--s { font-size: 20px; }
  .cell { padding: 16px 20px 18px; row-gap: 8px; }
  .cell__label { display: block; font-size: 13px; line-height: 1.35; }
  .cell__label > * { vertical-align: -3px; }
  .cell__label .brand, .cell__label .logo-gads { margin-right: 6px; }
  .cell__foot { flex-direction: column; gap: 2px; }
  .cell__sub, .delta { font-size: 13px; }
  .split__legend { gap: 6px 16px; font-size: 13px; }
  .board__spend .delta { white-space: normal; }

  .tabs--stores { gap: 22px; margin: 0 -16px; padding: 0 16px; }
  .tabs--stores .tabs__item { font-size: 16px; }

  .srow--head { display: none; }
  .srow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding: 16px 0; }
  .srow:nth-child(2) { border-top: 0; padding-top: 0; }
  .srow__name { grid-column: span 2; }
  .srow__spend { grid-column: span 2; align-items: flex-end; }
  .srow__bar { display: none; }
  .srow__m { text-align: left; display: flex; flex-direction: column; gap: 2px; align-self: end; }
  .srow__k { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); line-height: 1.2; }
  .srow__k .brand, .srow__k .logo-gads { width: 11px; height: 11px; }
  .srow__m b { font-size: 15px; }

  .front__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .front__head { padding: 10px 12px; }
  .front__body { padding: 12px; }
  .funnel__stage { padding: 9px 12px; width: calc(100% - var(--step, 0) * 24px); }
  .front__name { font-size: 16px; }
  .table-wrap { margin: 0 -20px; padding: 0 20px 0 0; }
  .table-wrap .rank thead th:first-child, .table-wrap .rank tbody th {
    position: sticky; left: 0; z-index: 1; background: var(--surface); padding-left: 20px;
    box-shadow: 1px 0 0 var(--line-2);
  }

  .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .toolbar .tabs { gap: 0; }
  .toolbar .tabs__item { flex: 1; justify-content: center; font-size: 15px; }
  .vfilters { grid-template-columns: minmax(0, 1fr); padding: 8px; gap: 8px; }
  .vfilters .seg { display: flex; }
  .vfilters .seg__item { flex: 1; justify-content: center; padding: 9px 8px; }
  .seg__long { display: none; }
  .seg__short { display: inline; }
  .vfilters .select { order: 2; justify-content: space-between; padding: 0 4px; }
  .vfilters .select select { flex: 1; }
  .vfilters .vsummary { order: 3; padding: 0 4px 2px; font-size: 13px; }
  .select { margin-bottom: 12px; }
  .creatives { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .creative__body { padding: 12px; gap: 12px; }
  .creative__name { font-size: 14px; }
  .cstats__main b { font-size: 19px; }
  .cstats__main span { font-size: 13px; }
  .cstats__sub { flex-direction: column; font-size: 12px; }
  .carousel__head .mstats { width: 100%; }
  .carousel .mstats dd { font-size: 16px; }
  .product { flex-basis: 136px; }
  .product__img { width: 136px; height: 136px; }

  .modal { padding: 0; place-items: end stretch; }
  .modal__panel { grid-template-columns: minmax(0, 1fr); border-radius: var(--r-panel) var(--r-panel) 0 0; max-height: 90vh; }
  .modal__media img { min-height: 0; max-height: 300px; }
  .modal__body { padding: 20px 20px 28px; gap: 20px; min-width: 0; }
  .modal .table-wrap { margin: 0 -20px; padding: 0 20px 0 0; }
  .modal__title { font-size: 20px; }
  .modal .mstats, .carousel .mstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .modal .mstats > div, .carousel .mstats > div { padding: 0; border-left: 0; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset: auto 0 0 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 0 4px env(safe-area-inset-bottom);
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 9px;
    font-size: 11px; font-weight: 500; color: var(--ink-3); text-decoration: none;
  }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 22%; right: 22%; height: 2px; border-radius: 0 0 2px 2px; background: var(--blue); }
  .tab-glyph { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Login ---------- */
[hidden] { display: none !important; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.login__card {
  width: min(380px, 100%); background: var(--surface); border-radius: var(--r-panel); padding: 32px 28px 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.login__brand { height: 22px; width: auto; align-self: flex-start; margin-bottom: 8px; }
.login__title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.login__field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.login__field input, .admin__add input {
  font: inherit; font-size: 15px; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-inner); background: var(--surface);
}
.login__field input:focus-visible, .admin__add input:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
.login__error { font-size: 14px; color: var(--down); }
.login__submit {
  margin-top: 4px; border: 0; border-radius: var(--r-inner); background: var(--ink); color: #fff; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.login__submit:disabled { opacity: 0.7; cursor: progress; }
.login__help { font-size: 13px; color: var(--ink-2); }
.foot__out { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }

/* ---------- Área do administrador ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer;
  padding: 8px 14px; border-radius: var(--r-inner); border: 1px solid var(--ink); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
}
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--quiet { background: var(--surface); color: var(--ink); border-color: var(--line); padding: 6px 10px; font-size: 13px; }
.btn--danger { color: var(--down); }
.admin__top { display: flex; align-items: center; gap: 16px; }
.admin__client { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.admin__side { display: flex; flex-direction: column; gap: 24px; }
.admin__hint { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.admin__message {
  width: 100%; font: 14px/1.5 var(--font-text); color: var(--ink); padding: 14px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r-inner); background: #f6f7fa;
}
.admin__add { display: flex; gap: 8px; margin-bottom: 12px; }
.admin__add input { flex: 1; min-width: 0; padding: 8px 12px; font-size: 14px; }
.admin__result { border: 1px solid var(--line); border-radius: var(--r-inner); background: #f6f7fa; padding: 12px 14px; margin-bottom: 14px; }
.admin__result-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.admin__credential { margin: 0 0 10px; font: 13px/1.5 var(--font-text); white-space: pre-wrap; }
.admin__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin__row .admin__hint { margin: 0; }
.admin__error { color: var(--down); font-size: 14px; }
.members { list-style: none; margin: 0; padding: 0; }
.members__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.members__row:first-child { border-top: 0; }
.members__row b { display: block; font-size: 14px; font-weight: 600; }
.members__row small { font-size: 12px; color: var(--ink-2); }
.run { font-size: 12px; font-weight: 600; }
.run--ok { color: var(--up); }
.run--erro { color: var(--down); }
@media (max-width: 900px) {
  .members__row { flex-direction: column; align-items: flex-start; }
  .admin__add { flex-direction: column; }
}
