/* ================================================================
   PRÊMIO ENCONTRO GASTRO BRASÍLIA 2026
   Estilos Globais — Votação + Admin
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

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

/* ── Variáveis ── */
:root {
  --primary:       #E8960C;
  --primary-dark:  #B87200;
  --primary-light: #F5B030;
  --primary-glow:  rgba(232,150,12,0.25);

  --bg:            #0F172B;
  --bg2:           #162033;
  --bg3:           #1E2A40;
  --bg4:           #25344E;

  --text:          #FFFFFF;
  --text-soft:     #CCCCCC;
  --text-muted:    #888888;
  --text-faint:    #555555;

  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(232,150,12,0.30);
  --border-strong: rgba(232,150,12,0.65);

  --error:         #E05252;
  --success:       #48BB78;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;

  --shadow:        0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.8);
  --glow:          0 0 24px rgba(232,150,12,0.30);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }


/* ================================================================
   HEADER / CAPA
   ================================================================ */

.site-header {
  position: relative;
  width: 100%;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 40px;
  overflow: hidden;

  /* Gradient fallback — substitua por background-image: url('capa.jpg') */
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(12,12,12,0.95) 100%),
    radial-gradient(ellipse at 30% 40%, #3a1800 0%, transparent 60%),
    radial-gradient(ellipse at 70% 60%, #1a0c00 0%, transparent 60%),
    #0C0C0C;
  background-size: cover;
  background-position: center;
}

/* Se houver imagem de capa: adicione style="background-image:url('capa.jpg')" no header */

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
}

/* Logos area */
.header-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.header-logos img {
  height: 156px;
  width: auto;
  object-fit: contain;
  filter: none;
}

/* Fallback quando não há logo */
.header-brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 5.5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.header-title span {
  color: var(--primary-light);
}

.header-subtitle {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-soft);
  font-weight: 300;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.header-tagline {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--border-accent);
  padding: 6px 18px;
  border-radius: 40px;
}


/* ================================================================
   NAVEGAÇÃO HORIZONTAL (TABS)
   ================================================================ */

.groups-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.groups-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 1200px;
  margin: 0 auto;
}

.groups-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 22px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.nav-tab .tab-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s;
}

.nav-tab:hover {
  color: var(--text-soft);
  background: rgba(255,255,255,0.03);
}

.nav-tab:hover .tab-icon {
  transform: scale(1.15);
}

.nav-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
  background: rgba(232,150,12,0.06);
}

.nav-tab.active .tab-icon {
  filter: drop-shadow(0 0 6px rgba(232,150,12,0.5));
}


/* ================================================================
   MAIN LAYOUT
   ================================================================ */

.site-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Bloco introdutório do prêmio ── */
.premio-intro {
  max-width: 760px;
  margin: 0 auto 48px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
}

.premio-intro h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 3.5vw, 30px);
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
  text-align: center;
}

.premio-intro .subtitulo {
  font-style: italic;
  color: var(--gold);
  font-size: 17px;
  margin-bottom: 20px !important;
  text-align: center;
}

.premio-intro h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--text);
  margin: 24px 0 8px;
}

.premio-intro p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 12px;
  max-width: none !important;
}

.categorias-lista {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.categorias-lista li {
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Boas-vindas (quando nenhum grupo está selecionado) ── */
.welcome-section {
  text-align: center;
  padding: 60px 0;
}

.welcome-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 4vw, 36px);
  color: var(--text);
  margin-bottom: 16px;
}

.welcome-section p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.welcome-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  justify-content: center;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.welcome-group-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
}

.welcome-group-btn .wg-icon {
  font-size: 36px;
  transition: transform 0.2s;
}

.welcome-group-btn .wg-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.welcome-group-btn .wg-count {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.welcome-group-btn:hover {
  border-color: var(--border-strong);
  background: rgba(232,150,12,0.07);
  box-shadow: var(--glow);
  transform: translateY(-3px);
}

.welcome-group-btn:hover .wg-icon { transform: scale(1.15); }


/* ── Grupo header (acima do form) ── */
.group-form-header {
  text-align: center;
  margin-bottom: 32px;
}

.group-form-header .gfh-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px rgba(232,150,12,0.45));
}

.group-form-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 3.5vw, 32px);
  color: var(--primary-light);
  margin-bottom: 6px;
}

.group-form-header p {
  font-size: 14px;
  color: var(--text-muted);
}


/* ================================================================
   FORM CONTAINER
   ================================================================ */

.form-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}

