/* ── Emerald Archive — Design System ──────────────────── */
:root {
  --bg:          #F7F7F6;
  --surface:     #FFFFFF;
  --fg:          #062F3B;
  --muted:       #EBECE9;
  --muted-fg:    #5A7161;
  --border:      #D9DBD6;

  --primary:     #334C3B;
  --primary-fg:  #F7F7F6;
  --primary-dim: rgba(51,76,59,.09);

  --accent:      #BD7522;
  --accent-fg:   #FFFFFF;
  --accent-dim:  rgba(189,117,34,.10);
  --accent-hover:#A2641D;

  --sidebar-bg:  #062F3B;
  --sidebar-fg:  #E6E7E3;
  --sidebar-hover:#163A44;
  --sidebar-w:   260px;

  --ok:          #667F6E;
  --ok-dim:      rgba(102,127,110,.12);
  --warn:        #BD7522;
  --warn-dim:    rgba(189,117,34,.12);
  --danger:      #DC2828;
  --danger-dim:  rgba(220,40,40,.10);

  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   14px;
  --shadow-card: 0 1px 2px rgba(6,47,59,.05), 0 1px 3px rgba(6,47,59,.04);
  --shadow-hover:0 6px 16px rgba(6,47,59,.09);
}

*, *::before, *::after { box-sizing: border-box }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: .95rem;
  line-height: 1.6;
}

/* ── Admin Layout ──────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}

.sidebar-brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .03em;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: rgba(230,231,227,.55);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(230,231,227,.35);
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: rgba(230,231,227,.75);
  font-size: 14px;
  font-weight: 500;
  transition: background .13s, color .13s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  border-left-color: var(--accent);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: .85;
  line-height: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sidebar-footer {
  padding: 12px 10px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.sidebar-logout {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220,40,40,.3);
  background: rgba(220,40,40,.08);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .13s;
  font-family: inherit;
}

.sidebar-logout:hover {
  background: rgba(220,40,40,.18);
}

/* ── Content area ──────────────────────────────────────── */
.content-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  min-height: 100vh;
}

/* ── Page header ───────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header-left {}

.page-title {
  margin: 0 0 3px;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

.page-subtitle {
  margin: 0;
  font-size: .875rem;
  color: var(--muted-fg);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.box {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--muted);
  margin-top: 12px;
}

.box.accent {
  border-color: rgba(189,117,34,.3);
  background: var(--accent-dim);
}

.box.ok {
  border-color: rgba(102,127,110,.3);
  background: var(--ok-dim);
}

.section {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Merriweather', Georgia, serif;
}

h1 { margin: 0 0 12px; font-size: 1.5rem;  font-weight: 700 }
h2 { margin: 0 0 10px; font-size: 1.125rem; font-weight: 700 }
h3 {
  margin: 0 0 8px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.big   { font-size: 1rem; font-weight: 700; color: var(--fg) }
.muted { color: var(--muted-fg); font-size: .875rem }
.small { font-size: .8rem }

/* ── Forms ─────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px }
.form-row { display: flex; gap: 12px; flex-wrap: wrap }
.form-row > * { flex: 1; min-width: 140px }

label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted-fg);
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .13s, box-shadow .13s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51,76,59,.12);
}

input[type="file"] {
  background: transparent;
  border: none;
  padding: 0;
  font-size: .85rem;
  color: var(--muted-fg);
  box-shadow: none;
}

input[type="checkbox"] { width: auto }

/* ── Buttons ───────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .13s, box-shadow .13s, transform .1s;
  white-space: nowrap;
  font-family: inherit;
}

/* primary — forest green */
button, .btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
button:hover, .btn-primary:hover {
  background: #2a3e30;
  border-color: #2a3e30;
}

/* secondary */
button.secondary, .btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}
button.secondary:hover, .btn-secondary:hover {
  background: var(--muted);
}

/* accent — bronze */
.btn-accent {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover) }

/* ghost — outline primary */
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-ghost:hover { background: var(--primary-dim) }

/* danger */
.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(220,40,40,.25);
}
.btn-danger:hover { background: rgba(220,40,40,.18) }

.btn-sm {
  padding: 5px 12px;
  font-size: .8rem;
  border-radius: var(--radius-sm);
}

/* ── Lists ─────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.itemRow {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: box-shadow .15s;
}

.itemRow:hover { box-shadow: var(--shadow-hover) }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Table ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 4px }

table { width: 100%; border-collapse: collapse; font-size: .9rem }

th {
  text-align: left;
  padding: 9px 14px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted-fg);
  border-bottom: 2px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}

tr:last-child td { border-bottom: none }
tr:hover td { background: var(--muted) }

/* ── Pills ─────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-fg);
}

.pill.open   { background: var(--ok-dim);   border-color: rgba(102,127,110,.3); color: var(--ok) }
.pill.closed { background: var(--muted);    color: var(--muted-fg) }
.pill.draft  { background: var(--warn-dim); border-color: rgba(189,117,34,.3);  color: var(--warn) }

/* ── Links ─────────────────────────────────────────────── */
.link {
  color: var(--primary);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
}
.link:hover { text-decoration: underline }

