/* =========================================================================
   ARD FMC Decides — design system
   A calm, institutional palette with editorial typography and soft surfaces.
   ========================================================================= */

:root {
  --brand: #0f5c45;
  --brand-2: #0a3d2f;
  --brand-3: #147a5a;
  --brand-soft: #e9f3ee;
  --accent: #c7a34a;
  --accent-soft: #f8f1df;
  --ink: #132333;
  --ink-2: #263b4f;
  --muted: #68788a;
  --muted-2: #8b98a7;
  --line: #e2e8ee;
  --line-strong: #cfd8e1;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --success: #087443;
  --success-soft: #ecfdf3;
  --warning: #a15c07;
  --warning-soft: #fffaeb;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --shadow-xs: 0 1px 2px rgba(19, 35, 51, .05);
  --shadow-sm: 0 4px 14px rgba(19, 35, 51, .06);
  --shadow: 0 12px 32px rgba(19, 35, 51, .08);
  --shadow-lg: 0 28px 70px rgba(19, 35, 51, .14);
  --shadow-pop: 0 18px 44px rgba(19, 35, 51, .22);

  /* Gold is the shared accent for warnings and highlights. The public
     ballot (vote.css) and the console (console.css) each redefine these
     with their own values, so the same component reads correctly on
     every page. */
  --gold: #E9A825;
  --gold-soft: #FBEFD4;
  --gold-ink: #77510A;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --wrap: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.console-body { background: var(--canvas); }

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

:focus-visible {
  outline: 3px solid rgba(15, 92, 69, .28);
  outline-offset: 2px;
}

::selection { background: rgba(15, 92, 69, .18); }

/* -------------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------------- */

.wrap { width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }
.wrap-narrow { width: min(760px, calc(100% - 40px)); margin-inline: auto; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.strong { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.ml-auto { margin-left: auto !important; }
.full { width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------------------
   Public header / footer
   ------------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(226, 232, 238, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 78px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo {
  width: 46px; height: 46px; border-radius: 13px; object-fit: cover;
  border: 1px solid var(--line); background: #fff; flex: 0 0 auto;
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block; font-family: var(--font-display); font-size: 1.08rem;
  letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small {
  display: block; color: var(--muted); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 7px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .82rem; color: var(--ink-2); font-weight: 600;
}
.user-chip .avatar-xs {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2); font-size: .68rem; font-weight: 800;
}

.site-footer {
  margin-top: 64px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
}
.footer-inner {
  padding: 26px 0; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .8rem;
}
.footer-inner strong { color: var(--ink-2); }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px; font-weight: 700; font-size: .9rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.btn svg { flex: 0 0 auto; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand);
  color: #fff; box-shadow: 0 10px 22px rgba(15, 92, 69, .22);
}
.btn-primary:hover { color: #fff; box-shadow: 0 14px 28px rgba(15, 92, 69, .28); }
.btn-secondary { background: var(--brand-soft); color: var(--brand-2); border-color: rgba(15, 92, 69, .12); }
.btn-secondary:hover { background: #dfeee7; color: var(--brand-2); }
.btn-gold { background: var(--accent); color: #2d2207; box-shadow: 0 10px 22px rgba(199, 163, 74, .24); }
.btn-gold:hover { color: #2d2207; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 10px 22px rgba(180, 35, 24, .18); }
.btn-danger:hover { color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--muted-2); }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: .98rem; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: .78rem; border-radius: 9px; }
.btn-xs { padding: 5px 9px; font-size: .72rem; border-radius: 8px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Cards, panels and surfaces
   ------------------------------------------------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.card-pad { padding: 24px; }
.card-head {
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-family: var(--font-display); font-size: 1.18rem; letter-spacing: -.01em; }
.card-body { padding: 24px; }
.card-foot { padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel-tint { background: var(--brand-soft); border-color: rgba(15, 92, 69, .12); }
.panel-warn { background: var(--warning-soft); border-color: #f2d9a5; }
.panel-danger { background: var(--danger-soft); border-color: #fecdca; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand);
}
.eyebrow-gold { color: var(--warning); }
.section-title { font-family: var(--font-display); font-size: clamp(1.4rem, 2.4vw, 1.8rem); letter-spacing: -.02em; }
.section-sub { color: var(--muted); max-width: 62ch; }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label {
  display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 700;
  color: var(--ink-2); letter-spacing: .01em;
}
.field .hint { margin-top: 6px; font-size: .76rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2);
  border-radius: 12px; padding: 12px 14px; color: var(--ink); font-size: .94rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 92, 69, .12);
}
.textarea { min-height: 100px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2368788a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-action {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px;
  border-radius: 9px; display: grid; place-items: center; cursor: pointer;
}
.input-action:hover { background: var(--brand-soft); color: var(--brand-2); }
.input-action .icon-eye-off { display: none; }
.input-action.is-visible .icon-eye { display: none; }
.input-action.is-visible .icon-eye-off { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.checkline { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--ink-2); }
.checkline input { margin-top: 3px; accent-color: var(--brand); width: 17px; height: 17px; }
.file-drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  padding: 18px; background: var(--surface-2); display: flex; align-items: center; gap: 16px;
}
.file-drop input[type="file"] { max-width: 100%; font-size: .82rem; }
.file-preview {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--line); background: #fff; flex: 0 0 auto;
}
.input-sm { padding: 8px 10px; border-radius: 9px; font-size: .84rem; }

/* -------------------------------------------------------------------------
   Alerts and badges
   ------------------------------------------------------------------------- */

.alert {
  border: 1px solid transparent; border-radius: 12px; padding: 12px 15px;
  font-size: .86rem; font-weight: 600; margin-bottom: 18px;
}
.alert-success { background: var(--success-soft); border-color: #abefc6; color: #067647; }
.alert-error { background: var(--danger-soft); border-color: #fecdca; color: #b42318; }
.alert-warning { background: var(--warning-soft); border-color: #f2d9a5; color: #93370d; }
.alert-info { background: var(--info-soft); border-color: #b2ddff; color: #175cd3; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .03em;
  background: #eef2f5; color: var(--ink-2); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-live { background: var(--success-soft); color: #067647; }
.badge-live .dot { animation: pulse 1.8s ease infinite; }
.badge-muted { background: #eef2f5; color: var(--muted); }
.badge-gold { background: var(--accent-soft); color: #8a6512; }
.badge-brand { background: var(--brand-soft); color: var(--brand-2); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

/* -------------------------------------------------------------------------
   Auth pages
   ------------------------------------------------------------------------- */

.auth-page { padding: 44px 0 20px; }
.auth-shell {
  display: grid; grid-template-columns: 1.04fr .96fr;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-lg);
  min-height: 620px;
}
.auth-aside {
  position: relative; padding: 52px;
  background: var(--brand-2);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; isolation: isolate;
}
.auth-aside::before {
  content: ""; position: absolute; inset: -20%; z-index: -1; opacity: .5;
  background: rgba(255, 255, 255, .04);
}
.auth-aside::after {
  content: ""; position: absolute; width: 340px; height: 340px; right: -160px; bottom: -170px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; z-index: -1;
}
.auth-aside--cms { background: #2a2417; }
.auth-aside--cms::before { background: rgba(199, 163, 74, .12); }
.auth-aside--cms::after { border-color: rgba(199, 163, 74, .3); }
.auth-aside h1 {
  font-family: var(--font-display); color: #fff;
  font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.05; letter-spacing: -.03em;
  margin: 18px 0 16px;
}
.auth-aside .lead { color: rgba(255, 255, 255, .76); max-width: 42ch; font-size: .98rem; }
.auth-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800;
  color: #f5e7bd; background: rgba(255, 255, 255, .06);
}
.auth-meta { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 34px; }
.auth-meta div { min-width: 100px; }
.auth-meta strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: #fff; }
.auth-meta span { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .58); font-weight: 700; }
.auth-card { padding: 52px; display: flex; flex-direction: column; justify-content: center; }
.auth-card h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 2.5vw, 2rem); letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 28px; }
.auth-foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.auth-foot svg { flex: 0 0 auto; margin-top: 2px; color: var(--brand); }
.auth-logo { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; border: 2px solid rgba(255, 255, 255, .24); box-shadow: 0 12px 30px rgba(0, 0, 0, .2); }

/* -------------------------------------------------------------------------
   Public hero / landing
   ------------------------------------------------------------------------- */

.page-hero { padding: 40px 0 12px; }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.025em; }
.page-hero .sub { color: var(--muted); margin-top: 8px; max-width: 62ch; }

/* -------------------------------------------------------------------------
   Ballot (shared shell; the public ballot itself is styled in vote.css)
   ------------------------------------------------------------------------- */

.ballot-page { padding: 34px 0 64px; }
.ballot-grid { display: grid; grid-template-columns: minmax(0, 1fr) 308px; gap: 24px; align-items: start; }

.progress { height: 7px; background: #edf1f4; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .4s ease; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.progress-meta strong { color: var(--brand-2); }

.candidate-hero {
  display: flex; align-items: center; gap: 20px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2);
  margin-bottom: 20px;
}
.candidate-hero-photo {
  width: 108px; height: 108px; border-radius: 16px; overflow: hidden; flex: 0 0 auto;
  background: #eef2f0; display: grid; place-items: center;
}
.candidate-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.candidate-hero-photo .initials { font-family: var(--font-display); font-size: 2rem; color: var(--brand-2); }
.candidate-hero h3 { font-family: var(--font-display); font-size: 1.28rem; letter-spacing: -.01em; }
.candidate-hero p { color: var(--muted); font-size: .82rem; margin-top: 4px; }

.ballot-side { position: sticky; top: 98px; display: grid; gap: 16px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-xs); }
.side-card h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 12px; }
.side-note { font-size: .78rem; color: var(--muted); line-height: 1.55; }
.side-note strong { color: var(--ink-2); }

/* -------------------------------------------------------------------------
   Success / completion
   ------------------------------------------------------------------------- */

.complete-card {
  max-width: 620px; margin: 48px auto; text-align: center; padding: 46px 36px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.complete-icon {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  margin: 0 auto 22px; background: var(--success-soft); color: var(--success);
  box-shadow: 0 0 0 10px rgba(8, 116, 67, .06);
}
.complete-card h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.complete-card .sub { color: var(--muted); margin: 10px auto 26px; max-width: 46ch; }
.receipt {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin: 24px 0; text-align: left;
}
.receipt div { background: var(--surface); padding: 14px 16px; }
.receipt span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.receipt strong { display: block; margin-top: 3px; font-size: .9rem; color: var(--ink); }

/* -------------------------------------------------------------------------
   Console shell (committee + content manager)
   ------------------------------------------------------------------------- */

.console { min-height: 100vh; display: grid; grid-template-columns: 262px minmax(0, 1fr); }
.console-sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  background: var(--brand-2);
  color: #d7e6df; display: flex; flex-direction: column; gap: 22px; overflow-y: auto;
}
.console--cms .console-sidebar { background: #2a2417; }
.console-brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 0; color: #fff; }
.console-brand:hover { color: #fff; }
.console-brand img { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; border: 1px solid rgba(255, 255, 255, .18); }
.console-brand strong { display: block; font-family: var(--font-display); font-size: 1rem; letter-spacing: -.01em; }
.console-brand small { display: block; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .5); font-weight: 800; }
.console--cms .console-brand small { color: rgba(244, 227, 178, .6); }
.console-nav { display: grid; gap: 4px; }
.console-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: rgba(255, 255, 255, .68); font-size: .86rem; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.console-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.console-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.console--cms .console-nav a.active { background: rgba(199, 163, 74, .16); color: #f7e9c3; box-shadow: inset 3px 0 0 var(--accent); }
.console-nav .nav-label {
  padding: 14px 12px 4px; font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(255, 255, 255, .38); font-weight: 800;
}
.console-side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); }
.console-side-foot .who { font-size: .76rem; color: rgba(255, 255, 255, .55); margin-bottom: 10px; }
.console-side-foot .who strong { display: block; color: #fff; font-size: .86rem; }
.console-sidebar .btn-ghost { color: #e7f3ed; border-color: rgba(255, 255, 255, .26); }
.console-sidebar .btn-ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); }
.console-main { min-width: 0; padding: 28px 34px 56px; }
.console-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.console-topbar h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; }
.console-topbar .sub { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.console-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mobile-menu { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px 20px; box-shadow: var(--shadow-xs);
}
.stat-label { display: flex; align-items: center; gap: 7px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.stat-value { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; margin-top: 8px; letter-spacing: -.03em; }
.stat-foot { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.stat-accent { border-top: 3px solid var(--brand); }
.stat-accent-gold { border-top: 3px solid var(--accent); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.status-panel {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 26px;
  background: var(--brand-2); color: #fff; box-shadow: var(--shadow);
}
.status-panel::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: -110px;
  border: 1px solid rgba(255, 255, 255, .15); border-radius: 50%;
}
.status-panel h2 { font-family: var(--font-display); font-size: 1.5rem; color: #fff; margin: 10px 0 6px; }
.status-panel p { color: rgba(255, 255, 255, .7); font-size: .86rem; max-width: 46ch; }
.status-panel .status-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.status-panel .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.status-panel .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.status-panel.is-closed { background: #3b4755; }

.quick-list { display: grid; gap: 0; }
.quick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.quick-row:last-child { border-bottom: 0; }
.quick-row .name { font-weight: 700; font-size: .88rem; }
.quick-row .meta { color: var(--muted); font-size: .76rem; margin-top: 2px; }
.quick-row .value { font-family: var(--font-display); font-size: 1.2rem; }

/* -------------------------------------------------------------------------
   Results
   ------------------------------------------------------------------------- */

.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs); }
.result-card-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-card-head h3 { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.01em; }
.result-card-head .meta { color: var(--muted); font-size: .74rem; margin-top: 3px; }
.result-card-body { padding: 18px 20px; }
.result-list { display: grid; gap: 14px; }
.result-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.result-avatar {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--brand-soft);
  display: grid; place-items: center; color: var(--brand-2); font-weight: 800; font-size: .82rem;
}
.result-info { min-width: 0; }
.result-name { font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-bar { height: 7px; background: #edf1f4; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.result-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .5s ease; }
.result-row.is-winner .result-bar span { background: var(--accent); }
.result-row.is-winner .result-name::after { content: "Leading"; margin-left: 8px; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: #8a6512; background: var(--accent-soft); padding: 2px 6px; border-radius: 999px; vertical-align: 1px; }
.result-score { text-align: right; font-family: var(--font-display); font-size: 1.2rem; line-height: 1; }
.result-score small { display: block; font-family: var(--font-sans); font-size: .66rem; color: var(--muted); margin-top: 3px; letter-spacing: .04em; }
.binary-result { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.binary-stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.binary-stat.yes { background: var(--success-soft); border-color: #abefc6; }
.binary-stat.no { background: var(--danger-soft); border-color: #fecdca; }
.binary-stat .value { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; }
.binary-stat .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); margin-top: 5px; }

.detail-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end;
  padding: 24px; border-radius: var(--radius-xl); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-xs); margin-bottom: 20px;
}
.detail-head h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -.02em; }
.detail-head .sub { color: var(--muted); font-size: .84rem; margin-top: 5px; }
.detail-total { text-align: right; }
.detail-total strong { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.detail-total span { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.winner-banner {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--radius);
  background: #fbf3dc; border: 1px solid #ead9a9; margin-bottom: 20px;
}
.winner-banner .icon { width: 42px; height: 42px; border-radius: 50%; background: #fff8e6; color: #8a6512; display: grid; place-items: center; flex: 0 0 auto; }
.winner-banner strong { display: block; font-size: .9rem; }
.winner-banner span { font-size: .78rem; color: #7a5b13; }
.live-note { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--muted); }

/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line); font-weight: 800; white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: .86rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fafcfb; }
.data-table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person img, .cell-person .avatar {
  width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
  background: var(--brand-soft); display: grid; place-items: center; color: var(--brand-2); font-weight: 800; font-size: .76rem;
}
.cell-person .name { font-weight: 700; font-size: .86rem; }
.cell-person .meta { color: var(--muted); font-size: .72rem; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form .input { min-width: 220px; }

/* -------------------------------------------------------------------------
   CMS specifics
   ------------------------------------------------------------------------- */

.cms-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.cms-form-card { position: sticky; top: 24px; }
.cms-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.cms-tab {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 700;
}
.cms-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.cms-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.photo-cell { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.type-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); }
.type-pill.yesno { background: var(--accent-soft); color: #8a6512; }
.order-input { width: 64px; }
.danger-zone { border: 1px solid #fecdca; background: #fffbfa; border-radius: var(--radius-lg); padding: 24px; }
.danger-zone h3 { color: var(--danger); font-family: var(--font-display); }
.cms-note { font-size: .78rem; color: var(--muted); line-height: 1.55; }
.cms-note strong { color: var(--ink-2); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .icon { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); margin-bottom: 4px; }
.empty-state p { font-size: .84rem; max-width: 40ch; margin: 0 auto; }

/* -------------------------------------------------------------------------
   Shared runtime UI
   -------------------------------------------------------------------------
   These components are created at runtime by assets/js/app.js, so they
   live in the base stylesheet that every page loads. Without them the
   confirm dialog and the photo lightbox render as raw, unstyled markup
   on any page that does not load vote.css.
   ------------------------------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 27, 19, .92);
  display: grid; place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox-figure { margin: 0; max-width: min(92vw, 760px); max-height: 92vh; text-align: center; }
.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 18px;
  border: 5px solid #fff;
  box-shadow: var(--shadow-pop);
  background: #fff;
}
.lightbox-figure figcaption {
  color: #fff;
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}
.lightbox-close {
  position: absolute; top: 18px; right: 18px;
  width: 46px; height: 46px; border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .26); transform: translateY(-2px); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(4, 27, 19, .78);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px 24px;
  max-width: 430px; width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.modal-icon {
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--gold-soft); color: var(--gold-ink);
  display: grid; place-items: center;
  margin: 0 auto 14px;
}
.modal.is-danger .modal-icon { background: var(--danger-soft); color: var(--danger); }
.modal.is-danger .btn-primary {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 0 #8E0B18;
}
.modal.is-danger .btn-primary:hover { background: #b42318; color: #fff; }
.modal h3 { font-size: 1.25rem; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-actions .btn { flex: 0 1 auto; }

/* -------------------------------------------------------------------------
   Utilities: avatar, kbd, print
   ------------------------------------------------------------------------- */

.avatar-lg { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }
.avatar-md { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.kbd { font-size: .7rem; padding: 2px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: #fff; color: var(--muted); }

@media print {
  .site-header, .site-footer, .console-sidebar, .console-actions, .btn, .live-note { display: none !important; }
  .console { display: block; }
  .console-main { padding: 0; }
  body { background: #fff; }
  .card, .result-card, .detail-head { box-shadow: none; border-color: #ccc; }
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .ballot-grid { grid-template-columns: minmax(0, 1fr) 270px; }
  .auth-aside, .auth-card { padding: 40px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .cms-grid { grid-template-columns: 1fr; }
  .cms-form-card { position: static; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .auth-shell--verify .auth-card { order: -1; }
  .auth-aside { padding: 34px 30px; }
  .auth-aside h1 { font-size: 2rem; }
  .auth-aside .lead { font-size: .9rem; }
  .auth-meta { margin-top: 22px; }
  .auth-card { padding: 34px 30px 38px; }
  .console { grid-template-columns: 1fr; }
  .console-sidebar {
    position: static; height: auto; padding: 16px;
    flex-direction: column; gap: 14px;
  }
  .console-brand { display: none; }
  .console-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .console-nav a { flex: 0 0 auto; padding: 8px 11px; font-size: .78rem; }
  .console-nav .nav-label { display: none; }
  .console-side-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; padding-top: 12px; }
  .console-side-foot .who { margin-bottom: 0; }
  .console-side-foot .btn-block { width: auto; }
  .console-main { padding: 22px 20px 48px; }
  .ballot-grid { grid-template-columns: 1fr; }
  .ballot-side { position: static; }
  .ballot-side .side-card { padding: 14px; }
  .result-grid { grid-template-columns: 1fr; }
  .detail-head { grid-template-columns: 1fr; }
  .detail-total { text-align: left; }
}

@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .wrap, .wrap-narrow { width: calc(100% - 28px); }
  .header-inner { min-height: 68px; }
  .brand-logo { width: 40px; height: 40px; border-radius: 11px; }
  .brand-text strong { font-size: .98rem; }
  .brand-text small { font-size: .6rem; }
  .user-chip { padding: 5px 9px 5px 6px; font-size: .76rem; }
  .auth-page { padding: 20px 0 10px; }
  .auth-aside { padding: 28px 22px; }
  .auth-aside h1 { font-size: 1.65rem; }
  .auth-meta { gap: 18px; }
  .auth-card { padding: 28px 22px 32px; }
  .auth-card h2 { font-size: 1.45rem; }
  .page-hero { padding: 26px 0 8px; }
  .ballot-page { padding: 20px 0 40px; }
  .ballot-card-head { padding: 22px 20px 18px; }
  .ballot-card-body { padding: 20px; }
  .ballot-card-foot { padding: 14px 20px; position: sticky; bottom: 0; z-index: 5; box-shadow: 0 -8px 20px rgba(19, 35, 51, .06); }
  .choice-grid, .choice-grid--three { grid-template-columns: 1fr; }
  .choice-grid { gap: 12px; }
  .choice-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px; }
  .choice-photo { margin-bottom: 0; width: 84px; height: 84px; aspect-ratio: auto; }
  .choice-card--binary { display: flex; padding: 20px 14px; }
  .choice-card--binary .binary-icon { width: 46px; height: 46px; }
  .candidate-hero { align-items: flex-start; gap: 14px; padding: 14px; }
  .candidate-hero-photo { width: 80px; height: 80px; border-radius: 13px; }
  .candidate-hero h3 { font-size: 1.08rem; }
  .ballot-card-foot .btn { flex: 1 1 auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; border-radius: var(--radius); }
  .stat-value { font-size: 1.6rem; }
  .console-main { padding: 18px 14px 40px; }
  .console-topbar h1 { font-size: 1.4rem; }
  .form-grid { grid-template-columns: 1fr; }
  .card-pad, .card-body { padding: 18px; }
  .card-head { padding: 16px 18px; }
  .table-toolbar { align-items: stretch; }
  .search-form { width: 100%; }
  .search-form .input { flex: 1; min-width: 0; }
  .result-card-head { padding: 15px 16px; }
  .result-card-body { padding: 15px 16px; }
  .complete-card { margin: 24px auto; padding: 34px 20px; }
  .receipt { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .status-panel { padding: 20px; }
  .status-panel h2 { font-size: 1.3rem; }
}

@media (max-width: 420px) {
  .header-meta .user-chip span.label { display: none; }
  .choice-card { grid-template-columns: 70px minmax(0, 1fr); }
  .choice-photo { width: 70px; height: 70px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
