/* ============================================================
   Dashboard Parlamentares — Brasil 61
   Sociofy blue design — matches design handoff
   ============================================================ */

/* ── Noto Sans ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Noto Sans';
  src: local('Noto Sans'), local('NotoSans'),
       url('https://cdn.brasil61.com/fonts/NotoSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans';
  src: local('Noto Sans Bold'), local('NotoSans-Bold'),
       url('https://cdn.brasil61.com/fonts/NotoSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ── Tokens (Sociofy) ──────────────────────────────────────── */
:root {
  --bg-page:        #EEF4FF;
  --bg-surface:     #E8F0FE;
  --bg-card:        #FFFFFF;
  --bg-dark:        #2F2F2F;
  --blue:           #2563EB;
  --blue-light:     #3B82F6;
  --blue-dark:      #1D4ED8;
  --blue-faint:     rgba(37, 99, 235, 0.08);
  --blue-pill:      #DBEAFE;
  --blue-pill-text: #1D4ED8;
  --green:          #22C55E;
  --border:         #E2E8F0;
  --border-dark:    #CBD5E1;
  --border-focus:   #2563EB;
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --success:        #22C55E;
  --success-bg:     #F0FDF4;
  --success-text:   #15803D;
  --danger:         #EF4444;
  --danger-bg:      #FEF2F2;
  --danger-text:    #B91C1C;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-pill:    999px;
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-card:    0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-hover:   0 4px 12px rgba(37, 99, 235, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
  --font:           'Noto Sans', 'Inter', Arial, sans-serif;

  /* Shell Brasil 61 */
  --yellow:         #F5A800;
}

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

html, body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  width: 100%;
}

/* ── Navbar Brasil 61 (shell) ──────────────────────────────── */
.main-navbar {
  background: var(--bg-dark);
  position: sticky;
  top: 0;
  z-index: 5000;
  width: 100%;
}
.main-navbar__container {
  min-height: 56px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 18px;
  box-sizing: border-box;
}
.main-navbar__navigation {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 20px;
  min-width: 0;
}
.main-navbar__logo,
.main-navbar__logo a {
  display: flex;
  align-items: center;
}
.main-navbar__logo img {
  height: 22px;
  width: auto;
  display: block;
}
.main-navbar__geonews {
  display: none;
}
.main-navbar__user-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  gap: 12px;
  min-width: 0;
}
.main-navbar__social_icons,
.main-navbar__search,
.main-navbar__menu-mobile {
  display: none;
}
.main-navbar__social_icons {
  display: none;
  align-items: center;
  gap: 18px;
}
.main-navbar__social_icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: color 0.15s, opacity 0.15s;
  opacity: 0.85;
}
.main-navbar__social_icons a:hover { color: var(--yellow); opacity: 1; }
.main-navbar__social_icons a svg { display: block; }
.main-navbar__social_icons a svg path { fill: currentColor; }
.main-navbar__social_icons .mobile-only { display: none; }

.main-navbar__search {
  display: none;
  background: #FFAF38;
  border-radius: 5px;
  flex: 0 0 245px;
  width: 245px;
  height: 40px;
  padding: 5px;
  overflow: hidden;
}
@media only screen and (min-width: 48rem) {
  .main-navbar__search {
    margin-right: 1.5em;
  }
}
.search-bar__search-field,
.search-bar__input,
.main-navbar__search form {
  height: 100%;
  width: 100%;
}
.main-navbar__search form {
  display: flex;
  align-items: center;
}
.main-navbar__search input {
  background: transparent;
  border: none;
  outline: none;
  color: #3a2a00;
  flex: 1;
  height: 100%;
  min-width: 0;
  padding: 0 8px 0 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
}
.main-navbar__search input::placeholder {
  color: #6a4e00;
  opacity: 1;
}
.main-navbar__search button {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.main-navbar__search button img {
  width: 14px;
  height: 14px;
  display: block;
}

.main-navbar__login {
  display: flex;
  flex: initial;
  list-style: none;
  margin-left: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  transition: color 0.15s;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.main-navbar__login:hover { color: var(--yellow); }
.main-navbar__login svg { width: 14px; height: 14px; }

.nav-uinfo {
  text-align: right;
  line-height: 1.3;
}
.nav-uname {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
}
.nav-uclient {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--yellow);
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--yellow);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-out {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  padding: 6px 14px;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--radius-pill);
  transition: background .2s, color .2s, border-color .2s;
}
.nav-out:hover {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.3);
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-pill);
  transition: color .2s, border-color .2s, background .2s;
}
.nav-back:hover {
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.07);
}
.nav-back svg { flex-shrink: 0; }

