/* ============================================
   Biblioteca de Criativos - Estilos
   Desktop-first, com breakpoints em 1024 / 768 / 560 / 420
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-elevated: #1f1f1f;
  --border: #2a2a2a;
  --border-light: #333;
  --text: #f5f5f5;
  --text-muted: #999;
  --text-dim: #666;
  --accent: #F5C400;
  --accent-hover: #ffd633;
  --accent-text: #0a0a0a;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --transition: 180ms ease;
  /* Header sticky offset (usado em alguns scroll-padding) */
  --header-h: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Sem highlight azul/cinza de tap no mobile */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  /* Evita scroll horizontal acidental */
  overflow-x: hidden;
}

/* Respeita safe-areas (iPhone notch) */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.8; }

img, video {
  max-width: 100%;
  display: block;
}

/* Inputs: bloqueia zoom no iOS forçando >=16px (regra de ouro do Safari) */
input, select, textarea, button {
  font-family: inherit;
  font-size: 16px;
  color: inherit;
}

/* ============== LAYOUT ============== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.navbar {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  min-width: 0; /* permite truncar em mobile */
}
.logo > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-links { display: flex; gap: 16px; align-items: center; flex-shrink: 0; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

main { padding: 32px 0 64px; }

/* ============== HERO ============== */
.hero {
  padding: 40px 0 24px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--text-muted);
  font-size: clamp(14px, 1.6vw, 16px);
  max-width: 600px;
  margin: 0 auto;
}

/* ============== BOTÕES ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  /* Tamanho mínimo de toque (44px) recomendado pra mobile */
  min-height: 40px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); opacity: 1; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.btn-block { width: 100%; }

/* ============== FILTROS ============== */
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filters select, .filters input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  min-height: 38px;
}
.filters select:focus, .filters input:focus {
  outline: none;
  border-color: var(--accent);
}
.filters input[type="text"] {
  flex: 1 1 240px;
  min-width: 0;
  font-size: 16px; /* anti-zoom iOS */
}
.filters select { flex: 0 1 180px; min-width: 0; }
.filters .btn { flex-shrink: 0; }

/* ============== GRID DE CRIATIVOS ============== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.card:active { transform: translateY(0); }

.card-media {
  aspect-ratio: 4 / 5;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  isolation: isolate; /* novo stacking context pra o ::before nao vazar */
}
/* Backdrop embaçado: pega a mesma imagem do card e usa como fundo
   embaçado. Assim a imagem real (object-fit:contain) aparece INTEIRA
   no centro e os "espaços" laterais são preenchidos por um blur da
   própria imagem — fica elegante e o grid permanece uniforme. */
.card-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--media-bg);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.4) brightness(0.55);
  transform: scale(1.2); /* esconde bordas do blur */
  z-index: 0;
  pointer-events: none;
}
/* Card sem --media-bg (ex: vídeo, placeholder): fundo escuro sólido */
.card-media:not([style*="--media-bg"])::before {
  background-image: none;
  background: var(--bg);
  filter: none;
  transform: none;
}
.card-media > img,
.card-media > video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain; /* mostra a imagem/vídeo INTEIROS, sem cortar */
}
.card-media .placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 48px;
}
/* Thumbnail externa quebrou (URL CDN expirou) — mostra ícone discreto */
.card-media.thumb-broken::after {
  content: '🔗';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 48px;
  color: var(--text-dim);
  z-index: 1;
}
.card-media.thumb-broken::before {
  filter: none;
  background: var(--bg-elevated);
  transform: none;
}

