/* ============================================================================
   Gomoov Car · Campanhas — visual herdado do painel da Alltech (estilo "Soyuz"),
   recolorido com o verde da marca. Primária #96b95a (medida no PNG oficial).
   Tipografia: Mukta Vaani. Tema via [data-theme]; tokens em CSS vars.
   Contraste: texto sobre o verde é ESCURO (--on-primary); verde como texto
   sobre fundo claro usa --primary-ink.
============================================================================ */
:root,
:root[data-theme="light"] {
  --primary: #96b95a;
  --primary-2: #c5d99a;
  --primary-hover: #6f9139;
  --primary-ink: #6f9139;
  --primary-weak: rgba(150,185,90,.14);
  --on-primary: #1c2015;
  --secondary: #9aa392;
  --success: #43d187;
  --success-weak: rgba(67,209,135,.12);
  --danger: #f9616d;
  --danger-weak: rgba(249,97,109,.12);
  --warning: #f7bb4d;
  --warning-weak: rgba(247,187,77,.14);
  --info: #3d9bfb;
  --info-weak: rgba(61,155,251,.12);
  --ch-meta: #96b95a;
  --ch-google: #f7bb4d;

  --bg: #f4f5f1;
  --bg-2: #eceee6;
  --card: #ffffff;
  --card-2: #f7f8f3;
  --line: rgba(38,42,29,.09);
  --line-2: rgba(38,42,29,.05);
  --text: #262a1d;
  --muted: #7d8474;

  --axis: rgba(38,42,29,.18);
  --split: rgba(38,42,29,.06);
  --chart-label: #7d8474;

  --shadow: 0 6px 22px rgba(38,42,29,.07);
  --shadow-hover: 0 12px 30px rgba(38,42,29,.12);
  --logo-chip: #262a1d;
  --radius: 10px;
  --radius-sm: 8px;

  --turq: var(--primary);
  --turq-light: var(--primary-2);
  --orange: var(--warning);
  --gray: var(--secondary);
}
:root[data-theme="dark"] {
  --primary: #a3c46a;
  --primary-2: #c5d99a;
  --primary-hover: #b4d27f;
  --primary-ink: #b4d27f;
  --primary-weak: rgba(163,196,106,.18);
  --on-primary: #14170d;
  --secondary: #8b9184;
  --success: #43d187;
  --success-weak: rgba(67,209,135,.16);
  --danger: #f9616d;
  --danger-weak: rgba(249,97,109,.16);
  --warning: #f7bb4d;
  --warning-weak: rgba(247,187,77,.16);
  --info: #3d9bfb;
  --info-weak: rgba(61,155,251,.16);
  --ch-meta: #a3c46a;
  --ch-google: #f7bb4d;

  --bg: #14160f;
  --bg-2: #1a1d14;
  --card: #20241a;
  --card-2: #282d21;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.05);
  --text: #eceee6;
  --muted: #9aa092;

  --axis: rgba(255,255,255,.14);
  --split: rgba(255,255,255,.06);
  --chart-label: #9aa092;

  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-hover: 0 16px 40px rgba(0,0,0,.55);
  --logo-chip: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Mukta Vaani", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--primary-weak); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--secondary); background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- GATE ---------- */
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); }
.gate-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 36px 40px; width: 360px; box-shadow: var(--shadow); text-align: center;
}
.gate-box h1 { font-size: 22px; font-weight: 600; margin: 18px 0 6px; color: var(--text); }
.gate-box input {
  width: 100%; margin: 14px 0; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 15px;
}
.gate-box button, .primary-btn {
  background: var(--primary); color: var(--on-primary); border: none; border-radius: var(--radius-sm);
  padding: 11px 18px; font-weight: 700; font-size: 14px; transition: background .15s, transform .15s, box-shadow .15s;
}
.gate-box button { width: 100%; }
.gate-box button:hover, .primary-btn:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px var(--primary-weak); }
.gate-logo { padding: 10px 16px; display: inline-flex; }
.gate-logo img { height: 30px; display: block; }
.brand-suffix { color: var(--muted); font-weight: 500; }
.error { color: var(--danger); font-size: 13px; }

