/* Painel Pixiu. Toda cor, tamanho e espaço vem de base/marca/paleta.css. */

:root { color-scheme: dark; }

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pos { color: var(--positive-text); }
.neg { color: var(--negative-text); }
.gold { color: var(--revenue-text); }

/* Estrutura */

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--side);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28'><path d='M14 0 L28 14 L14 28 L0 14 Z' fill='none' stroke='%2300E08A' stroke-opacity='0.07' stroke-width='0.6'/></svg>");
  border-right: 1px solid var(--line);
  z-index: 30;
}

.brand {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-6) var(--s-4) var(--s-2);
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: var(--t-xl);
  font-weight: 500;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--t-xs);
}

.seal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--seal-line);
  border-radius: 50%;
  color: var(--jade-2);
  background: radial-gradient(circle at 40% 35%, var(--jade-deep), var(--paper) 72%);
  box-shadow: inset 0 0 0 3px var(--side), inset 0 0 0 4px var(--seal-line);
  font-family: var(--sc);
  font-size: 22px;
  line-height: 1;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-4) var(--s-3);
}

.nav button {
  display: flex;
  align-items: center;
  text-align: left;
  padding: var(--s-2) var(--s-3);
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
}

.nav button:hover { color: var(--text); }

.nav button[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--action);
}

.nav .badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--cinnabar-deep);
  color: var(--text);
  font-size: var(--t-xs);
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
}

.side-foot p {
  margin: var(--s-1) 0 0;
  color: var(--faint);
  font-size: var(--t-xs);
}

.side-foot .backup { color: var(--muted); }

.main {
  min-width: 0;
  max-width: 1480px;
  padding: var(--s-6) var(--s-8) 72px;
}

.booting { color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: var(--s-4); }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  border: 0;
  background: var(--scrim);
}

/* Cabeçalho da tela: carimbo + título */

.page-h {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}

.page-h h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--t-2xl);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
}

.page-h .is-campaign { font-size: clamp(30px, 4vw, var(--t-2xl)); }

.page-h .sub {
  margin: var(--s-1) 0 0;
  color: var(--muted);
}

.page-h .sub .cslug { margin-left: var(--s-2); }

.stamp {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 52px;
  padding: var(--s-1) 0;
  border: 1.5px solid var(--seal-line);
  border-radius: var(--radius);
  color: var(--seal);
  font-family: var(--sc);
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.1;
  writing-mode: vertical-rl;
}

.back {
  display: inline-block;
  margin-bottom: var(--s-2);
  color: var(--action);
  font-size: var(--t-sm);
  text-decoration: none;
}

.back:hover { text-decoration: underline; text-underline-offset: 3px; }

.menu {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--side);
}

.menu span {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--text);
}

/* Faixa do lucro: o número que manda na tela */

.band {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: end;
  gap: var(--s-2) var(--s-8);
  padding: var(--s-6) 0 var(--s-4);
  border-bottom: 1px solid var(--line);
}

.band-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: var(--t-md);
}

.band-value {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--t-hero);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.band-side {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-bottom: var(--s-2);
}

.band-delta { margin: 0; font-size: var(--t-md); }
.band-delta.good { color: var(--positive-text); }
.band-delta.bad { color: var(--negative-text); }
.band-delta.mute { color: var(--faint); }

.formula {
  margin: 0;
  color: var(--faint);
  font-size: var(--t-xs);
}

/* Botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  white-space: nowrap;
}

.btn:hover { border-color: var(--action); color: var(--positive-text); }

.btn.primary {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
}

.btn.primary:hover { background: var(--jade-2); border-color: var(--jade-2); color: var(--on-action); }
.btn.quiet { color: var(--muted); border-color: transparent; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--action);
  text-align: left;
}

.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--negative-text); }

/* Chip: todo controle de alternar (período, plataforma, modo, status) */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font-size: var(--t-sm);
  white-space: nowrap;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }

.chip[aria-pressed="true"] {
  color: var(--on-action);
  background: var(--action);
  border-color: var(--action);
}

