/* ==========================================================================
   FLYTO ANALYTICS - DASHBOARD DE TRÁFEGO PAGO & AUDIOVISUAL
   Identidade: Clean Editorial Cinza (#eae9ea) & Verde Flyto (#277e1b / #206e14)
   Tipografia: Plus Jakarta Sans
   ========================================================================== */

:root {
  /* Cores de Superfície & Fundo */
  --bg-page: #eae9ea;
  --bg-card: #ffffff;
  --bg-card-hover: #fafcfc;
  --bg-subtle: #f3f5f5;
  --bg-glass: rgba(234, 233, 234, 0.94);

  /* Verde Flyto (Branding Principal) */
  --green-soft: #d8f7d3;
  --green-subtle: #eafbea;
  --green-ribbon: #e9f7e8;
  --green-primary: #277e1b;
  --green-vibrant: #2f9b20;
  --green-dark: #1b5e13;
  --green-glow: rgba(39, 126, 27, 0.16);

  /* Tipografia & Contraste */
  --text-primary: #111616;
  --text-secondary: #434f4f;
  --text-muted: #6e7d7d;
  --text-inverse: #ffffff;

  /* Bordas e Sombras */
  --border-subtle: rgba(17, 22, 22, 0.08);
  --border-card: rgba(17, 22, 22, 0.09);
  --border-green: rgba(39, 126, 27, 0.28);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --shadow-sm: 0 2px 8px rgba(17, 22, 22, 0.04);
  --shadow-card: 0 8px 24px -6px rgba(17, 22, 22, 0.06), 0 2px 6px -1px rgba(17, 22, 22, 0.02);
  --shadow-hover: 0 14px 34px -8px rgba(17, 22, 22, 0.1), 0 4px 12px -2px rgba(17, 22, 22, 0.04);

  /* Animações e Transições */
  --trans-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --trans-normal: 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Grid Background */
.dash-bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(17, 22, 22, 0.032) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 22, 22, 0.032) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  z-index: 0;
}

.dash-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   1. BARRA FLUTUANTE DE APRESENTAÇÃO / PRINT
   ========================================================================== */
.presentation-floating-bar {
  display: none;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #111616;
  color: #ffffff;
  padding: 12px 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid var(--green-primary);
}

.presentation-mode .presentation-floating-bar {
  display: block;
}

.presentation-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.presentation-bar-info strong {
  font-size: 0.95rem;
  color: #ffffff;
  display: block;
}

.presentation-bar-info p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.presentation-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   2. CARIMBO OFICIAL FLYTO NO TOPO (VISÍVEL NO MODO PRINT / IMPRESSÃO)
   ========================================================================== */
.print-branding-header {
  display: none;
  padding: 24px 0 20px 0;
  border-bottom: 2px solid var(--text-primary);
  margin-bottom: 28px;
}

.presentation-mode .print-branding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.print-brand-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.print-brand-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.print-brand-text h3 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.print-brand-text span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.print-brand-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.print-period-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.print-website {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--green-dark);
}

/* ==========================================================================
   3. TOPBAR DE NAVEGAÇÃO
   ========================================================================== */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
  box-shadow: 0 4px 16px rgba(17, 22, 22, 0.025);
  transition: transform var(--trans-fast);
}

.presentation-mode .dash-header {
  display: none !important;
}

.dash-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dash-brand-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-brand-logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}

.dash-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-header-title h2 {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.dash-header-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   4. SISTEMA DE BOTÕES FLYTO
   ========================================================================== */
.btn-dash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--trans-fast);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}

