/* ============================================================================
   Ads Dashboard — design system Meta (getdesign.md/design-md/meta)
   Tokens extraídos do DESIGN.md: cores, tipografia, spacing, raio, elevação.
   ========================================================================== */

:root {
  /* Brand & accent */
  --primary: #0064e0;
  --primary-deep: #0457cb;
  --primary-soft: #0091ff;
  --fb-blue: #1876f2;
  --oculus-purple: #a121ce;

  /* Semântica */
  --success: #31a24c;
  --success-bg: #24e400;
  --attention: #f2a918;
  --warning: #f7b928;
  --critical: #e41e3f;
  --critical-strong: #f0284a;

  /* Superfícies */
  --canvas: #ffffff;
  --surface-soft: #f1f4f7;

  /* Texto */
  --ink-deep: #0a1317;
  --ink: #1c1e21;
  --charcoal: #444950;
  --slate: #4b4c4f;
  --steel: #5d6c7b;
  --stone: #8595a4;
  --hairline: #ced0d4;
  --hairline-soft: #dee3e9;
  --disabled-text: #bcc0c4;

  /* Raio */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 16px;
  --r-xxl: 24px;
  --r-xxxl: 32px;
  --r-feature: 40px;
  --r-full: 100px;

  /* Espaço */
  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 10px;
  --s-md: 12px;
  --s-base: 16px;
  --s-lg: 20px;
  --s-xl: 24px;
  --s-xxl: 32px;
  --s-xxxl: 40px;
  --s-section: 64px;

  /* Tipografia */
  --font: "Optimistic VF", "Montserrat", "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif;

  /* Elevação */
  --shadow-1: rgba(0, 0, 0, 0.2) 1px 1px 0 0;
  --shadow-2: rgba(20, 22, 26, 0.3) 0 1px 4px 0;

  --maxw: 1280px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--ink-deep); letter-spacing: 0; }
p { margin: 0; }
a { color: var(--primary); }

/* --------------------------------------------------------------- tipografia */
.t-heading-lg { font-size: 36px; line-height: 1.28; font-weight: 500; }
.t-heading-md { font-size: 28px; line-height: 1.21; font-weight: 300; }
.t-heading-sm { font-size: 24px; line-height: 1.25; font-weight: 500; }
.t-subtitle-lg { font-size: 18px; line-height: 1.44; font-weight: 700; }
.t-subtitle-md { font-size: 18px; line-height: 1.44; font-weight: 400; }
.t-body { font-size: 16px; line-height: 1.5; }
.t-body-sm { font-size: 14px; line-height: 1.43; letter-spacing: -0.14px; }
.t-body-sm-bold { font-size: 14px; line-height: 1.43; letter-spacing: -0.14px; font-weight: 700; }
.t-caption { font-size: 12px; line-height: 1.33; letter-spacing: 0; }
.t-caption-bold { font-size: 12px; line-height: 1.33; letter-spacing: 0; font-weight: 700; }
.muted { color: var(--steel); }
.dim { color: var(--stone); }

/* --------------------------------------------------------------- botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-xs);
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.14px;
  line-height: 1.43;
  padding: 14px 30px;
  min-height: 44px;
  cursor: pointer;
  transition: background-color 180ms ease-out, color 180ms ease-out, transform 120ms ease-out;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.985); }
.btn:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: 2px; }

.btn-cta { background: var(--primary); color: #fff; }
.btn-cta:hover { background: var(--primary-deep); }
.btn-cta:disabled { background: var(--disabled-text); color: #fff; cursor: not-allowed; }

.btn-dark { background: var(--ink-deep); color: #fff; }
.btn-dark:hover { background: var(--charcoal); }

.btn-secondary { background: transparent; color: var(--ink-deep); border: 2px solid var(--ink-deep); }
.btn-ghost { background: transparent; color: var(--ink-deep); border: 2px solid rgba(10, 19, 23, 0.12); }
.btn-ghost:hover { border-color: var(--ink-deep); }
.btn-sm { padding: 8px 16px; min-height: 36px; font-size: 13px; }
.btn-block { width: 100%; }

/* pill tabs */
.tabs { display: flex; flex-wrap: wrap; gap: var(--s-xs); }
.tab {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.14px;
  cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}
