/* Painel: seções de visão geral e campanhas (a galeria usa gallery.css). */
.topbar { align-items: end; }
.quick { display: flex; gap: 6px; align-self: end; }
.quick button, .chip button {
  font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); border-radius: 99px; padding: 6px 10px; cursor: pointer;
}
.quick button:hover { border-color: var(--accent); }
.sections { width: 100%; display: flex; gap: 18px; font-size: 13px; }
.sections a { color: var(--muted); text-decoration: none; }
.sections a:hover { color: var(--accent); }

.block { margin-bottom: 34px; scroll-margin-top: 140px; }
.block h2 { font-size: 17px; margin: 0 0 12px; }
.block h2 small { font-weight: 400; font-size: 13px; }
.block-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.block-head h2 { margin: 0; }
.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: auto; }
.inline select { font: inherit; font-size: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border-radius: 99px; padding: 4px 6px 4px 12px; font-size: 13px; max-width: 60ch; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { background: rgba(255,255,255,.2); border: none; color: #fff; padding: 2px 8px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi-card .label { font-size: 12px; color: var(--muted); }
.kpi-card .value { font-size: 24px; font-weight: 700; margin: 4px 0 2px; }
.kpi-card .delta { font-size: 12px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }

.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.charts > .panel:only-child { grid-column: 1 / -1; }
.charts .panel:first-child:not(.wide) { order: 0; }
.charts .wide { min-width: 0; }
.charts:nth-of-type(2) { grid-template-columns: 1fr 2fr; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
.panel h3 small { text-transform: none; letter-spacing: 0; }
.chart-box { position: relative; height: 260px; }
.scroll { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th:first-child, table.data td:first-child,
table.data th.text, table.data td.text { text-align: left; }
table.data td.text { white-space: normal; min-width: 220px; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th.sorted::after { content: " ▾"; }
table.sortable th.sorted.asc::after { content: " ▴"; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--bg); }
table.data tbody tr.selected { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pill { display: inline-block; color: #fff; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #6b7280; }
.pill.leads { background: #15803d; } .pill.traffic { background: #2563eb; } .pill.engagement { background: #c026d3; }
.pill.video { background: #ea580c; } .pill.reach { background: #0891b2; }

@media (max-width: 900px) {
  .charts, .charts:nth-of-type(2) { grid-template-columns: 1fr; }
}

/* ---- abas principais ---- */
.tabs-main { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; align-self: end; }
.tabs-main button {
  font: inherit; font-size: 14px; font-weight: 600; border: none; background: none; color: var(--muted);
  padding: 7px 16px; border-radius: 7px; cursor: pointer;
}
.tabs-main button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tab-panel { padding-top: 4px; }
.sections { margin-bottom: 14px; }

/* ---- alertas ---- */
.segment-filter { display: flex; gap: 6px; }
.segment-filter button {
  font: inherit; font-size: 13px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 99px; padding: 5px 12px; cursor: pointer;
}
.segment-filter button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.note { font-size: 13px; margin: 4px 0 16px; }
.alert-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.alert-col { background: var(--surface); border: 1px solid var(--border); border-top-width: 4px; border-radius: var(--radius); padding: 12px 14px; min-height: 140px; }
.alert-col h3 { margin: 0 0 10px; font-size: 15px; }
.alert-col h3 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.alert-col.risk { border-top-color: var(--bad); }
.alert-col.watch { border-top-color: #ca8a04; }
.alert-col.good { border-top-color: var(--good); }
.alert-list.unclassified { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.alert-item {
  display: flex; justify-content: space-between; gap: 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; cursor: pointer; font-size: 13px;
}
.alert-item:hover { border-color: var(--accent); }

/* ---- visão geral e criativos ---- */
#overview .panel { margin-bottom: 12px; }
.charts { margin-bottom: 0; }
table.data tfoot td { font-weight: 700; border-bottom: none; border-top: 2px solid var(--border); }
.campaigns-panel summary { cursor: pointer; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.campaigns-panel[open] summary { margin-bottom: 10px; }
.creatives-head { position: sticky; top: 118px; z-index: 3; background: var(--bg); padding: 6px 0; }
.creative-section { margin-bottom: 22px; }
.section-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 10px; }
.section-head .pill { font-size: 12px; padding: 3px 10px; }
.more {
  margin-top: 10px; font: inherit; font-size: 13px; border: 1px dashed var(--border); background: none;
  color: var(--accent); border-radius: 8px; padding: 8px 14px; cursor: pointer; width: 100%;
}

@media (max-width: 900px) {
  .alert-columns { grid-template-columns: 1fr; }
  .creatives-head { position: static; }
}

/* ---- alertas: cartões ---- */
.alert-list { display: grid; gap: 8px; }
.alert-item { flex-direction: column; align-items: stretch; }
.alert-head { display: flex; justify-content: space-between; gap: 8px; }
.alert-item ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.45; }
.alert-item li.risk::marker { color: var(--bad); }
.alert-item li.watch::marker { color: #ca8a04; }
.alert-item li.risk { color: var(--text); }
.alert-item p { margin: 4px 0 0; font-size: 12px; }
.alert-item.risk { border-left: 4px solid var(--bad); }
.alert-item.watch { border-left: 4px solid #ca8a04; }
.alert-item.good { border-left: 4px solid var(--good); }
.alert-col h3 .count {
  display: inline-block; min-width: 22px; text-align: center; margin-right: 6px; font-size: 12px;
  background: var(--bg); border-radius: 99px; padding: 1px 7px;
}
.stale { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* ---- origem: mídia paga × SEO ---- */
.origin-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.origin-tile { border-radius: var(--radius); padding: 14px 16px; color: #fff; }
.origin-tile.paid { background: #2563eb; }
.origin-tile.seo { background: #7c3aed; }
.tile-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
.tile-value { font-size: 30px; font-weight: 800; line-height: 1.15; }
.tile-share { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.tile-detail { font-size: 12px; opacity: .92; }
table.data tr.group-row td { font-weight: 700; background: var(--bg); }
table.data tr.group-row.paid td:first-child { border-left: 4px solid #2563eb; }
table.data tr.group-row.seo td:first-child { border-left: 4px solid #7c3aed; }
.fine { font-size: 11px; margin: 10px 0 0; }

/* ---- painéis por segmento ---- */
.charts.two { grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
.bucket-switch { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 8px; }
.bucket-switch button { font: inherit; font-size: 12px; border: none; background: none; color: var(--muted); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.bucket-switch button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.chart-box.tall { height: 320px; }
table.data.compact { margin-top: 10px; font-size: 12px; }
table.data.compact td, table.data.compact th { padding: 5px 6px; }
table.data tr.sub-row td { color: var(--muted); font-size: 12px; }
table.data tr.dim td { opacity: .6; }
table.data caption { caption-side: top; text-align: left; padding: 8px 0; }
.pill.st-live { background: #15803d; }
.pill.st-paused { background: #ca8a04; }
.pill.st-removed, .pill.st-stopped { background: #9ca3af; }
.subhead { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 10px; }
.kpi-card.highlight { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
form[hidden] { display: none !important; }
@media (max-width: 900px) { .charts.two { grid-template-columns: 1fr; } }
