:root {
  --primary: #9ACD32;
  --primary-dark: #6ba91f;
  --primary-darker: #4a7314;
  --bg-soft: #f7faf3;
  --border-soft: #e5e9df;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
}
* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui; color: #1a1a1a; }
main.container { max-width: 1280px; }
nav { display: flex; justify-content: space-between; align-items: center; }
nav form { margin: 0; }
nav button { padding: 4px 12px; font-size: 13px; }

h1, h2 { margin-bottom: 8px; }
.section-title { margin-top: 36px; margin-bottom: 12px; font-size: 18px; color: #374151; font-weight: 600; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 16px; flex-wrap: wrap; gap: 12px; }
.date-picker { display: flex; align-items: center; gap: 6px; }
.date-picker input { margin: 0; padding: 6px 10px; font-size: 14px; max-width: 160px; }
.date-picker button { padding: 4px 12px; font-size: 14px; min-width: 36px; }

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: white;
  border-radius: 16px;
  padding: 24px 32px;
  margin: 16px 0 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(154, 205, 50, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title { font-size: 14px; opacity: 0.7; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.hero-status { font-weight: 700; }
.hero-status.bom { color: #84cc16; }
.hero-status.ruim { color: #f87171; }
.hero-status.neutro { color: #fbbf24; }

.funnel { display: flex; align-items: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.funnel-step {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 14px 18px;
  min-width: 110px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.funnel-step.highlight { background: var(--primary); color: #1a1a1a; border-color: var(--primary); }
.funnel-num { font-size: 24px; font-weight: 800; line-height: 1; }
.funnel-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; margin-top: 4px; }
.funnel-pct { font-size: 10px; opacity: 0.6; margin-top: 2px; }
.funnel-arrow { color: rgba(255,255,255,0.3); font-size: 18px; font-weight: 300; }

.hero-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  gap: 24px;
  font-size: 13px;
  opacity: 0.85;
  flex-wrap: wrap;
}
.hero-meta strong { color: var(--primary); }

/* ============ DIAGNOSIS GRID ============ */
.diag-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 16px 0;
}
@media (max-width: 768px) { .diag-grid { grid-template-columns: 1fr; } }
.diag-cell {
  background: white;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
}
.diag-cell.risco { border-left-color: #f59e0b; }
.diag-cell.oportunidade { border-left-color: #10b981; }
.diag-cell.acao { border-left-color: #3b82f6; }
.diag-cell h4 { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.diag-cell p { margin: 0; line-height: 1.5; font-size: 14px; }
.diag-empty { background: var(--bg-soft); padding: 16px; border-radius: 8px; color: var(--text-muted); font-size: 13px; }
.diag-confidence { font-size: 11px; color: var(--text-dim); text-align: right; margin-top: 4px; }

/* ============ SUMMARY (WhatsApp box) ============ */
.summary-box {
  background: #25d366;
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.summary-box::before {
  content: "💬";
  font-size: 22px;
  flex-shrink: 0;
}

/* ============ FEATURED CAMPAIGNS ============ */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.featured-card {
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.featured-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.featured-card .cover-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-card .cover-wrap::before {
  content: attr(data-initial);
  position: absolute;
  font-size: 96px;
  font-weight: 800;
  color: rgba(154, 205, 50, 0.15);
  z-index: 0;
}
.featured-card img.cover {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}
.featured-card img.cover.hires {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-card .body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.featured-card .name { font-weight: 600; font-size: 14px; line-height: 1.3; margin: 0; }
.featured-card .meta-line {
  display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-muted);
}
.featured-card .kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin: 4px 0;
}
.featured-card .kpi-row > div { text-align: center; }
.featured-card .kpi-row .val { font-weight: 700; font-size: 16px; }
.featured-card .kpi-row .lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.featured-card .body-preview { font-size: 12px; color: #4b5563; line-height: 1.4; max-height: 70px; overflow: hidden; }
.featured-card .footer-line { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }

/* ============ KPI CARDS (legacy, only used as fallback) ============ */
.kpi-card { padding: 16px; background: var(--bg-soft); border-radius: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; }
.kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ============ TABLE ============ */
.table-wrap { overflow-x: auto; }
table { font-size: 13px; margin: 0; }
table thead { background: var(--bg-soft); position: sticky; top: 0; z-index: 1; }
table th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
table tbody tr:hover { background: #fafafa; }
table img.creative-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* ============ PLACEHOLDERS ============ */
.creative-placeholder {
  width: 48px; height: 48px; border-radius: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.creative-placeholder.video { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.creative-placeholder.text { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.creative-placeholder.none { background: #d4d4d4; color: #888; }
.creative-placeholder.large { width: 100%; aspect-ratio: 1 / 1; border-radius: 0; font-size: 64px; }

/* ============ BADGES ============ */
.classification { padding: 4px 10px; border-radius: 12px; font-weight: 600; font-size: 11px; white-space: nowrap; }
.cls-scale { background: #dcfce7; color: #166534; }
.cls-keep { background: #dbeafe; color: #1e40af; }
.cls-review { background: #fef3c7; color: #92400e; }
.cls-pause { background: #fee2e2; color: #991b1b; }

.status-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.status-ACTIVE { background: #dcfce7; color: #166534; }
.status-PAUSED { background: #e5e7eb; color: #374151; }
.status-ARCHIVED { background: #fecaca; color: #991b1b; }

/* ============ ACTIONS ============ */
.action-card {
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 8px 0;
  background: white;
}
.action-type {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; margin-right: 8px;
  background: var(--primary); color: #1a1a1a;
}

/* ============ MINI-CARDS (footer row) ============ */
.meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
@media (max-width: 768px) { .meta-row { grid-template-columns: 1fr; } }
.mini-card {
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}
.mini-card h4 { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.mini-card .stat { font-size: 16px; font-weight: 600; }
.channel-list { list-style: none; padding: 0; margin: 0; }
.channel-list li { padding: 4px 0; font-size: 13px; }

/* ============ CREATIVE CELL (table) ============ */
.creative-cell { display: flex; gap: 10px; align-items: flex-start; max-width: 360px; }
.creative-cell > div { min-width: 0; }
.creative-cell .ad-body { font-size: 11px; color: #6b7280; line-height: 1.35; max-height: 48px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin-top: 2px; }

/* ============ EMPTY STATES ============ */
.empty-state { color: var(--text-muted); font-style: italic; padding: 16px; text-align: center; background: var(--bg-soft); border-radius: 8px; }

footer.foot { color: var(--text-dim); font-size: 11px; text-align: center; margin-top: 40px; padding: 16px; }