.tab:hover { border-color: var(--ink-deep); }
.tab[aria-pressed="true"] { background: var(--ink-deep); color: #fff; border-color: var(--ink-deep); }
.tab:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: 2px; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-full);
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.33;
  font-weight: 700;
  color: #fff;
}
.badge-success { background: var(--success); }
.badge-attention { background: var(--attention); }
.badge-critical { background: var(--critical); }
.badge-warning { background: var(--warning); color: var(--ink-deep); }
.badge-soft { background: var(--surface-soft); color: var(--charcoal); }
.badge-outline { background: transparent; border: 1px solid var(--hairline); color: var(--charcoal); }
.badge-dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

/* --------------------------------------------------------------- estrutura */
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-xl); }
@media (min-width: 1360px) { .shell { padding: 0 var(--s-xxxl); } }

.promo-banner {
  background: var(--ink-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.14px;
  padding: var(--s-md) var(--s-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  flex-wrap: wrap;
}
.promo-banner .promo-left { display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap; }
.promo-banner a, .promo-banner button.link {
  color: #fff; text-decoration: underline; background: none; border: none; cursor: pointer;
  font: inherit; padding: 0;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--hairline-soft);
}
.topnav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: var(--s-base);
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: var(--s-sm); min-width: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--r-full);
  background: var(--ink-deep); color: #fff;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; letter-spacing: -0.5px;
  flex: 0 0 auto;
}
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: -0.16px; color: var(--ink-deep); white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--steel); white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: var(--s-xs); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--hairline-soft); background: var(--canvas);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
.icon-btn:hover { border-color: var(--ink-deep); }
.icon-btn:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: 2px; }

main { padding-bottom: var(--s-section); }

/* --------------------------------------------------------------- filtros */
.filters {
  display: grid;
  gap: var(--s-md);
  padding: var(--s-lg) 0 var(--s-base);
}
.filters-row {
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  flex-wrap: wrap;
}
.filters-row .spacer { flex: 1 1 auto; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 12px; font-weight: 700; color: var(--charcoal); letter-spacing: 0; }

.input, .select {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 10px var(--s-md);
  height: 40px;
  min-width: 0;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.input:focus, .select:focus {
  outline: none;
  border: 2px solid var(--fb-blue);
  padding: 9px 11px;
}
.select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235d6c7b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

.chip-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hairline); border-radius: var(--r-full);
  background: var(--canvas); color: var(--ink);
  font-size: 13px; font-weight: 700; letter-spacing: -0.14px;
  padding: 8px 14px; cursor: pointer; min-height: 36px;
  transition: all 160ms ease-out;
}
.chip-toggle[aria-pressed="true"] { background: var(--ink-deep); color: #fff; border-color: var(--ink-deep); }
.chip-toggle .swatch { width: 8px; height: 8px; border-radius: 50%; }

/* --------------------------------------------------------------- cards */
.card {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xxxl);
  padding: var(--s-xxl);
}
.card-sm { border-radius: var(--r-xl); padding: var(--s-xl); }
.card-flat { border-radius: var(--r-xl); padding: var(--s-xl); border: 1px solid var(--hairline-soft); }

.section { margin-top: var(--s-xxxl); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-base); margin-bottom: var(--s-base); flex-wrap: wrap;
}
.section-head h2 { font-size: 24px; line-height: 1.25; font-weight: 500; }
.section-head p { color: var(--steel); font-size: 14px; }

