/* ============================================================
   VOTESECURE - SECURE ONLINE VOTING SYSTEM
   Aesthetic: Civic Authority — deep navy, gold accents,
   geometric precision, editorial typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --navy:       #050b14;
  --navy-mid:   #10243c;
  --navy-light: #173a61;
  --gold:       #2f7bf5;
  --gold-light: #6eb5ff;
  --gold-pale:  #eaf5ff;
  --white:      #f7fbff;
  --off-white:  #e9f2ff;
  --gray:       #7e93ab;
  --gray-light: #c7d7ee;
  --red:        #e15555;
  --green:      #24a66b;
  --green-light:#42c483;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 12px 36px rgba(0,0,0,0.28);
  --shadow-sm: 0 6px 18px rgba(7,17,31,0.18);

  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(47,123,245,0.16), transparent 28%),
    linear-gradient(135deg, #060d18 0%, var(--navy-mid) 50%, #0d1f35 100%);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 20% 20%, rgba(110,181,255,0.16) 0%, transparent 58%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(47,123,245,0.2) 0%, transparent 62%);
  pointer-events: none; z-index: 0;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p { color: var(--gray-light); font-size: 0.95rem; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

/* ── Layout Containers ─────────────────────────────────────── */
.page-wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.container-sm {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ── Preloader ───────────────────────────────────────────── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 8, 18, 0.9);
  backdrop-filter: blur(8px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-card {
  width: min(360px, calc(100vw - 2rem));
  padding: 1.75rem;
  border-radius: 20px;
  background: rgba(7, 17, 31, 0.95);
  border: 1px solid rgba(110,181,255,0.22);
  box-shadow: var(--shadow);
  text-align: center;
}

.preloader-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

.preloader h2 {
  margin-bottom: 0.35rem;
  font-size: 1.25rem;
}

.preloader p {
  color: var(--gray-light);
  margin-bottom: 1rem;
}

.preloader-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.preloader-bar span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  animation: preloaderPulse 1.1s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(220%); }
}

/* ── Header / Navbar ───────────────────────────────────────── */
.navbar {
  background: rgba(5,11,20,0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(110,181,255,0.18);
  padding: 0.9rem 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0.3rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 999px;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(2,6,15,0.72);
  backdrop-filter: blur(6px);
  z-index: 220;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(320px, 86vw);
  background: rgba(7, 17, 31, 0.97);
  border-left: 1px solid rgba(110,181,255,0.2);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: translateX(100%);
  transition: transform var(--transition);
}

.mobile-nav.open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-close {
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-links a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  color: var(--gray-light);
  font-weight: 600;
}

.mobile-nav-links a.active,
.mobile-nav-links a:hover {
  background: rgba(47,123,245,0.14);
  color: var(--gold);
}

.mobile-nav-user {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-brand {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
  color: var(--white); text-decoration: none;
}

.nav-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 1rem;
}

.nav-brand span { color: var(--gold); }

.nav-links {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 500;
  color: var(--gray-light);
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.nav-user {
  display: flex; align-items: center; gap: 0.75rem;
}

.nav-badge {
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem; font-weight: 500;
  font-family: var(--font-mono);
}

/* ── Hero / Page Header ────────────────────────────────────── */
.page-hero {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}

.page-hero::after {
  content: '';
  display: block;
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  margin: 1.5rem auto 0;
  border-radius: 2px;
}

.page-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero p  { font-size: 1rem; max-width: 520px; margin: 0 auto; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: rgba(7,17,31,0.82);
  border: 1px solid rgba(110,181,255,0.16);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card:hover { border-color: rgba(110,181,255,0.34); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.2); }

.card-sm { padding: 1.25rem 1.5rem; }
.card-header {
  border-bottom: 1px solid rgba(201,168,76,0.12);
  padding-bottom: 1rem; margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2, .card-header h3 { margin: 0; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.45rem; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-light);
}

input, select, textarea {
  background: rgba(7,17,31,0.72);
  border: 1px solid rgba(110,181,255,0.22);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.78rem 0.95rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(47,123,245,0.16);
  background: rgba(10,24,38,0.9);
}

input::placeholder, textarea::placeholder { color: var(--gray); }

select option { background: var(--navy-mid); }

textarea { resize: vertical; min-height: 90px; }

.input-with-icon {
  position: relative;
}
.input-with-icon input { padding-left: 2.6rem; }
.input-with-icon .icon {
  position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--gray); font-size: 1rem; pointer-events: none;
}

.form-hint {
  font-size: 0.78rem; color: var(--gray);
  margin-top: 0.2rem;
}

.form-error {
  font-size: 0.82rem; color: #e05858;
  display: none;
}
.form-error.show { display: block; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem; font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(47,123,245,0.28);
  color: var(--white);
}

.btn-secondary {
  background: rgba(47,123,245,0.1);
  color: var(--gold-light);
  border: 1px solid rgba(110,181,255,0.3);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(47,123,245,0.16);
  border-color: var(--gold);
  color: var(--white);
}

.btn-danger {
  background: rgba(192,57,43,0.12);
  color: #e05858;
  border: 1px solid rgba(192,57,43,0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(192,57,43,0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-light);
  border: 1px solid rgba(138,155,176,0.2);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.9rem 2.2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.55rem 0.7rem; }

/* ── Alerts / Notifications ────────────────────────────────── */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: flex; align-items: flex-start; gap: 0.65rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(26,122,74,0.15);
  border: 1px solid rgba(26,122,74,0.35);
  color: #5dd49a;
}

.alert-danger {
  background: rgba(192,57,43,0.15);
  border: 1px solid rgba(192,57,43,0.35);
  color: #e07070;
}

.alert-info {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--gold-light);
}

