/* ================================================================
   DataViz Electoral · Registraduría Style · Light Theme Premium
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #F4F6FA;
  color: #1A1A2E;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #E8EDF5; }
::-webkit-scrollbar-thumb { background: #C5CDD8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #1B3A7A; }

/* ── App Loader ─────────────────────────────────── */
#app-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #0D1B4B;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.loader-ring {
  width: 64px; height: 64px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: #FFC107;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-text { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════ */
#app-header {
  background: #0D1B4B;
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.header-left {
  display: flex; align-items: center; gap: 16px;
}
.header-logo-badge {
  display: flex; align-items: center; gap: 10px;
}
.registraduria-badge {
  background: white; border-radius: 8px;
  padding: 4px 10px; display: flex; align-items: center; gap: 8px;
}
.reg-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #1B3A7A, #0D1B4B);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.reg-text { font-size: 0.6rem; font-weight: 700; color: #0D1B4B; line-height: 1.1; text-transform: uppercase; }
.election-badge {
  display: flex; align-items: center; gap: 6px;
}
.year-badge {
  background: #FFC107; color: #0D1B4B;
  font-size: 1.4rem; font-weight: 900; line-height: 1;
  padding: 2px 8px; border-radius: 4px;
  letter-spacing: -1px;
}
.election-label {
  color: white; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.2;
}
.election-sublabel {
  font-size: 0.72rem; font-weight: 700; color: white;
  letter-spacing: 1px; text-transform: uppercase;
  border-left: 2px solid rgba(255,255,255,0.3);
  padding-left: 16px; margin-left: 8px;
}
.header-right {
  display: flex; align-items: center; gap: 16px;
}
.header-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none;
  color: white; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.22); }

