/* CSS específico do v2 — só o que NÃO couber em assets/style_v2.css do hub.
   Tokens visuais (cores, espaçamento) reusam --v2-* do tema global.
   Componentes (KPI card, tab bar locked, spinner, etc.) DEVEM herdar do
   style_v2.css. Adicionar aqui só estilos novos exclusivos do Lançamento. */


/* ── Header / logo ──────────────────────────────────────────────────────── */

/* Bloco de texto ao lado da logo no header */
.v2-logo-text { display: flex; flex-direction: column; justify-content: center; }
.v2-logo-text h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 0;
}
.v2-logo-text h1 span { color: var(--v2-accent); }
.v2-logo-text p {
  color: var(--v2-dim);
  font-size: .68rem;
  font-family: 'JetBrains Mono', monospace;
  margin: 3px 0 0;
}


/* ── Filtros (selectors expert + lançamento) ─────────────────────────────── */

/* Grupo de filtro flexível; usado pelo dropdown de Lançamento.
   Não-namespeado deliberadamente: é genérico e pode ser promovido pro
   style_v2.css do hub se outras páginas precisarem. */
.v2-filter-grow { flex: 1 1 220px; min-width: 220px; }


/* ── Painéis de aba (placeholder / locked) ───────────────────────────────── */

/* Placeholder de aba ainda não implementada */
.v2-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 360px;
  padding: 32px;
  color: var(--v2-dim);
  text-align: center;
}
.v2-placeholder h2 { color: var(--v2-text); margin: 0; }

/* Aba bloqueada (sem permissão) */
.v2-panel-locked {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 32px;
  color: var(--v2-dim);
  font-size: .9rem;
}


/* ── Captura: cap-top-grid (gauges + KPI cards) ──────────────────────────── */

.v2-cap-top-grid {
  display: grid;
  grid-template-columns: 3fr 3fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.v2-cap-gauge-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 11px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 130px;
}
.v2-cap-gauge-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--v2-dim);
  font-weight: 700;
}
@media (max-width: 1100px) {
  .v2-cap-top-grid { grid-template-columns: 1fr 1fr; }
}

.v2-cap-gauge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.v2-cap-gauge-grid .v2-cap-gauge-card {
  min-height: 280px;
}
.v2-cap-gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .v2-cap-gauge-grid { grid-template-columns: 1fr; }
}

.v2-cap-bottom-grid {
  display: grid;
  grid-template-columns: 1.3fr 3fr;
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .v2-cap-bottom-grid { grid-template-columns: 1fr; }
}

/* ── Tráfego: barra de filtros ───────────────────────────────────────────── */
.v2-traf-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 11px;
}
.v2-traf-filters .v2-filter-group { display: flex; flex-direction: column; gap: 4px; }
.v2-traf-filters .v2-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--v2-dim);
  font-weight: 700;
}


/* ── Top Criativos rank (Visão Geral) ────────────────────────────────────── */

.v2-rank-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  padding: 18px 14px;
  margin-bottom: 24px;
}
.v2-rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.v2-rank-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .92rem;
  font-weight: 800;
  color: var(--v2-text);
  letter-spacing: .3px;
}
.v2-pill-group {
  display: inline-flex;
  background: var(--v2-bg);
  border: 1px solid var(--v2-border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.v2-pill-btn {
  background: transparent;
  border: 0;
  color: var(--v2-dim);
  padding: 6px 14px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.v2-pill-btn:hover:not(.v2-pill-active) { color: var(--v2-text); }
.v2-pill-btn.v2-pill-active {
  background: var(--v2-accent);
  color: #fff;
}


/* ── Donuts (Visão Geral) ────────────────────────────────────────────────── */

.v2-donut-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.v2-donut-card {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 380px;
}
.v2-donut-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  font-weight: 800;
  text-align: center;
  color: var(--v2-text);
  letter-spacing: .3px;
}
.v2-donut-chart {
  flex: 0 0 auto;
}
.v2-donut-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--v2-dim);
  font-size: 1.2rem;
}
.v2-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 6px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
}
.v2-donut-legend-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
}
.v2-donut-legend-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.v2-donut-legend-label { color: var(--v2-text); }
.v2-donut-legend-value { color: var(--v2-dim); font-weight: 600; }


/* TODO: ex.: layouts específicos
.v2-lc-cap-top-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
}
.v2-lc-cap-top-grid > :nth-child(1),
.v2-lc-cap-top-grid > :nth-child(2) { grid-column: span 3; }
.v2-lc-cap-top-grid > :nth-child(3),
.v2-lc-cap-top-grid > :nth-child(4) { grid-column: span 1; }
*/

/* =============================================================================
   Modal de drilldown — usado em Criativos (clique numa row da tabela)
   ============================================================================= */
.v2-modal {
  position: fixed; inset: 0; z-index: 9999;
}
.v2-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.v2-modal-card {
  position: relative;
  max-width: 1100px; width: calc(100% - 40px);
  max-height: calc(100vh - 60px); overflow: auto;
  margin: 30px auto;
  background: #15171e;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.v2-modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; background: #15171e; z-index: 2;
}
.v2-modal-title-wrap { flex: 1; min-width: 0; }
.v2-modal-title {
  font-size: 16px; font-weight: 700; color: #e8eaf0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v2-modal-subtitle {
  font-size: 12px; color: #95b1cf; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v2-modal-close {
  background: transparent; border: none; color: #a8aebc;
  font-size: 28px; line-height: 1; cursor: pointer;
  padding: 0 8px; margin-left: 16px;
}
.v2-modal-close:hover { color: #fff; }
.v2-modal-body { padding: 20px; }
.v2-modal-cols {
  display: grid; grid-template-columns: 320px 1fr; gap: 20px;
}
@media (max-width: 768px) {
  .v2-modal-cols { grid-template-columns: 1fr; }
}
.v2-modal-left { display: flex; flex-direction: column; }
.v2-modal-media {
  width: 100%; max-height: 480px; object-fit: contain;
  background: #0a0c12; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}
.v2-modal-right { display: flex; flex-direction: column; gap: 8px; }
.v2-modal-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.v2-modal-kpi {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px; padding: 8px 10px;
}
.v2-modal-kpi-label {
  font-size: 10px; color: #7a8294; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.v2-modal-kpi-value {
  font-size: 16px; font-weight: 700; color: #e8eaf0;
  font-family: 'JetBrains Mono', monospace; margin-top: 2px;
}
.v2-modal-kpi-sub { font-size: 10px; color: #95b1cf; }
.v2-modal-section-title {
  font-size: 12px; color: #a8aebc; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 12px;
}
.v2-modal-ls-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.v2-modal-ls-row {
  background: rgba(255,255,255,0.02);
  padding: 6px 10px; border-radius: 4px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
}
.v2-modal-ls-label { color: #a8aebc; }
.v2-modal-ls-val { color: #e8eaf0; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.v2-modal-creative-text {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; padding: 10px 12px;
}
.v2-modal-creative-title {
  font-size: 13px; font-weight: 700; color: #e8eaf0; margin-bottom: 4px;
}
.v2-modal-creative-body {
  font-size: 12px; color: #cdd2dd; white-space: pre-wrap;
}