.alert-warning {
  background: rgba(200,130,20,0.15);
  border: 1px solid rgba(200,130,20,0.35);
  color: #f0c060;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }

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

thead tr {
  background: rgba(201,168,76,0.08);
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--gray-light);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
}
tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── Badges / Chips ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem; font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.badge-gold    { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }
.badge-green   { background: rgba(26,122,74,0.15);  color: #5dd49a;    border: 1px solid rgba(26,122,74,0.3); }
.badge-red     { background: rgba(192,57,43,0.15);  color: #e07070;    border: 1px solid rgba(192,57,43,0.3); }
.badge-gray    { background: rgba(138,155,176,0.1); color: var(--gray); border: 1px solid rgba(138,155,176,0.2); }
.badge-blue    { background: rgba(52,101,164,0.2);  color: #7ab3f5;    border: 1px solid rgba(52,101,164,0.35); }

/* ── Candidate Cards ───────────────────────────────────────── */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.candidate-card {
  background: rgba(17,34,64,0.75);
  border: 2px solid rgba(201,168,76,0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.candidate-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  opacity: 0;
  transition: opacity var(--transition);
}

.candidate-card:hover,
.candidate-card.selected {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,168,76,0.15);
}

.candidate-card:hover::before,
.candidate-card.selected::before { opacity: 1; }

.candidate-card.selected { background: rgba(201,168,76,0.07); }

.candidate-avatar {
  width: 70px; height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201,168,76,0.3);
  background: var(--navy-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--gold);
  overflow: hidden;
}

.candidate-avatar img { width: 100%; height: 100%; object-fit: cover; }

.candidate-info { flex: 1; }
.candidate-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--white); margin-bottom: 0.2rem; }
.candidate-party { font-size: 0.82rem; color: var(--gold); font-weight: 500; margin-bottom: 0.5rem; }
.candidate-manifesto { font-size: 0.83rem; color: var(--gray); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.vote-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: none; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700;
  position: absolute; top: 1rem; right: 1rem;
}
.candidate-card.selected .vote-check { display: flex; }

/* ── Position Section ──────────────────────────────────────── */
.position-section {
  margin-bottom: 3rem;
}

.position-title {
  font-family: var(--font-display);
  font-size: 1.3rem; color: var(--white);
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(201,168,76,0.2);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
}

.position-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 1.2em;
  background: linear-gradient(180deg, var(--gold), var(--gold-light));
  border-radius: 2px;
}

/* ── Election Timer ────────────────────────────────────────── */
.timer-bar {
  background: rgba(17,34,64,0.9);
  border-bottom: 1px solid rgba(201,168,76,0.15);
  padding: 0.65rem 0;
  text-align: center;
}

.timer-wrap {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; flex-wrap: wrap;
}

.timer-label {
  font-size: 0.8rem; color: var(--gray);
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.08em;
}

.timer-segments {
  display: flex; gap: 0.35rem; align-items: center;
}

.timer-seg {
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius);
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 1.05rem; font-weight: 500;
  color: var(--gold);
  min-width: 2.8rem; text-align: center;
}

.timer-colon { color: var(--gold); font-family: var(--font-mono); font-size: 1rem; }

.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-light); animation: pulse 1.5s infinite; }
.timer-dot.inactive { background: var(--red); animation: none; }

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

/* ── Stats / KPI Cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(17,34,64,0.7);
  border: 1px solid rgba(201,168,76,0.12);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 1.3rem; flex-shrink: 0;
}

.stat-icon.gold   { background: rgba(201,168,76,0.12); color: var(--gold); }
.stat-icon.green  { background: rgba(26,122,74,0.15);  color: var(--green-light); }
.stat-icon.blue   { background: rgba(52,101,164,0.2);  color: #7ab3f5; }
.stat-icon.red    { background: rgba(192,57,43,0.15);  color: #e07070; }

.stat-info { flex: 1; }
.stat-value { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 600; color: var(--white); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--gray); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Progress / Vote Bars ──────────────────────────────────── */
.vote-bar-wrap { margin: 0.4rem 0; }
.vote-bar-top  { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 0.3rem; }
.vote-bar-name { color: var(--white); font-weight: 500; }
.vote-bar-count{ color: var(--gold); font-family: var(--font-mono); }