/* --------------------------------------------------------------- insights */
.insights { margin-top: var(--s-base); }
.accordion {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  background: var(--canvas);
  overflow: hidden;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.accordion.is-open { border-color: var(--hairline); box-shadow: var(--shadow-2); }
.accordion-trigger {
  width: 100%;
  display: flex; align-items: center; gap: var(--s-md);
  padding: var(--s-lg) var(--s-xl);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border: none; cursor: pointer; text-align: left;
  font-family: var(--font);
}
.accordion-trigger:focus-visible { outline: 2px solid var(--fb-blue); outline-offset: -2px; }
.accordion-trigger .spark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink-deep); color: #fff;
  display: grid; place-items: center; flex: 0 0 auto;
  font-size: 16px;
}
.accordion-titles { flex: 1 1 auto; min-width: 0; }
.accordion-titles .kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel);
}
.accordion-titles h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.16px; margin-top: 2px; }
.accordion-titles .meta-line { font-size: 13px; color: var(--steel); margin-top: 4px; }
.accordion-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chev {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--hairline-soft);
  display: grid; place-items: center; flex: 0 0 auto;
  transition: transform 300ms ease-in-out, background-color 200ms ease-out;
  color: var(--charcoal);
}
.accordion.is-open .chev { transform: rotate(180deg); background: var(--surface-soft); }

.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms ease-in-out;
}
.accordion.is-open .accordion-body { grid-template-rows: 1fr; }
.accordion-body > .accordion-inner { overflow: hidden; }
.accordion-content { padding: 0 var(--s-xl) var(--s-xl); }

.insight-grid {
  display: grid;
  gap: var(--s-md);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.insight {
  position: relative;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  padding: var(--s-lg);
  background: var(--canvas);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: insight-in 380ms ease-out forwards;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.insight:hover { border-color: var(--hairline); box-shadow: var(--shadow-2); }
.insight::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--stone);
}
.insight[data-sev="critico"]::before { background: var(--critical); }
.insight[data-sev="atencao"]::before { background: var(--attention); }
.insight[data-sev="oportunidade"]::before { background: var(--primary); }
.insight[data-sev="positivo"]::before { background: var(--success); }
.insight[data-sev="info"]::before { background: var(--stone); }

.insight-head { display: flex; align-items: flex-start; gap: var(--s-xs); justify-content: space-between; }
.insight-title { font-size: 15px; font-weight: 700; letter-spacing: -0.16px; color: var(--ink-deep); line-height: 1.35; }
.insight-body { font-size: 13.5px; line-height: 1.45; color: var(--charcoal); margin-top: var(--s-xs); }
.insight-action {
  margin-top: var(--s-md);
  background: var(--surface-soft);
  border-radius: var(--r-lg);
  padding: var(--s-md);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.insight-action strong { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); margin-bottom: 4px; }
.insight-foot { display: flex; align-items: center; gap: var(--s-xs); margin-top: var(--s-md); flex-wrap: wrap; }

@keyframes insight-in { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .insight, .accordion-body, .chev, .btn, .kpi { animation: none !important; transition: none !important; }
}
.insight[data-sev="critico"] { animation: insight-in 380ms ease-out forwards, pulse-critical 3.2s ease-in-out 400ms 2; }
@keyframes pulse-critical {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 30, 63, 0); }
  50% { box-shadow: 0 0 0 3px rgba(228, 30, 63, 0.12); }
}

/* --------------------------------------------------------------- KPIs */
.kpi-grid {
  display: grid;
  gap: var(--s-md);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpi {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  padding: var(--s-lg);
  background: var(--canvas);
  min-width: 0;
  transition: border-color 180ms ease-out, transform 180ms ease-out;
}
.kpi:hover { border-color: var(--hairline); }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--steel); letter-spacing: 0.04em; text-transform: uppercase; }
.kpi-value {
  font-size: 28px; line-height: 1.15; font-weight: 500; letter-spacing: -0.5px;
  color: var(--ink-deep); margin-top: 6px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-value.neg { color: var(--critical); }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-xs); margin-top: var(--s-sm); }
.kpi-hint { font-size: 11.5px; color: var(--stone); }
.kpi-spark { width: 74px; height: 26px; flex: 0 0 auto; }
.delta { font-size: 12px; font-weight: 700; border-radius: var(--r-full); padding: 2px 8px; }
.delta-up { color: var(--success); background: rgba(49, 162, 76, 0.12); }
.delta-down { color: var(--critical); background: rgba(228, 30, 63, 0.10); }
.delta-flat { color: var(--steel); background: var(--surface-soft); }

