.voter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(340px, 1fr);
  gap: 2.5rem;
  align-items: start;
  margin-top: 2rem;
}

.position-section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  position: relative;
  overflow: hidden;
}

.position-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #10b981, #34d399, #059669);
  opacity: 0.9;
  border-radius: 6px 0 0 6px;
}

.position-section:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 30px 60px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.position-section .section-heading.compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  gap: 1rem;
}

.position-section .section-heading.compact h3 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Candidate Card Grid */
.candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

/* Interactive Candidate Card */
.candidate-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 20px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Glassmorphism shine effect */
.candidate-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  z-index: 1;
  pointer-events: none;
}

.candidate-card:hover::after {
  left: 200%;
}

/* Radio button overlay styling */
.candidate-card input[type="radio"] {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  accent-color: #10b981;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.candidate-card input[type="radio"]:hover {
  transform: scale(1.1);
}

.candidate-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.08);
}

/* Selected State */
.candidate-card.selected {
  background: linear-gradient(145deg, #ffffff, #f5f3ff);
  border-color: #10b981;
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.15), inset 0 0 0 1px #10b981;
}

.candidate-card.selected .avatar {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  transform: scale(1.05);
}

.candidate-card.selected .candidate-name {
  color: #4f46e5;
}

/* Abstain Card Specific Styling */
.candidate-card.abstain {
  background: rgba(241, 245, 249, 0.5);
  border: 2px dashed rgba(148, 163, 184, 0.4);
}

.candidate-card.abstain:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.candidate-card.abstain.selected {
  border-color: #64748b;
  border-style: solid;
  background: #f1f5f9;
  box-shadow: 0 15px 35px rgba(100, 116, 139, 0.15), inset 0 0 0 1px #64748b;
}

.candidate-card.abstain .avatar {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: none;
  border: 2px solid transparent;
}

/* Metadata Text inside cards */
.candidate-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 2;
}

.candidate-meta .candidate-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
  transition: color 0.3s ease;
}

.candidate-meta .candidate-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  border: 3px solid white;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

/* Premium Sidebar Summary Panel */
.summary-panel {
  padding: 2.5rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  position: sticky;
  top: 2rem;
}

.summary-panel h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: none;
}

/* Custom Progress Track for the dynamic progress bar */
.progress-container {
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-percentage {
  font-size: 1.25rem;
  font-weight: 900;
  color: #10b981;
}

.progress-track {
  height: 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Selection list items */
#selectionSummary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

#selectionSummary .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#selectionSummary .summary-row:hover {
  background: #ffffff;
  transform: translateX(5px) scale(1.02);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.2);
}

#selectionSummary .summary-key {
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
}

#selectionSummary .summary-val {
  font-weight: 800;
  font-size: 0.95rem;
  color: #10b981;
  text-align: right;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#selectionSummary .summary-row:has(.summary-val:empty),
#selectionSummary .summary-row.not-selected {
  background: rgba(241, 245, 249, 0.5);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

#selectionSummary .summary-row.not-selected .summary-val {
  color: #94a3b8 !important;
  font-weight: 600;
}

/* Submitting controls */
.summary-panel .primary-button {
  height: 3.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  color: white;
  border: none;
  cursor: pointer;
}

.summary-panel .primary-button:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.summary-panel .primary-button:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  color: #f8fafc;
}