.main-navbar__menu-mobile {
  color: #fff;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: none;
  place-items: center;
  cursor: pointer;
}
.main-navbar__menu-mobile svg path { fill: currentColor; }

/* ── Page header ───────────────────────────────────────────── */
.page-head {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 6px;
}
.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}
.page-sub {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 4px 0 0;
}
.page-status {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ── Filter bar ────────────────────────────────────────────── */
#filter-bar {
  max-width: 1440px;
  margin: 14px auto 0;
  padding: 0 24px;
}
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.is-hidden { display: none !important; }
.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.filter-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2394A3B8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 12px center / 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 34px 10px 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13.5px;
  height: 40px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.filter-select:hover { border-color: var(--border-dark); }
.filter-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-faint);
}
.filter-select:disabled {
  background-color: #F8FAFC;
  color: var(--text-muted);
  cursor: not-allowed;
}
.btn-limpar {
  height: 40px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn-limpar:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger-text);
}
.btn-exportar {
  height: 40px;
  padding: 0 14px;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-exportar:hover:not(:disabled) {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}
.btn-exportar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.filter-toggle {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.filter-toggle:hover {
  border-color: var(--border-dark);
}
.filter-toggle:has(input:focus-visible) {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-faint);
}
.filter-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-box {
  width: 34px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: #CBD5E1;
  position: relative;
  flex: 0 0 34px;
  transition: background 0.15s;
}
.toggle-box::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.filter-toggle input:checked + .toggle-box {
  background: var(--blue);
}
.filter-toggle input:checked + .toggle-box::after {
  transform: translateX(14px);
}
.toggle-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main layout ───────────────────────────────────────────── */
#main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 32px;
}
.cols-wrapper {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  align-items: stretch;
}
#left-col  { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#right-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (min-width: 1101px) {
  #left-col {
    position: sticky;
    top: 72px;
    align-self: stretch;
  }
}

/* ── Candidate card ────────────────────────────────────────── */
#candidate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

@media (min-width: 1101px) {
  #candidate-card {
    flex: 1;
    min-height: 100%;
  }
}
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 8px;
}
.card-identity {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cand-profile-link {
  flex: 0 0 auto;
  border-radius: 50%;
}
.cand-profile-link:hover .cand-photo {
  box-shadow: 0 0 0 3px var(--blue-faint);
}
.cand-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--border), 0 4px 12px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  background: var(--blue-pill);
}
.cand-id-info { min-width: 0; flex: 1; }
.cand-name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 2px;
  letter-spacing: -0.005em;
  text-decoration: none;
}
.cand-name-link.has-profile-link:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cand-urna {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.cand-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cand-partido {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-pill);
  color: var(--blue-pill-text);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-eleito,
.badge-nao-eleito {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-eleito     { background: var(--success-bg); color: var(--success-text); }
.badge-nao-eleito { background: var(--danger-bg);  color: var(--danger-text); }
.badge-eleito::before,
.badge-nao-eleito::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-eleito::before     { background: var(--success-text); }
.badge-nao-eleito::before { background: var(--danger-text); }

.identity-source-tags {
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  background: #F8FAFC;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.source-box-camara {
  margin-top: 14px;
  padding: 11px;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.source-box-tse .source-box-title {
  margin-top: 14px;
}
.source-box-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.source-box-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-muted);
}
.source-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  margin-top: 9px;
}
.source-field {
  min-width: 0;
}
.source-field .lab,
.camara-social-row .lab {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.source-field .val {
  display: block;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.source-field-empty {
  grid-column: 1 / -1;
}
.source-field-wide {
  grid-column: 1 / -1;
}
.source-field-wide .val {
  overflow-wrap: normal;
  word-break: normal;
}
.source-field-empty .val {
  color: var(--text-muted);
  font-weight: 500;
}
.camara-social-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.camara-social-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.camara-social-links a {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}
.camara-social-links img {
  width: 24px;
  height: 24px;
  display: block;
}
.camara-social-links a:hover {
  opacity: 0.78;
  transform: translateY(-1px);
}
.tse-status-row {
  margin-top: 8px;
}

/* KPIs — 3 cols top, 2 cols bottom */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 12px;
}
.kpi-grid-bottom {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 5px;
}
.kpi-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 9px;
  text-align: left;
  transition: all 0.2s;
}
.kpi-box:hover {
  background: var(--blue-faint);
  border-color: var(--blue);
}
.kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.1;
  white-space: nowrap;
}
.kpi-value--sm {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

/* Perfil */
.perfil-title {
  margin: 14px 0 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.perfil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.perfil-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.perfil-item:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--border); }