.vote-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px; overflow: hidden;
}
.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.results-chart-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.results-chart-title {
  font-size: 1rem; font-weight: 700; color: var(--white);
}
.results-chart-subtitle {
  font-size: 0.82rem; color: var(--gray); margin-top: 0.2rem;
}
.results-chart-pill {
  background: rgba(47,123,245,0.14);
  color: var(--gold-light);
  border: 1px solid rgba(110,181,255,0.25);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.results-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  align-items: end;
  min-height: 240px;
}
.results-chart-bar {
  display: flex; flex-direction: column; gap: 0.6rem; align-items: center;
}
.results-chart-track {
  width: 100%;
  height: 160px;
  min-height: 160px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(110,181,255,0.16);
  border-radius: 14px;
  padding: 0.45rem;
  display: flex; align-items: flex-end;
}
.results-chart-fill {
  display: block;
  width: 100%;
  border-radius: 10px;
  background-color: var(--gold);
  background-image: linear-gradient(180deg, var(--gold-light), var(--gold));
  transition: height 0.8s cubic-bezier(0.4,0,0.2,1);
  box-shadow: inset 0 -8px 20px rgba(0,0,0,0.18);
}
.results-chart-bar.winner .results-chart-fill {
  background-color: var(--green);
  background-image: linear-gradient(180deg, #4ad88b, var(--green));
}
.results-chart-labels {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.2rem;
}
.results-chart-name {
  font-size: 0.9rem; font-weight: 600; color: var(--white);
}
.results-chart-meta {
  font-size: 0.75rem; color: var(--gray);
}

.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.chat-bubble {
  background: rgba(7, 17, 31, 0.82);
  border: 1px solid rgba(110,181,255,0.16);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.chat-bubble-system {
  border-left: 3px solid var(--gold);
  background: rgba(47,123,245,0.1);
}

.chat-bubble-admin {
  border-left: 3px solid var(--gold-light);
}

.chat-author {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}

.chat-text {
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-mini-list {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-mini-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  font-size: 0.86rem;
  color: var(--gray-light);
}

.chat-mini-item strong {
  color: var(--white);
}

.winner-card {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.winner-card::before {
  content: '🏆';
  font-size: 3rem; display: block;
  margin-bottom: 0.5rem;
}
.winner-name  { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); }
.winner-meta  { font-size: 0.85rem; color: var(--gray-light); margin-top: 0.3rem; }
.winner-votes { font-family: var(--font-mono); color: var(--gold-light); font-size: 1.1rem; font-weight: 600; margin-top: 0.5rem; }

/* ── Assistant Panel ───────────────────────────────────────── */
.imbomah-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 180;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.imbomah-launcher:hover {
  transform: translateY(-2px);
}

.imbomah-window {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  width: min(360px, calc(100vw - 2rem));
  max-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(7, 17, 31, 0.96);
  border: 1px solid rgba(110,181,255,0.2);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.imbomah-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.imbomah-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.imbomah-title {
  font-weight: 700;
  color: var(--white);
}
.imbomah-subtitle {
  font-size: 0.78rem;
  color: var(--gray);
}
.assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.assistant-form {
  display: flex;
  gap: 0.75rem;
}
.assistant-form input {
  flex: 1;
}

/* ── Settings / Schedule ──────────────────────────────────── */
.settings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.settings-summary-card {
  background: rgba(10, 22, 38, 0.7);
  border: 1px solid rgba(110,181,255,0.16);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
}
.settings-summary-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin-bottom: 0.45rem;
}
.settings-summary-text {
  color: var(--gray-light);
  font-size: 0.9rem;
}

/* ── News Ticker ─────────────────────────────────────────── */
.ticker-floating {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 1.5rem));
  z-index: 170;
}
.ticker-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1.5px solid rgba(47, 123, 245, 0.65);
  background: rgba(7, 17, 31, 0.92);
  box-shadow: 0 0 0 1px rgba(110, 181, 255, 0.16), var(--shadow-sm);
  overflow: hidden;
}
.ticker-label {
  flex-shrink: 0;
  background: rgba(47,123,245,0.18);
  color: var(--gold-light);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.ticker-feed {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  color: var(--gray-light);
  font-size: 0.95rem;
}
.ticker-feed span {
  display: inline-block;
  padding-left: 1rem;
  animation: ticker-scroll 12s linear infinite;
}

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

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 0.25rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  margin-bottom: 2rem; flex-wrap: wrap;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.88rem; font-weight: 500;
  color: var(--gray); background: transparent;
  border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all var(--transition);
  margin-bottom: -1px;
  font-family: var(--font-body);
}