.summary-panel .ghost-button.subtle {
  border-radius: 16px;
  padding: 1rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.summary-panel .ghost-button.subtle:hover {
  background: rgba(241, 245, 249, 0.8);
  color: #334155;
  border-color: rgba(148, 163, 184, 0.2);
}

/* ============================================
   VOTER BALLOT - RESPONSIVE MOBILE STYLES
   ============================================ */

/* Tablet: stack layout, remove sticky summary */
@media (max-width: 1100px) {
  .voter-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .candidate-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .summary-panel {
    position: relative;
    top: 0;
  }
}

/* Mobile: full-width single column */
@media (max-width: 720px) {
  .voter-layout {
    margin-top: 0.75rem;
    gap: 1rem;
  }

  .candidate-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .position-section {
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 16px;
  }

  .position-section .section-heading.compact {
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
  }

  .position-section .section-heading.compact h3 {
    font-size: 1.15rem;
  }

  .candidate-card {
    padding: 1rem;
    border-radius: 14px;
    gap: 1rem;
  }

  .candidate-meta .candidate-name {
    font-size: 1rem;
  }

  .candidate-meta .candidate-sub {
    font-size: 0.8rem;
  }

  .avatar {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1rem;
  }

  .summary-panel {
    padding: 1.25rem 1rem;
    border-radius: 16px;
  }

  .summary-panel h3 {
    font-size: 1.1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
  }

  #selectionSummary {
    gap: 0.6rem;
    margin-bottom: 1.25rem;
  }

  #selectionSummary .summary-row {
    padding: 0.75rem;
    border-radius: 12px;
  }

  #selectionSummary .summary-key {
    font-size: 0.82rem;
  }

  #selectionSummary .summary-val {
    font-size: 0.85rem;
    max-width: 50%;
  }

  .summary-panel .primary-button {
    height: 3rem;
    font-size: 0.95rem;
    border-radius: 12px;
  }
}

/* Small phones: tighten further */
@media (max-width: 430px) {
  .position-section {
    padding: 1rem 0.875rem;
    border-radius: 14px;
  }

  .candidate-card {
    padding: 0.875rem;
    gap: 0.875rem;
  }

  .candidate-card input[type="radio"] {
    width: 1.2rem;
    height: 1.2rem;
    top: 0.875rem;
    right: 0.875rem;
  }

  .summary-panel {
    padding: 1rem 0.875rem;
  }
}

/* ============================================
   VOTER NAV BAR — PREMIUM REDESIGN
   ============================================ */
.voter-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.75rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.06),
    0 1px 4px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  margin-bottom: 1.75rem;
  position: sticky;
  top: 0.75rem;
  z-index: 30;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.voter-navbar:hover {
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.09),
    0 2px 8px rgba(4, 120, 87, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #047857 0%, #10b981 60%, #34d399 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.35);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.brand-logo:hover {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.45);
}

.brand-logo svg {
  width: 18px;
  height: 18px;
  color: white;
  stroke: white;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #047857 0%, #059669 50%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 0.67rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Divider between brand & actions */
.nav-divider {
  width: 1px;
  height: 28px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 99px;
  flex-shrink: 0;
}

/* Right side actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.voter-stats-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Status chip inside navbar */
.nav-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
  white-space: nowrap;
}

.nav-status-chip .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Logout button — premium */
.logout-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.18);
  padding: 0.55rem 1.1rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  transition: all 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.logout-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  opacity: 0;
  transition: opacity 0.22s ease;
  border-radius: inherit;
}

.logout-nav-btn:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.logout-nav-btn:hover::before {
  opacity: 1;
}

.logout-nav-btn svg,
.logout-nav-btn span {
  position: relative;
  z-index: 1;
}

.logout-nav-btn:active {
  transform: translateY(0);
}

/* Page title bar below navbar */
.voter-title-bar {
  margin-bottom: 1.5rem;
}

.voter-title-bar .eyebrow {
  margin-bottom: 0.3rem;
}

/* ============================================
   RESPONSIVE — Voter Navbar
   ============================================ */
@media (max-width: 768px) {
  .voter-navbar {
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    top: 0.5rem;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .brand-tagline {
    display: none;
  }

  .nav-divider {
    display: none;
  }

  .voter-stats-nav {
    display: none;
  }

  .logout-nav-btn span {
    display: none;
  }

  .logout-nav-btn {
    padding: 0.55rem 0.65rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    justify-content: center;
  }

  .voter-title-bar h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 430px) {
  .brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .brand-name {
    font-size: 0.82rem;
  }
}