:root, [data-theme="dark"] {
  --theme-name: 'dark';
  --bg-primary: #07090e;
  --bg-surface: #0f1422;
  --bg-card: #141c2e;
  --bg-card-hover: #1b263e;
  --bg-input: #111728;
  --border-color: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --header-bg: rgba(15, 20, 34, 0.88);
  --drawer-bg: #0f1422;
  --card-glass: rgba(20, 28, 46, 0.85);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.65);
  
  /* Tangerine Brand Theme */
  --tangerine-50: #fff7ed;
  --tangerine-100: #ffedd5;
  --tangerine-200: #fed7aa;
  --tangerine-300: #fdba74;
  --tangerine-400: #fb923c;
  --tangerine-500: #f97316; /* Primary Tangerine */
  --tangerine-600: #ea580c;
  --tangerine-700: #c2410c;
  
  --primary: #f97316;
  --primary-hover: #ea580c;
  --accent: #fb923c;
  --tangerine-glow: rgba(249, 115, 22, 0.35);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Ambient Mesh & Texture */
  --body-bg-gradient: radial-gradient(circle at 10% 12%, rgba(249, 115, 22, 0.08) 0%, transparent 45%),
                      radial-gradient(circle at 90% 88%, rgba(99, 102, 241, 0.07) 0%, transparent 50%),
                      radial-gradient(circle at 50% 40%, rgba(16, 185, 129, 0.04) 0%, transparent 55%),
                      #07090e;
  --dot-grid-color: rgba(255, 255, 255, 0.035);
}

[data-theme="light"] {
  --theme-name: 'light';
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --header-bg: rgba(255, 255, 255, 0.94);
  --drawer-bg: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.07), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 14px 30px -4px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.04);

  /* Tangerine Brand Theme in Light */
  --tangerine-50: #fff7ed;
  --tangerine-100: #ffedd5;
  --tangerine-200: #fed7aa;
  --tangerine-300: #fdba74;
  --tangerine-400: #fb923c;
  --tangerine-500: #f97316;
  --tangerine-600: #ea580c;
  --tangerine-700: #c2410c;

  --primary: #f97316;
  --primary-hover: #ea580c;
  --accent: #fb923c;
  --tangerine-glow: rgba(249, 115, 22, 0.2);

  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;

  /* Ambient Mesh & Texture for Light Mode */
  --body-bg-gradient: radial-gradient(circle at 10% 10%, rgba(249, 115, 22, 0.06) 0%, transparent 40%),
                      radial-gradient(circle at 90% 90%, rgba(59, 130, 246, 0.05) 0%, transparent 45%),
                      radial-gradient(circle at 50% 35%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
                      #f8fafc;
  --dot-grid-color: rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image: var(--body-bg-gradient);
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--dot-grid-color) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* ======================================================== */
/* AMBIENT VIDEO & DYNAMIC MOTION BACKGROUND                */
/* (Civic Crowd Activity, Tech Flow & Productivity Video)   */
/* ======================================================== */
.ambient-video-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.22;
  filter: saturate(1.25) contrast(1.15) brightness(0.85);
  transition: opacity 0.5s ease;
  will-change: transform;
}

[data-theme="light"] .ambient-video-bg {
  opacity: 0.10;
  filter: saturate(1.1) contrast(1.05) brightness(1.2);
}

.ambient-video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.88) 75%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .ambient-video-overlay {
  background: radial-gradient(circle at 50% 30%, rgba(248, 250, 252, 0.55) 0%, rgba(241, 245, 249, 0.90) 80%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glassy-motion-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  will-change: transform;
}

.glassy-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.35;
  will-change: transform;
}

[data-theme="dark"] .glassy-orb {
  opacity: 0.36;
}

[data-theme="light"] .glassy-orb {
  opacity: 0.26;
  filter: blur(100px);
}