.chip.sm { padding: 2px var(--s-2); font-size: var(--t-xs); }

.status[aria-pressed="true"] {
  color: var(--positive-text);
  background: transparent;
  border-color: color-mix(in srgb, var(--jade) 55%, transparent);
}

.status[aria-pressed="false"] { color: var(--faint); }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

.seg .chip { border-color: transparent; }

.tag {
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--faint);
  font-size: var(--t-xs);
  font-weight: 400;
}

/* Campos */

input, select, textarea {
  min-height: 34px;
  padding: 6px var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { color: var(--muted); font-size: var(--t-sm); }
.field input, .field select, .field textarea { width: 100%; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.form-actions { grid-column: 1 / -1; display: flex; gap: var(--s-2); }

.hint {
  margin: var(--s-2) 0 0;
  color: var(--faint);
  font-size: var(--t-xs);
}

/* Avisos */

.ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding: var(--s-2) var(--s-3);
  color: var(--positive-text);
  background: var(--positive-wash);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ribbon.warn {
  color: var(--revenue-text);
  background: var(--revenue-wash);
  border-color: var(--seal-line);
}

/* Filtros */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  margin-bottom: var(--s-4);
}

.dates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters select { min-width: 150px; }
.dates label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--t-sm); }
.search input { min-width: 200px; }

.pulse {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  margin: 0 0 var(--s-4);
  color: var(--muted);
}

.pulse strong { color: var(--text); font-weight: 500; }

/* Cartão: superfície lisa, sem brilho */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.card h2, .section-h h2 {
  margin: 0;
  font-size: var(--t-md);
  font-weight: 500;
}

.card-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) 0;
}

.card-h.flush { padding: 0; }
.card-h + .table-scroll, .card-h + .empty, .card-h + .alerts { margin-top: var(--s-3); }
.card-b { padding: var(--s-3) var(--s-4) var(--s-4); }

.empty { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-8) var(--s-3); text-align: center; }
.empty p, .chart-empty { color: var(--muted); }

/* Métricas: régua de números, sem um cartão por número */

