/* =============================================================
   INC eVote — Design System v2
   Navy + Gold identity, Inter font, mobile-first voter UX
   ============================================================= */

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

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --navy:         #0B2A4A;
  --navy-mid:     #1A3E5C;
  --navy-light:   #234E6E;
  --gold:         #C9992A;
  --gold-light:   #F0B429;
  --gold-pale:    #FEF3C7;

  /* Page chrome */
  --bg-page:      #F5F6FA;
  --bg-card:      #FFFFFF;
  --bg-inset:     #EEF1F8;

  /* Text */
  --text:         #111827;
  --text-muted:   #6B7280;
  --text-soft:    #9CA3AF;

  /* Borders */
  --border:       #E5E7EB;
  --border-focus: #C9992A;

  /* Sidebar */
  --sidebar-w:    256px;
  --sidebar-bg:   #FFFFFF;
  --sidebar-fg:   #374151;
  --sidebar-hover:#F3F4F6;
  --sidebar-active-bg: #FEF3C7;
  --sidebar-active-fg: #92400E;
  --sidebar-active-bar:#C9992A;

  /* Status */
  --success:      #059669;
  --danger:       #DC2626;
  --warning:      #D97706;
  --info:         #2563EB;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 10px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);
  --shadow-gold:  0 4px 20px rgba(201,153,42,.25);

  /* Radii */
  --r-sm:   6px;
  --r:      10px;
  --r-lg:   16px;
  --r-xl:   24px;

  /* Progress */
  --progress-bg: var(--gold);
}

/* ── DARK MODE TOKENS ──────────────────────────────────────── */
body[data-theme="dark"] {
  --bg-page:      #0D1525;
  --bg-card:      #152032;
  --bg-inset:     #0A1628;
  --text:         #F1F5F9;
  --text-muted:   #94A3B8;
  --text-soft:    #64748B;
  --border:       #1E3048;
  --sidebar-bg:   #0F1E30;
  --sidebar-fg:   #CBD5E1;
  --sidebar-hover:#162235;
  --sidebar-active-bg: #1A3048;
  --sidebar-active-fg: #F0B429;
  --sidebar-active-bar:#F0B429;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow:       0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:    0 10px 32px rgba(0,0,0,.5);
}

/* ── BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { color: var(--text); font-weight: 700; line-height: 1.25; }

a { color: var(--info); }
a:hover { color: var(--navy); }
body[data-theme="dark"] a { color: #60A5FA; }
body[data-theme="dark"] a:hover { color: #93C5FD; }

/* Monospace */
.mono, code { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; }

/* ── HEADER ─────────────────────────────────────────────────── */
.app-header {
  height: 64px;
  background: var(--navy);
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,.2);
  border-bottom: 2px solid var(--gold);
}

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

.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--gold);
  display: grid; place-items: center;
  font-weight: 900; font-size: 14px; color: var(--navy);
  letter-spacing: -.5px;
  box-shadow: 0 2px 8px rgba(201,153,42,.4);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1rem; font-weight: 700;
  color: #FFFFFF; letter-spacing: -.2px;
}
.brand-sub {
  font-size: .7rem; color: rgba(255,255,255,.55);
  line-height: 1;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.header-actions .btn {
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.2);
  font-size: .85rem;
  padding: .3rem .7rem;
  border-radius: var(--r-sm);
}
.header-actions .btn:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.35);
}

.header-actions .dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 200px;
}
.header-actions .dropdown-item {
  color: var(--text); border-radius: var(--r-sm);
  padding: .5rem .75rem; font-size: .9rem;
}
.header-actions .dropdown-item:hover {
  background: var(--bg-inset); color: var(--text);
}

/* Role badge in header */
.role-badge {
  display: inline-block;
  font-size: .65rem; font-weight: 700;
  background: var(--gold); color: var(--navy);
  border-radius: 999px; padding: 1px 8px;
  text-transform: uppercase; letter-spacing: .3px;
}

/* ── LAYOUT ─────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - 64px);
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
  padding: 12px 8px;
  scrollbar-width: thin;
}

.nav-section-label {
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-soft); padding: 12px 12px 4px;
}

.sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: .55rem .85rem;
  color: var(--sidebar-fg);
  border-radius: var(--r);
  font-size: .9rem; font-weight: 500;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.sidebar .nav-link .bi {
  font-size: 1rem; width: 20px; text-align: center;
  flex-shrink: 0;
}
.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--text);
  text-decoration: none;
}
.sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
  border-left-color: var(--sidebar-active-bar);
  font-weight: 600;
}

/* Sidebar divider */
.sidebar hr { border-color: var(--border); margin: 10px 8px; }