.glassy-orb-tangerine {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.65) 0%, rgba(234, 88, 12, 0.22) 55%, transparent 72%);
  top: -120px;
  right: -100px;
  animation: floatOrbTangerine 22s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.glassy-orb-indigo {
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(79, 70, 229, 0.18) 60%, transparent 75%);
  bottom: -150px;
  left: -120px;
  animation: floatOrbIndigo 28s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.glassy-orb-emerald {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.45) 0%, rgba(5, 150, 105, 0.14) 60%, transparent 75%);
  top: 40%;
  left: 30%;
  animation: floatOrbEmerald 26s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.glassy-crowd-wave {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 100%, rgba(249, 115, 22, 0.08) 0%, transparent 60%);
  animation: crowdWavePulse 12s ease-in-out infinite alternate;
}

.glassy-crowd-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--dot-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--dot-grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 85%);
  opacity: 0.7;
}

.glassy-frost-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
}

@keyframes floatOrbTangerine {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-120px, 80px, 0) scale(1.12); }
  100% { transform: translate3d(-60px, 160px, 0) scale(0.95); }
}

@keyframes floatOrbIndigo {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(140px, -90px, 0) scale(1.08); }
  100% { transform: translate3d(80px, -180px, 0) scale(0.92); }
}

@keyframes floatOrbEmerald {
  0% { transform: translate3d(0, 0, 0) scale(0.9); }
  50% { transform: translate3d(-90px, -60px, 0) scale(1.15); }
  100% { transform: translate3d(100px, 80px, 0) scale(1); }
}

@keyframes crowdWavePulse {
  0% { opacity: 0.3; transform: scaleY(0.95); }
  50% { opacity: 0.7; transform: scaleY(1.05); }
  100% { opacity: 0.4; transform: scaleY(0.98); }
}