.perfil-item:nth-child(odd)  { padding-right: 14px; }
.perfil-item:nth-last-child(1),
.perfil-item:nth-last-child(2) { border-bottom: none; }
.perfil-item .lab {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.perfil-item .val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Section title ─────────────────────────────────────────── */
.section-title {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blue);
  margin-bottom: 14px;
}

/* ── Map ───────────────────────────────────────────────────── */
#map-container,
#table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.map-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.map-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.legend-bar {
  width: 140px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFF2A6, #DDE7B9, #77BFE3, #3BA3F5, #8A78AA, #E43D4D);
  border: 1px solid var(--border);
}
#graph-mapa {
  height: 420px;
  position: relative;
  z-index: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}
.leaflet-container {
  background: #F8FAFC !important;
  font-family: var(--font) !important;
}
#graph-mapa .leaflet-control-container,
#graph-mapa .leaflet-top,
#graph-mapa .leaflet-bottom,
#graph-mapa .leaflet-control {
  z-index: 1000 !important;
}
#graph-mapa .leaflet-tooltip-pane {
  z-index: 1100 !important;
}
.map-info-control,
.map-class-legend {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  font-family: var(--font);
  backdrop-filter: blur(8px);
}
.map-info-control {
  min-width: 190px;
  padding: 9px 11px;
}
.map-info-control strong,
.map-info-control span,
.map-info-control small {
  display: block;
}
.map-info-control strong {
  font-size: 12px;
  line-height: 1.25;
}
.map-info-control span {
  color: #B91C1C;
  font-size: 13px;
  font-weight: 700;
  margin-top: 3px;
}
.map-info-control small {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}
.map-class-legend {
  padding: 8px 10px;
  min-width: 116px;
}
.map-class-legend strong {
  display: block;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.map-class-legend div {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.45;
}
.map-class-legend i {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 3px;
  flex: 0 0 14px;
}
.muni-tooltip {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  padding: 8px 12px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-card) !important;
  font-size: 12.5px !important;
}
.muni-tooltip::before { display: none !important; }
.muni-tooltip strong { color: var(--blue-dark); font-weight: 700; }
.muni-tooltip .tt-row { margin-top: 3px; color: var(--text-secondary); font-size: 12px; }
.muni-tooltip .tt-row .v { color: var(--text-primary); font-weight: 600; }
.leaflet-control-zoom a {
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
  background: #fff !important;
  font-family: var(--font) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--blue-faint) !important;
  color: var(--blue) !important;
}

/* ── Table ─────────────────────────────────────────────────── */
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.busca-input {
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><circle cx='6' cy='6' r='4.5' fill='none' stroke='%2394A3B8' stroke-width='1.5'/><path d='M9.5 9.5l3 3' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round'/></svg>") no-repeat left 12px center / 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px 8px 34px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  width: 240px;
  transition: all 0.15s;
}
.busca-input::placeholder { color: var(--text-muted); }
.busca-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-faint);
}

#tabela-municipios {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#tabela-municipios th {
  background: transparent;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