.tab-btn:hover { color: var(--gold-light); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--navy-mid);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 520px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

/* ── Auth Pages ────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-panel {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 3rem 2rem;
}

.auth-left {
  background: linear-gradient(160deg, #12365c 0%, #0d1f35 100%);
  border-right: 1px solid rgba(110,181,255,0.16);
  position: relative; overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110,181,255,0.14), transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}

.auth-left-content { position: relative; z-index: 1; text-align: center; max-width: 360px; }
.auth-left-icon { font-size: 4rem; margin-bottom: 1.5rem; display: block; }

.auth-right { background: var(--navy); }
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap h2 { margin-bottom: 0.5rem; }
.auth-form-wrap .sub { color: var(--gray); font-size: 0.9rem; margin-bottom: 2rem; }

.voter-id-display {
  background: rgba(201,168,76,0.06);
  border: 1px dashed rgba(201,168,76,0.3);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.3rem; font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin: 1rem 0;
}

/* ── Misc utilities ────────────────────────────────────────── */
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.mb-4  { margin-bottom: 2rem; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-center { text-align: center; }
.text-gold   { color: var(--gold); }
.text-gray   { color: var(--gray); }
.text-sm     { font-size: 0.85rem; }
.text-mono   { font-family: var(--font-mono); }
.hidden      { display: none !important; }

.divider {
  border: none; border-top: 1px solid rgba(255,255,255,0.07);
  margin: 1.5rem 0;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 500; display: flex; flex-direction: column; gap: 0.5rem;
}

.toast {
  background: var(--navy-mid);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 0.6rem;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}

.toast.success { border-color: rgba(26,122,74,0.4); }
.toast.error   { border-color: rgba(192,57,43,0.4); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Main Landing ──────────────────────────────────────────── */
.home-hero {
  padding: 5rem 0;
  text-align: center;
}

.home-hero .tagline {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.home-hero .tagline span { color: var(--gold); }

.hero-ctas {
  display: flex; gap: 1rem; justify-content: center;
  flex-wrap: wrap; margin-top: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin: 4rem 0;
}

.feature-card {
  background: rgba(7,17,31,0.72);
  border: 1px solid rgba(110,181,255,0.12);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  border-color: rgba(110,181,255,0.3);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { color: var(--white); margin-bottom: 0.5rem; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  margin-top: auto;
  border-top: 1px solid rgba(201,168,76,0.1);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.82rem; color: var(--gray);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .navbar .container { flex-wrap: wrap; gap: 0.75rem; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .nav-user { margin-left: auto; }
  .page-hero { padding: 3rem 0 2.2rem; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-summary { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; }
  .nav-user { width: 100%; justify-content: center; margin-left: 0; display: none; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .tabs { overflow-x: auto; white-space: nowrap; padding-bottom: 0.25rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .candidates-grid { grid-template-columns: 1fr; }
  .results-chart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticker-floating { width: calc(100vw - 1rem); bottom: 0.5rem; }
  .ticker-wrap { border-radius: 16px; padding: 0.7rem 0.85rem; }
  .ticker-feed { font-size: 0.85rem; }
  .imbomah-window {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 4.5rem;
    width: auto;
    max-height: min(70vh, 460px);
  }
  .imbomah-launcher { right: 0.75rem; bottom: 0.75rem; }
  .modal { padding: 1.25rem; }
  .modal-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 640px; }
}

@media (max-width: 560px) {
  .container, .container-sm { padding: 0 1rem; }
  .navbar { padding: 0.75rem 0; }
  .nav-brand { width: 100%; justify-content: center; }
  .nav-user { flex-wrap: wrap; gap: 0.5rem; }
  .page-hero { padding: 2rem 0 1.5rem; }
  .card { padding: 1.25rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .results-chart { grid-template-columns: 1fr; }
  .assistant-form { flex-direction: column; }
  .assistant-form .btn { width: 100%; }
  .auth-panel { padding: 2rem 1.25rem; }
  .modal { max-width: 100%; padding: 1rem; }
  .btn-sm { width: auto; }
}

@media (max-width: 480px) {
  .container, .container-sm { padding: 0 0.9rem; }
  .card { padding: 1rem; }
  .page-hero h1 { font-size: 1.75rem; }
  .page-hero p { font-size: 0.95rem; }
  .ticker-feed { font-size: 0.8rem; }
  .imbomah-window { left: 0.5rem; right: 0.5rem; bottom: 4rem; }
}