.app-header, .main-container, .app-footer, .app-drawer, .drawer-overlay {
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  background-color: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tenant-logo-preview {
  height: 44px;
  max-width: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--tangerine-400), var(--tangerine-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 18px var(--tangerine-glow);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #fed7aa 40%, #fb923c 75%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--tangerine-300);
  font-weight: 600;
  display: block;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-setup { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-nominations { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.status-voting_open { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); animation: pulse 2s infinite; }
.status-voting_closed { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-declared { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ======================================================== */
/* TENANT PORTAL LIVE STATUS INDICATORS (VOTER & ADMIN)    */
/* ======================================================== */
.portal-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.25s ease;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  position: relative;
  flex-shrink: 0;
}

.live-pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
  animation: liveDotPulse 1.8s infinite;
}

@keyframes liveDotPulse {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* User & Admin Session Bars in Header */
.user-session-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.session-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* Main Container */
.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  flex: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: var(--card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-center {
  max-width: 480px;
  margin: 40px auto;
}

.card-header {
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

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

/* Forms & Inputs */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.input-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.3rem !important;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  text-transform: uppercase;
  color: var(--tangerine-400);
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary { 
  background: linear-gradient(135deg, var(--tangerine-500), var(--tangerine-600)); 
  color: #fff; 
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}
.btn-primary:hover { 
  background: linear-gradient(135deg, var(--tangerine-600), var(--tangerine-700)); 
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover { 
  background: var(--bg-card); 
  border-color: var(--tangerine-400);
}

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1.1rem; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Typography & Helpers */
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-xs { font-size: 0.75rem; }
.text-tangerine { color: var(--tangerine-400); font-weight: 700; }

code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(249, 115, 22, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--tangerine-300);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

/* E-Booth Specifics */
.voter-badge-banner {
  background: linear-gradient(to right, rgba(249, 115, 22, 0.1), rgba(234, 88, 12, 0.05));
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.contests-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.contest-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.contest-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.contest-header h3 {
  font-size: 1.25rem;
  color: var(--tangerine-300);
}

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

.candidate-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.candidate-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.candidate-option-content {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.candidate-option input[type="radio"]:checked + .candidate-option-content {
  border-color: var(--tangerine-500);
  background: rgba(249, 115, 22, 0.1);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.25);
}

.candidate-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.candidate-manifesto {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.voting-code-box {
  background: linear-gradient(145deg, #182032, #0d121f);
  border: 2px dashed var(--tangerine-500);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.code-input-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Turnout Stats */
.turnout-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.turnout-stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-top: 8px;
  display: block;
}

/* Results & Declaration Certificate */
.declaration-certificate {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.result-tally-bar {
  background: var(--bg-card);
  border-radius: 9999px;
  height: 12px;
  overflow: hidden;
  margin-top: 6px;
  position: relative;
}

.tally-fill {
  background: linear-gradient(to right, var(--primary), var(--accent));
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}

/* Admin Console */
.admin-stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.select-stage {
  font-weight: 700;
  background: var(--bg-card);
  color: #fbbf24;
}

.admin-subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.subtab-content { display: none; }
.subtab-content.active { display: block; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Data Tables */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

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

/* Tags & Alerts */
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}
.tag-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.tag-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-outline { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }

.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.alert-info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #93c5fd; }

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease forwards;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Hamburger Toggle Button - HIDDEN on public front end by default */
.menu-toggle-btn {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: none; /* Strictly hidden on unauthenticated front end; shown only after login */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.menu-toggle-btn:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: var(--primary);
  transform: scale(1.04);
}

/* Modal Card Large for Organization & Account Settings */
.modal-card-lg {
  max-width: 900px !important;
  width: 95vw !important;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 28px !important;
}

.modal-body-scroll {
  overflow-y: auto;
  padding-right: 6px;
  flex: 1;
}

.modal-body-scroll::-webkit-scrollbar {
  width: 6px;
}

.modal-body-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.modal-body-scroll::-webkit-scrollbar-thumb {
  background: rgba(249, 115, 22, 0.3);
  border-radius: 4px;
}

#modal-invite-admin {
  z-index: 1700 !important;
}

/* ======================================================== */
/* HAMBURGER DRAWER: AESTHETIC FEATURE HUB                  */
/* ======================================================== */
.drawer-settings-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.drawer-category-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-category-heading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 6px 2px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-feature-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.drawer-feature-card:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.35);
  transform: translateX(4px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.drawer-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.drawer-feature-info {
  flex: 1;
  min-width: 0;
}

.drawer-feature-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.drawer-feature-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.drawer-feature-arrow {
  opacity: 0.4;
  font-size: 0.8rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.drawer-feature-card:hover .drawer-feature-arrow {
  opacity: 1;
  transform: translateX(2px);
  color: var(--primary);
}

.drawer-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.drawer-menu-item:hover {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.3);
  color: #fff;
  transform: translateX(4px);
}

.drawer-menu-logout {
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.06) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  border-radius: var(--radius-md) !important;
}

.drawer-menu-logout:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* Slide-out Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.app-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-color);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.75);
  z-index: 1600;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.app-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.drawer-body {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px 4px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
}

.drawer-nav-item:hover {
  color: var(--text-main);
  background: rgba(249, 115, 22, 0.08);
}

.drawer-nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(234, 88, 12, 0.2));
  border-color: rgba(249, 115, 22, 0.4);
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ======================================================== */
/* MODERN TOP PORTAL NAVIGATION (CLEAN & UNCLUTTERED)     */
/* ======================================================== */
.portal-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(17, 23, 38, 0.85);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.portal-nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.portal-nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.portal-nav-tab.active {
  background: linear-gradient(135deg, var(--tangerine-500), var(--tangerine-600));
  color: #fff;
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 4px 14px var(--tangerine-glow);
}

.portal-nav-tab svg {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .portal-nav-bar {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* ======================================================== */
/* VOTING PROGRESS & TURNOUT COMMAND CENTER                 */
/* ======================================================== */
.turnout-command-center {
  background: linear-gradient(145deg, #131b2e 0%, #0d1220 100%);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  margin-bottom: 32px;
}

.turnout-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.turnout-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.results-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.results-meta-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Turnout Gauge Card */
.turnout-gauge-card {
  background: rgba(10, 13, 20, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.turnout-gauge-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.turnout-gauge-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tangerine-400);
  display: block;
  margin-bottom: 4px;
}

.turnout-metric-flex {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.turnout-big-stat {
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-feature-settings: "tnum";
}

.turnout-sub-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.quorum-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.quorum-box.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.quorum-box.achieved {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.2);
}

/* Glowing Progress Track */
.turnout-progress-track {
  background: #0f1523;
  height: 16px;
  border-radius: 9999px;
  position: relative;
  overflow: visible;
  border: 1px solid var(--border-color);
}

.turnout-progress-fill {
  background: linear-gradient(90deg, #f97316 0%, #fb923c 60%, #10b981 100%);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 16px var(--tangerine-glow);
}

.quorum-marker-flag {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%);
  pointer-events: none;
}

.quorum-marker-tip {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 3 Stat Cards */
.turnout-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.stat-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
}

.stat-card-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  display: block;
  margin-top: 2px;
}

/* ======================================================== */
/* CONTESTED OFFICES PIE CHARTS (POSITION IN CENTER)        */
/* ======================================================== */
.results-section-header {
  margin-bottom: 24px;
}

.results-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.results-donut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 24px;
}

@media (max-width: 600px) {
  .results-donut-grid {
    grid-template-columns: 1fr;
  }
}

.contest-pie-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.contest-pie-card:hover {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.contest-pie-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.contest-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tangerine-400);
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}

.contest-office-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.contest-total-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-shrink: 0;
}

.contest-total-pill strong {
  font-size: 1.15rem;
  color: #fff;
}

.contest-total-pill span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.contest-pie-content {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 20px;
  flex: 1;
}

@media (max-width: 540px) {
  .contest-pie-content {
    flex-direction: column;
    gap: 20px;
  }
}

/* Donut SVG Container */
.donut-chart-wrapper {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.donut-svg {
  width: 210px;
  height: 210px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
}

.donut-center-title {
  font-weight: 800;
  font-size: 12px;
  fill: var(--text-main);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: inherit;
}

.donut-center-votes {
  font-size: 11px;
  font-weight: 700;
  fill: var(--tangerine-400);
  font-family: inherit;
}

.donut-segment {
  cursor: pointer;
  transition: stroke-width 0.25s ease, opacity 0.2s ease;
}

.donut-segment:hover {
  stroke-width: 32px;
  opacity: 0.95;
}

/* Candidate Score List */
.contest-candidate-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.cand-score-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all 0.2s ease;
}

.cand-score-row.leading {
  background: rgba(249, 115, 22, 0.05);
  border-color: rgba(249, 115, 22, 0.35);
}

.cand-score-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.cand-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.cand-name-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-main);
}

.cand-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cand-score-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.cand-votes-text {
  font-weight: 700;
  color: var(--text-main);
}

.cand-pct-badge {
  font-weight: 700;
  color: var(--text-muted);
}

.cand-score-bar-track {
  background: #0f1523;
  height: 6px;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cand-score-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ====================================================================== */
/* SUBSCRIPTION, BILLING & QUOTA ALERT STYLES                            */
/* ====================================================================== */
.quota-alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.quota-alert-banner.quota-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.quota-banner-left {
  flex: 1;
}

.quota-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.quota-capacity-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.quota-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.quota-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--tangerine-400));
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.quota-danger .quota-progress-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.quota-warning-text {
  font-size: 0.82rem;
  color: #fed7aa;
  line-height: 1.4;
}

.quota-danger .quota-warning-text {
  color: #fca5a5;
  font-weight: 600;
}

.subscription-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.sub-plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sub-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.sub-plan-card.active-plan {
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.06) 0%, var(--bg-surface) 100%);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
}