/* --------------------------------------------------------------- canais */
.channel-grid { display: grid; gap: var(--s-md); grid-template-columns: 1fr 1fr; }
.channel-card { border-radius: var(--r-xl); border: 1px solid var(--hairline-soft); padding: var(--s-xl); background: var(--canvas); }
.channel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-xs); }
.channel-name { display: flex; align-items: center; gap: var(--s-xs); font-size: 16px; font-weight: 700; letter-spacing: -0.16px; color: var(--ink-deep); }
.channel-name .dot { width: 10px; height: 10px; border-radius: 50%; }
.channel-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-md); margin-top: var(--s-base); }
.stat-label { font-size: 11.5px; color: var(--steel); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.stat-value { font-size: 18px; font-weight: 700; letter-spacing: -0.16px; color: var(--ink-deep); font-variant-numeric: tabular-nums; }
.sharebar { height: 8px; border-radius: var(--r-full); background: var(--surface-soft); overflow: hidden; margin-top: var(--s-base); display: flex; }
.sharebar span { display: block; height: 100%; }

.funnel { display: grid; gap: var(--s-sm); margin-top: var(--s-base); }
.funnel-step { display: grid; grid-template-columns: 110px 1fr 92px; align-items: center; gap: var(--s-sm); font-size: 13px; }
.funnel-bar { height: 10px; border-radius: var(--r-full); background: var(--surface-soft); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: var(--ink-deep); border-radius: var(--r-full); transition: width 500ms ease-out; }
.funnel-step .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------------- gráficos */
.charts-grid { display: grid; gap: var(--s-md); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  padding: var(--s-xl);
  background: var(--canvas);
  min-width: 0;
}
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-xs); margin-bottom: var(--s-base); }
.chart-title { font-size: 16px; font-weight: 700; letter-spacing: -0.16px; color: var(--ink-deep); }
.chart-sub { font-size: 12.5px; color: var(--steel); margin-top: 2px; }
.chart-box { position: relative; height: 260px; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; pointer-events: none;
}
.donut-center .dc-value { font-size: 18px; font-weight: 700; letter-spacing: -0.16px; color: var(--ink-deep); }
.donut-center .dc-label { font-size: 11px; color: var(--steel); text-transform: uppercase; letter-spacing: 0.06em; }
.chart-box.tall { height: 300px; }
.chart-legend { display: flex; gap: var(--s-md); flex-wrap: wrap; margin-top: var(--s-sm); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--charcoal); }
.legend-item .dot { width: 8px; height: 8px; border-radius: 50%; }