#tabela-municipios th.text-right,
#tabela-municipios td.num { text-align: right; }
#tabela-municipios th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  font-size: 9px;
  transition: opacity 0.15s;
}
#tabela-municipios th.sorted { color: var(--text-primary); font-weight: 600; }
#tabela-municipios th.sorted .sort-arrow { opacity: 1; color: var(--text-primary); }
#tabela-municipios th:hover { color: var(--text-primary); }

#tabela-municipios td {
  padding: 5px 8px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  line-height: 1.25;
}
#tabela-municipios tr {
  transition: background 0.12s;
  cursor: pointer;
}
#tabela-municipios tr:hover td { background: var(--blue-faint); }
#tabela-municipios tr.selected td {
  background: var(--blue-faint);
  box-shadow: inset 3px 0 0 var(--blue);
}
.col-uf { width: 52px; text-align: center !important; }
#tabela-municipios th[data-col="populacao"] {
  min-width: 108px;
}
.col-uf-cell {
  display: inline-block;
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}
.muni-bar-cell {
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}
.muni-bar-track {
  flex: 1;
  max-width: 76px;
  height: 4px;
  border-radius: 999px;
  background: #E2E8F0;
  overflow: hidden;
  position: relative;
}
.muni-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
}
.muni-bar-val {
  min-width: 44px;
  text-align: right;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 11.5px;
}

.paginacao {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  padding: 8px 0 0;
  flex-wrap: wrap;
}
.paginacao button {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  min-width: 32px;
}
.paginacao button:hover:not(.active):not(:disabled) {
  background: var(--blue-faint);
  color: var(--blue);
  border-color: var(--blue-light);
}
.paginacao button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.paginacao button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tabela-total {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 7px 10px;
  background: var(--bg-page);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}
.tabela-total strong { color: var(--text-primary); font-weight: 700; }

/* ── Footer Brasil 61 (shell) ──────────────────────────────── */
.footer {
  background: #F9F9F9;
  color: #2F2F2F;
  margin-top: 40px;
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
}
.footer__container {
  box-sizing: border-box;
  width: 92%;
  max-width: none;
  margin: 0 auto;
  padding: 42px 0 40px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer__branding {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 39.5%;
  display: flex;
  flex: initial;
  list-style: none;
  margin-left: 0;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer__logo {
  width: 100%;
  margin-bottom: 38px;
}
.footer__logo img {
  width: 230px;
  max-width: 100%;
  display: block;
}
.footer__links {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 10px;
}
.footer__links a {
  color: #2F2F2F;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  transition: color 0.15s;
}
.footer__links a:hover { color: var(--yellow); }
.footer__links .logo-audio {
  width: 190px;
  display: block;
  margin-top: 24px;
  align-self: flex-start;
}
.footer__info {
  display: flex;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 60.5%;
  align-items: flex-start;
  flex-wrap: wrap;
}
.footer__description {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  font-size: 0.85em;
  color: #464646;
  line-height: 1.5;
  margin: 0 0 38px;
}
.footer__description b {
  color: #2F2F2F;
  font-weight: 700;
}
.footer__contact {
  display: flex;
  width: 46%;
  flex-direction: column;
}
.footer__contact__email,
.footer__contact__phone {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  flex: initial;
  list-style: none;
  margin-left: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #2F2F2F;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}
.footer__contact__email { padding-bottom: 1em; }
.footer__contact__phone { padding-bottom: 1em; }
.footer__contact a:hover { color: var(--yellow); }
.footer__contact img {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.footer__contact__adresss {
  color: #2F2F2F;
  font-size: 12.6px;
  font-weight: 700;
  line-height: 1.45;
  max-width: 430px;
}
.footer__contact__adresss > * { padding-left: 0; }
.footer__contact__adresss p {
  margin: 0;
}
.footer__social-media {
  display: flex;
  flex: initial;
  list-style: none;
  margin-left: auto;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  width: 118px;
  padding-top: 3em;
}
.footer__social-media__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.15s;
}
.footer__social-media__link:hover { opacity: 1; }
.footer__social-media__link img {
  max-height: 16px;
  width: auto;
  display: block;
}
.footer__notes {
  background: #E6E6E6;
  color: #2F2F2F;
  width: 100%;
  padding: 8px 0 20px;
  font-family: var(--font);
}
.footer__notes__container {
  box-sizing: border-box;
  flex-shrink: 0;
  width: 94.2857142857%;
  display: flex;
  flex: initial;
  list-style: none;
  margin: 0 auto;
  align-items: center;
  flex-wrap: wrap;
  height: 30px;
  justify-content: flex-end;
  gap: 28px;
}
.footer__notes__link a {
  color: #2F2F2F;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}
.footer__notes__link a:hover,
.footer__copyright a:hover {
  color: var(--yellow);
}
.footer__copyright {
  display: none;
  color: #111;
  font-size: 13px;
  line-height: 1.4;
  margin: 18px 0 0;
  text-align: center;
}
.footer__copyright a {
  color: #111;
  text-decoration: underline;
}

/* ── Select2 (busca) — matchando .filter-select ──────────── */
.filter-group .select2-container { width: 100% !important; }
.filter-group .select2-container--default .select2-selection--single {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
}
.filter-group .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 40px;
  padding: 0 34px 0 12px;
}
.filter-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted);
}
.filter-group .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
  width: 34px;
  right: 0;
}
.filter-group .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--text-muted) transparent transparent transparent;
}
.filter-group .select2-container--default.select2-container--focus .select2-selection--single,
.filter-group .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-faint);
  outline: none;
}
.filter-group .select2-container--default .select2-selection--single[aria-disabled="true"] {
  background-color: #F8FAFC;
  color: var(--text-muted);
  cursor: not-allowed;
}
.filter-group .select2-container--default.select2-container--disabled .select2-selection--single {
  background-color: #F8FAFC;
}

