:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-primary: #0f3d68;
  --color-primary-light: #1a5a94;
  --color-accent: #c9a227;
  --color-text: #1a1d21;
  --color-muted: #5c6570;
  --color-border: #e2e6ec;
  --sidebar-width: 268px;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(15, 61, 104, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container-narrow {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Landing */
.landing-hero {
  background: linear-gradient(135deg, #0a2847 0%, #0f3d68 45%, #1a5a94 100%);
  color: #fff;
  padding: 4.5rem 1.25rem 5rem;
  position: relative;
  overflow: hidden;
}
.landing-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 80% 20%, rgba(201, 162, 39, 0.15), transparent);
  pointer-events: none;
}
.landing-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.landing-hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.landing-hero p.lead {
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: 52ch;
  margin-bottom: 1.75rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #0a2847;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  margin-left: 0.75rem;
}
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: -0.03em;
}
.landing-nav .links a {
  color: rgba(255, 255, 255, 0.9);
  margin-left: 1.25rem;
  font-size: 0.95rem;
}

.features {
  padding: 3.5rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.features h2 {
  text-align: center;
  font-size: 1.65rem;
  margin-bottom: 2rem;
  color: var(--color-primary);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--color-primary);
}
.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-muted);
}

.landing-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.88rem;
}

/* Auth cards */
.auth-wrap {
  min-height: calc(100vh - 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #e8eef5 0%, #f4f6f9 100%);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: var(--color-primary);
}
.auth-card .sub {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-muted);
}
.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.95rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(26, 90, 148, 0.15);
}

/* Alerts */
.alert {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success {
  background: #e8f5e9;
  color: #1b5e20;
}
.alert-danger {
  background: #ffebee;
  color: #b71c1c;
}
.alert-warning {
  background: #fff8e1;
  color: #f57f17;
}
.alert-info {
  background: #e3f2fd;
  color: #0d47a1;
}

/* Admin layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0a2847 0%, #0f3d68 100%);
  color: #e8eef5;
  padding: 1.25rem 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .brand {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}
.admin-sidebar nav a {
  display: block;
  padding: 0.55rem 1.25rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  border-left-color: var(--color-accent);
}
.admin-sidebar .nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  padding: 1rem 1.25rem 0.35rem;
}
.admin-main {
  flex: 1;
  padding: 1.5rem 1.75rem 3rem;
  min-width: 0;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.admin-header h1 {
  margin: 0;
  font-size: 1.45rem;
  color: var(--color-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.stat-card .val {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--color-primary);
}
.stat-card .lbl {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data-table th,
table.data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
table.data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 6px;
}
.btn-danger {
  background: #c62828;
  color: #fff;
}
.btn-muted {
  background: #eceff1;
  color: #37474f;
}

/* Voter top nav */
.voter-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.voter-nav .links a {
  margin-left: 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-primary);
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success {
  background: #e8f5e9;
  color: #2e7d32;
}
.badge-warning {
  background: #fff3e0;
  color: #ef6c00;
}
.badge-muted {
  background: #eceff1;
  color: #546e7a;
}

.video-box {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  margin-bottom: 1rem;
}
video {
  width: 100%;
  vertical-align: middle;
}