@media (max-width: 600px) {
  .form-card { padding: 24px 18px; }
}

/* ── Sections dentro do form ── */
.form-block {
  margin-bottom: 32px;
}

.form-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Notice ── */
.form-notice {
  display: block;
  background: rgba(232,150,12,0.06);
  border: 1px solid rgba(232,150,12,0.18);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.form-notice strong { color: var(--text-soft); }

/* ── Grid ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-row.full { grid-template-columns: 1fr; }

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ── Field ── */
.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.req { color: var(--primary); margin-left: 2px; }

.field input,
.field select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23E8960C' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field select option {
  background: var(--bg3);
  color: var(--text);
}

.field input::placeholder { color: var(--text-faint); }

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(224,82,82,0.15);
}

.field-error {
  font-size: 11px;
  color: var(--error);
  display: none;
}

.field.has-error .field-error { display: block; }


/* ── Categorias ── */
.categoria-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.categoria-item:focus-within {
  border-color: var(--border-accent);
}

.categoria-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cat-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.cat-required {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
}


/* ── Submit ── */
.btn-submit {
  width: 100%;
  padding: 15px 24px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #000;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 28px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-light);
  box-shadow: 0 6px 28px rgba(232,150,12,0.40);
  transform: translateY(-1px);
}

.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }


/* ── Alerts ── */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.alert-error  { background: rgba(224,82,82,0.10); border: 1px solid rgba(224,82,82,0.30); color: #F08080; }
.alert-success{ background: rgba(72,187,120,0.10); border: 1px solid rgba(72,187,120,0.30); color: #68D391; }
.alert-icon   { font-size: 18px; flex-shrink: 0; }


/* ── Tela de sucesso ── */
#success-screen {
  display: none;
  text-align: center;
  padding: 64px 24px;
}

#success-screen.visible { display: block; }

.success-icon {
  font-size: 80px;
  display: block;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 24px rgba(232,150,12,0.6));
  animation: pop 0.5s cubic-bezier(.18,.89,.32,1.28) both;
}

@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#success-screen h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4vw, 32px);
  color: var(--primary-light);
  margin-bottom: 12px;
}

#success-screen p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 440px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* Grupo não encontrado */
.not-found {
  text-align: center;
  padding: 80px 24px;
}

.not-found h2 { font-size: 24px; color: var(--error); margin-bottom: 12px; }
.not-found p  { color: var(--text-muted); margin-bottom: 24px; }


/* ── Botões utilitários ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  background: var(--primary);
  color: #000;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 20px rgba(232,150,12,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn-outline:hover {
  border-color: var(--border-accent);
  color: var(--primary-light);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }


/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 32px 24px;
  text-align: center;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-logos img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(0.4);
  transition: filter 0.2s;
}
.footer-logos img:hover { filter: brightness(0) invert(0.7); }

.footer-text {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.8;
}

.footer-text strong { color: var(--text-muted); }


/* ================================================================
   ADMIN — LOGIN
   ================================================================ */

.admin-login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.admin-login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.admin-lock-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.admin-login-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.admin-login-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}


/* ================================================================
   ADMIN — PAINEL
   ================================================================ */

.admin-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.admin-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header-brand .brand-icon { font-size: 28px; }

.admin-header-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--text);
  line-height: 1.2;
}

.admin-header-brand h1 span {
  display: block;
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
}

.admin-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ── Summary cards ── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}

.summary-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.summary-card:hover,
.summary-card.active {
  border-color: var(--border-strong);
  background: rgba(232,150,12,0.07);
  box-shadow: var(--glow);
}

.summary-card .sc-icon { font-size: 28px; margin-bottom: 6px; }
.summary-card .sc-name { font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 8px; }
.summary-card .sc-count { font-size: 28px; font-weight: 800; color: var(--primary-light); line-height: 1; }
.summary-card .sc-label { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

/* ── Admin nav ── */
.admin-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-grupo-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #1D6F42;
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.5px;
}

.btn-excel:hover {
  background: #24874F;
  box-shadow: 0 4px 18px rgba(29,111,66,0.4);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg3);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn-refresh:hover { border-color: var(--border-accent); color: var(--primary); }
.btn-refresh.spinning svg { animation: spin 1s linear infinite; }

/* ── Categoria ranking card ── */
.cat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.cat-card-header {
  background: var(--bg3);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.cat-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
}

.cat-total-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(232,150,12,0.10);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── Ranking table ── */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.ranking-table th:last-child { text-align: right; }

