:root {
  --blue-950: #06264a;
  --blue-900: #073b73;
  --blue-800: #07539c;
  --blue-700: #0068bd;
  --blue-600: #0b7bd3;
  --blue-100: #dceefe;
  --blue-50: #f1f8ff;
  --ink: #10233a;
  --muted: #607287;
  --line: #dbe6f0;
  --surface: #ffffff;
  --background: #eef4f8;
  --green: #1f9d67;
  --shadow: 0 14px 36px rgba(16, 48, 80, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
.hero {
  color: white;
  background:
    radial-gradient(circle at 82% 12%, rgba(83, 178, 255, .28), transparent 28%),
    linear-gradient(135deg, var(--blue-950), var(--blue-700));
  border-bottom: 5px solid #53b2ff;
}
.hero-inner {
  width: min(1440px, calc(100% - 40px));
  min-height: 190px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 38px;
}
.brand { width: 245px; max-height: 72px; object-fit: contain; object-position: left center; }
.eyebrow, .section-kicker {
  margin: 0 0 6px;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .13em;
}
.eyebrow { color: #9ed7ff; }
.hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.04em; }
.subtitle { margin: 13px 0 0; color: #d9edff; font-size: 1rem; }
.page { width: min(1440px, calc(100% - 40px)); margin: 26px auto 54px; }
.panel {
  background: var(--surface);
  border: 1px solid rgba(198, 216, 231, .9);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.toolbar {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}
.month-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.month-tab {
  border: 1px solid var(--line);
  color: var(--blue-900);
  background: #f8fbfe;
  border-radius: 11px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 800;
}
.month-tab.active {
  color: white;
  background: var(--blue-700);
  border-color: var(--blue-700);
  box-shadow: 0 8px 18px rgba(0, 104, 189, .22);
}
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; font-weight: 750; }
select, input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  min-height: 40px;
  padding: 8px 12px;
  outline: none;
}
select:focus, input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(11, 123, 211, .12); }
.checkbox-label { display: flex; grid-auto-flow: column; align-items: center; gap: 8px; min-height: 40px; }
.checkbox-label input { accent-color: var(--blue-700); width: 17px; height: 17px; }
.ghost-button, .info-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--blue-800);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.ghost-button:hover, .info-button:hover { background: var(--blue-50); border-color: #b8d8f4; }
.context-line {
  margin: 18px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: .9rem;
}
.context-line strong { color: var(--ink); margin-right: 8px; }
.status-dot { display: inline-block; width: 9px; height: 9px; background: var(--green); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 0 4px rgba(31, 157, 103, .12); }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card {
  min-height: 132px;
  padding: 19px;
  border-radius: 17px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -28px; bottom: -35px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(11, 123, 211, .08);
}
.kpi-label { color: var(--muted); font-size: .79rem; font-weight: 800; }
.kpi-value { margin-top: 9px; font-size: clamp(1.7rem, 2.5vw, 2.35rem); line-height: 1; font-weight: 900; letter-spacing: -.04em; color: var(--blue-900); }
.kpi-note { margin-top: 11px; color: var(--muted); font-size: .76rem; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .panel, .heat-section, .page > .panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 1.22rem; letter-spacing: -.02em; }
.section-kicker { color: var(--blue-700); }
.metric-badge {
  background: var(--blue-50);
  color: var(--blue-800);
  border: 1px solid #cfe5f8;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.ranking-list { display: grid; gap: 10px; }
.rank-row {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1.35fr) minmax(120px, 1fr) 92px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}
.rank-pos {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: #edf4fa; color: var(--blue-900); font-size: .75rem; font-weight: 900;
}
.rank-row:nth-child(-n+3) .rank-pos { background: var(--blue-700); color: white; }
.rank-name { font-size: .84rem; font-weight: 780; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 9px; background: #eaf1f6; border-radius: 99px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-700), #59b7f6); }
.rank-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 850; color: var(--blue-950); font-size: .83rem; }
.helper { margin: 6px 0 0; color: var(--muted); font-size: .82rem; }
.heat-layout {
  min-height: 440px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas:
    ". north north northeast"
    ". center southeast southeast"
    ". . south south";
  gap: 13px;
}
.heat-card {
  min-height: 118px;
  border-radius: 19px;
  padding: 18px;
  color: white;
  background: rgba(0, 92, 170, var(--heat));
  border: 1px solid rgba(0, 71, 132, .14);
  box-shadow: inset 0 -30px 50px rgba(2, 31, 61, .07);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .2s ease;
}
.heat-card:hover { transform: translateY(-2px); }
.heat-card[data-region="Norte"] { grid-area: north; }
.heat-card[data-region="Nordeste"] { grid-area: northeast; }
.heat-card[data-region="Centro-Oeste"] { grid-area: center; }
.heat-card[data-region="Sudeste"] { grid-area: southeast; }
.heat-card[data-region="Sul"] { grid-area: south; }
.heat-region { font-size: 1.02rem; font-weight: 900; }
.heat-number { font-size: 1.75rem; font-weight: 900; letter-spacing: -.04em; margin-top: 8px; }
.heat-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .72rem; opacity: .93; margin-top: 11px; }
.top-post-heading { align-items: end; }
.inline-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-controls select { min-width: 190px; }
.post-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.post-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfdff;
  min-height: 245px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.post-rank { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post-rank strong { width: 29px; height: 29px; border-radius: 9px; background: var(--blue-700); color: white; display: grid; place-items: center; }
.source-chip { border-radius: 999px; padding: 5px 8px; font-size: .66rem; font-weight: 850; background: var(--blue-100); color: var(--blue-900); }
.post-caption { margin: 0; color: #34495f; font-size: .79rem; line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.post-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.post-metric { background: white; border: 1px solid #e4edf4; border-radius: 9px; padding: 8px; }
.post-metric span { display: block; font-size: .65rem; color: var(--muted); font-weight: 750; }
.post-metric b { display: block; margin-top: 3px; font-size: .89rem; color: var(--blue-900); }
.post-link { color: var(--blue-700); font-size: .76rem; font-weight: 850; text-decoration: none; }
.post-link:hover { text-decoration: underline; }
.table-heading { align-items: end; }
.search-field input { min-width: 240px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 13px; border-bottom: 1px solid #e8eff5; text-align: left; font-size: .8rem; }
th { background: #f4f8fb; color: #41576d; font-size: .69rem; text-transform: uppercase; letter-spacing: .06em; position: sticky; top: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f7fbff; }
tbody tr:last-child td { border-bottom: 0; }
.store-cell strong { display: block; }
.store-cell span { display: block; color: var(--muted); font-size: .7rem; margin-top: 2px; }
.rate-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #edf7f2; color: #177c54; font-weight: 850; }
.empty-state { color: var(--muted); padding: 34px 8px; text-align: center; }
footer {
  background: var(--blue-950);
  color: #d8eaff;
  padding: 24px 20px;
  font-size: .78rem;
}
footer > div { width: min(1440px, 100%); margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; }
dialog {
  width: min(620px, calc(100% - 28px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 25px 80px rgba(0, 28, 58, .25);
}
dialog::backdrop { background: rgba(3, 28, 53, .58); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; color: white; background: var(--blue-900); }
.dialog-head h2 { margin: 0; font-size: 1.1rem; }
.dialog-head button { border: 0; background: transparent; color: white; font-size: 1.7rem; cursor: pointer; }
dialog ul { margin: 0; padding: 22px 42px 26px; color: #34495f; line-height: 1.55; font-size: .9rem; }
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .hero-inner { min-height: 165px; gap: 22px; }
  .brand { width: 180px; }
  .toolbar, .panel-heading, .context-line { align-items: stretch; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .two-cols { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heat-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "north north"
      "center northeast"
      "southeast southeast"
      "south south";
  }
}
@media (max-width: 600px) {
  .hero-inner { width: min(100% - 28px, 1440px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 18px; padding: 28px 0; }
  .page { width: min(100% - 20px, 1440px); margin-top: 14px; }
  .toolbar, .grid .panel, .heat-section, .page > .panel { padding: 15px; }
  .month-tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .month-tab { padding: 10px 8px; }
  .filters, .inline-controls { display: grid; grid-template-columns: 1fr; width: 100%; }
  .filters label, .filters select, .ghost-button, .inline-controls label, .inline-controls select { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 27px minmax(120px, 1fr) 78px; }
  .rank-track { display: none; }
  .heat-layout { display: grid; grid-template-columns: 1fr; grid-template-areas: "north" "northeast" "center" "southeast" "south"; min-height: unset; }
  footer > div { flex-direction: column; }
}