/* --------------------------------------------------------------- tabelas */
.table-card { border: 1px solid var(--hairline-soft); border-radius: var(--r-xl); background: var(--canvas); overflow: hidden; }
.table-toolbar {
  display: flex; align-items: center; gap: var(--s-xs); justify-content: space-between;
  padding: var(--s-base) var(--s-lg); border-bottom: 1px solid var(--hairline-soft); flex-wrap: wrap;
}
.table-toolbar .search { position: relative; }
.table-toolbar .search input {
  border: none; background: var(--surface-soft); border-radius: var(--r-full);
  padding: 10px var(--s-base) 10px 36px; height: 40px; width: 260px; max-width: 60vw;
  font-family: var(--font); font-size: 14px; color: var(--ink);
}
.table-toolbar .search input:focus { outline: 2px solid var(--fb-blue); }
.table-toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--stone); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-soft);
  color: var(--charcoal);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  text-align: left; padding: 10px var(--s-md); white-space: nowrap;
  border-bottom: 1px solid var(--hairline-soft);
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--ink-deep); }
thead th .arrow { opacity: 0.4; font-size: 10px; }
thead th[aria-sort="ascending"] .arrow, thead th[aria-sort="descending"] .arrow { opacity: 1; }
tbody td { padding: 12px var(--s-md); border-bottom: 1px solid var(--hairline-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-title { font-weight: 700; color: var(--ink-deep); max-width: 320px; }
.cell-sub { font-size: 11.5px; color: var(--stone); }
.pill-channel { font-size: 11px; font-weight: 700; border-radius: var(--r-full); padding: 3px 9px; display: inline-block; }
.pill-meta { background: rgba(0, 100, 224, 0.1); color: var(--primary); }
.pill-google { background: rgba(161, 33, 206, 0.1); color: var(--oculus-purple); }
.roas-good { color: var(--success); font-weight: 700; }
.roas-mid { color: var(--attention); font-weight: 700; }
.roas-bad { color: var(--critical); font-weight: 700; }
.table-foot { padding: var(--s-md) var(--s-lg); font-size: 12px; color: var(--steel); border-top: 1px solid var(--hairline-soft); display: flex; justify-content: space-between; gap: var(--s-xs); flex-wrap: wrap; }

/* --------------------------------------------------------------- estados */
.skeleton { position: relative; overflow: hidden; background: var(--surface-soft); border-radius: var(--r-lg); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.empty { padding: var(--s-xxxl); text-align: center; color: var(--steel); font-size: 14px; }
.banner-error {
  border: 1px solid var(--critical-strong); background: rgba(228,30,63,0.06);
  color: var(--critical); border-radius: var(--r-lg); padding: var(--s-md) var(--s-base);
  font-size: 13px; margin-top: var(--s-base);
}

footer.site-footer {
  border-top: 1px solid var(--hairline-soft);
  padding: var(--s-xl) 0;
  color: var(--steel);
  font-size: 12px;
  display: flex; justify-content: space-between; gap: var(--s-xs); flex-wrap: wrap;
}

/* --------------------------------------------------------------- gate (login) */
.gate-body { background: var(--surface-soft); min-height: 100vh; display: grid; place-items: center; padding: var(--s-xl); }
.gate { width: 100%; max-width: 420px; }
.gate-card {
  background: var(--canvas); border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xxxl); padding: var(--s-xxl); box-shadow: var(--shadow-2);
}
.gate-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.gate-title { font-size: 32px; line-height: 1.2; font-weight: 500; margin-top: 6px; color: var(--ink-deep); }
.gate-sub { font-size: 14px; color: var(--steel); margin-top: 6px; }
.gate-form { display: grid; gap: var(--s-base); margin-top: var(--s-xl); }
.gate-form .field span { font-size: 12px; font-weight: 700; color: var(--charcoal); }
.gate-form .input { width: 100%; }
.gate-alert { border-radius: var(--r-lg); padding: var(--s-sm) var(--s-md); font-size: 13px; margin-top: var(--s-base); }
.gate-alert-critical { background: rgba(228,30,63,0.08); color: var(--critical); border: 1px solid rgba(228,30,63,0.25); }
.gate-code {
  background: var(--ink-deep); color: #fff; border-radius: var(--r-lg);
  padding: var(--s-md); font-size: 12px; overflow-x: auto; margin-top: var(--s-base);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.check { display: flex; align-items: center; gap: var(--s-xs); font-size: 13px; color: var(--charcoal); }

/* --------------------------------------------------------------- responsivo */
@media (max-width: 1023px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .shell { padding: 0 var(--s-base); }
  .card { padding: var(--s-xl); border-radius: var(--r-xxl); }
  .kpi-value { font-size: 24px; }
  .brand-sub { display: none; }
  .section { margin-top: var(--s-xl); }
  .section-head h2 { font-size: 20px; }
  .accordion-trigger { padding: var(--s-base); flex-wrap: wrap; }
  .accordion-chips { width: 100%; order: 3; }
  .insight-grid { grid-template-columns: 1fr; }
  .chart-box { height: 220px; }
  .funnel-step { grid-template-columns: 88px 1fr 74px; font-size: 12px; }
  .table-toolbar { padding: var(--s-md); }
  .table-toolbar .search input { width: 100%; max-width: none; }
  .table-toolbar .search { width: 100%; }
  .gate-card { padding: var(--s-xl); border-radius: var(--r-xxl); }
  .gate-title { font-size: 26px; }
}
@media (max-width: 479px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 18px; }
  .kpi-value { font-size: 26px; }
  .insight-title { font-size: 14px; }
  .promo-banner { font-size: 12.5px; padding: var(--s-sm) var(--s-base); }
  .filters-row .btn { width: 100%; }
}