/* ---------- TOPBAR ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; background: var(--card);
  box-shadow: 0 4px 18px -12px rgba(38,42,29,.4);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.brand-logo-wrap { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--logo-chip); }
.brand-logo { height: 26px; display: block; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.ghost-btn {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; transition: border-color .15s, transform .15s, background .15s;
}
.ghost-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.ghost-btn.busy { opacity: .6; pointer-events: none; }
.sync-badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: transparent; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sync-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-badge.ok::before    { background: var(--success); }
.sync-badge.warn::before  { background: var(--warning); }
.sync-badge.error::before { background: var(--danger); }

.tabs { display: flex; gap: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; }
.tab { background: transparent; border: none; color: var(--muted); border-radius: 6px; padding: 8px 18px; font-size: 13px; font-weight: 600; transition: color .15s, background .15s; white-space: nowrap; }
.tab.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 3px 10px var(--primary-weak); }
.tab:hover:not(.active) { color: var(--text); background: var(--primary-weak); }

/* ---------- FILTROS ---------- */
.filter-group { display: flex; flex-direction: column; gap: 10px; }
.filter-group label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; font-weight: 600; }
.filter-head { display: flex; align-items: center; justify-content: space-between; }
.link-btn { background: none; border: none; color: var(--primary-ink); font-size: 11px; font-weight: 700; padding: 0; text-transform: uppercase; letter-spacing: .05em; }
.link-btn:hover { text-decoration: underline; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-row button {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 15px; font-size: 13px; line-height: 1; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.filter-row button:hover { border-color: var(--primary); transform: translateY(-1px); }
.filter-row button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 3px 10px var(--primary-weak); font-weight: 600; }
.filter-row.dates { gap: 10px; }
.filter-row input[type=date] {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; min-width: 140px; font-family: inherit;
}
.filter-row input[type=date]:focus { outline: none; border-color: var(--primary); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600; transition: all .15s;
}
.chip:hover { border-color: var(--primary); transform: translateY(-1px); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 3px 10px var(--primary-weak); }
/* chips de campanha: ponto de status + selo do canal + nome truncado */
.camp-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; text-align: left; }
.camp-chip .st { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.camp-chip .st.on { background: var(--success); box-shadow: 0 0 0 2px var(--success-weak); }
.camp-chip .ch { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--primary-weak); color: var(--primary-ink); flex: none; }
.camp-chip.active .ch { background: rgba(0,0,0,.14); color: var(--on-primary); }
.camp-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- CARDS ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 18px 24px; padding: 18px 20px; box-shadow: var(--shadow);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 9px; }
.card h3::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--primary); flex: none; }
.card h3 + .muted.small { display: block; margin: 4px 0 10px; }
.card-note { margin: 8px 0 0; line-height: 1.5; }
.scope-pill {
  font-size: 12px; font-weight: 600; color: var(--primary-ink);
  background: var(--primary-weak); border: 1px solid transparent;
  padding: 2px 10px; border-radius: 999px; margin-left: 8px;
}
.scope-pill:empty { display: none; }
/* faixa de aviso metodológico (evento de plataforma ≠ lead) */
.note {
  margin: 0 24px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5;
  background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--warning); color: var(--text);
}
.note b { font-weight: 700; }