/* ── Progress Bar ─────────────────────────────── */
#progress-bar {
  background: #FFC107;
  padding: 8px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.progress-left {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; font-weight: 500; color: #0D1B4B;
  white-space: nowrap;
}
.progress-label { font-weight: 700; }
.progress-track {
  flex: 1; height: 8px; background: rgba(13,27,75,0.2);
  border-radius: 4px; overflow: hidden; min-width: 100px; max-width: 300px;
}
.progress-fill {
  height: 100%; background: #0D1B4B;
  border-radius: 4px; transition: width 1s ease;
}
.progress-pct { font-weight: 800; font-size: 0.85rem; color: #0D1B4B; }
.progress-right {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: #0D1B4B; font-weight: 500;
  white-space: nowrap;
}
.clock-icon { font-size: 0.9rem; }

/* ── Nav Bar ──────────────────────────────────── */
#nav-bar {
  background: white;
  border-bottom: 2px solid #E8EDF5;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; position: sticky; top: 60px; z-index: 99;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.nav-left { display: flex; align-items: center; gap: 8px; }
.territory-breadcrumb {
  display: flex; align-items: center; gap: 4px;
}
.breadcrumb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F0F4FF; border: 1px solid #C5D3F0;
  border-radius: 20px; padding: 5px 14px;
  font-size: 0.78rem; font-weight: 600; color: #1B3A7A;
  cursor: pointer; transition: all 0.2s;
}
.breadcrumb-btn:hover { background: #DDE6FF; }
.breadcrumb-btn.active { background: #0D1B4B; color: white; border-color: #0D1B4B; }
.breadcrumb-sep { color: #94A3B8; font-size: 0.8rem; }

.nav-center {
  display: flex; align-items: center;
  background: #F0F4FF; border-radius: 24px;
  padding: 3px; gap: 2px;
}
.nav-tab {
  padding: 6px 20px; border-radius: 20px;
  font-size: 0.82rem; font-weight: 500; color: #64748B;
  cursor: pointer; transition: all 0.2s; border: none; background: none;
  white-space: nowrap; font-family: inherit;
}
.nav-tab:hover { color: #1B3A7A; }
.nav-tab.active {
  background: #0D1B4B; color: white;
  box-shadow: 0 2px 8px rgba(13,27,75,0.35);
}
/* Textos completos y cortos de pestañas */
.tab-short { display: none; }
.tab-full { display: inline; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.avance-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F8FAFF; border: 1px solid #C5D3F0;
  border-radius: 20px; padding: 5px 12px;
  font-size: 0.78rem; color: #1B3A7A; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.avance-btn:hover { background: #DDE6FF; }
.action-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #F0F4FF; border: 1px solid #C5D3F0;
  color: #1B3A7A; cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.action-btn:hover { background: #DDE6FF; }

/* ════════════════════════════════════════════════
   VIEW 1 – VOTOS A PARTIDOS
════════════════════════════════════════════════ */
#view-partidos {
  padding: 28px 24px;
  max-width: 1400px; margin: 0 auto;
}

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.candidate-card {
  background: white;
  border-radius: 16px;
  padding: 20px 16px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative; overflow: hidden;
}
.candidate-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--party-color, #9E9E9E);
}
.candidate-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  border-color: var(--party-color, #9E9E9E);
}
.candidate-card.winner {
  border-color: var(--party-color, #9E9E9E);
  background: linear-gradient(to bottom, rgba(var(--party-rgb),0.04), white);
}

.cand-votes {
  font-size: 1.5rem; font-weight: 900;
  color: #1A1A2E; line-height: 1;
  margin-bottom: 4px;
}
.cand-pct {
  font-size: 0.8rem; font-weight: 600; color: #64748B;
  margin-bottom: 14px;
}

.cand-avatar-wrap {
  position: relative; display: inline-block;
  margin-bottom: 10px;
}
.cand-avatar {
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 3px solid var(--party-color, #9E9E9E);
  overflow: hidden; margin: 0 auto 4px;
  background: #F0F4FF;
  display: flex; align-items: center; justify-content: center;
}
.cand-avatar svg { width: 100%; height: 100%; }

.vice-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  background: #E8EDF5;
  display: flex; align-items: center; justify-content: center;
  position: absolute; bottom: 0; right: -8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.vice-avatar svg { width: 100%; height: 100%; }

.cand-bar {
  width: 100%; height: 6px;
  background: #E8EDF5; border-radius: 3px; overflow: hidden;
  margin: 10px 0 8px;
}
.cand-bar-fill {
  height: 100%; border-radius: 3px;
  background: var(--party-color, #9E9E9E);
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.cand-name {
  font-size: 0.7rem; font-weight: 700; color: #1A1A2E;
  line-height: 1.2; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cand-role { font-size: 0.62rem; color: #94A3B8; margin-bottom: 3px; }
.vice-name {
  font-size: 0.62rem; color: #64748B; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.party-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 10px; padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.6rem; font-weight: 700;
  color: white; letter-spacing: 0.3px;
  background: var(--party-color, #9E9E9E);
  white-space: nowrap; overflow: hidden;
  max-width: 100%; text-overflow: ellipsis;
}

.rank-badge {
  position: absolute; top: 12px; left: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--party-color, #9E9E9E);
  color: white; font-size: 0.65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* Blancos card */
.blank-card {
  background: #F8FAFF; border: 1px dashed #C5D3F0;
}
.blank-card .cand-votes { color: #64748B; font-size: 1.1rem; }

/* ════════════════════════════════════════════════
   VIEW 2 – VOTOS POR TERRITORIO
════════════════════════════════════════════════ */
#view-territorio {
  padding: 20px 24px;
  max-width: 1400px; margin: 0 auto;
}

.territorio-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 24px;
  align-items: start;
}

/* Map Panel */
.map-panel {
  background: white; border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
}
.map-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #E8EDF5;
  display: flex; align-items: center; justify-content: space-between;
}
.map-panel-title { font-size: 0.82rem; font-weight: 700; color: #1A1A2E; }
.sub-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid #E8EDF5;
}
.sub-tab {
  padding: 10px 16px;
  font-size: 0.78rem; font-weight: 500; color: #64748B;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; display: flex; align-items: center; gap: 6px;
  transition: all 0.2s; white-space: nowrap;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.sub-tab:hover { color: #1B3A7A; }
.sub-tab.active { color: #1B3A7A; border-bottom-color: #1B3A7A; font-weight: 600; }

#mapa-svg-wrap {
  padding: 20px;
}
#arauca-svg {
  width: 100%;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}
.mun-polygon {
  stroke: white; stroke-width: 2.5;
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
}
.mun-polygon:hover {
  filter: brightness(1.15);
  stroke-width: 3.5;
}
.mun-polygon.highlighted {
  stroke: #FFC107; stroke-width: 3;
  filter: brightness(1.1);
}

.map-legend {
  padding: 12px 20px 16px;
  border-top: 1px solid #E8EDF5;
}
.map-legend-title { font-size: 0.72rem; font-weight: 600; color: #64748B; margin-bottom: 8px; }
.legend-items { display: flex; flex-direction: column; gap: 6px; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem; color: #1A1A2E;
}
.legend-dot {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}

/* Municipality List Panel */
.mun-list-panel {
  background: white; border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden;
}
.mun-list-search {
  padding: 14px 16px;
  border-bottom: 1px solid #E8EDF5;
  display: flex; align-items: center; gap: 10px;
}
.search-icon { color: #94A3B8; font-size: 0.9rem; }
.mun-search-input {
  flex: 1; border: none; outline: none;
  font-size: 0.85rem; color: #1A1A2E;
  font-family: inherit; background: none;
}
.mun-search-input::placeholder { color: #94A3B8; }

.mun-list { overflow-y: auto; max-height: calc(100vh - 280px); }

.mun-row {
  padding: 16px; border-bottom: 1px solid #F0F4FF;
  cursor: pointer; transition: background 0.15s;
}
.mun-row:hover { background: #F8FAFF; }
.mun-row.highlighted { background: #F0F4FF; border-left: 3px solid #0D1B4B; }

.mun-row-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.mun-name {
  font-size: 0.88rem; font-weight: 800; color: #1A1A2E;
  letter-spacing: 0.3px;
}
.mun-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.7rem; color: #64748B;
}
.mun-meta-item { display: flex; align-items: center; gap: 4px; }
.mun-meta-label { font-weight: 500; }
.mun-meta-val { font-weight: 700; color: #1A1A2E; }
.mun-meta-pct { color: #64748B; }
.mun-arrow {
  color: #94A3B8; font-size: 0.8rem; margin-left: 4px;
}

.winner-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: #F8FAFF; border-radius: 10px;
  border-left: 3px solid var(--party-color, #9E9E9E);
}
.winner-avatars { display: flex; align-items: center; position: relative; }
.winner-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid white; overflow: hidden;
  background: #E8EDF5; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.winner-avatar svg { width: 100%; height: 100%; }
.winner-avatar:last-child { margin-left: -12px; }
.winner-info { flex: 1; min-width: 0; }
.winner-party-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--party-color, #9E9E9E);
  color: white; border-radius: 4px; padding: 2px 8px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.3px;
  margin-bottom: 4px; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.winner-cand-name {
  font-size: 0.72rem; font-weight: 600; color: #1A1A2E;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.winner-vice-name {
  font-size: 0.65rem; color: #64748B;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.winner-votes-wrap { text-align: right; flex-shrink: 0; }
.winner-votes { font-size: 1rem; font-weight: 800; color: #1A1A2E; line-height: 1; }
.winner-pct {
  font-size: 0.72rem; font-weight: 600;
  color: var(--party-color, #9E9E9E);
}
.winner-vote-bar {
  height: 4px; background: #E8EDF5; border-radius: 2px;
  overflow: hidden; margin-top: 6px;
}
.winner-vote-fill {
  height: 100%; border-radius: 2px;
  background: var(--party-color, #9E9E9E);
}

/* ════════════════════════════════════════════════
   VIEW 3 – INFORMACIÓN GENERAL
════════════════════════════════════════════════ */
#view-info {
  padding: 28px 24px;
  max-width: 1400px; margin: 0 auto;
}
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.info-card {
  background: white; border-radius: 16px; padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid var(--info-color, #1B3A7A);
}
.info-card-label { font-size: 0.72rem; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.info-card-value { font-size: 2rem; font-weight: 900; color: #1A1A2E; }
.info-card-sub { font-size: 0.78rem; color: #64748B; margin-top: 4px; }

/* ── Toast ──────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1A1A2E; color: white;
  border-radius: 10px; padding: 10px 16px;
  font-size: 0.82rem; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transform: translateX(120%); transition: transform 0.3s ease;
  border-left: 3px solid #FFC107;
}
.toast.show { transform: translateX(0); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 960px) {
  .territorio-layout { grid-template-columns: 1fr; }
  .candidates-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 768px) {
  #app-header { padding: 8px 16px; height: auto; flex-wrap: wrap; gap: 12px; }
  .header-left { width: 100%; justify-content: center; }
  .header-right { width: 100%; justify-content: center; }
  #progress-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 16px; }
  .progress-left { flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
  .progress-track { max-width: none; width: 100%; }
  .progress-right { align-self: flex-end; }
  .info-grid { grid-template-columns: 1fr; }
  .filters-header { flex-direction: column; align-items: stretch; }
  #filter-mun, #filter-puesto, #filter-zona-wrap { flex: 1 1 100% !important; max-width: 100%; }
}
@media (max-width: 600px) {
  .election-sublabel { display: none; }
  #app-header { padding: 12px; }
  .header-logo-badge { gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
  .header-logo-badge img { height: 35px !important; }
  .header-left, .header-right { width: 100%; justify-content: center; }
  .header-right { gap: 8px; margin-top: 10px; }
  
  #progress-bar { flex-direction: column; padding: 12px; gap: 8px; }
  .progress-left { width: 100%; flex-wrap: wrap; justify-content: center; flex-direction: row; align-items: center; text-align: center; }
  .progress-track { width: 100%; }
  .progress-right { width: 100%; justify-content: center; }
  
  #nav-bar { padding: 12px; height: auto; flex-direction: column; gap: 10px; align-items: stretch; overflow: visible; }
  .nav-left { width: 100%; justify-content: center; flex-wrap: wrap; gap: 8px; }
  .nav-center {
    width: 100%; flex-wrap: wrap; justify-content: center;
    padding: 4px; border-radius: 12px; gap: 4px;
  }
  .nav-tab {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    padding: 9px 6px;
    font-size: 0.72rem;
    white-space: normal;
    line-height: 1.2;
  }
  /* En móvil: ocultar texto largo, mostrar texto corto */
  .tab-full { display: none; }
  .tab-short { display: inline; }
  .nav-right { width: 100%; justify-content: center; flex-wrap: wrap; gap: 8px; }
  
  #view-partidos, #view-territorio, #view-info { padding: 16px 12px; }
  .candidates-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .candidate-card { padding: 16px 10px; }
  .cand-avatar { width: 60px; height: 60px; }
  .vice-avatar { width: 28px; height: 28px; right: -4px; }
  .cand-votes { font-size: 1.3rem; margin-bottom: 2px; }
  .cand-pct { font-size: 0.75rem; margin-bottom: 8px; }
  .party-badge { white-space: normal; word-break: break-word; line-height: 1.2; padding: 4px 6px; }
}
@media print {
  #app-header { position: relative; }
  #nav-bar { position: relative; }
}

/* ── Animations ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-up { animation: fadeUp 0.4s ease both; }
.anim-delay-1 { animation-delay: 60ms; }
.anim-delay-2 { animation-delay: 120ms; }
.anim-delay-3 { animation-delay: 180ms; }

/* -- Data Tables ------------------------------------ */
.table-card { background: white; border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; width: 100%; }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid #E8EDF5; font-weight: 700; color: #1A1A2E; background: #F8FAFF; }
.data-table-wrap { overflow-x: auto; max-height: 600px; overflow-y: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 800px; }
.data-table th { padding: 12px 16px; font-size: 0.75rem; font-weight: 600; color: #64748B; background: white; position: sticky; top: 0; z-index: 10; border-bottom: 2px solid #E8EDF5; white-space: nowrap; }
.data-table td { padding: 12px 16px; font-size: 0.82rem; color: #1A1A2E; border-bottom: 1px solid #F0F4FF; }
.data-table tbody tr:hover td { background: #F8FAFF; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table .party-color-indicator { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 8px; vertical-align: middle; }

/* Fila del total del departamento en tablas consolidadas */
.data-table tbody tr.row-total-dept td {
  background: #0D1B4B !important;
  color: white !important;
  font-weight: 800;
}
.data-table tbody tr.row-total-dept:hover td {
  background: #11225B !important;
  color: white !important;
}

/* ── Candidates Horizontal List View ────────────────── */
.candidates-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.candidate-row {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #E8EDF5;
  transition: all 0.2s ease;
}

.candidate-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 5px;
  background: var(--party-color, #9E9E9E);
}

.candidate-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: #C5D3F0;
}

.candidate-row.winner {
  background: linear-gradient(to right, rgba(var(--party-rgb), 0.03), white);
  border-color: rgba(var(--party-rgb), 0.2);
}

.candidate-row .cand-rank {
  font-size: 1.1rem;
  font-weight: 900;
  color: #94A3B8;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.candidate-row.winner .cand-rank {
  color: var(--party-color);
}

.candidate-row .cand-avatar-col {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.candidate-row .cand-main-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--party-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0F4FF;
}
.candidate-row .cand-main-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.candidate-row .cand-vice-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid white;
  overflow: hidden;
  background: #E8EDF5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.candidate-row .cand-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.candidate-row .cand-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.candidate-row .cand-name-txt {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1A1A2E;
}

.candidate-row .cand-vice-txt {
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 500;
}

.candidate-row .cand-party-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.candidate-row .cand-party-badge {
  background: var(--party-color);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.candidate-row .cand-bar-container {
  width: 100%;
  height: 8px;
  background: #F1F5F9;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.candidate-row .cand-bar-fill-horiz {
  height: 100%;
  background: var(--party-color);
  border-radius: 4px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.candidate-row .cand-votes-col {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.candidate-row .cand-votes-val {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1A1A2E;
  line-height: 1.1;
}

.candidate-row .cand-pct-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--party-color);
}

/* Responsive updates for candidate horizontal rows */
@media (max-width: 768px) {
  .candidate-row {
    padding: 12px 14px;
    gap: 12px;
  }
  .candidate-row .cand-main-avatar {
    width: 44px;
    height: 44px;
  }
  .candidate-row .cand-vice-avatar-badge {
    width: 22px;
    height: 22px;
  }
  .candidate-row .cand-votes-val {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .candidate-row {
    flex-wrap: wrap;
  }
  .candidate-row .cand-info-col {
    flex: 1 1 calc(100% - 70px);
  }
  .candidate-row .cand-votes-col {
    flex: 1 1 100%;
    text-align: left;
    margin-left: 68px;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    border-top: 1px dashed #F1F5F9;
    padding-top: 8px;
    margin-top: 4px;
  }
  .candidate-row .cand-votes-val {
    font-size: 1.1rem;
  }
  .candidate-row .cand-pct-val {
    font-size: 0.8rem;
  }
}