.ranking-table td {
  padding: 13px 20px;
  font-size: 13px;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.ranking-table tr:last-child td { border-bottom: none; }

.ranking-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Position cell */
.rank-pos {
  font-size: 18px;
  font-weight: 800;
  min-width: 40px;
}

.rank-pos.gold   { color: #FFD700; }
.rank-pos.silver { color: #C0C0C0; }
.rank-pos.bronze { color: #CD7F32; }
.rank-pos.other  { color: var(--text-faint); font-size: 13px; }

/* Bar cell */
.rank-bar-cell { min-width: 120px; }

.rank-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  transition: width 0.6s ease;
}

.rank-bar-fill.first { background: linear-gradient(90deg, #C07800, #FFD700); }

.rank-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

.rank-votes {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  min-width: 50px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state-icon { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.4; }

/* Loading state */
.loading-state {
  text-align: center;
  padding: 64px 24px;
}

.loading-spinner-lg {
  width: 44px;
  height: 44px;
  border: 3px solid var(--bg3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loading-state p { color: var(--text-muted); font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .admin-header { padding: 12px 16px; }
  .admin-body { padding: 20px 16px 60px; }
  .ranking-table th, .ranking-table td { padding: 10px 12px; }
  .rank-bar-cell { display: none; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-card .sc-count { font-size: 22px; }
}

/* ================================================================
   ADMIN — TABS RESULTADOS / CANDIDATOS
   ================================================================ */

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}

.admin-tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-tab-btn:hover { color: var(--text-soft); }

.admin-tab-btn.active {
  background: var(--bg);
  color: var(--primary-light);
  box-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* ================================================================
   EDITOR DE CANDIDATOS
   ================================================================ */

.editor-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(232,150,12,0.06);
  border: 1px solid rgba(232,150,12,0.18);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.editor-notice strong { color: var(--text-soft); }

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.editor-grupo-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Bloco de categoria ── */
.editor-cat-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.editor-cat-block:focus-within {
  border-color: var(--border-accent);
}

.editor-cat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.editor-cat-drag {
  color: var(--text-faint);
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
  padding: 2px 4px;
}

.editor-cat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  flex-shrink: 0;
  white-space: nowrap;
}

.editor-cat-name-input {
  flex: 1;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.editor-cat-name-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-del-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid rgba(224,82,82,0.25);
  border-radius: var(--radius-sm);
  color: #E05252;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  flex-shrink: 0;
}

.btn-del-cat:hover {
  background: rgba(224,82,82,0.10);
  border-color: rgba(224,82,82,0.55);
}

/* ── Lista de opções ── */
.editor-opcoes-list {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-opcao-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.editor-opcao-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  flex-shrink: 0;
}

.editor-opcao-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.editor-opcao-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-del-opcao {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.btn-del-opcao:hover {
  background: rgba(224,82,82,0.12);
  border-color: rgba(224,82,82,0.4);
  color: #E05252;
}

.editor-cat-footer {
  padding: 0 16px 14px;
}

.btn-add-opcao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px dashed var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn-add-opcao:hover {
  background: rgba(232,150,12,0.07);
  border-style: solid;
}

/* ── Add categoria ── */
.btn-add-cat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
  font-family: 'Montserrat', sans-serif;
}

.btn-add-cat:hover {
  border-color: var(--border-accent);
  color: var(--primary);
  background: rgba(232,150,12,0.04);
}

/* ── Save bar ── */
.editor-save-bar {
  position: sticky;
  bottom: 0;
  margin-top: 24px;
  padding: 16px 0;
  background: linear-gradient(0deg, var(--bg) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.editor-unsaved-msg {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s;
}

.editor-unsaved-msg.visible { opacity: 1; }

/* ── Toast notification ── */
.editor-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.editor-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.editor-toast.success {
  background: #1A3D2B;
  border: 1px solid rgba(72,187,120,0.35);
  color: #68D391;
}

.editor-toast.error {
  background: #3D1A1A;
  border: 1px solid rgba(224,82,82,0.35);
  color: #F08080;
}

/* ── Config loading indicator no site de votação ── */
.config-loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.config-loading .spinner-wrap {
  width: 32px;
  height: 32px;
  border: 2px solid var(--bg3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

@media (max-width: 600px) {
  .editor-cat-top { flex-wrap: wrap; }
  .editor-cat-name-input { order: -1; width: 100%; }
  .editor-save-bar { flex-direction: column; align-items: stretch; }
  .editor-toast { right: 12px; left: 12px; bottom: 12px; }
}