/* Dropdown */
.select2-dropdown {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-family: var(--font);
  overflow: hidden;
}
.select2-container--default .select2-search--dropdown {
  padding: 8px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-faint);
}
.select2-results__option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--blue) !important;
  color: #fff !important;
}
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: var(--blue-faint);
  color: var(--blue-pill-text);
}
.select2-container--default .select2-results__option[role="group"] { padding: 0; }
.select2-results__options { max-height: 320px; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-light); }

/* ── Responsivo ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cols-wrapper    { grid-template-columns: 1fr; }
  .filter-card     { grid-template-columns: repeat(2, 1fr); }
  .filter-toggle,
  .filter-card .btn-exportar,
  .filter-card .btn-limpar { grid-column: 1 / -1; }
  #left-col        { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 900px) {
  .footer__container         { width: calc(100% - 40px); padding: 28px 0; }
  .footer__branding,
  .footer__info,
  .footer__contact           { width: 100%; }
  .footer__branding          { margin-bottom: 28px; }
  .footer__description       { margin-bottom: 24px; }
  .footer__social-media      { margin-left: 0; padding-top: 24px; }
  .footer__notes__container  { width: calc(100% - 40px); justify-content: flex-start; gap: 18px; height: auto; }
}
@media (max-width: 640px) {
  .filter-card              { grid-template-columns: 1fr; }
  .page-title               { font-size: 22px; }
  #graph-mapa               { height: 340px; }
  .busca-input              { width: 100%; }
  .main-navbar__container   { padding: 0 16px; gap: 12px; }
  .main-navbar__user-area   { gap: 16px; }
  .main-navbar__search      { flex-basis: 180px; width: 180px; }
  .source-fields            { grid-template-columns: 1fr; }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 5mm;
  }

  html,
  body {
    width: 100%;
    min-height: auto;
    background: #fff !important;
    color: #000;
    font-size: 10px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }


  body.print-report .main-navbar,
  body.print-report .page-head,
  body.print-report #filter-bar,
  body.print-report .footer,
  body.print-report .footer__notes,
  body.print-report #tabela-paginacao {
    display: none !important;
  }

  body.print-report #input-busca-municipio {
    display: none !important;
  }

  body.print-report #main-content {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.print-report .cols-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 5px;
    align-items: stretch;
  }

  body.print-report #left-col {
    position: static;
    display: flex;
    min-width: 0;
    align-self: stretch;
  }

  body.print-report #right-col {
    gap: 5px;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  body.print-report #candidate-card,
  body.print-report #map-container,
  body.print-report #table-container {
    border: 1px solid #CBD5E1;
    box-shadow: none;
    border-radius: 8px;
    padding: 5px;
    break-inside: avoid;
  }

  body.print-report #candidate-card {
    flex: 1;
    height: 100%;
    min-height: 100%;
  }

  body.print-report #graph-mapa {
    height: 350px;
    min-height: 350px;
  }

  body.print-report #table-container {
    flex: 1;
  }

  body.print-report .map-head {
    gap: 6px;
  }

  body.print-report .section-title,
  body.print-report .source-box-title,
  body.print-report .perfil-title {
    font-size: 7.5px;
    margin-bottom: 3px;
    padding-bottom: 2px;
  }

  body.print-report .cand-name {
    font-size: 10px;
  }

  body.print-report .camara-social-links a {
    width: 16px;
    height: 16px;
  }

  body.print-report .camara-social-links img {
    width: 14px;
    height: 14px;
  }

  body.print-report .cand-photo {
    width: 48px;
    height: 48px;
  }

  body.print-report .kpi-value {
    font-size: 9.5px;
  }

  body.print-report .kpi-sub,
  body.print-report .source-box-sub,
  body.print-report .perfil-item .lab,
  body.print-report .source-field .lab {
    font-size: 6.8px;
  }

  body.print-report .perfil-item .val,
  body.print-report .source-field .val,
  body.print-report #tabela-municipios td {
    font-size: 7.2px;
  }

  body.print-report #tabela-municipios th {
    font-size: 6.5px;
    font-weight: 700;
    color: #1e293b;
    padding: 2px 3px 3px;
    line-height: 1.1;
    border-bottom: 1.5px solid #94a3b8;
  }

  body.print-report #tabela-municipios td {
    padding: 2px 3px;
    font-size: 5.9px;
    line-height: 1.15;
    font-weight: 500;
  }

  body.print-report #tabela-municipios td strong {
    font-size: inherit;
    font-weight: 700;
  }

  body.print-report .col-uf-cell {
    font-size: 5.6px;
    padding: 0 5px;
  }

  body.print-report .muni-bar-cell {
    min-width: 92px;
    gap: 4px;
  }

  body.print-report .muni-bar-track {
    max-width: 54px;
    height: 2px;
  }

  body.print-report .muni-bar-val {
    min-width: 34px;
    font-size: 5.9px;
  }

  body.print-report .map-class-legend {
    max-width: 80px;
  }

  body.print-report .map-class-legend strong,
  body.print-report .map-class-legend div {
    font-size: 7.5px;
  }

  body.print-report .map-class-legend i {
    width: 10px;
    height: 10px;
    flex-basis: 10px;
  }

  body.print-report .tabela-total {
    font-size: 6.8px;
    margin-top: 3px;
    padding: 3px 5px;
  }

  body.print-report .card-identity {
    gap: 8px;
  }

  body.print-report .cand-urna,
  body.print-report .cand-partido,
  body.print-report .badge-eleito,
  body.print-report .badge-nao-eleito {
    font-size: 7px;
  }

  body.print-report .source-box-camara {
    margin-top: 6px;
    padding: 6px;
  }

  body.print-report .source-fields {
    gap: 4px 6px;
    margin-top: 5px;
  }

  body.print-report .kpi-grid,
  body.print-report .kpi-grid-bottom {
    gap: 3px;
    margin-top: 5px;
  }

  body.print-report .kpi-box {
    padding: 4px 5px;
  }

  body.print-report .kpi-label,
  body.print-report .kpi-sub {
    font-size: 6.6px;
  }

  body.print-report .perfil-title {
    margin: 6px 0 3px;
  }

  body.print-report .perfil-item {
    padding: 3px 0;
  }

  body.print-report .perfil-item:nth-child(even) {
    padding-left: 6px;
  }

  body.print-report .perfil-item:nth-child(odd) {
    padding-right: 6px;
  }

  body.print-report .leaflet-control-zoom,
  body.print-report .map-class-legend {
    transform: scale(0.75);
    transform-origin: top right;
  }

  body.print-report .map-info-control {
    display: none !important;
  }

  body.print-report .map-class-legend {
    transform-origin: bottom right;
  }
}