/* Verde Sólido Primário */
.btn-dash-primary {
  background: linear-gradient(135deg, #2f9b20 0%, #206e14 100%);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(39, 126, 27, 0.32);
}

.btn-dash-primary:hover {
  background: linear-gradient(135deg, #37ae26 0%, #257e17 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(39, 126, 27, 0.42);
}

.btn-dash-primary:active {
  transform: translateY(0);
}

/* Botão Brand */
.btn-dash-brand {
  background: #ffffff;
  color: var(--green-dark);
  border: 1.5px solid var(--green-primary);
  box-shadow: 0 2px 8px var(--green-glow);
}

.btn-dash-brand:hover {
  background: var(--green-subtle);
  color: #12450c;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--green-glow);
}

/* Botão Secundário Branco */
.btn-dash-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}

.btn-dash-secondary:hover {
  background: var(--bg-subtle);
  border-color: rgba(17, 22, 22, 0.18);
  transform: translateY(-1px);
}

/* Botão Outline */
.btn-dash-outline {
  background: #ffffff;
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.btn-dash-outline:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-dash-outline.text-danger {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.25);
}

.btn-dash-outline.text-danger:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

/* Botão Ghost */
.btn-dash-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-dash-ghost:hover {
  color: var(--text-primary);
  background: rgba(17, 22, 22, 0.05);
}

.btn-dash-sm {
  padding: 6px 14px;
  font-size: 0.76rem;
}

/* ==========================================================================
   5. BANNER EXECUTIVO DO CLIENTE
   ========================================================================== */
.dash-main {
  padding: 24px 0 60px 0;
}

.dash-client-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* Marca d'água Flyto no Card do Cliente */
.dash-client-panel::after {
  content: '';
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: 140px;
  background-image: url('./assets/logo-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.03;
  pointer-events: none;
}

.client-panel-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.client-info-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}

/* Logo Flyto Icon Padrão Sempre Presente */
.client-avatar-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1.5px solid rgba(39, 126, 27, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(39, 126, 27, 0.12);
  flex-shrink: 0;
  padding: 9px;
}

.client-avatar-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.client-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.client-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.client-period-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

/* Input Inline do Nome do Cliente */
.client-name-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 580px;
}

.client-name-input {
  width: 100%;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 2px 36px 2px 0;
  outline: none;
  transition: all var(--trans-fast);
  font-family: inherit;
}

.client-name-input:hover {
  border-bottom-color: rgba(39, 126, 27, 0.4);
}

.client-name-input:focus {
  background: #ffffff;
  border: 1px solid var(--green-primary);
  border-radius: var(--radius-sm);
  padding: 4px 36px 4px 10px;
  box-shadow: 0 0 0 3px var(--green-glow);
}

.btn-clear-name {
  position: absolute;
  right: 4px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 50%;
  line-height: 1;
  opacity: 0.5;
  transition: all var(--trans-fast);
}

.btn-clear-name:hover {
  opacity: 1;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

/* Barra de Ferramentas */
.client-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.presentation-mode .client-toolbar {
  display: none !important;
}

.dash-action-toast {
  display: none;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--green-subtle);
  color: var(--green-dark);
  border: 1px solid var(--border-green);
  animation: modalIn 0.2s ease-out;
}

/* ==========================================================================
   6. SEÇÃO DE KPIS PRINCIPAIS
   ========================================================================== */
.dash-kpi-section {
  margin-bottom: 32px;
}