.sub-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 9999px;
}

.sub-plan-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.sub-plan-pricing {
  margin: 12px 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sub-price-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.sub-price-interval {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sub-voter-cap {
  display: inline-block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tangerine-400);
  margin-bottom: 12px;
}

.sub-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
  min-height: 38px;
}

.sub-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  flex: 1;
}

.sub-features li {
  font-size: 0.78rem;
  color: #cbd5e1;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-features li::before {
  content: "✓";
  color: #10b981;
  font-weight: 800;
}

.sub-action-btn {
  width: 100%;
  font-size: 0.85rem;
  padding: 9px 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .quota-alert-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .quota-banner-right {
    width: 100%;
  }
  .quota-banner-right button {
    width: 100%;
  }
}

/* User Settings & Account Security Styles */
.user-settings-nav-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
}

.user-settings-panel {
  padding-top: 4px;
}

.session-user-pill {
  border-radius: 9999px;
  padding: 4px 12px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.3);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-user-pill:hover {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.5);
}

/* ======================================================== */
/* THEME CONTROLS & DYNAMIC APPEARANCE STYLES               */
/* ======================================================== */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  user-select: none;
}

.theme-toggle-btn:hover {
  border-color: var(--tangerine-400);
  transform: rotate(20deg) scale(1.08);
  box-shadow: 0 0 14px var(--tangerine-glow);
}