/* ── CONTENT ────────────────────────────────────────────────── */
.content {
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
}
.card-body { padding: 20px; }

/* Elevated card */
.card-elevated {
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

/* Gold accent card */
.card-accent-gold {
  border-top: 3px solid var(--gold);
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--gold);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--r);
  display: grid; place-items: center;
  background: var(--gold-pale);
  color: var(--gold);
  font-size: 1.3rem; flex-shrink: 0;
}
body[data-theme="dark"] .stat-icon { background: #1A3048; color: var(--gold-light); }
.stat-value {
  font-size: 2rem; font-weight: 900; line-height: 1;
  color: var(--text);
}
.stat-label {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-top: 2px;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  font-family: inherit;
  font-weight: 600; font-size: .9rem;
  border-radius: var(--r);
  padding: .5rem 1.1rem;
  transition: all .15s ease;
  letter-spacing: -.1px;
}
.btn-primary {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.btn-primary:hover {
  background: var(--navy-mid); border-color: var(--navy-mid);
  box-shadow: 0 4px 12px rgba(11,42,74,.25);
}
.btn-gold {
  background: var(--gold); border-color: var(--gold); color: var(--navy);
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--gold-light); border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}
.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; border-radius: var(--r-lg); }
.btn-xl { padding: 1rem 2rem; font-size: 1.1rem; border-radius: var(--r-lg); }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-control, .form-select {
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  background: var(--bg-card);
  padding: .55rem .85rem;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,153,42,.15);
  background: var(--bg-card);
  color: var(--text);
}
.form-label {
  font-size: .85rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: .04em;
}
.form-text { font-size: .8rem; color: var(--text-soft); }
.input-group-text {
  background: var(--bg-inset); border: 1.5px solid var(--border);
  color: var(--text-muted);
}

/* Dark mode forms */
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] .input-group-text {
  background: var(--bg-inset);
  border-color: var(--border);
  color: var(--text);
}
body[data-theme="dark"] .form-control::placeholder { color: var(--text-soft); }

/* ── TABLES ─────────────────────────────────────────────────── */
.table {
  color: var(--text);
  border-color: var(--border);
  font-size: .9rem;
}
.table thead th {
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
}
.table td { padding: 12px 14px; border-color: var(--border); vertical-align: middle; }
.table-striped tbody tr:nth-child(odd) { background: rgba(0,0,0,.015); }