.dash-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.dash-section-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Grid de 4 Cards de Métricas com Marca d'Água Flyto */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.kpi-card::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 96px;
  height: 96px;
  background-image: url('./assets/logo-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.032;
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi-card-highlight {
  border: 2px solid var(--green-primary);
  background: linear-gradient(180deg, #ffffff 0%, #f7fdf7 100%);
  box-shadow: 0 8px 26px -6px rgba(39, 126, 27, 0.15);
}

.kpi-card-highlight::after {
  opacity: 0.09;
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.kpi-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-gold {
  background: #fef3c7;
  color: #b45309;
}

.icon-green {
  background: var(--green-soft);
  color: var(--green-dark);
}

.icon-blue {
  background: #e0e7ff;
  color: #4338ca;
}

.icon-purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.kpi-main-val {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.text-green {
  color: var(--green-dark) !important;
}

.kpi-sub-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   7. FAIXA DE MÉTRICAS SECUNDÁRIAS (RIBBON COM DESTAQUE VERDE DA PALETA)
   ========================================================================== */
.kpi-ribbon {
  background: linear-gradient(135deg, #eaf7e8 0%, #dff4de 100%);
  border: 1.5px solid #a3e39d;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: 0 6px 20px rgba(39, 126, 27, 0.09);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.kpi-ribbon::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 110px;
  height: 110px;
  background-image: url('./assets/logo-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.035;
  pointer-events: none;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  flex: 1;
  min-width: 140px;
  position: relative;
  z-index: 1;
}

.ribbon-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1a6410;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ribbon-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.ribbon-divider {
  width: 1.5px;
  height: 36px;
  background: rgba(39, 126, 27, 0.22);
}

/* ==========================================================================
   8. BLOCO DE RETENÇÃO DE VÍDEO
   ========================================================================== */
.video-retention-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--green-primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.retention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.retention-title-wrap h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.retention-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.retention-bars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.retention-bar-col {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.retention-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.retention-bar-label strong {
  color: var(--text-primary);
  font-weight: 800;
}

.retention-track {
  width: 100%;
  height: 8px;
  background: rgba(17, 22, 22, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.retention-fill {
  height: 100%;
  background: linear-gradient(90deg, #37ae26 0%, #206e14 100%);
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-complete {
  background: linear-gradient(90deg, #206e14 0%, #154e0c 100%);
}

.retention-rate {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   9. ANÚNCIOS CONSOLIDADOS & CARDS COM UPLOAD
   ========================================================================== */
.dash-ads-section {
  margin-bottom: 38px;
}

.ads-filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.presentation-mode .ads-filter-controls {
  display: none !important;
}

.ads-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  color: var(--text-muted);
  width: 240px;
}

.ads-search-box input {
  border: none;
  outline: none;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: transparent;
  width: 100%;
  font-family: inherit;
}

.dash-select {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

/* Grid de Cards de Anúncios com Marca d'Água Flyto */
.ads-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ad-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.ad-card::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 80px;
  height: 80px;
  background-image: url('./assets/logo-icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.03;
  pointer-events: none;
}

.ad-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.ad-card-header {
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ad-title-block h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
}

.ad-sub-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ad-format-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.format-video {
  background: #ede9fe;
  color: #6d28d9;
}

.format-image {
  background: #e0f2fe;
  color: #0369a1;
}

/* Corpo do Card: Capa à Esquerda + Métricas à Direita */
.ad-card-body {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}

/* Área de Capa do Anúncio */
.ad-cover-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  background: #e7eaeb;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Botões sobre a Capa Carregada */
.ad-cover-actions-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 22, 22, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.ad-cover-wrapper:hover .ad-cover-actions-overlay {
  opacity: 1;
}

.presentation-mode .ad-cover-actions-overlay {
  display: none !important;
}

.btn-cover-action {
  background: #ffffff;
  color: var(--text-primary);
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform var(--trans-fast);
}

.btn-cover-action:hover {
  transform: scale(1.05);
}

/* Upload Vazio / Sem Capa */
.ad-cover-upload-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: background var(--trans-fast);
  background: #edf0f0;
}

.ad-cover-upload-empty:hover {
  background: #e2e6e6;
}

.ad-cover-upload-empty svg {
  color: var(--green-primary);
  margin-bottom: 6px;
}

.ad-cover-upload-empty span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ad-cover-upload-empty small {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.presentation-mode .ad-cover-upload-empty small {
  display: none;
}

/* Métricas do Anúncio (Grade 2x3 limpa) */
.ad-metrics-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ad-metric-pill {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ad-metric-pill.highlight-pill {
  background: var(--green-subtle);
  border: 1px solid var(--border-green);
}

.metric-pill-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.highlight-pill .metric-pill-label {
  color: var(--green-dark);
}

.metric-pill-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.highlight-pill .metric-pill-val {
  color: var(--green-dark);
}

/* Retenção de Vídeo dentro do Card */
.ad-card-footer {
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ad-mini-retention-stages {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-badge {
  font-weight: 700;
  color: var(--text-primary);
}

/* Estado Vazio */
.ads-empty-state {
  background: #ffffff;
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ads-empty-state h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.ads-empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 480px;
}

.empty-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   10. TABELA ANALÍTICA DETALHADA
   ========================================================================== */
.dash-table-section {
  margin-bottom: 40px;
}

.table-scroll-container {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
  scrollbar-width: thin;
  scrollbar-color: rgba(39, 126, 27, 0.3) transparent;
}

.table-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.table-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.table-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(39, 126, 27, 0.28);
  border-radius: 9999px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--green-primary);
}

.dash-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.dash-data-table th {
  background: #fafbfb;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.dash-data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.dash-data-table tbody tr:hover {
  background: #f8faf9;
}

.dash-data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-ad-name {
  font-weight: 800;
  color: var(--text-primary);
}

.text-right {
  text-align: right;
}

/* ==========================================================================
   11. RODAPÉ EXECUTIVO COM MARCA D'ÁGUA FLYTO
   ========================================================================== */
.dash-footer-stamp {
  border-top: 1px solid var(--border-subtle);
  padding: 28px 0;
  margin-top: 20px;
}

.footer-stamp-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand-seal {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-seal-icon {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.footer-brand-seal strong {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
}

.footer-brand-seal p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.footer-site-link span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-dark);
}

/* ==========================================================================
   12. MODAL DE IMPORTAÇÃO E VISUALIZADOR
   ========================================================================== */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 22, 22, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dash-modal-overlay.active {
  display: flex;
}

.dash-modal-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.modal-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Zona de Drag & Drop */
.csv-drop-zone {
  border: 2px dashed var(--border-green);
  border-radius: var(--radius-md);
  background: #f7faf7;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.csv-drop-zone:hover, .csv-drop-zone.drag-over {
  background: #eef8ee;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 4px var(--green-glow);
}

.drop-icon-box {
  margin-bottom: 12px;
}

.drop-zone-content h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.text-green-highlight {
  color: var(--green-primary);
  text-decoration: underline;
}

.drop-zone-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-name-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #ffffff;
  border: 1px solid var(--border-card);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.csv-columns-info {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.csv-columns-info h5 {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.columns-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.col-chip {
  font-size: 0.7rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.columns-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.import-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}

.import-feedback.success {
  background: var(--green-subtle);
  color: var(--green-dark);
  border: 1px solid var(--border-green);
}

.import-feedback.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-modal-card.modal-lg {
  max-width: 840px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Tutorial de Métricas Disponíveis */
.tutorial-steps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tutorial-step-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tutorial-step-card.highlight-step {
  background: linear-gradient(180deg, #f8fdf8 0%, #edf8ec 100%);
  border: 1.5px solid #a3e39d;
  box-shadow: 0 4px 16px rgba(39, 126, 27, 0.08);
}

.step-badge {
  background: var(--text-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.step-badge-green {
  background: var(--green-primary);
}

.step-content {
  flex: 1;
}

.step-content h4 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.step-content p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.step-hint {
  font-size: 0.8rem;
  color: var(--green-dark);
  font-weight: 700;
  margin-top: 6px !important;
}

.metrics-checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .metrics-checklist-grid {
    grid-template-columns: 1fr;
  }
}

.metric-check-item {
  background: #ffffff;
  border: 1px solid rgba(39, 126, 27, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(17, 22, 22, 0.02);
}

.check-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-subtle);
  color: var(--green-dark);
  font-weight: 900;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-check-item strong {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}

.metric-check-item small {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

/* Modal de Visualização de Capa Expandida */
.image-viewer-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 720px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.35);
  animation: modalIn 0.2s ease-out;
}

.image-viewer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(17, 22, 22, 0.7);
  color: #ffffff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-body {
  width: 100%;
  max-height: 520px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-body img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.image-viewer-footer {
  padding: 16px 20px;
  background: #ffffff;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ==========================================================================
   13. RESPONSIVIDADE COMPLETA
   ========================================================================== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ads-cards-grid {
    grid-template-columns: 1fr;
  }

  .retention-bars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-ribbon {
    justify-content: flex-start;
  }

  .ribbon-divider {
    display: none;
  }
}

/* Mobile & Tablet Pequeno (max-width: 768px) */
@media (max-width: 768px) {
  .dash-container {
    padding: 0 16px;
  }

  .dash-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .dash-brand-area {
    justify-content: space-between;
  }

  .dash-top-actions {
    justify-content: space-between;
    width: 100%;
  }

  .client-panel-main {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .client-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .client-toolbar .btn-dash {
    width: 100%;
    justify-content: center;
  }

  .kpi-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .kpi-main-val {
    font-size: 1.8rem;
  }

  .ad-card-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ad-cover-wrapper {
    height: 220px;
  }

  .retention-bars-grid {
    grid-template-columns: 1fr;
  }

  .ads-filter-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ads-search-box {
    width: 100%;
  }

  .dash-select {
    width: 100%;
  }

  .presentation-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .presentation-bar-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Mobile Compacto (max-width: 480px) */
@media (max-width: 480px) {
  .client-info-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .client-name-input {
    font-size: 1.25rem;
  }

  .ad-metrics-mini-grid {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar suppression in presentation mode */
.presentation-mode {
  overflow-x: hidden !important;
}

.presentation-mode * {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.presentation-mode *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ==========================================================================
   14. ESTILOS DE IMPRESSÃO (@media print) - ZERO SCROLLBARS / 100% RESPONSIVO
   ========================================================================== */
@media print {
  @page {
    margin: 10mm 8mm;
    size: auto;
  }

  /* Oculta completamente qualquer barra de rolagem no PDF */
  * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
    width: 100% !important;
    overflow: visible !important;
    overflow-x: hidden !important;
  }

  .dash-bg-grid,
  .dash-header,
  .presentation-floating-bar,
  .client-toolbar,
  .ads-filter-controls,
  .btn-cover-action,
  .dash-modal-overlay,
  .btn-clear-name,
  .dash-action-toast,
  .edit-hint-icon {
    display: none !important;
  }

  .print-branding-header {
    display: flex !important;
    padding: 0 0 14px 0 !important;
    margin-bottom: 18px !important;
    border-bottom: 2px solid #111616 !important;
  }

  .dash-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .dash-client-panel,
  .kpi-card,
  .kpi-ribbon,
  .video-retention-box,
  .ad-card {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    break-inside: avoid;
  }

  .dash-client-panel {
    padding: 14px 18px !important;
    margin-bottom: 18px !important;
  }

  .client-name-input {
    font-size: 1.25rem !important;
    padding: 0 !important;
    border: none !important;
  }

  .kpi-cards-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .kpi-card {
    padding: 12px 14px !important;
  }

  .kpi-main-val {
    font-size: 1.45rem !important;
  }

  .kpi-ribbon {
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    background: #f0faf0 !important;
    border: 1px solid #a3e39d !important;
  }

  .ribbon-val {
    font-size: 1.05rem !important;
  }

  .ads-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .ad-card-body {
    grid-template-columns: 130px 1fr !important;
    padding: 10px 12px !important;
  }

  .ad-cover-wrapper {
    height: 120px !important;
  }

  /* Tabela 100% fluida sem rolagem horizontal no PDF */
  .table-scroll-container {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    break-inside: avoid;
    overflow: visible !important;
    overflow-x: visible !important;
    width: 100% !important;
  }

  .dash-data-table {
    width: 100% !important;
    table-layout: auto !important;
    font-size: 8pt !important;
  }

  .dash-data-table th,
  .dash-data-table td {
    white-space: normal !important;
    word-break: break-word !important;
    padding: 6px 6px !important;
  }

  .dash-footer-stamp {
    margin-top: 14px !important;
    padding: 12px 0 !important;
    border-top: 1px solid #d1d5db !important;
  }
}