.section-h {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.popover {
  position: absolute;
  right: 0;
  top: calc(100% + var(--s-2));
  z-index: 6;
  width: min(280px, 80vw);
  max-height: 320px;
  overflow: auto;
  padding: var(--s-2) var(--s-3);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.popover label {
  display: flex;
  gap: var(--s-2);
  align-items: center;
  padding: 5px 0;
  font-size: var(--t-sm);
}

.ruler {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.ruler li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.ruler-label { color: var(--muted); font-size: var(--t-sm); }

.ruler-value {
  font-size: var(--t-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ruler-delta { font-size: var(--t-xs); color: var(--faint); }
.ruler-delta.good { color: var(--positive-text); }
.ruler-delta.bad { color: var(--negative-text); }

.ruler.minor { border-top: 0; }
.ruler.minor .ruler-value { font-size: var(--t-md); }

/* Grade de cartões do Resumo */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--s-3);
}

.tiles.minor { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-width: 0;
  padding: var(--s-4);
}

.tile-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
}

.tile-label { color: var(--muted); font-size: var(--t-sm); }

.tile-value {
  margin: var(--s-2) 0 0;
  font-size: var(--t-lg);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.tile.lg .tile-value { font-size: var(--t-xl); }
.tile.sm { padding: var(--s-3) var(--s-4); }
.tile.sm .tile-value { margin-top: var(--s-1); font-size: var(--t-md); }

.tile-delta { margin: 0; color: var(--faint); font-size: var(--t-xs); }
.tile-delta.good { color: var(--positive-text); }
.tile-delta.bad { color: var(--negative-text); }

.tile.is-up { background: color-mix(in srgb, var(--jade) 7%, var(--surface)); border-color: color-mix(in srgb, var(--jade) 40%, transparent); }
.tile.is-down { background: color-mix(in srgb, var(--cinnabar) 7%, var(--surface)); border-color: color-mix(in srgb, var(--cinnabar) 45%, transparent); }

.info {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.info:hover { color: var(--text); border-color: var(--muted); }

.info::after {
  content: attr(data-tip);
  position: absolute;
  right: -8px;
  bottom: calc(100% + var(--s-2));
  z-index: 8;
  width: max-content;
  max-width: 240px;
  padding: var(--s-2) var(--s-3);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: var(--t-xs);
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.info:hover::after, .info:focus-visible::after { opacity: 1; }

/* Rosca de gastos por plataforma */

.tile.donut { grid-row: span 2; }

.donut-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-4);
  flex: 1;
  margin-top: var(--s-3);
}

.donut-ring { position: relative; width: 156px; margin: 0 auto; }
.donut-ring svg { display: block; width: 100%; height: auto; }
.donut-ring circle { fill: none; stroke-width: 5.5; }
.donut-ring .track { stroke: var(--line-soft); }

.donut-ring p {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  text-align: center;
}

.donut-ring p span { color: var(--muted); font-size: var(--t-xs); }
.donut-ring p strong { font-size: var(--t-xs); font-weight: 500; }

.arc-0 { --arc: var(--text); }
.arc-1 { --arc: color-mix(in srgb, var(--ivory) 55%, var(--surface)); }
.arc-2 { --arc: color-mix(in srgb, var(--ivory) 25%, var(--surface)); }
.donut-ring .arc { stroke: var(--arc); }

.donut-legend { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: var(--t-sm); }
.donut-legend li { display: flex; align-items: center; gap: var(--s-2); }
.donut-legend i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--arc); }
.donut-legend .pct { margin-left: auto; color: var(--muted); }
.donut-legend strong { min-width: 92px; font-weight: 500; text-align: right; }

/* Gráficos */

.grid-charts { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.8fr); gap: var(--s-4); }
.grid-charts.solo { grid-template-columns: 1fr; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--t-xs);
}

.legend i { display: inline-block; width: 16px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid; }
.legend .revenue { color: var(--revenue-text); }
.legend .spend { color: var(--negative); border-top-style: dotted; }
.legend .profit { color: var(--positive-text); }
.legend .compare { color: var(--muted); border-top-style: dashed; }
.legend .note { width: 8px; height: 8px; border: 0; background: var(--revenue-text); transform: rotate(45deg); }

.line-chart { position: relative; min-height: 220px; touch-action: pan-y; }
.line-chart svg { width: 100%; height: auto; display: block; }
.line-chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.line-chart .zero { stroke: var(--line-strong); stroke-width: 1; }
.line-chart .tick { fill: var(--faint); font-size: 11px; font-family: var(--sans); }
.line-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .line.revenue { stroke: var(--revenue-text); }
.line-chart .line.spend { stroke: var(--negative); stroke-dasharray: 0.5 4.5; stroke-width: 2.5; }
.line-chart .line.profit { stroke: var(--positive-text); stroke-width: 2.5; }
.line-chart .line.compare { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1.5; }
.line-chart .guide { stroke: var(--line-strong); stroke-width: 1; }
.line-chart .dot.revenue { fill: var(--revenue-text); }
.line-chart .dot.spend { fill: var(--negative); }
.line-chart .dot.profit { fill: var(--positive-text); }
.line-chart .note-mark { fill: var(--revenue-text); }

.tip {
  position: absolute;
  top: var(--s-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  padding: var(--s-2) var(--s-3);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  pointer-events: none;
  font-size: var(--t-xs);
}

.tip strong { font-weight: 500; }
.tip-note { color: var(--revenue-text); font-style: normal; max-width: 260px; white-space: normal; }

/* Dia da semana: barra = lucro, com linha do zero */

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--s-2);
}