body[data-theme="dark"] .table { color: var(--text); }
body[data-theme="dark"] .table thead th { background: var(--bg-inset); color: var(--text-muted); border-color: var(--border); }
body[data-theme="dark"] .table td { border-color: var(--border); }
body[data-theme="dark"] .table > :not(caption) > * > * { background-color: transparent; color: var(--text); }
body[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255,255,255,.03); }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge { font-family: inherit; font-weight: 600; letter-spacing: .02em; border-radius: 999px; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
  border-radius: var(--r-lg);
  border: none;
  font-size: .9rem;
  box-shadow: var(--shadow-sm);
}
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-danger   { background: #FEF2F2; color: #991B1B; }
.alert-warning  { background: #FFFBEB; color: #92400E; }
.alert-info     { background: #EFF6FF; color: #1E40AF; }
body[data-theme="dark"] .alert-success { background: #064E3B; color: #6EE7B7; }
body[data-theme="dark"] .alert-danger  { background: #450A0A; color: #FCA5A5; }
body[data-theme="dark"] .alert-warning { background: #451A03; color: #FCD34D; }
body[data-theme="dark"] .alert-info    { background: #1E3A5F; color: #93C5FD; }

/* ── PROGRESS ───────────────────────────────────────────────── */
.progress {
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  background: var(--gold);
  border-radius: 999px;
  transition: width .4s ease;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.app-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 14px 24px;
  font-size: .82rem;
}

/* ── VOTER PORTAL SPECIFIC ──────────────────────────────────── */

/* Voter page wrapper — centered, max-width, generous padding */
.voter-page {
  min-height: calc(100vh - 64px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px 48px;
}
.voter-page-sm  { max-width: 480px;  width: 100%; }
.voter-page-md  { max-width: 640px;  width: 100%; }
.voter-page-lg  { max-width: 860px;  width: 100%; }

/* Login / Auth card */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 5vw, 36px) clamp(14px, 4vw, 32px);
  width: 100%;
}
.auth-logo {
  width: 64px; height: 64px; border-radius: var(--r-lg);
  background: var(--navy);
  display: grid; place-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(11,42,74,.25);
  font-size: 1.6rem;
}
.auth-title  { font-size: 1.5rem; font-weight: 800; text-align: center; color: var(--text); margin-bottom: 4px; }
.auth-sub    { font-size: .9rem;  text-align: center; color: var(--text-muted); margin-bottom: 28px; }

/* Election cards */
.election-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.election-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--gold);
  transform: translateY(-2px);
}
.election-card-live { border-color: var(--success); }

/* Live pulse dot */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.8); }
}

/* Position items */
.position-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: box-shadow .12s, border-color .12s;
}
.position-item:hover { box-shadow: var(--shadow); }
.position-item.done  { border-color: var(--success); background: #ECFDF5; }
body[data-theme="dark"] .position-item.done { background: #064E3B; border-color: var(--success); }
.position-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-inset); color: var(--text-muted);
  display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.position-item.done .position-num { background: var(--success); color: #fff; }

/* BALLOT: Candidate cards — large, tap-friendly */
.candidate-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s, transform .08s;
  position: relative; min-height: 88px;
  user-select: none; -webkit-user-select: none;
}
.candidate-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.candidate-card.selected {
  border-color: var(--gold);
  background: var(--gold-pale);
  box-shadow: var(--shadow-gold);
}
body[data-theme="dark"] .candidate-card.selected { background: #2D1F00; }

.candidate-photo {
  width: 72px; height: 72px; border-radius: var(--r);
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--bg-inset);
}
.candidate-photo-placeholder {
  width: 72px; height: 72px; border-radius: var(--r);
  background: var(--bg-inset); border: 2px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 1.8rem; color: var(--text-soft);
}
.candidate-name {
  font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.3;
}
.candidate-ballot-no {
  display: inline-block; font-size: .75rem;
  background: var(--bg-inset); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--r-sm);
  padding: 2px 8px; margin-top: 4px; font-weight: 600;
}
.candidate-card.selected .candidate-ballot-no {
  background: rgba(201,153,42,.15); border-color: var(--gold); color: var(--navy);
}
.select-ring {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  flex-shrink: 0; margin-left: auto;
  color: transparent;
  transition: all .12s;
}
.candidate-card.selected .select-ring {
  background: var(--gold); border-color: var(--gold); color: var(--navy);
}

/* Success page */
.success-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  min-height: calc(100vh - 64px); padding: 32px 16px;
}
.success-icon {
  width: 96px; height: 96px; border-radius: 50%;
  background: #ECFDF5;
  display: grid; place-items: center;
  font-size: 3rem; margin: 0 auto 24px;
  animation: pop-in .4s cubic-bezier(.175,.885,.32,1.275);
}
body[data-theme="dark"] .success-icon { background: #064E3B; }
@keyframes pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* OTP boxes */
.otp-input {
  width: clamp(36px, calc((100vw - 80px) / 6), 52px);
  height: clamp(48px, 10vw, 64px);
  min-width: 36px;
  border: 2px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-page);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 800;
  text-align: center; color: var(--text);
  caret-color: var(--gold);
  font-family: inherit;
  padding: 0;
  transition: border-color .15s, box-shadow .15s;
}
.otp-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,153,42,.2);
  background: var(--bg-card);
}
.otp-input.filled { border-color: var(--navy); background: var(--bg-card); }
body[data-theme="dark"] .otp-input { background: var(--bg-inset); }

/* ── ADMIN SPECIFIC ─────────────────────────────────────────── */

/* Page header */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { font-size: 1.4rem; font-weight: 800; margin: 0; color: var(--text); }
.page-sub   { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }

/* Admin election card */
.admin-election-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.admin-election-card:hover { box-shadow: var(--shadow); }
.admin-election-card .card-accent { height: 4px; background: var(--gold); }
.admin-election-card .card-accent.live { background: var(--success); }
.admin-election-card .card-accent.closed { background: var(--text-soft); }

