/* Tipografia base */
html { -webkit-text-size-adjust: 100%; }
body { font-feature-settings: "cv11", "ss01"; }

/* KPI cards */
.kpi-card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
}
.kpi-card:hover {
  border-color: rgb(203 213 225);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}
.kpi-card .kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(100 116 139);
}
.kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgb(15 23 42);
  margin-top: 0.5rem;
  line-height: 1.2;
}
@media (min-width: 640px) {
  .kpi-card .kpi-value { font-size: 1.875rem; }
}
.kpi-card .kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}
.kpi-delta.up   { color: rgb(22 101 52); background: rgb(220 252 231); }
.kpi-delta.down { color: rgb(153 27 27); background: rgb(254 226 226); }
.kpi-delta.flat { color: rgb(71 85 105); background: rgb(241 245 249); }

/* Plataforma cards */
.platform-card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  padding: 1.25rem;
}
.platform-card .platform-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgb(241 245 249);
}
.platform-card .platform-icon {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}
.platform-card .platform-icon.meta   { background: linear-gradient(135deg, #1877F2, #0866FF); }
.platform-card .platform-icon.google { background: linear-gradient(135deg, #4285F4, #34A853); }
.platform-card .platform-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.platform-card .platform-stat label {
  display: block;
  font-size: 0.7rem;
  color: rgb(100 116 139);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.platform-card .platform-stat strong {
  display: block;
  font-size: 1.125rem;
  color: rgb(15 23 42);
  font-weight: 700;
  margin-top: 0.125rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-meta   { background: rgba(255, 255, 255, 0.15); color: white; }
.badge-google { background: rgba(255, 255, 255, 0.15); color: white; }

/* Tabela */
#tabela-campanhas tr {
  transition: background 0.15s ease;
}
#tabela-campanhas tr:hover { background: rgb(248 250 252); }
#tabela-campanhas td {
  padding: 0.875rem 1.25rem;
  vertical-align: middle;
}
.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.platform-pill.meta   { background: rgb(219 234 254); color: rgb(30 64 175); }
.platform-pill.google { background: rgb(220 252 231); color: rgb(22 101 52); }

/* Histórico */
#lista-historico li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgb(248 250 252);
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
#lista-historico li:hover {
  background: white;
  border-color: rgb(203 213 225);
  transform: translateX(2px);
}
#lista-historico li.ativo {
  background: var(--brand-50, rgb(238 242 255));
  border-color: var(--brand-500, rgb(99 102 241));
}

/* Botões de filtro/métrica */
.btn-metrica, .btn-filtro {
  transition: all 0.15s ease;
}

/* Responsividade da tabela em mobile */
@media (max-width: 640px) {
  #tabela-campanhas td {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }
}

/* Print */
@media print {
  header, footer, #seletor-relatorio, #lista-historico, .btn-metrica, .btn-filtro { display: none !important; }
  .bg-gradient-to-br { background: white !important; color: black !important; }
  body { background: white; }
}