.week .col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.week .plot { display: flex; flex-direction: column; width: 100%; height: 180px; }
.week .up, .week .down { display: flex; justify-content: center; width: 100%; }
.week .up { align-items: flex-end; border-bottom: 1px solid var(--line-strong); }
.week .down { align-items: flex-start; }
.week .bar { width: 14px; min-height: 2px; background: var(--positive); }
.week .down .bar { background: var(--negative); }
.week .lbl { margin-top: var(--s-2); color: var(--muted); font-size: var(--t-xs); }
.week strong { max-width: 100%; overflow: hidden; font-size: var(--t-xs); font-weight: 500; white-space: nowrap; }

/* Tabelas */

.table-scroll { overflow: auto; max-height: min(680px, 72vh); }

.data { width: 100%; border-collapse: collapse; min-width: 860px; }
.data.full { min-width: 1560px; }
.data.entries { min-width: 900px; }
.data.compare-table { min-width: 0; }

.data th, .data td {
  padding: 10px var(--s-3);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
}

.data th.num, .data td.num { text-align: right; }

.data td:first-child, .data th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  white-space: normal;
  min-width: 220px;
}

.data th:first-child { z-index: 3; background: var(--surface-2); }
.data tbody tr:hover td { background: var(--surface-2); }
.data tr.row-loss td:first-child { box-shadow: inset 2px 0 0 var(--negative); }
.data tfoot td { background: var(--surface-2); font-weight: 500; }

.data.compare-table td:first-child, .data.compare-table th:first-child { min-width: 120px; color: var(--muted); }
.data.compare-table th { color: var(--text); }

.sort {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: inherit;
}

.sort:hover { color: var(--text); }

.cname { font-weight: 500; }
.cslug { margin-top: 2px; color: var(--faint); font-size: var(--t-xs); }

.clink { color: inherit; text-decoration: none; }
.clink:hover { color: var(--positive-text); text-decoration: underline; text-underline-offset: 3px; }

/* Plataforma: monograma neutro, sem cor de marca */

.plat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-sm);
}

.plat b {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.budget {
  width: 88px;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  text-align: right;
}

.budget:hover, .budget:focus { border-bottom-color: var(--action); }

.flag { display: inline-block; width: 8px; height: 8px; margin-left: var(--s-1); border-radius: 50%; vertical-align: middle; }
.flag.alta { background: var(--negative); }
.flag.media { background: var(--revenue); }
.flag.baixa { background: var(--faint); }

.data .note { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.row-actions { text-align: right; }
.row-actions .link + .link { margin-left: var(--s-3); }

/* Atenção */

.alerts { list-style: none; margin: 0; padding: var(--s-2) var(--s-4) var(--s-3); }
.alerts li { border-top: 1px solid var(--line-soft); }
.alerts li:first-child { border-top: 0; }

.alerts a, .alerts.inline li {
  position: relative;
  display: flex;
  gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-2) 0 var(--s-2) 14px;
  color: inherit;
  text-decoration: none;
}

.alerts a::before, .alerts.inline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--faint);
}

.alerts .alta a::before, .alerts.inline .alta::before { background: var(--negative); }
.alerts .media a::before, .alerts.inline .media::before { background: var(--revenue); }
.alerts a:hover strong { color: var(--positive-text); }
.alerts strong { flex: 0 0 auto; font-weight: 500; }
.alerts span { color: var(--muted); }
.alerts.inline { padding: 0; }

/* Contas */

.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.account-card, .composer, .mcp-note, .entry-form { padding: var(--s-4); }
.account-card .plat { margin-top: var(--s-1); }

.account-lucro {
  margin: var(--s-3) 0 var(--s-2);
  font-size: var(--t-xl);
  font-weight: 500;
  line-height: 1;
}

.account-card ul { list-style: none; padding: 0; margin: 0 0 var(--s-3); }

