/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --primary:     #96021b;
  --primary-dark:#44161a;
  --bg-dark:     rgba(56,2,2,1);
  --text:        #113654;
  --text-light:  #4a6070;
  --accent:      #3be1c5;
  --bg:          #f8f9fa;
  --bg-card:     #ffffff;
  --border:      #dde3e8;
  --success:     #28a745;
  --warning:     #ffc107;
  --danger:      #dc3545;
  --radius:      0.5rem;
  --shadow:      0 2px 12px rgba(17,54,84,.10);
  --shadow-lg:   0 6px 32px rgba(17,54,84,.14);
  --font:        "Google Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --transition:  0.2s ease;
}

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

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

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg-dark);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  color: white !important;
}
.brand-text { font-size: 1.2rem; font-weight: 700; }
.brand-accent { color: var(--accent); }
.brand-sub { font-size: 0.7rem; opacity: 0.7; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-link { color: rgba(255,255,255,.85); font-size: 0.9rem; font-weight: 500; }
.nav-link:hover { color: white; }
.nav-link-muted { opacity: 0.6; }
.nav-user { font-size: 0.85rem; color: rgba(255,255,255,.6); }
.nav-user strong { color: var(--accent); }

/* ── Main ───────────────────────────────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash-container { max-width: 1100px; margin: 1rem auto; padding: 0 2rem; }
.flash {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.92rem;
}
.flash-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.flash-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.flash-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 100%);
  padding: 5rem 2rem 4rem;
  color: white;
}
.hero-inner { max-width: 800px; margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(59,225,197,.3);
}
.hero-title { font-size: 3rem; color: white; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.85; max-width: 600px; margin: 0 auto 2.5rem; }

.enter-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 480px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
}
.enter-title { font-size: 1.2rem; color: white; margin-bottom: 0.5rem; }
.enter-note { font-size: 0.85rem; opacity: 0.65; margin-bottom: 1.5rem; }

.name-form { display: flex; flex-direction: column; gap: 1rem; }

/* ── Info section ───────────────────────────────────────────────────────── */
.info-section { max-width: 1100px; margin: 3rem auto; padding: 0 2rem; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.info-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.info-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.info-card p  { font-size: 0.9rem; color: var(--text-light); }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header {
  max-width: 1100px;
  margin: 2.5rem auto 1.5rem;
  padding: 0 2rem;
}
.page-header h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.page-subtitle { color: var(--text-light); font-size: 0.95rem; }
.back-link {
  display: inline-block;
  font-size: 0.87rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  transition: color var(--transition);
}
.back-link:hover { color: var(--primary); }
.role-meta { margin-top: 0.5rem; }

/* ── Roles grid ─────────────────────────────────────────────────────────── */
.roles-grid {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.role-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.role-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.role-card.role-full { opacity: 0.75; }

.role-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.role-title { font-size: 1.05rem; flex: 1; }
.role-capacity { text-align: right; flex-shrink: 0; }
.cap-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); display: block; }
.cap-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
}
.cap-badge.cap-full { background: #fce4ec; color: #c62828; }

.role-description { font-size: 0.9rem; color: var(--text-light); flex: 1; margin-bottom: 1.2rem; }
.role-card-footer { display: flex; gap: 0.75rem; align-items: center; }

/* ── Detail layout ──────────────────────────────────────────────────────── */
.detail-layout {
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.detail-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.detail-card h4 { font-size: 0.95rem; margin: 1rem 0 0.5rem; color: var(--primary); }
.detail-card p  { font-size: 0.92rem; color: var(--text-light); line-height: 1.7; }

.nominee-list { list-style: none; }
.nominee-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.nominee-item:last-child { border-bottom: none; }
.nominee-name { font-weight: 600; font-size: 0.92rem; }
.nominee-affil { font-size: 0.8rem; color: var(--text-light); }

.nominate-card, .already-voted-card, .flagged-card, .full-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.nominate-card h3, .already-voted-card h3, .flagged-card h3, .full-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}
.nominate-note, .already-note { font-size: 0.85rem; color: var(--text-light); margin-bottom: 1.2rem; }
.nominate-form { display: flex; flex-direction: column; gap: 1rem; }

.already-voted-card { border-color: #a5d6a7; background: #f1f8f1; }
.already-icon { font-size: 2rem; color: var(--success); margin-bottom: 0.5rem; }
.already-voted-card h3 { color: #2e7d32; }

.flagged-card { border-color: #ffcc80; background: #fff8f0; }
.flag-icon { font-size: 2rem; margin-bottom: 0.5rem; }

/* ── Checkbox list ──────────────────────────────────────────────────────── */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 360px;
  overflow-y: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  background: #fafafa;
}
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: background var(--transition);
}
.checkbox-item:hover { background: #f0f4f8; }
.checkbox-item input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-item input[type="checkbox"]:disabled { opacity: 0.35; cursor: not-allowed; }
.checkbox-item:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.checkbox-item:has(input:checked) { background: #fdf0f2; }
.checkbox-info { display: flex; flex-direction: column; }
.checkbox-name { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.checkbox-affil { font-size: 0.78rem; color: var(--text-light); }

.selection-counter {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  border-radius: var(--radius);
  background: #f3f4f5;
}
.selection-counter.counter-done { background: #e8f5e9; color: #2e7d32; }
.selection-counter.counter-over { background: #fce4ec; color: #c62828; }

.role-pick-hint { font-size: 0.82rem; color: var(--text-light); margin-bottom: 1rem; }

.my-picks-list {
  list-style: none;
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.my-picks-list li {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  background: rgba(46,125,50,.08);
  border-radius: 0.3rem;
}

.nominee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.nominee-votes {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: #fdf0f2;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  white-space: nowrap;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: inline-block;
}
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }
.btn-primary.btn-full { width: 100%; text-align: center; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-block;
}
.btn-secondary:hover { background: var(--primary); color: white; }

.btn-disabled {
  background: rgba(0,0,0,.08);
  color: var(--text-light);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: not-allowed;
  display: inline-block;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  border-radius: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity var(--transition);
}
.btn-sm:hover { opacity: 0.85; }
.btn-success { background: var(--success); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-edit    { background: #1565c0; color: white; text-decoration: none; padding: 0.3rem 0.7rem; border-radius: 0.3rem; font-size: 0.8rem; font-weight: 600; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(150,2,27,.12);
}
.form-input-sm { max-width: 100px; }
.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  background: white;
  width: 100%;
  transition: border-color var(--transition);
}
.form-select:focus { outline: none; border-color: var(--primary); }
.form-textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  background: white;
  width: 100%;
  resize: vertical;
  transition: border-color var(--transition);
}
.form-textarea:focus { outline: none; border-color: var(--primary); }

.inline-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.stack-form  { display: flex; flex-direction: column; gap: 0.75rem; }
.form-row    { display: flex; gap: 0.75rem; align-items: center; }

/* ── Admin layout ───────────────────────────────────────────────────────── */
.admin-layout {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
}
.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}
.admin-nav { display: flex; flex-direction: column; }
.admin-nav-link {
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav-link:hover { background: #f3f4f5; color: var(--text); }
.admin-nav-link.active { color: var(--primary); border-left-color: var(--primary); background: #fdf0f2; }

.admin-main h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.admin-main h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }

.section-note { font-size: 0.88rem; color: var(--text-light); margin-bottom: 0.75rem; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card.stat-warn { border-color: #ffcc80; background: #fffde7; }
.stat-num  { font-size: 2.2rem; font-weight: 700; color: var(--primary); }
.stat-label{ font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.2rem; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table thead th {
  background: #f3f4f5;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.admin-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #fafafa; }
.flagged-row { background: #fff8f0 !important; }
.hash-cell { font-family: monospace; font-size: 0.8rem; color: var(--text-light); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.76rem;
  font-weight: 700;
}
.badge-full { background: #fce4ec; color: #c62828; }
.badge-open { background: #e8f5e9; color: #2e7d32; }
.badge-flag { background: #fff3e0; color: #e65100; }

/* ── Add card ───────────────────────────────────────────────────────────── */
.add-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.add-card h3 { font-size: 1rem; margin-bottom: 1rem; }

/* ── Role admin card ────────────────────────────────────────────────────── */
.roles-admin-list { display: flex; flex-direction: column; gap: 1rem; }
.role-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}
.role-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.role-admin-header h3 { font-size: 1rem; }
.role-admin-meta { display: flex; align-items: center; gap: 0.5rem; }
.role-desc-preview { font-size: 0.87rem; color: var(--text-light); }

/* ── Nominations section ────────────────────────────────────────────────── */
.nom-section { margin-bottom: 2.5rem; }

/* ── Auth page ──────────────────────────────────────────────────────────── */
.auth-page { display: flex; justify-content: center; align-items: center; padding: 4rem 2rem; }
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,.55);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.82rem;
}
.footer-inner p { margin-bottom: 0.2rem; }
.footer-note { opacity: 0.5; font-size: 0.76rem; }

/* ── Passcode ───────────────────────────────────────────────────────────── */
.passcode-code {
  background: #f3f4f5;
  padding: 0.2rem 0.55rem;
  border-radius: 0.3rem;
  font-size: 0.85rem;
  font-family: monospace;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}
.btn-copy {
  background: #1565c0;
  color: white;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: #1a1a2e;
  color: #3be1c5;
  padding: 0.65rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Edit banner ────────────────────────────────────────────────────────── */
.edit-banner {
  background: #fff3cd;
  color: #856404;
  padding: 0.55rem 0.9rem;
  border-radius: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ── Results ────────────────────────────────────────────────────────────── */
.result-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.result-header h2 { font-size: 1.15rem; }
.result-meta { display: flex; align-items: center; gap: 0.75rem; }
.voter-count { font-size: 0.82rem; color: var(--text-light); }

.result-list { display: flex; flex-direction: column; gap: 0.5rem; }
.result-row {
  display: grid;
  grid-template-columns: 36px 1fr 200px 70px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.4rem;
  background: #fafafa;
  border: 1px solid var(--border);
}
.result-row.result-winner {
  background: linear-gradient(90deg, #fff8e1 0%, #fffde7 100%);
  border-color: #ffe082;
}
.result-rank { text-align: center; }
.rank-crown { font-size: 1.1rem; }
.rank-num { font-size: 0.9rem; font-weight: 700; color: var(--text-light); }
.result-person { display: flex; flex-direction: column; }
.result-name { font-size: 0.95rem; font-weight: 700; }
.result-affil { font-size: 0.76rem; color: var(--text-light); }
.result-bar-wrap { }
.result-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.result-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.result-bar-fill.bar-winner { background: #f9a825; }
.result-votes { text-align: right; }
.result-votes strong { font-size: 1.05rem; color: var(--primary); }
.vote-label { font-size: 0.72rem; color: var(--text-light); display: block; }
.no-votes { font-size: 0.9rem; color: var(--text-light); font-style: italic; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-layout  { grid-template-columns: 1fr; }
  .admin-layout   { grid-template-columns: 1fr; }
  .admin-sidebar  { position: static; }
  .stats-grid     { grid-template-columns: repeat(2,1fr); }
  .info-grid      { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-title     { font-size: 2rem; }
  .roles-grid     { grid-template-columns: 1fr; }
  .stats-grid     { grid-template-columns: repeat(2,1fr); }
  .navbar         { padding: 0 1rem; }
  .nav-links      { gap: 0.75rem; }
}

/* ── Voting status card ──────────────────────────────────────────────────── */
.voting-control-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.vc-header { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:1.25rem; flex-wrap:wrap; }
.vc-header h2 { font-size:1.15rem; margin-bottom:.25rem; }
.vc-desc { font-size:.87rem; color:var(--text-light); }
.vc-status {
  font-size:1rem; font-weight:700; padding:.4rem 1rem;
  border-radius:2rem; white-space:nowrap;
}
.vc-active    { background:#e8f5e9; color:#2e7d32; }
.vc-published { background:#fff8e1; color:#f57f17; }
.vc-inactive  { background:#fce4ec; color:#c62828; }
.vc-actions { display:flex; gap:.75rem; flex-wrap:wrap; margin-bottom:1.25rem; }
.vc-info { font-size:.86rem; color:var(--text-light); display:flex; flex-direction:column; gap:.25rem; }

.btn-danger-outline {
  background:transparent; color:var(--danger); border:1.5px solid var(--danger);
  padding:.6rem 1.2rem; border-radius:var(--radius); font-family:var(--font);
  font-size:.9rem; font-weight:600; cursor:pointer; transition:all var(--transition);
}
.btn-danger-outline:hover { background:var(--danger); color:white; }

/* ── Mini progress bar ───────────────────────────────────────────────────── */
.mini-bar-wrap { display:flex; align-items:center; gap:.5rem; }
.mini-bar { height:8px; background:var(--primary); border-radius:4px; min-width:2px; transition:width .3s; }
.mini-pct { font-size:.78rem; color:var(--text-light); white-space:nowrap; }

/* ── User panel ──────────────────────────────────────────────────────────── */
.change-banner {
  background:#fff3cd; color:#856404;
  padding:.85rem 2rem; font-size:.9rem;
  border-bottom:1px solid #ffeaa7;
  text-align:center;
}
.change-banner a { color:#856404; font-weight:700; text-decoration:underline; }

.panel-layout { max-width:1100px; margin:0 auto 2rem; padding:0 2rem; display:grid; grid-template-columns:260px 1fr; gap:2rem; align-items:start; }

.status-card {
  border-radius:var(--radius); padding:1.5rem;
  display:flex; gap:1rem; align-items:flex-start;
  border:1px solid var(--border); box-shadow:var(--shadow);
  position:sticky; top:80px;
}
.status-active    { background:#f1f8f1; border-color:#a5d6a7; }
.status-published { background:#fffde7; border-color:#ffe082; }
.status-inactive  { background:#fafafa; border-color:var(--border); }
.status-icon { font-size:2rem; }
.status-label { font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-light); }
.status-value { font-size:1.1rem; font-weight:700; margin-top:.2rem; }

.panel-roles h2 { font-size:1.2rem; margin-bottom:1rem; }
.panel-role-list { display:flex; flex-direction:column; gap:.75rem; }
.panel-role-card {
  background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius); padding:1rem 1.25rem;
  box-shadow:var(--shadow);
}
.panel-role-card.role-voted { border-color:#a5d6a7; }
.panel-role-header { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin-bottom:.4rem; }
.panel-role-title { font-size:.95rem; font-weight:600; }
.panel-picks { font-size:.82rem; color:var(--text-light); margin-bottom:.4rem; }
.pick-tag { font-weight:600; color:var(--text); }
.panel-vote-link { font-size:.82rem; color:var(--primary); font-weight:600; }

.badge-voted   { background:#e8f5e9; color:#2e7d32; }
.badge-pending { background:#f3f4f5; color:var(--text-light); }

.page-section { max-width:1100px; margin:0 auto 3rem; padding:0 2rem; }
.page-section h2 { font-size:1.3rem; margin-bottom:.5rem; }

/* ── Privacy note ───────────────────────────────────────────────────────── */
.privacy-note {
  display:flex; gap:1rem; align-items:flex-start;
  background:#f0f7ff; border:1px solid #bbdefb; border-radius:var(--radius);
  padding:1.25rem; margin-top:2rem; font-size:.88rem; color:#1565c0;
}
.privacy-icon { font-size:1.4rem; flex-shrink:0; }

/* ── Reset passcode inline ───────────────────────────────────────────────── */
.reset-details { display:inline-block; }
.reset-details summary { cursor:pointer; list-style:none; }
.reset-details summary::-webkit-details-marker { display:none; }
.reset-form { margin-top:.5rem; display:flex; flex-direction:column; gap:.4rem; padding:.75rem; background:#f8f9fa; border-radius:.4rem; border:1px solid var(--border); min-width:240px; }
.reset-btns { display:flex; gap:.4rem; }

/* ── Nav extras ─────────────────────────────────────────────────────────── */
.nav-link-active { color:var(--accent) !important; font-weight:700; }
.nav-link-admin  { color:#ffcc80 !important; }

/* ── Responsive additions ───────────────────────────────────────────────── */
@media (max-width:900px) {
  .panel-layout { grid-template-columns:1fr; }
  .status-card  { position:static; }
}

/* ── Duration vote ───────────────────────────────────────────────────────── */
.duration-section {
  border-top: 1.5px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1rem;
}
.duration-options { display:flex; gap:.75rem; margin:.75rem 0 .5rem; }
.duration-label { cursor:pointer; flex:1; }
.duration-label input[type="radio"] { display:none; }
.duration-box {
  display:flex; flex-direction:column; align-items:center;
  padding:.75rem .5rem; border:2px solid var(--border);
  border-radius:var(--radius); transition:all var(--transition);
  background:white;
}
.duration-label:hover .duration-box { border-color:var(--primary); background:#fdf0f2; }
.duration-label.duration-selected .duration-box {
  border-color:var(--primary); background:var(--primary); color:white;
}
.duration-num { font-size:1.6rem; font-weight:700; line-height:1; }
.duration-unit { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; opacity:.8; }
.duration-hint { font-size:.82rem; color:var(--text-light); min-height:1.2em; }

/* ── Duration tally in results ───────────────────────────────────────────── */
.duration-tally {
  margin-top:1.25rem; padding:1rem 1.25rem;
  background:#f8f9fa; border-radius:var(--radius);
  border:1px solid var(--border);
}
.tally-heading { font-size:.95rem; margin-bottom:.75rem; color:var(--text); }
.tally-sub { font-size:.78rem; font-weight:400; color:var(--text-light); }
.duration-tally-bars { display:flex; flex-direction:column; gap:.6rem; }
.dur-bar-row { display:grid; grid-template-columns:80px 1fr 80px; align-items:center; gap:.75rem; }
.dur-yr-label { font-size:.85rem; font-weight:600; color:var(--text); }
.dur-bar-track { height:10px; background:#e9ecef; border-radius:5px; overflow:hidden; }
.dur-bar-fill { height:100%; background:var(--primary); border-radius:5px; transition:width .4s; min-width:2px; }
.dur-count { font-size:.8rem; color:var(--text-light); text-align:right; }
.dur-winner { font-size:.85rem; color:var(--text-light); margin-top:.75rem; }
.dur-winner strong { color:var(--primary); }