/* Status pills */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .03em;
}
.status-ongoing  { background: #ECFDF5; color: #065F46; }
.status-scheduled{ background: #EFF6FF; color: #1E40AF; }
.status-paused   { background: #FFFBEB; color: #92400E; }
.status-closed   { background: #F3F4F6; color: #374151; }
.status-draft    { background: #F9FAFB; color: #6B7280; border: 1px solid var(--border); }
body[data-theme="dark"] .status-ongoing   { background: #064E3B; color: #34D399; }
body[data-theme="dark"] .status-scheduled { background: #1E3A5F; color: #93C5FD; }
body[data-theme="dark"] .status-paused    { background: #451A03; color: #FCD34D; }
body[data-theme="dark"] .status-closed    { background: #1F2937; color: #9CA3AF; }
body[data-theme="dark"] .status-draft     { background: #111827; color: #6B7280; }

/* Offcanvas skin */
.mgr-offcanvas .offcanvas-header { background: var(--bg-card); border-bottom: 1px solid var(--border); color: var(--text); }
.mgr-offcanvas .offcanvas-body   { background: var(--bg-card); color: var(--text); }
.mgr-offcanvas .list-group-item  { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.mgr-offcanvas .list-group-item:hover { background: var(--bg-inset); }

/* DataTables */
body[data-theme="dark"] .dataTable-wrapper .dataTable-input,
body[data-theme="dark"] .dataTable-wrapper .dataTable-selector {
  background: var(--bg-inset); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
body[data-theme="dark"] .dataTable-wrapper .dataTable-top,
body[data-theme="dark"] .dataTable-wrapper .dataTable-bottom,
body[data-theme="dark"] .dataTable-wrapper label,
body[data-theme="dark"] .dataTable-wrapper .dataTable-info { color: var(--text); }
body[data-theme="dark"] .dataTable-pagination a {
  color: var(--text); background: var(--bg-inset); border: 1px solid var(--border);
}
body[data-theme="dark"] .dataTable-pagination .active a { background: var(--navy); border-color: var(--gold); }

/* ── MOBILE SIDEBAR ─────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 64px;
    width: var(--sidebar-w); max-width: 86vw;
    transform: translateX(-110%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 32px rgba(0,0,0,.12);
    z-index: 1031;
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open::before {
    content: ''; position: fixed;
    inset: 64px 0 0 0; background: rgba(0,0,0,.4);
    z-index: 1029;
  }
}

/* Desktop collapsed */
@media (min-width: 992px) {
  body.sidebar-collapsed .layout { grid-template-columns: 68px 1fr; }
  body.sidebar-collapsed .sidebar { width: 68px; padding: 12px 6px; }
  body.sidebar-collapsed .sidebar .nav-link .label { display: none; }
  body.sidebar-collapsed .sidebar .nav-section-label { display: none; }
  body.sidebar-collapsed .sidebar hr { display: none; }
  body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center; padding: .7rem;
    border-left: none; border-radius: var(--r);
  }
  body.sidebar-collapsed .sidebar .nav-link .bi { width: auto; font-size: 1.2rem; }
}

/* ── RESPONSIVE VOTER ───────────────────────────────────────── */
@media (max-width: 575.98px) {
  .auth-card { padding: 24px 18px; border-radius: var(--r-lg); }
  .candidate-card { padding: 14px 16px; }
  .candidate-photo, .candidate-photo-placeholder { width: 60px; height: 60px; }
  .candidate-name { font-size: .95rem; }
  .otp-input { width: clamp(32px, calc((100vw - 80px) / 6), 44px); height: 48px; font-size: 1.2rem; }
  .content { padding: 16px; }
  .voter-page { padding: 16px 12px 36px; }
  h4 { font-size: 1.15rem; }
}

/* ── UTILITIES ──────────────────────────────────────────────── */
.rounded-xl { border-radius: var(--r-xl) !important; }
.shadow-gold { box-shadow: var(--shadow-gold) !important; }
.text-gold   { color: var(--gold) !important; }
.bg-navy     { background: var(--navy) !important; color: #fff !important; }
.bg-gold     { background: var(--gold) !important; }
.border-gold { border-color: var(--gold) !important; }

/* Sticky floating submit bar */
.sticky-actions {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 20px; z-index: 1040;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: .5rem .75rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Safe area inset for mobile */
body { padding-bottom: env(safe-area-inset-bottom); }

/* dvh support */
@supports (height: 100dvh) {
  .layout { min-height: calc(100dvh - 64px); }
}

/* ── NO SIDEBAR layout (terminal mode) ─────────────────────── */
.layout-nosidebar {
  grid-template-columns: 1fr !important;
}
.layout-nosidebar .sidebar { display: none !important; }
.layout-nosidebar .content {
  max-width: 100%;
  min-height: calc(100vh - 64px);
}