/* ── Stats grid ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  transition: transform .2s, box-shadow .2s;
}

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

.stat-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

.stat-value.accent { color: var(--accent) }
.stat-value.ok     { color: var(--ok) }

/* ── Avatar ────────────────────────────────────────────── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted-fg);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted-fg);
  font-size: .875rem;
}

/* ── Alert ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid;
  border-left-width: 5px;
  box-shadow: var(--shadow-card);
}

.alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  line-height: 0;
}
.alert-icon svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  display: block;
}

.alert-content { flex: 1; min-width: 0 }

.alert-title {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: .01em;
  margin-bottom: 2px;
}

.alert-message { font-weight: 500 }

/* Tons com contraste reforçado (WCAG AA) sobre os fundos claros */
.alert.ok     { background: var(--ok-dim);     border-color: rgba(102,127,110,.5); color: #234433 }
.alert.warn   { background: var(--warn-dim);   border-color: rgba(189,117,34,.5);  color: #6e440f }
.alert.danger { background: var(--danger-dim); border-color: rgba(220,40,40,.45);  color: #8c1818 }
.alert.info   { background: rgba(45,125,160,.10); border-color: rgba(45,125,160,.45); color: #1f5c77 }

/* ── Divider ───────────────────────────────────────────── */
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

/* ── Wrap (login, cédula, páginas sem sidebar) ─────────── */
.wrap { max-width: 860px; margin: 0 auto; padding: 20px }

.wrap .card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

/* ── Auth pages (login, registro) ─────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}

.auth-header {
  background: var(--sidebar-bg);
  padding: 28px 32px 24px;
  text-align: center;
}

.auth-brand-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.auth-brand-sub {
  font-size: .8rem;
  color: rgba(230,231,227,.55);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-body {
  padding: 28px 32px 32px;
}

.auth-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 6px;
}

.auth-subtitle {
  font-size: .875rem;
  color: var(--muted-fg);
  margin: 0 0 22px;
}

.auth-links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-links .link {
  font-size: .85rem;
}

/* ── Ballot (cédula) ───────────────────────────────────── */
.ballot-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 24px 16px;
}

.ballot-wrap {
  max-width: 580px;
  margin: 0 auto;
}

.ballot-header {
  text-align: center;
  margin-bottom: 20px;
}

.ballot-election-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 6px;
}

.ballot-scrutiny-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(189,117,34,.3);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Vote option cards (SIM/NÃO/BRANCO) */
.vote-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.vote-option {
  cursor: pointer;
  text-align: center;
  padding: 18px 10px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  display: block;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}

.vote-option:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.vote-option input[type="radio"] { display: none }

.vote-option .vote-label {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.vote-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.vote-option:has(input:checked) .vote-label {
  color: var(--primary);
}

/* Candidate card on ballot */
.candidate-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.candidate-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.candidate-photo-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--muted-fg);
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.candidate-name {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
}

.candidate-role {
  font-size: .875rem;
  color: var(--muted-fg);
  margin-top: 2px;
}

/* ── Busca e ordenação de tabelas ──────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.table-search {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 16 16' fill='none' stroke='%235A7161' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E") no-repeat 11px center;
  font-size: .9rem;
  font-family: inherit;
  color: var(--fg);
  outline: none;
  transition: border-color .13s, box-shadow .13s;
}

.table-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51,76,59,.12);
}

.table-search-count {
  font-size: .8rem;
  color: var(--muted-fg);
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.th-sortable:hover { color: var(--primary) }

.th-arrow {
  display: inline-block;
  width: 0; height: 0;
  margin-left: 5px;
  vertical-align: middle;
  opacity: .35;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
}

.sorted-asc .th-arrow {
  opacity: 1;
  border-bottom: 5px solid var(--accent);
  border-top: 0;
}

.sorted-desc .th-arrow {
  opacity: 1;
  border-top: 5px solid var(--accent);
  border-bottom: 0;
}

/* ── Loading / feedback ────────────────────────────────── */
/* Barra de progresso fina no topo — feedback imediato ao navegar/enviar */
.route-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 9999;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(189,117,34,.6);
  opacity: 0;
  transition: width .2s ease, opacity .3s ease;
  pointer-events: none;
}

.route-progress.active {
  opacity: 1;
  transition: width 8s cubic-bezier(.1,.7,.3,1), opacity .15s ease;
}

.route-progress.done {
  width: 100% !important;
  opacity: 0;
  transition: width .2s ease, opacity .4s ease .1s;
}

/* Botão ocupado — mostra que a ação está em curso e bloqueia novo clique */
button.is-busy, .btn.is-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: .85;
}

button.is-busy::after, .btn.is-busy::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .6s linear infinite;
}

button.secondary.is-busy::after, .btn-ghost.is-busy::after, .btn-danger.is-busy::after {
  border-color: rgba(51,76,59,.25);
  border-top-color: var(--primary);
}

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

/* ── Mobile navigation ─────────────────────────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  z-index: 300;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
}

.mobile-topbar-title {
  font-family: 'Merriweather', Georgia, serif;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
}

.mobile-topbar-sub {
  font-size: .7rem;
  color: rgba(230,231,227,.5);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hamburger {
  background: none;
  border: none;
  color: rgba(230,231,227,.85);
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .13s, color .13s;
}

.hamburger:hover { background: rgba(255,255,255,.1); color: #fff }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  cursor: pointer;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-topbar { display: flex }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 250;
    padding-top: 56px; /* libera espaço para a topbar mobile fixa */
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }

  /* a topbar mobile já exibe a marca — o brand interno fica redundante */
  .sidebar .sidebar-brand { display: none }

  .sidebar-overlay.open { display: block }

  .content-area {
    margin-left: 0;
    padding: 72px 16px 32px;
  }

  .page-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
  }

  .page-title { font-size: 1.15rem }

  .card { padding: 14px }

  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }

  th, td { padding: 10px }

  .auth-body { padding: 22px 20px 28px }
  .auth-header { padding: 22px 20px 20px }

  .vote-options { gap: 7px }
  .vote-option { padding: 16px 8px }
  .vote-option .vote-label { font-size: .9rem }

  /* Busca de tabela ocupa a largura toda; 16px evita auto-zoom no iOS */
  .table-search { max-width: none; width: 100%; font-size: 16px }
  .table-toolbar { gap: 8px }
}