.drawer-theme-box {
  margin: 10px 8px 14px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-theme-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.drawer-theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.drawer-theme-toggle-btn:hover {
  border-color: var(--primary);
  background: rgba(249, 115, 22, 0.1);
}

/* ======================================================== */
/* LIGHT / WHITE THEME ELEVATION OVERRIDES                  */
/* ======================================================== */
[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #0f172a 0%, #ea580c 70%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-subtitle {
  color: var(--tangerine-600);
}

[data-theme="light"] .brand-icon {
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

[data-theme="light"] .portal-nav-bar {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .portal-nav-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .card-header h2,
[data-theme="light"] .card-header h3 {
  color: #0f172a;
}

[data-theme="light"] .form-group label {
  color: #475569;
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="email"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .data-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}

[data-theme="light"] .data-table td {
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .data-table tr:hover {
  background: #f8fafc;
}

[data-theme="light"] .btn-outline {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-outline:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="light"] .subtab-btn {
  color: #64748b;
}

[data-theme="light"] .subtab-btn:hover {
  color: #0f172a;
}

[data-theme="light"] .subtab-btn.active {
  color: var(--primary);
}

[data-theme="light"] .tag-outline {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] .modal {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
}

[data-theme="light"] .modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

[data-theme="light"] .modal-header h3 {
  color: #0f172a;
}

[data-theme="light"] .modal-close-btn {
  color: #64748b;
}

[data-theme="light"] .modal-close-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

[data-theme="light"] .app-drawer {
  background: #ffffff;
  border-right-color: #e2e8f0;
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .drawer-overlay {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .drawer-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .drawer-section-title {
  color: #64748b;
}

[data-theme="light"] .drawer-nav-item {
  color: #475569;
}

[data-theme="light"] .drawer-nav-item:hover {
  color: #0f172a;
  background: #f1f5f9;
}

[data-theme="light"] .drawer-nav-item.active {
  color: var(--tangerine-600);
  background: #fff7ed;
  border-color: #fed7aa;
}

[data-theme="light"] .drawer-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .turnout-command-center {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .results-main-title {
  color: #0f172a;
}

[data-theme="light"] .turnout-gauge-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .turnout-big-stat {
  color: #0f172a;
}

[data-theme="light"] .turnout-progress-track {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme="light"] .quorum-marker-flag {
  background: rgba(15, 23, 42, 0.4);
}

[data-theme="light"] .stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .stat-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .stat-card-num {
  color: #0f172a;
}

[data-theme="light"] .results-section-title {
  color: #0f172a;
}

[data-theme="light"] .contest-pie-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .contest-pie-card:hover {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .contest-pie-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .contest-office-title {
  color: #0f172a;
}

[data-theme="light"] .contest-total-pill {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .contest-total-pill strong {
  color: #0f172a;
}

[data-theme="light"] .cand-score-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .cand-score-row:hover {
  background: #f1f5f9;
}

[data-theme="light"] .cand-score-row.leading {
  background: #fff7ed;
  border-color: #fdba74;
}

[data-theme="light"] .cand-name-col {
  color: #0f172a;
}

[data-theme="light"] .cand-votes-text {
  color: #0f172a;
}

[data-theme="light"] .cand-score-bar-track {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

[data-theme="light"] .donut-center-title {
  fill: #0f172a;
}

[data-theme="light"] .donut-svg {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

[data-theme="light"] .voting-code-box {
  background: #ffffff;
  border-color: var(--tangerine-500);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.08);
}

[data-theme="light"] .sub-plan-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .sub-plan-card.active-plan {
  background: #fffbf5;
  border-color: var(--tangerine-500);
}

[data-theme="light"] .sub-plan-title {
  color: #0f172a;
}

[data-theme="light"] .sub-price-num {
  color: #0f172a;
}

[data-theme="light"] .sub-features li {
  color: #334155;
}

[data-theme="light"] .quota-alert-banner {
  background: #fff7ed;
  border-color: #fdba74;
}

[data-theme="light"] .quota-capacity-text {
  color: #0f172a;
}

[data-theme="light"] .user-session-bar {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .session-name {
  color: #0f172a;
}

[data-theme="light"] code {
  background: #fff7ed;
  color: var(--tangerine-700);
  border-color: #fed7aa;
}

[data-theme="light"] .status-voting_open {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

[data-theme="light"] .stat-value {
  color: #0f172a;
}

[data-theme="light"] .candidate-option-content {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .candidate-name {
  color: #0f172a;
}

[data-theme="light"] .contest-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .contest-header {
  border-bottom-color: #e2e8f0;
}

/* ======================================================== */
/* INSTITUTIONAL FOOTER & PRAIZELE CORPORATION ATTRIBUTION  */
/* ======================================================== */
.app-footer {
  position: relative;
  z-index: 10;
  margin-top: 60px;
  padding: 32px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .app-footer {
  background: rgba(255, 255, 255, 0.65);
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

@media (max-width: 768px) {
  .footer-right {
    align-items: flex-start;
  }
}

.footer-attribution {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.praizele-corp-badge {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.2px;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.drawer-designed-by {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.drawer-designed-by strong {
  background: linear-gradient(135deg, #f97316, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* ========================================================
   VOTER SEARCH WINDOW & ADVANCED REGISTER CONTROLS
   ======================================================== */
.voter-search-toolbar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s ease;
}

.filter-pill-btn {
  border-radius: 9999px !important;
  font-size: 0.78rem !important;
  padding: 5px 12px !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-muted) !important;
  transition: all 0.2s ease !important;
}

.filter-pill-btn:hover {
  border-color: rgba(249, 115, 22, 0.5) !important;
  color: #fff !important;
  background: rgba(249, 115, 22, 0.08) !important;
}

.filter-pill-btn.active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(234, 88, 12, 0.15)) !important;
  border-color: var(--tangerine-500) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.25) !important;
}

/* ========================================================
   E-VOTER BOOTH CANDIDATE CARDS & VOTING SELECTION
   ======================================================== */
.candidate-option {
  position: relative;
  display: block;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
}

.candidate-option:hover {
  transform: translateY(-2px);
}

.candidate-option-content {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.candidate-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.candidate-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(16, 185, 129, 0.2));
  border: 1.5px solid rgba(249, 115, 22, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.candidate-identity {
  flex: 1;
  min-width: 0;
}

.candidate-identity .candidate-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.candidate-nominee-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
}

.candidate-manifesto-box {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid rgba(249, 115, 22, 0.5);
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin: 8px 0 14px 0;
  font-size: 0.85rem;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.45;
  flex: 1;
}

.candidate-vote-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  margin-top: auto;
}

.radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.radio-circle-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s ease;
}

/* Selected Candidate Card Highlight */
.candidate-option input[type="radio"]:checked + .candidate-option-content {
  border-color: var(--tangerine-500);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.14), rgba(234, 88, 12, 0.06));
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

.candidate-option input[type="radio"]:checked + .candidate-option-content .candidate-avatar {
  background: linear-gradient(135deg, var(--tangerine-500), var(--tangerine-600));
  border-color: #fff;
  color: #fff;
}

.candidate-option input[type="radio"]:checked + .candidate-option-content .candidate-vote-indicator {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.5);
  color: #fb923c;
  font-weight: 800;
}

.candidate-option input[type="radio"]:checked + .candidate-option-content .radio-circle {
  border-color: var(--tangerine-500);
  background: var(--tangerine-500);
}

.candidate-option input[type="radio"]:checked + .candidate-option-content .radio-circle-inner {
  background: #fff;
}

/* ========================================================
   PUBLIC ACCREDITATION LOOKUP SEARCH ITEMS
   ======================================================== */
.voter-lookup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  gap: 12px;
  transition: all 0.2s ease;
}

.voter-lookup-item:hover {
  background: rgba(249, 115, 22, 0.05);
  border-color: rgba(249, 115, 22, 0.35);
}

.voter-lookup-info strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
}

.voter-lookup-info code {
  color: #38bdf8;
  font-size: 0.85rem;
  margin-top: 2px;
  display: inline-block;
}