.account-card li {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.account-card li span { color: var(--muted); }

.mcp-note > .formula { margin-top: var(--s-2); max-width: 42rem; }

.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-4); }
.pick-grid h3, .unmatched h3 { margin: 0 0 var(--s-2); color: var(--muted); font-size: var(--t-sm); font-weight: 500; }
.pick-line, .pick-row { padding: var(--s-2) 0; border-top: 1px solid var(--line-soft); }
.pick { display: flex; gap: 10px; align-items: flex-start; padding: var(--s-2) 0; border-top: 1px solid var(--line-soft); }
.pick-line .pick, .pick-row .pick { border-top: 0; padding: 0; }
.pick input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin-top: 2px; padding: 0; accent-color: var(--action); flex: 0 0 auto; }
.pick span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick strong { font-weight: 500; }
.pick em { font-style: normal; color: var(--faint); font-size: var(--t-xs); }
.pick-row { display: flex; flex-direction: column; gap: var(--s-2); }
.pick-form { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.pick-form .btn { align-self: flex-start; }
.pick-line { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.pick-line .pick { flex: 1; }

.composer { position: sticky; top: var(--s-3); }
.composer h2, .entry-form h2, .mcp-note h2 { margin-bottom: var(--s-3); }
.rules-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: var(--s-3); }

/* Lançamentos */

.drawer { padding: 0 var(--s-4) var(--s-4); }
.drawer summary { cursor: pointer; color: var(--action); padding: var(--s-4) 0; }

.entry-tools { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; align-items: center; }
.entry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.entry-grid .span-3 { grid-column: span 3; }

.day-h { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-3); margin-bottom: var(--s-3); }
.grid-scroll { margin: 0 calc(var(--s-4) * -1) var(--s-3); }
.data.grid-table { min-width: 1280px; }
.data.grid-table td, .data.grid-table th { padding: 6px; }
.data.grid-table td:first-child, .data.grid-table th:first-child { padding-left: var(--s-4); min-width: 200px; }
.cell-input { width: 100%; min-width: 84px; text-align: right; }

.imp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--s-3); }
.imp-grid .example { color: var(--faint); font-size: var(--t-xs); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unmatched { margin-top: var(--s-4); }
.unmatched .pick-line span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unmatched select { max-width: 50%; }
.import-summary { margin: var(--s-4) 0 var(--s-3); }
.import-summary.mute { color: var(--muted); }

/* Detalhe da campanha */

.detail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  align-items: center;
  color: var(--muted);
  font-size: var(--t-sm);
}

.detail-controls label, .detail-controls span { display: inline-flex; gap: var(--s-2); align-items: center; }

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  padding: 10px 14px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Larguras menores */

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.minor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.donut { grid-column: 1 / -1; grid-row: auto; }
  .grid-charts, .account-grid, .pick-grid { grid-template-columns: 1fr; }
  .composer { position: static; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-grid .span-3 { grid-column: 1 / -1; }
  .imp-grid, .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    width: min(280px, 88vw);
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }
  .sidebar.open { transform: none; }
  .menu { display: inline-grid; }
  .main { padding: var(--s-4) var(--s-4) 64px; }
  .page-h { gap: var(--s-3); }
  .page-h h1 { font-size: var(--t-xl); }
  .page-h .is-campaign { font-size: var(--t-xl); }
  .stamp { width: 36px; height: 44px; font-size: var(--t-sm); }
  .band { grid-template-columns: 1fr; padding-top: var(--s-2); }
  .band-side { padding-bottom: 0; }
}

@media (max-width: 640px) {
  .tiles.minor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: var(--s-3); }
  .tile.lg .tile-value { font-size: var(--t-lg); }
  .filters > label, .filters > label select, .search input, .dates label, .dates input { flex: 1 1 140px; min-width: 0; width: 100%; }
  .dates { flex: 1 1 100%; flex-wrap: nowrap; }
  .ruler { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.imp-grid, .form-grid.rules-grid { grid-template-columns: 1fr; }
  .day-h { flex-direction: column; align-items: stretch; }
  .unmatched .pick-line { flex-direction: column; align-items: stretch; }
  .unmatched select { max-width: none; }
  .ribbon { flex-direction: column; align-items: stretch; }
  .alerts a { flex-direction: column; gap: 2px; }
  .week .plot { height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