.card-body { padding: 14px 14px 16px; }
.card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.tag-funil-topo { color: #60a5fa; border-color: rgba(96,165,250,0.3); }
.tag-funil-meio { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.tag-funil-fundo { color: #34d399; border-color: rgba(52,211,153,0.3); }
.tag-tipo { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.badge-position {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-video {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.8);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  color: white;
  font-size: 12px;
}
/* Badge "EMBED" — sinaliza que o detalhe abre o post original direto da plataforma */
.badge-embed {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(245, 196, 0, 0.95);
  color: #0a0a0a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  z-index: 2;
}

/* ============== MODAL ============== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.75);
  color: var(--text);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 10;
  transition: background var(--transition);
}
.modal-close:hover { background: rgba(0,0,0,0.9); }

.modal-detail-media {
  background: var(--bg);
  max-height: 70vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-detail-media img,
.modal-detail-media video {
  max-height: 65vh;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
}
.modal-detail-body { padding: 24px; }
.modal-detail-body h2 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 12px;
  word-break: break-word;
}
.modal-detail-body p {
  color: var(--text-muted);
  margin-bottom: 16px;
  word-break: break-word;
}

.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.detail-info dt { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.detail-info dd { color: var(--text); font-size: 14px; word-break: break-word; }
.detail-info dd a { word-break: break-all; }

.carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px;
  background: var(--bg);
  scroll-snap-type: x mandatory;
}
.carousel img, .carousel video {
  max-height: 60vh;
  width: auto;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  scroll-snap-align: center;
}

/* ============== EMBEDS (YouTube, Instagram, TikTok, etc) ============== */
/* Container do embed dentro do modal de detalhe.
   Sempre centralizado, com fundo escuro nas bordas.
   Embeds de plataforma original — vídeos, carrosséis e áudios funcionam. */
.modal-detail-embed {
  background: var(--bg);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-height: 80vh;
  overflow-y: auto;
  min-height: 320px;
}
.modal-detail-embed .embed-inner {
  width: 100%;
  max-width: 600px;
  position: relative;
}
/* Aspecto fixo (YouTube 16:9, Shorts 9:16) — usa CSS var */
.modal-detail-embed.embed-fixed-aspect .embed-inner {
  aspect-ratio: var(--embed-aspect, 16/9);
}
.modal-detail-embed.embed-fixed-aspect .embed-inner > iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: #000;
}
/* Aspecto automático (Instagram, TikTok, X — altura dinâmica).
   IMPORTANTE: alguns players (TikTok, Instagram) injetam wrappers
   intermediários — por isso o seletor pega QUALQUER iframe descendente,
   não só filho direto. */
.modal-detail-embed.embed-auto .embed-inner iframe {
  width: 100% !important;
  min-height: 500px;
  border: 0;
  border-radius: var(--radius-sm);
}
.modal-detail-embed.embed-auto .embed-inner > blockquote {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}
/* Vertical em mobile (Shorts/Reels) */
.modal-detail-embed.embed-fixed-aspect[style*="9/16"] .embed-inner,
.modal-detail-embed.embed-fixed-aspect[style*="9 / 16"] .embed-inner {
  max-width: 360px;
}

/* Fallback quando uma imagem externa quebra (URL expirou) */
.modal-detail-media .media-fallback {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.modal-detail-media .media-fallback small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ============== FORMS ============== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 16px; /* anti-zoom iOS */
  font-family: inherit;
  transition: border-color var(--transition);
  min-height: 42px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.form-group input[type="file"] {
  padding: 8px 12px;
  font-size: 14px;
  background: var(--bg);
  cursor: pointer;
}
.form-help { color: var(--text-dim); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-info { background: rgba(245,196,0,0.08); border: 1px solid rgba(245,196,0,0.25); color: #fde68a; }

/* ============== ADMIN ============== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0a0a0a;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  gap: 2px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.sidebar nav a:hover { color: var(--text); background: var(--bg-card); }
.sidebar nav a.active { background: var(--bg-card); color: var(--accent); }
.sidebar nav a .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
  margin-top: 24px;
  padding: 0 12px;
}

.admin-content { padding: 32px; min-width: 0; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.admin-header h1 { font-size: 24px; font-weight: 700; line-height: 1.2; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-value.accent { color: var(--accent); }

.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}
.login-box .logo { justify-content: center; margin-bottom: 24px; }

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* Upload preview */
.upload-preview {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.upload-preview img, .upload-preview video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.url-extract-box {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.url-extract-box input { flex: 1 1 240px; min-width: 0; }
.url-extract-box .btn { flex-shrink: 0; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pagination {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  min-width: 38px;
  text-align: center;
}
.pagination a:hover { color: var(--text); }
.pagination .current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }


/* ============================================
   LEAD GATE — Landing pré-acesso ao site
   Layout limpo, sem teaser bugado.
   ============================================ */
.gate-body {
  min-height: 100vh;
  min-height: 100dvh; /* dvh resolve barra do Safari mobile */
  position: relative;
  display: flex;
  flex-direction: column;
  /* Glow radial bonito de fundo */
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(245, 196, 0, 0.08) 0%, transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(245, 196, 0, 0.04) 0%, transparent 60%),
    var(--bg);
}

/* Teaser de criativos: row horizontal embaixo, sem grid quebrado.
   Vira decoração e não atrapalha o conteúdo principal. */
.gate-teaser {
  position: absolute;
  inset: auto 0 0 0;
  height: 38vh;
  display: flex;
  gap: 8px;
  padding: 0 8px 8px;
  filter: blur(18px) saturate(0.9);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 100%);
          mask-image: linear-gradient(to top, #000 0%, transparent 100%);
}
.gate-teaser img,
.gate-teaser video {
  height: 100%;
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  object-fit: cover;
  border-radius: var(--radius);
}

.gate-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.gate-card {
  background: rgba(20, 20, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(245, 196, 0, 0.05);
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--text-muted);
}
.gate-brand .logo-mark { width: 28px; height: 28px; font-size: 15px; }

.gate-card h1 {
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.gate-card h1 span { color: var(--accent); }

.gate-lead {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 22px;
}
.gate-lead strong { color: var(--text); font-weight: 600; }

.gate-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  padding: 14px 0;
  margin-bottom: 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.gate-stats > div { text-align: center; min-width: 0; }
.gate-stats strong {
  display: block;
  font-size: clamp(18px, 4vw, 22px);
  color: var(--accent);
  font-weight: 700;
  line-height: 1.1;
}
.gate-stats span {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.gate-form .form-group { margin-bottom: 12px; }
.gate-form label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.gate-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 16px; /* anti-zoom iOS */
  transition: border-color var(--transition), background var(--transition);
  min-height: 46px;
}
.gate-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(245, 196, 0, 0.04);
}
.gate-form input::placeholder { color: var(--text-dim); }

.gate-form .btn-block {
  margin-top: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  min-height: 48px;
}

.gate-form .form-error-box:empty { display: none; }
.gate-form .form-error-box {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid rgba(239,68,68,0.25);
}

.gate-privacy {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
  line-height: 1.5;
}

.gate-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.gate-footer a {
  color: var(--text-muted);
  font-size: 12px;
}


/* ============================================
   SISTEMA DE NOTAS — Bordas e badges por tier
   9-10 = vencedor (ouro)
   7-8  = bom      (verde)
   5-6  = médio    (âmbar)
   3-4  = fraco    (laranja)
   1-2  = ruim     (vermelho)
   ============================================ */

/* --- Card: borda + glow conforme o tier --- */
.card.nota-tier-winner {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 32px rgba(245, 196, 0, 0.35),
    0 6px 24px rgba(0, 0, 0, 0.5);
}
.card.nota-tier-winner:hover {
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 40px rgba(245, 196, 0, 0.5),
    0 12px 32px rgba(0, 0, 0, 0.6);
  border-color: var(--accent-hover);
}

.card.nota-tier-bom {
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.5), 0 0 18px rgba(16, 185, 129, 0.15);
}
.card.nota-tier-bom:hover {
  box-shadow: 0 0 0 1px #10b981, 0 0 24px rgba(16, 185, 129, 0.3), 0 10px 30px rgba(0,0,0,0.4);
}

.card.nota-tier-medio {
  border-color: rgba(251, 191, 36, 0.5);
}
.card.nota-tier-medio:hover { border-color: #fbbf24; }

.card.nota-tier-fraco {
  border-color: rgba(249, 115, 22, 0.55);
}
.card.nota-tier-fraco:hover { border-color: #f97316; }

.card.nota-tier-ruim {
  border-color: var(--danger);
  box-shadow:
    0 0 0 1px var(--danger),
    0 0 22px rgba(239, 68, 68, 0.25);
}
.card.nota-tier-ruim:hover {
  box-shadow:
    0 0 0 1px var(--danger),
    0 0 28px rgba(239, 68, 68, 0.4),
    0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --- Badge dentro do card (canto superior esquerdo) --- */
.nota-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid currentColor;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.02em;
}
.nota-badge.nota-tier-winner {
  color: var(--accent);
  background: rgba(245, 196, 0, 0.18);
  text-shadow: 0 0 12px rgba(245, 196, 0, 0.6);
}
.nota-badge.nota-tier-bom   { color: #10b981; background: rgba(16, 185, 129, 0.18); }
.nota-badge.nota-tier-medio { color: #fbbf24; background: rgba(251, 191, 36, 0.18); }
.nota-badge.nota-tier-fraco { color: #fb923c; background: rgba(249, 115, 22, 0.2); }
.nota-badge.nota-tier-ruim  {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.18);
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* Se o card-media tem badge-position (carrossel), empurra a nota um pouco */
.card-media .badge-position { top: 10px; left: 56px; }

/* --- Pill (usado no admin/list e no modal de detalhe) --- */
.nota-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.nota-pill.nota-tier-winner { color: var(--accent); background: rgba(245, 196, 0, 0.12); }
.nota-pill.nota-tier-bom    { color: #10b981; background: rgba(16, 185, 129, 0.12); }
.nota-pill.nota-tier-medio  { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.nota-pill.nota-tier-fraco  { color: #fb923c; background: rgba(249, 115, 22, 0.12); }
.nota-pill.nota-tier-ruim   { color: var(--danger); background: rgba(239, 68, 68, 0.12); }


/* ============================================
   SUGESTÕES DE CRIATIVOS
   (página pública sugerir.php + admin)
   ============================================ */

/* CTA na navbar pública — destaca o "Sugerir criativo" */
.nav-links .nav-cta {
  background: var(--accent);
  color: var(--accent-text) !important;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
}
.nav-links .nav-cta:hover { background: var(--accent-hover); }

/* Banner CTA logo abaixo do hero da home */
.suggest-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(245, 196, 0, 0.08), rgba(245, 196, 0, 0.03));
  border: 1px solid rgba(245, 196, 0, 0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.suggest-banner:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(245, 196, 0, 0.14), rgba(245, 196, 0, 0.05));
  transform: translateY(-1px);
}
.suggest-banner-icon { font-size: 24px; flex-shrink: 0; }
.suggest-banner-text { flex: 1; font-size: 14px; line-height: 1.4; }
.suggest-banner-text strong { display: block; font-size: 15px; margin-bottom: 2px; }
.suggest-banner-text em { color: var(--accent); font-style: normal; font-weight: 600; }
.suggest-banner-arrow {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.suggest-banner:hover .suggest-banner-arrow { transform: translateX(4px); }

/* Formulário público de sugestão */
.suggest-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}
.suggest-form-section {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 600;
}

/* Tela de sucesso após enviar sugestão */
.suggest-success-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  margin: 32px 0;
}
.suggest-success-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 700;
  margin: 0 auto 20px;
}
.suggest-success-card h2 { font-size: 24px; margin-bottom: 12px; }
.suggest-success-card p { color: var(--text-muted); font-size: 15px; max-width: 440px; margin: 0 auto; line-height: 1.5; }

/* ====== ADMIN: tabs por status ====== */
.status-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.status-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all var(--transition);
}
.status-tab:hover { color: var(--text); }
.status-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.status-tab-count {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
}
.status-tab.active .status-tab-count {
  background: var(--accent);
  color: var(--accent-text);
}

/* ====== ADMIN: pill colorido de status ====== */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid;
}
.status-pill.status-pendente   { color: #f59e0b; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.status-pill.status-aprovado   { color: var(--success); background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); }
.status-pill.status-rejeitado  { color: var(--danger); background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); }

/* ====== ADMIN: tela de revisão (2 colunas) ====== */
.suggest-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.suggest-review-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ====== ADMIN: card de sucesso pós-aprovação ====== */
.approval-success-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  text-align: center;
}
.approval-success-icon {
  width: 56px;
  height: 56px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 16px;
}
.approval-success-card h2 { font-size: 22px; margin-bottom: 8px; }
.approval-success-card p { color: var(--text-muted); }

/* Botão verde WhatsApp */
.btn-whatsapp {
  background: #25D366;
  color: white;
  border: 1px solid #25D366;
  font-weight: 600;
}
.btn-whatsapp:hover { background: #20c25d; color: white; }

/* ====== ADMIN: badge no menu lateral (sugestões pendentes) ====== */
.sidebar-badge {
  background: var(--accent);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: auto;
  min-width: 20px;
  text-align: center;
}

/* ====== ADMIN: alerta de pendência no topo do dashboard ====== */
.dashboard-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245, 196, 0, 0.08);
  border: 1px solid rgba(245, 196, 0, 0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}
.dashboard-alert:hover {
  background: rgba(245, 196, 0, 0.14);
  border-color: var(--accent);
}
.dashboard-alert-icon { font-size: 22px; }
.dashboard-alert-arrow { margin-left: auto; color: var(--accent); font-size: 18px; transition: transform var(--transition); }
.dashboard-alert:hover .dashboard-alert-arrow { transform: translateX(4px); }

/* Stat-value variante de alerta */
.stat-value.warn { color: #f59e0b; }


/* ============================================
   RESPONSIVO — Mobile / Tablet
   ============================================ */

/* ---- Tablet (até 1024px): ajustes finos ---- */
@media (max-width: 1024px) {
  .admin-layout {
    grid-template-columns: 200px 1fr;
  }
  .admin-content { padding: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* ---- Tablet/Mobile grande (até 768px) ---- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  main { padding: 20px 0 48px; }

  .hero { padding: 24px 0 16px; }
  .hero p { font-size: 14px; }

  /* Admin: sidebar vira topbar horizontal scrollável */
  .admin-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    padding: 12px 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .sidebar .logo {
    padding: 0 16px 12px;
    margin-bottom: 8px;
    font-size: 15px;
  }
  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 4px;
    gap: 4px;
    /* Esconde scrollbar mas mantém scroll */
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
  .sidebar-footer {
    display: none;
  }

  .admin-content { padding: 20px 16px; }
  .admin-header { gap: 12px; margin-bottom: 18px; }
  .admin-header h1 { font-size: 20px; }

  /* Tela de revisão de sugestão: empilha em uma coluna */
  .suggest-review-grid { grid-template-columns: 1fr; }

  /* Banner de sugerir criativo: layout vertical em telas estreitas */
  .suggest-banner { flex-direction: row; padding: 12px 14px; gap: 10px; }
  .suggest-banner-text { font-size: 13px; }
  .suggest-banner-text strong { font-size: 14px; }

  /* Filtros: select e input ocupam linha cheia */
  .filters {
    flex-direction: column;
    padding: 12px;
    gap: 10px;
  }
  .filters select,
  .filters input[type="text"] {
    flex: 1 1 auto;
    width: 100%;
  }
  .filters .btn { width: 100%; }

  /* Grid: cards menores */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 13px; -webkit-line-clamp: 2; }

  /* Modal: praticamente fullscreen */
  .modal-overlay { padding: 0; }
  .modal {
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .modal-close {
    width: 44px;
    height: 44px;
    top: 10px;
    right: 10px;
  }
  .modal-detail-media { padding: 12px; max-height: 55vh; }
  .modal-detail-media img,
  .modal-detail-media video { max-height: 50vh; }
  .modal-detail-body { padding: 18px 16px 24px; }
  .modal-detail-body h2 { font-size: 19px; }
  .carousel { padding: 8px 12px; }

  /* Embeds em mobile: padding menor, altura ajustada */
  .modal-detail-embed { padding: 10px; max-height: 70vh; }
  .modal-detail-embed.embed-auto .embed-inner > iframe { min-height: 420px; }

  /* Forms admin: empilhar grids 2-col */
  .admin-content [style*="grid-template-columns: 1fr 1fr"],
  .admin-content [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Tabelas: padding menor */
  th, td { padding: 10px 12px; font-size: 13px; }

  /* Gate: mais respirável em telas estreitas */
  .gate-wrap { padding: 24px 16px; }
  .gate-card { padding: 28px 22px 22px; }
  .gate-teaser { height: 30vh; }
}

/* ---- Mobile (até 560px) ---- */
@media (max-width: 560px) {
  .container { padding: 0 14px; }

  .navbar { padding: 12px 0; }
  .navbar-inner { gap: 8px; }
  .logo { font-size: 15px; gap: 8px; }
  .logo-mark { width: 28px; height: 28px; font-size: 15px; }
  .nav-links { gap: 4px; }
  .nav-links a {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
  }

  .hero { padding: 20px 0 12px; }
  .hero p { font-size: 13px; }

  .btn { padding: 10px 16px; }

  /* Grid: 2 colunas sempre garantidas */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card-body { padding: 10px; }
  .card-title { font-size: 12.5px; margin-bottom: 6px; }
  .card-meta { gap: 4px; }
  .tag { font-size: 9.5px; padding: 2px 6px; }

  .badge-position { top: 6px; left: 6px; padding: 3px 7px; font-size: 10px; }
  .badge-video { top: 6px; right: 6px; width: 28px; height: 28px; font-size: 12px; }

  /* Nota badge menor no mobile */
  .nota-badge {
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    font-size: 12px;
    border-width: 1.5px;
  }
  .card-media .badge-position { left: 42px; }

  /* Stats no admin: full width */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }

  /* Pagination compacta */
  .pagination a, .pagination span { padding: 6px 10px; font-size: 13px; min-width: 34px; }

  /* Modal interno */
  .modal-detail-body { padding: 16px 14px 22px; }
  .modal-detail-body h2 { font-size: 17px; }
  .detail-info { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Gate */
  .gate-card { padding: 26px 20px 20px; border-radius: var(--radius); }
  .gate-card h1 { font-size: 22px; }
  .gate-lead { font-size: 13.5px; margin-bottom: 18px; }
  .gate-stats { gap: 4px; padding: 12px 0; margin-bottom: 18px; }
  .gate-stats strong { font-size: 18px; }
  .gate-stats span { font-size: 9px; }
  .gate-teaser { height: 22vh; gap: 6px; padding: 0 6px 6px; }

  /* URL extract no admin: empilha botão */
  .url-extract-box { gap: 6px; }
  .url-extract-box .btn { width: 100%; }
}

/* ---- Mobile extra-pequeno (até 420px) ---- */
@media (max-width: 420px) {
  .container { padding: 0 12px; }

  /* Logo só com a marca, sem texto */
  .logo > span { display: none; }

  .hero h1 { font-size: 24px; }

  .grid { gap: 8px; }
  .card-body { padding: 8px 10px 10px; }

  /* Modal-close sai pra fora pra não cobrir conteúdo */
  .modal-close {
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.85);
  }

  .detail-info { grid-template-columns: 1fr; }

  .gate-stats strong { font-size: 16px; }
}

/* ---- Mobile landscape (alturas pequenas) ---- */
@media (max-height: 600px) and (orientation: landscape) {
  .gate-wrap { padding: 16px; align-items: flex-start; }
  .gate-card { margin: 8px auto; }
  .gate-teaser { display: none; }
}

/* ---- Telas grandes (acima de 1400px): aproveita o espaço ---- */
@media (min-width: 1400px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