/* ---------- grid / KPI / tabelas ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; margin: 18px 24px; }
.grid-2 .card { margin: 0; }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 360px; }
.chart.short { height: 220px; }
.section-sub { margin: 26px 24px 2px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px; margin: 18px 24px; }
.kpi-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main spark" "label spark" "sub sub";
  column-gap: 12px; align-items: center; transition: transform .2s ease, box-shadow .2s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi.alt { border-left: 3px solid var(--primary); }
.kpi-main { grid-area: main; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi .value { font-size: 24px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .label { grid-area: label; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 6px; font-weight: 600; }
.kpi .sub { grid-area: sub; font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.kpi-delta { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.kpi-delta.good { color: var(--success); }
.kpi-delta.bad { color: var(--danger); }
.kpi-delta.neutral { color: var(--muted); }
.kpi-spark { grid-area: spark; width: 92px; height: 40px; display: flex; align-items: center; justify-content: flex-end; }
.kpi-spark svg { display: block; }

.cre-table-wrap { overflow-x: auto; }
.cre-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text); }
.cre-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 2px solid var(--line); }
.cre-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); color: var(--text); }
.cre-table tbody tr { transition: background .12s; }
.cre-table tbody tr:hover { background: var(--card-2); }
.cre-table th.r, .cre-table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.cre-table td:first-child { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cre-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.cre-table th.sortable:hover { color: var(--primary-ink); }
/* selo de canal + ponto de status dentro das tabelas */
.ch-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-right: 6px; color: var(--on-primary); vertical-align: middle; }
.ch-badge.meta { background: var(--ch-meta); }
.ch-badge.google { background: var(--ch-google); }
.st-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.st-dot.on { background: var(--success); }
.st-txt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.st-txt.on { color: var(--success); font-weight: 600; }
.term-st { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.term-st.added { background: var(--success-weak); color: var(--success); }
.term-st.excluded { background: var(--danger-weak); color: var(--danger); }
.term-st.both { background: var(--warning-weak); color: #8a5a00; }
.term-st.none { background: var(--bg-2); color: var(--muted); }

/* funil em pílulas: forma à esquerda + dados em lista à direita */
.fn-wrap { display: flex; gap: 16px; align-items: stretch; min-height: 240px; }
.fn-chart { flex: 0 0 42%; min-width: 0; height: 240px; }
.fn-data { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.fn-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 11px; }
.fn-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.fn-name { font-size: 14px; color: var(--text); font-weight: 600; line-height: 1.1; }
.fn-rate { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fn-num { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.fn-foot { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* card do teto mensal */
.budget-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: center; }
.budget-bar-wrap { position: relative; padding-top: 18px; }
.budget-bar { height: 22px; border-radius: 999px; background: var(--bg-2); overflow: hidden; display: flex; }
.budget-bar .seg { height: 100%; }
.budget-bar .seg.meta { background: var(--ch-meta); }
.budget-bar .seg.google { background: var(--ch-google); }
.budget-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .55; }
.budget-mark::after { content: attr(data-l); position: absolute; top: -2px; left: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.budget-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.budget-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.budget-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.budget-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.budget-kpis .bk { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); }
.budget-kpis .bk b { display: block; font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.budget-kpis .bk span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.budget-kpis .bk.ok b { color: var(--success); }
.budget-kpis .bk.warn b { color: #b8860b; }
.budget-kpis .bk.over b { color: var(--danger); }

/* lista curta chave→valor (intenção declarada) */
.kv { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.kv b { font-variant-numeric: tabular-nums; }

@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: minmax(0,1fr); }
  .kpi-grid, .kpi-grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body { overflow-x: hidden; }
  .kpi { min-width: 0; padding: 14px; }
  .kpi-spark { width: 70px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .budget-wrap { grid-template-columns: 1fr; }
  .fn-wrap { flex-direction: column; }
  .fn-chart { flex: none; height: 180px; }
}

/* ---------- CRIATIVOS ---------- */
.creatives-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.creative-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.creative-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-hover); }
.thumb-wrap { position: relative; }
.play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 18px; padding-left: 3px;
  border: 2px solid rgba(255,255,255,.85); pointer-events: none;
}
.creative-card .thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--bg-2); display: block; }
.creative-card .thumb-placeholder { width: 100%; aspect-ratio: 1/1; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); font-size: 12px; }
.creative-card .body { padding: 12px; }
.creative-card .cc-ad { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--primary-ink); background: var(--primary-weak); padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creative-card .cc-camp { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.creative-card .cc-copy { font-size: 12.5px; line-height: 1.4; max-height: 4.2em; overflow: hidden; margin-bottom: 10px; color: var(--text); }
.creative-card .metrics { display: flex; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.creative-card .metrics .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.creative-card .metrics b { font-size: 14px; color: var(--text); }

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,12,6,.6); backdrop-filter: blur(3px); }
.modal-box {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; max-width: 680px; width: calc(100% - 40px); max-height: 88vh; overflow: auto;
  padding: 26px; box-shadow: var(--shadow-hover);
}
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 32px; height: 32px; }
.cm-img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; background: var(--bg-2); margin-bottom: 16px; }
.cm-video { margin-bottom: 16px; }
.cm-fmt { display: flex; gap: 8px; margin-bottom: 12px; }
.cm-fmt button { background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 14px; font-size: 13px; }
.cm-fmt button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.cm-open { margin-left: auto; background: var(--warning); color: #3a2a00; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.cm-open:hover { filter: brightness(1.05); }
.cm-iframe-wrap { display: grid; place-items: center; min-height: 420px; background: var(--bg-2); border-radius: 10px; overflow: hidden; }
.cm-iframe-wrap iframe { border: 0; max-width: 100%; }
.cm-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.cm-meta .b { font-size: 18px; font-weight: 600; color: var(--text); }
.cm-meta .l { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.cm-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-ink); margin: 18px 0 8px; font-weight: 600; }
.cm-copy-best { background: var(--bg-2); border-left: 3px solid var(--primary); border-radius: 8px; padding: 14px 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; color: var(--text); }
.cm-copy-alt { background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.45; margin-top: 8px; white-space: pre-wrap; color: var(--text); }
.cm-titles { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-titles span { background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font-size: 12px; }
.cm-cta { display: inline-block; background: var(--warning); color: #3a2a00; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; }

/* ---------- LAYOUT: SIDEBAR + CONTEÚDO ---------- */
:root { --topbar-h: 64px; }
.layout { display: flex; align-items: flex-start; }
.sidebar {
  flex: 0 0 272px; width: 272px; align-self: flex-start;
  position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto; background: var(--card); border-right: 1px solid var(--line);
}
.sidebar-inner { display: flex; flex-direction: column; gap: 22px; padding: 18px 18px 30px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.sidebar-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.sidebar-close { display: none; background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 30px; height: 30px; }
.sidebar .filter-row.dates { flex-direction: column; align-items: stretch; gap: 8px; }
.sidebar .filter-row.dates .muted { display: none; }
.sidebar input[type=date] { width: 100%; min-width: 0; }
.sidebar .chips { flex-direction: column; align-items: stretch; }
.sidebar .camp-chip { width: 100%; }
.content { flex: 1 1 auto; min-width: 0; }

.menu-btn { display: none; font-size: 18px; line-height: 1; padding: 7px 12px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(10,12,6,.5); z-index: 55; }
.sidebar-backdrop.open { display: block; }

@media (max-width: 980px) {
  .layout { display: block; }
  .menu-btn { display: inline-flex; align-items: center; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; max-height: 100vh; width: 290px;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 60;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-hover); }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .card, .grid-2, .kpi-grid, .note { margin-left: 14px; margin-right: 14px; }
  .tabs { order: 3; width: 100%; box-sizing: border-box; }
  .tab { flex: 1 1 0; min-width: 0; padding: 8px 4px; font-size: 12px; white-space: normal; text-align: center; }
}

.footer { padding: 18px 24px 40px; text-align: center; color: var(--muted); }

/* ---------- LOADING: splash + skeletons ---------- */
.boot-splash { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: var(--bg); transition: opacity .35s ease; }
.boot-splash.fade { opacity: 0; pointer-events: none; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.boot-logo { padding: 12px 18px; }
.boot-logo img { height: 34px; display: block; }
.boot-msg { color: var(--muted); font-size: 13px; }
.boot-bar { width: 190px; height: 4px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 42%; border-radius: 3px; background: var(--primary); animation: bootbar 1.1s infinite ease-in-out; }
@keyframes bootbar { 0% { margin-left: -42%; } 100% { margin-left: 100%; } }

.skeleton { position: relative; overflow: hidden; background: var(--card-2); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent); animation: sk-shimmer 1.3s infinite; }
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }
.sk-chart { width: 100%; height: 100%; min-height: 200px; }
.sk-card { height: 86px; }
.sk-rows { display: flex; flex-direction: column; gap: 9px; }
.sk-row { height: 34px; }
.sk-cre { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sk-cre-thumb { aspect-ratio: 1/1; border-radius: 0; }
.sk-cre-body { height: 88px; border-radius: 0; }
