/* ==========================================================================
   PixSort — identidade visual
   Paleta: roxo profundo (base) + verde neon e rosa choque (destaques/CTAs)
   Estilo: app moderno de gamificação, vibrante para campanhas em redes sociais
   Tipografia: Fraunces (serifada, para números e destaque) + Manrope (UI)
   ========================================================================== */

:root {
  --bg: #34145f;
  --bg-panel: #ffffff;
  --primary: #4c1d95;
  --primary-deep: #34145f;
  --accent: #10b981;
  --accent-deep: #0b8f68;
  --pink: #ec4899;
  --pink-deep: #d6317f;
  --ink: #0f172a;
  --ink-soft: #5b5470;
  --line: #e4daf9;
  --paid: #0b8f68;
  --paid-bg: #d1fae5;
  --reserved: #b45309;
  --reserved-bg: #fef3c7;
  --danger: #dc2626;
  --danger-deep: #b91c1c;
  --review-bg: #fee2e2;
  --radius-sm: 8px;
  --radius-md: 20px;
  --shadow-card: 0 1px 2px rgba(76, 29, 149, 0.08), 0 8px 24px -12px rgba(76, 29, 149, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.serif { font-family: 'Fraunces', Georgia, serif; }

a { color: inherit; }

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

button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Cabeçalho ---------- */

.topbar {
  background: var(--primary-deep);
  color: #f1e9ff;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  border-radius: 4px;
}
.topbar-link {
  font-size: 14px;
  color: #d7c9f5;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.topbar-link:hover { color: #f1e9ff; border-color: #f1e9ff; }

/* ---------- Hero / vitrine do prêmio ---------- */

.hero {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #f1e9ff;
  padding: 48px 0 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; align-items: center; }
}
.hero-photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(241, 233, 255, 0.18);
  aspect-ratio: 4 / 3;
  background: #2a1257;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.eyebrow-plain {
  color: var(--pink);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
}
.hero-title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  margin: 0 0 14px;
  font-weight: 600;
}
.hero-desc {
  color: #d9c9f7;
  font-size: 15.5px;
  margin: 0 0 24px;
  max-width: 52ch;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 24px;
}
.stat-label { font-size: 12.5px; color: #b9a8e0; margin: 0 0 4px; }
.stat-value { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; margin: 0; }
.stat-value.gold { color: var(--accent); }

.countdown {
  display: flex; gap: 10px; margin-bottom: 26px;
}
.countdown-cell {
  background: rgba(241, 233, 255, 0.08);
  border: 1px solid rgba(241, 233, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 62px;
  text-align: center;
}
.countdown-num { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; display: block; }
.countdown-unit { font-size: 11px; color: #b9a8e0; }

.progress-wrap { margin-bottom: 26px; }
.progress-labels {
  display: flex; justify-content: space-between; font-size: 13px; color: #d7c9f5; margin-bottom: 6px;
}
.progress-track {
  background: rgba(241, 233, 255, 0.14);
  border-radius: 999px; height: 8px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px; transition: width 0.4s ease;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 13px 22px; font-size: 15px; font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--accent); color: #05271c; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, 0.55); }
.btn-gold:hover { background: #34d399; }
.btn-gold:disabled { background: #c9bfe8; color: #6b6280; cursor: not-allowed; box-shadow: none; }
.btn-outline {
  background: transparent; color: #f1e9ff; border: 1px solid rgba(241, 233, 255, 0.38);
}
.btn-outline:hover { border-color: #f1e9ff; }
.btn-dark { background: var(--primary-deep); color: #f1e9ff; }
.btn-dark:hover { background: #45208c; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-deep); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-ghost:disabled { opacity: 0.6; cursor: not-allowed; }
/* Comprovante já enviado pelo WhatsApp: mesmo verde do status "pago" */
.btn-sent { background: var(--paid-bg); color: var(--paid); border: 1px solid var(--paid); }
.btn-sent:hover { background: var(--paid); color: var(--paid-bg); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Seção de números ---------- */

.numbers-section { padding: 48px 0 72px; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.section-title { font-family: 'Fraunces', serif; font-size: 24px; margin: 0 0 4px; }
.section-sub { color: var(--ink-soft); font-size: 14px; margin: 0; }

.search-row {
  display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap;
}
.input {
  border: 1px solid var(--line); background: var(--bg-panel);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14.5px;
  color: var(--ink); width: 100%; font-family: inherit;
}
.input:focus { outline: 2px solid var(--pink); outline-offset: 1px; }
.search-input-wrap { position: relative; flex: 1; min-width: 220px; }

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.legend-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend-dot.available { background: var(--bg-panel); border: 1.5px solid var(--line); }
.legend-dot.selected { background: var(--pink); }
.legend-dot.reserved { background: var(--reserved-bg); border: 1.5px solid var(--reserved); }
.legend-dot.paid { background: var(--paid); }

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.num-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg-panel);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: var(--ink);
  transition: transform 0.08s ease, border-color 0.1s ease;
}
.num-cell.is-available:hover { border-color: var(--pink-deep); transform: translateY(-1px); }
.num-cell.is-selected { background: var(--pink); border-color: var(--pink-deep); color: #ffffff; }
.num-cell.is-reserved { background: var(--reserved-bg); border-color: var(--reserved); color: var(--reserved); cursor: not-allowed; }
.num-cell.is-paid { background: var(--paid); border-color: var(--paid); color: #eafbf3; cursor: not-allowed; }
.num-cell.is-hidden { display: none; }

.selection-bar {
  position: sticky; bottom: 16px;
  margin-top: 18px;
  background: var(--primary-deep);
  color: #f1e9ff;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}
.selection-bar strong { font-family: 'Fraunces', serif; color: var(--accent); }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(35, 10, 70, 0.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto; z-index: 50;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-panel); border-radius: var(--radius-md);
  width: 100%; max-width: 460px; padding: 26px;
  box-shadow: var(--shadow-card);
}
.modal-title { font-family: 'Fraunces', serif; font-size: 21px; margin: 0 0 6px; }
.modal-sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
/* Prévia da foto do prêmio (aceita link do Google Drive) */
#cfgImageUrl + .hint { display: block; margin-top: 6px; line-height: 1.4; }
.image-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.image-preview[hidden] { display: none; }
.image-preview img {
  width: 88px; height: 88px; flex-shrink: 0; object-fit: contain; padding: 4px;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.image-preview img[hidden] { display: none; }
.image-preview-msg { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); }
.image-preview-msg.error { color: var(--danger); }

/* ---------- Modo de venda (individual / cota) ---------- */

.field-title { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.sale-mode { display: flex; flex-direction: column; gap: 8px; }
/* "label" dentro de .field já tem estilo próprio — o seletor mais específico abaixo sobrescreve */
.field .sale-mode-option {
  display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 11px 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-weight: 400; cursor: pointer; background: var(--bg-panel);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.field .sale-mode-option:hover { border-color: #c9b8ec; }
.field .sale-mode-option:has(input:checked) { border-color: var(--primary); background: #f7f3ff; }
.field .sale-mode-option:has(input:focus-visible) { outline: 2px solid var(--pink); outline-offset: 2px; }
.sale-mode-option input { margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.sale-mode-body { display: flex; flex-direction: column; gap: 2px; }
.sale-mode-body strong { font-size: 13.5px; color: var(--ink); }
.sale-mode-body small { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.modal-close {
  float: right; background: none; border: none; font-size: 20px; color: var(--ink-soft);
  line-height: 1;
}
.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; display: none; }
.error-text.show { display: block; }

.order-summary {
  background: #f7ecfa; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
  font-size: 13.5px;
}
.order-summary .total { font-family: 'Fraunces', serif; font-size: 20px; color: var(--primary); }

/* ---------- Tela de pagamento (Pix) ---------- */

.pix-box { text-align: center; }
.pix-qr { width: 220px; height: 220px; margin: 0 auto 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.pix-copy-row {
  display: flex; gap: 8px; margin: 14px 0;
}
.pix-code {
  flex: 1; font-size: 11.5px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #f5f3ff; word-break: break-all; text-align: left;
  max-height: 70px; overflow-y: auto; color: var(--ink-soft);
}
.timer-pill {
  display: inline-block; background: var(--reserved-bg); color: var(--reserved);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; margin-bottom: 16px;
}

/* ---------- Rodapé ---------- */

.footer {
  background: var(--primary-deep); color: #b9a8e0; padding: 28px 0; font-size: 13px; text-align: center;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--primary-deep); color: #f1e9ff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 80;
  box-shadow: var(--shadow-card);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Admin ---------- */

.admin-shell { min-height: 100vh; background: var(--bg); }
.admin-topbar {
  background: var(--primary-deep); color: #f1e9ff; padding: 16px 0;
}
.admin-topbar-grid {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
}

.admin-brand-lockup { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.admin-brand-lockup .logo-text {
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 19px;
  color: #f1e9ff; letter-spacing: -0.01em; line-height: 1;
}
.admin-brand-lockup .logo-icon { height: 28px; width: auto; }

.admin-tabs { display: flex; justify-content: center; gap: 28px; }
.admin-tab {
  position: relative; padding-bottom: 4px; font-size: 14px; font-weight: 600;
  color: #d7c9f5; text-decoration: none; white-space: nowrap;
}
.admin-tab:hover { color: #f1e9ff; }
.admin-tab.active { color: #f1e9ff; }
.admin-tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px;
  background: linear-gradient(90deg, var(--pink), #a855f7); border-radius: 999px;
}

/* Precisa vir DEPOIS das regras base acima — media query com a mesma
   especificidade perde se aparecer antes da regra que está sobrescrevendo. */
@media (max-width: 720px) {
  .admin-topbar-grid { grid-template-columns: auto auto; }
  /* No celular as abas descem pra uma segunda linha, abaixo da marca e dos botões. */
  .admin-tabs { grid-column: 1 / -1; order: 3; justify-content: flex-start; gap: 22px; padding-top: 4px; }
}

/* padding-top/bottom separados: o atalho "padding" zeraria o recuo lateral do .container */
.admin-grid { display: grid; gap: 20px; padding-top: 28px; padding-bottom: 60px; }
/* Sem isso a coluna cresce até a largura da tabela e a página rola de lado no celular
   (a tabela já tem rolagem própria em .table-wrap). */
.admin-grid > * { min-width: 0; }
@media (min-width: 960px) {
  .admin-grid { grid-template-columns: 320px 1fr; align-items: start; }
}
.panel {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-card);
}
.panel + .panel { margin-top: 20px; }
.panel-title { font-family: 'Fraunces', serif; font-size: 18px; margin: 0 0 14px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }

/* ---------- Gráfico do Dashboard (donut SVG, sem dependência externa) ---------- */

.dashboard-chart-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 160px; height: 160px; flex-shrink: 0; margin: 0 auto; }
.donut-chart { width: 100%; height: 100%; }
.donut-track { fill: none; stroke: var(--line); stroke-width: 24; }
.donut-seg {
  fill: none; stroke-width: 24; stroke-linecap: butt;
  transform-origin: 80px 80px; transform: rotate(-90deg);
  transition: stroke-dasharray 0.5s ease, stroke-dashoffset 0.5s ease;
}
#donutPaid { stroke: var(--paid); }
#donutReserved { stroke: var(--reserved); }
#donutAvailable { stroke: var(--line); }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.donut-percent { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; }
.donut-percent-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

.dashboard-chart-legend { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 11px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-soft); }
.legend-row strong { margin-left: auto; color: var(--ink); font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.legend-row.total-row { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; font-weight: 600; color: var(--ink); }
.legend-row.revenue-row { font-weight: 600; color: var(--ink); }
.legend-row.revenue-row strong { color: var(--accent-deep); font-size: 21px; }
.kpi {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-card);
}
.kpi-value { font-family: 'Fraunces', serif; font-size: 26px; margin: 0; color: var(--primary); }
.kpi-label { font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-soft); font-weight: 600; font-size: 12.5px; }
/* Tabela de vendas: uma linha por compra, com os números como selos */
td.purchase-numbers-cell { white-space: normal; min-width: 150px; max-width: 260px; }
.purchase-numbers { display: flex; flex-wrap: wrap; gap: 4px; }
.number-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12.5px;
  font-variant-numeric: tabular-nums; color: var(--primary); background: var(--bg-panel); border: 1px solid var(--line);
}
.purchase-summary { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink-soft); }
/* Coluna "Vendedor": nome + código; "Venda direta" quando não veio por link */
.seller-code-cell { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-soft); }
.seller-none { color: var(--ink-soft); font-size: 13px; }

/* Paginação da tabela de vendas (10 compras por página) */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.pager[hidden] { display: none; }
.pager-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-panel); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s;
}
.pager-btn:hover:not(:disabled):not(.active) { border-color: var(--primary); }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: var(--bg-panel); cursor: default; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-gap { padding: 0 4px; color: var(--ink-soft); }
.pager-info { margin-left: auto; font-size: 13px; color: var(--ink-soft); }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.reserved { background: var(--reserved-bg); color: var(--reserved); }
.badge.paid { background: var(--paid-bg); color: var(--paid); }
.badge.review { background: var(--review-bg); color: var(--danger-deep); }
.review-detail { display: block; margin-top: 4px; font-size: 11.5px; color: var(--danger-deep); }

.login-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--primary-deep); padding: 32px 20px;
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 20px;
}
.login-brand-icon { height: 76px; width: 76px; }
/* Nome em texto, não a imagem pixsort-wordmark.png (que tem o "i" estilizado):
   mesmo tratamento do logo do cabeçalho do painel (.admin-brand-lockup .logo-text). */
.login-brand-word {
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: 40px; line-height: 1;
  color: var(--bg-panel); letter-spacing: -0.02em; /* branco, como no mockup do login */
}
.login-card {
  width: 100%; max-width: 380px; background: var(--bg-panel); border-radius: 28px;
  padding: 36px 32px; box-shadow: 0 24px 60px -20px rgba(10, 4, 30, 0.55);
}
.login-title {
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 24px; color: var(--ink);
  margin: 0 0 6px; text-align: center;
}
.login-sub {
  color: var(--ink-soft); font-size: 13.5px; margin: 0 0 24px; text-align: center;
}
.login-card .field { margin-bottom: 6px; }
.login-card .error-text { margin: 0 0 4px; }
.login-submit { margin-top: 16px; }
.login-submit:disabled { opacity: 0.75; cursor: progress; }

/* Campo de senha com o botão de mostrar/ocultar dentro, à direita */
.password-field { position: relative; }
.password-field .input { padding-right: 46px; }
.password-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: none; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft);
}
.password-toggle:hover { color: var(--primary); background: var(--line); }
.password-toggle:focus-visible { outline: 2px solid var(--pink); outline-offset: 1px; }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .icon-hide,
.password-toggle[aria-pressed="true"] .icon-show { display: none; }
.password-toggle[aria-pressed="true"] .icon-hide { display: block; }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag-btn {
  border: 1px solid var(--line); background: var(--bg-panel); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--ink-soft);
}
.tag-btn.active { background: var(--primary); color: #f1e9ff; border-color: var(--primary); }

/* ---------- Ganhadores (aba do admin) ---------- */

.winner-photo-preview {
  aspect-ratio: 1; width: 100%; max-width: 220px; margin-bottom: 10px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); overflow: hidden;
  display: grid; place-items: center;
  background: var(--bg-panel); color: var(--ink-soft); font-size: 12.5px; text-align: center;
}
.winner-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.winner-thumb {
  width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover;
  border: 1px solid var(--line);
}
td.winner-prize-cell { white-space: normal; min-width: 200px; max-width: 360px; word-break: break-word; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }

.hidden { display: none !important; }

/* ---------- Módulo isolado: Apuração de Sorteio (aba "Buscar Ganhador") ----------
   Seção só de acréscimo: não altera nenhuma regra acima. Reaproveita .panel,
   .field, .input, .btn e .badge.paid já existentes. */

.draw-lookup { max-width: 640px; padding-top: 28px; padding-bottom: 60px; }
.draw-lookup-sub { color: var(--ink-soft); font-size: 13.5px; margin: -6px 0 16px; }
.draw-lookup-form .input { font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.draw-lookup-form .hint { display: block; margin-top: 6px; line-height: 1.4; }

.draw-winner-card {
  border: 2px solid var(--paid); border-radius: var(--radius-md); padding: 20px;
  background: var(--paid-bg); text-align: center;
}
.draw-winner-badge { display: inline-block; margin-bottom: 10px; background: var(--bg-panel); }
.draw-winner-number {
  font-family: 'Fraunces', serif; font-size: 52px; font-weight: 700; line-height: 1;
  color: var(--primary); margin: 0; letter-spacing: 0.04em;
}
.draw-winner-caption { margin: 4px 0 16px; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.draw-winner-details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; text-align: left;
  background: var(--bg-panel); border-radius: var(--radius-sm); padding: 14px 16px;
}
.draw-winner-details dt { font-size: 12px; color: var(--ink-soft); }
.draw-winner-details dd { margin: 2px 0 0; font-weight: 700; color: var(--ink); word-break: break-word; }
@media (max-width: 480px) { .draw-winner-details { grid-template-columns: 1fr; } }

.draw-empty { text-align: center; padding: 24px 12px; border: 1.5px dashed var(--line); border-radius: var(--radius-md); }
.draw-empty-title { margin: 0 0 6px; font-weight: 700; color: var(--ink); }
.draw-empty-sub { margin: 0; font-size: 13px; color: var(--ink-soft); }
.draw-error { margin: 0; color: var(--danger); font-size: 14px; }

/* ---------- Módulo isolado: Afiliados/Vendedores (aba "Vendedores" + /vendedor.html) ----------
   Seção só de acréscimo: não altera nenhuma regra acima. */

.sellers-note { color: var(--ink-soft); font-size: 13px; margin: 0 0 14px; }
.seller-meta { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-soft); }
.seller-pix { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.seller-num { font-weight: 700; text-align: right; }
.seller-actions { display: flex; gap: 6px; }
tr.seller-inactive td { color: var(--ink-soft); }
.sellers-access-url { font-size: 13px; margin-bottom: 10px; }
.sellers-access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sellers-access-actions .btn { text-decoration: none; }

/* Painel do vendedor */
.seller-main { max-width: 720px; padding-top: 28px; padding-bottom: 60px; }
.seller-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seller-stats > div {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.seller-stat-value { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; color: var(--primary); }
.seller-stat-label { font-size: 12.5px; color: var(--ink-soft); }
.campaign-card { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
/* contain (não cover): mostra a foto INTEIRA. Com cover, uma foto quadrada de
   produto virava só uma faixa do meio e parecia "quebrada". */
.campaign-img {
  width: 100%; height: 240px; object-fit: contain; padding: 10px;
  background: var(--bg-panel); border-bottom: 1px solid var(--line);
}
.campaign-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.campaign-title { font-family: 'Fraunces', serif; font-size: 19px; margin: 0; color: var(--ink); }
.campaign-meta { margin: 0; font-size: 13px; color: var(--ink-soft); }
.campaign-link { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.campaign-link .input { font-size: 13.5px; }
.campaign-link-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.campaign-link-actions .btn { text-decoration: none; }
@media (max-width: 480px) { .seller-stats { grid-template-columns: 1fr; } }

/* Comissão e repasses (módulo Afiliados) */
td.seller-due { color: var(--accent-deep); }
.seller-stat-commission { color: var(--accent-deep); }
.payout-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.payout-summary > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.payout-summary strong { font-family: 'Fraunces', serif; font-size: 18px; color: var(--ink); }
.payout-summary .payout-due { border-color: var(--accent); background: var(--paid-bg); }
.payout-summary .payout-due strong { color: var(--accent-deep); }
.payout-label { font-size: 12px; color: var(--ink-soft); }
.payout-pix { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.payout-pix strong { color: var(--ink); word-break: break-all; }
.payout-history-title { font-size: 14px; margin: 18px 0 8px; color: var(--ink); }
.payout-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.payout-history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line); padding: 6px 0; }
.payout-history li.payout-empty { color: var(--ink-soft); border: none; }
@media (max-width: 480px) { .payout-summary { grid-template-columns: 1fr; } }

/* Sub-abas dentro de uma aba do admin (ex: Ganhadores → Cadastrados / Buscar ganhador) */
.admin-subtabs {
  display: inline-flex; gap: 4px; margin-top: 28px; padding: 4px;
  background: rgba(255, 255, 255, 0.08); border-radius: 999px;
}
.admin-subtab {
  border: none; background: transparent; color: #d7c9f5; font-size: 13.5px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px; transition: background 0.15s ease, color 0.15s ease;
}
.admin-subtab:hover { color: var(--bg-panel); }
.admin-subtab.active { background: var(--bg-panel); color: var(--primary); }
.admin-subtab:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
/* Painéis dentro da aba: menos espaço no topo, a barra de sub-abas já separa */
#viewWinners > .admin-pane { padding-top: 16px; }
#viewWinners > .draw-lookup { max-width: 640px; }

/* Cabeçalho de quadro com botão de fechar (comissão / acesso do vendedor) */
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-head .panel-title { margin-bottom: 14px; }
.panel-close {
  flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-panel);
  color: var(--ink-soft); font-size: 14px; line-height: 1;
}
.panel-close:hover { color: var(--ink); border-color: var(--ink-soft); }
.panel-close:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
