:root {
    --blue: #0a3fdd;
    --blue-d: #0830b0;
    --red: #e10600;
    --cyan: #1aa3e8;
    --ink: #1c2744;
    --muted: #667085;
    --line: #e6e1f2;
    --blush: #fde8e6;
    --wash: #eef1ff;
    --bg: #f7f6f3;
    --card: #ffffff;
    --side: #0a3fdd;
    --ok: #0c8f62;
    --warn: #9a6400;
    --bad: #c81e1e;
    --radius: 20px;
    --shadow: 0 16px 36px rgba(10, 47, 173, .07);
    --font: "Nunito", "Segoe UI", sans-serif;
    --display: "Nunito", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--font); font-size: 16.5px; background: var(--bg); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; margin: 0; color: var(--blue-d); }
p { margin: 0; }
::selection { background: #d9e0ff; color: var(--blue-d); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 999px; padding: 12px 18px; background: var(--blue); color: #fff;
    font-weight: 800; text-decoration: none; cursor: pointer; line-height: 1;
}
.btn:hover { background: var(--blue-d); }
.btn-red { background: var(--red); }
.btn-red:hover { background: #b80500; }
.btn-wa { background: #128c4a; }
.btn-wa:hover { background: #0c6e3a; }
.btn-ghost { background: #fff; color: var(--blue-d); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--wash); }
.btn-sm { padding: 8px 12px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 999px; border: 0; background: #fff;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--blue-d); box-shadow: var(--shadow);
}
.icon-btn svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 800; color: var(--blue-d); }
.field small { color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea, .inline-input {
    width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
    padding: 12px 13px; outline: none; color: var(--ink);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus {
    border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10, 63, 221, .12);
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 700; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }

.alert { border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; background: #e8f6ee; color: #146c43; font-weight: 700; }
.alert-error { background: var(--blush); color: #9d1515; }
.alert-warn { background: #fff6df; color: #7a5200; }
.alert-ok { background: #e8f6ee; color: #146c43; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 800; background: var(--wash); color: var(--blue-d); }
.st-nuevo { background: var(--blush); color: #b42318; }
.st-contactado { background: #e7eeff; color: #1237b0; }
.st-confirmado { background: #e5f6ff; color: #0b6496; }
.st-votara { background: #e5f8ee; color: #0c6b45; }
.st-indeciso { background: #fff4d8; color: #8a5a00; }
.st-no_contesta { background: #ffe8d8; color: #9a3d00; }
.st-baja { background: #ffe1e1; color: #9d1515; }

.card { background: var(--card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card h2 { font-size: 20px; margin-bottom: 6px; }
.muted { color: var(--muted); }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.stack { display: grid; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: 0; background: #fff; border-radius: 999px; padding: 8px 12px;
    text-decoration: none; color: var(--blue-d); font-weight: 800; font-size: 14px;
    box-shadow: var(--shadow);
}
.chip.on, .chip:hover { background: var(--blue); color: #fff; }

.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data th { text-align: left; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid #f0ebe4; }
table.data td { padding: 12px; border-bottom: 1px solid #f3efe9; vertical-align: middle; }
table.data tr:hover td { background: #fbfaf7; }
table.data a { font-weight: 800; text-decoration: none; color: var(--blue-d); }
code.mono, .mono { font-family: Consolas, "Courier New", monospace; font-size: .92em; }

.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--blue-d); font-size: 18px; margin-bottom: 6px; }

.hp { position: absolute; left: -9999px; }

.pub { background: radial-gradient(900px 420px at 100% 0, #ffe8e4 0, transparent 55%), radial-gradient(800px 380px at 0 0, #e7ecff 0, transparent 50%), var(--bg); }
.pub-top, .pub-foot { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.pub-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo-link { width: min(280px, 62vw); }
.logo-link img { width: 100%; height: auto; }
.pub-enter { color: var(--blue-d); font-weight: 800; text-decoration: none; background: #fff; border-radius: 999px; padding: 10px 14px; box-shadow: var(--shadow); }
.hero, .reg-card, .steps, .muni-band { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; padding: 8px 0 28px; }
.kicker { display: flex; gap: 8px; align-items: center; color: var(--blue-d); font-weight: 800; margin-bottom: 10px; }
.kicker span { background: var(--red); color: #fff; border-radius: 999px; padding: 4px 9px; font-size: 13px; }
.hero h1 { font-size: clamp(46px, 6vw, 72px); line-height: .92; max-width: 280px; }
.lede { margin-top: 14px; font-size: 19px; max-width: 42ch; color: #3a4660; }
.hero-points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hero-points li { padding-left: 18px; position: relative; }
.hero-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); position: absolute; left: 0; top: .55em; }
.invite { margin-top: 16px; background: #fff; border: 0; border-left: 4px solid var(--red); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.hero-photo { position: relative; min-height: 460px; border-radius: 32px; overflow: hidden; background: linear-gradient(160deg, #e7ecff, #fff 46%, #ffe4e0); box-shadow: var(--shadow); }
.hero-photo img { width: 100%; height: 520px; object-fit: cover; object-position: center 12%; }
.photo-cap { position: absolute; left: 16px; bottom: 16px; background: var(--blue); color: #fff; border-radius: 16px; padding: 10px 12px; }
.photo-cap strong { display: block; color: #fff; }
.photo-cap span { color: #d7e1ff; font-size: 14px; }
.reg-card { margin-top: -8px; margin-bottom: 28px; padding: 22px; }
.reg-card h2 { font-size: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.thanks { display: grid; gap: 12px; }
.linkbox { background: var(--wash); border: 1.5px dashed #b9c4f5; border-radius: 16px; padding: 12px 14px; word-break: break-all; font-weight: 800; color: var(--blue-d); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.step { padding: 18px; position: relative; }
.step em { font-style: normal; color: var(--red); font-family: var(--display); font-weight: 800; letter-spacing: .08em; font-size: 13px; }
.step h3 { margin-top: 6px; }
.muni-band { padding: 8px 0 40px; }
.muni-band h2 { margin-bottom: 10px; }
.pub-foot { padding: 8px 0 28px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.side { background: var(--side); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand-plate { display: block; background: #fff; border-radius: 16px; padding: 8px 10px 4px; }
.nav { display: grid; gap: 4px; }
.nav a, .nav-exit {
    display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
    border-radius: 14px; padding: 10px 12px; background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer;
    font-weight: 800;
}
.nav a svg, .nav-exit svg { width: 20px; height: 20px; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.16); }
.nav a.active { box-shadow: inset 3px 0 0 #fff; }
.side-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 8px; }
.side-user strong, .side-user small { display: block; }
.side-user small { color: rgba(255,255,255,.78); }
.avatar, .avatar-lg {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: #fff; color: var(--blue); font-weight: 800; flex: none;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; background: var(--blue); color: #fff; }
.content { min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 14px; padding: 16px 22px; position: sticky; top: 0;
    background: rgba(247, 246, 243, .9); backdrop-filter: blur(10px); z-index: 5;
}
.top-title h1 { font-size: 26px; }
.top-title p { color: var(--muted); font-size: 14px; font-weight: 700; }
.top-search { margin-left: auto; position: relative; width: min(360px, 36vw); }
.top-search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); }
.top-search input { width: 100%; border: 0; border-radius: 999px; padding: 11px 14px 11px 38px; background: #fff; box-shadow: var(--shadow); }
.search-pop { position: absolute; top: 48px; left: 0; right: 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.search-pop a { display: block; padding: 10px 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
.search-pop a:hover { background: var(--wash); }
.search-pop small { display: block; color: var(--muted); font-weight: 600; }
.menu-btn { display: none; }
.wrap { padding: 6px 22px 40px; }
.my-link { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin-bottom: 16px; }
.my-link code { flex: 1; background: var(--wash); border-radius: 12px; padding: 8px 10px; overflow: auto; color: var(--blue-d); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { padding: 16px 16px 14px; }
.stat::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 99px; background: var(--red); margin-bottom: 10px; }
.stat b { display: block; font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -.04em; color: var(--blue-d); line-height: 1; }
.stat span { color: var(--muted); font-weight: 700; }
.stat.pulse b { color: var(--red); }
.layout-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; }
.bar { height: 10px; background: #efeafd; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }
.bar.red > span { background: linear-gradient(90deg, var(--red), #ff7a72); }
.spark { width: 100%; height: 72px; }
.spark polyline { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.list-people { display: grid; }
.list-people a, .list-people > div { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid #f3efe9; text-decoration: none; color: inherit; }
.rank { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.rank i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--wash); color: var(--blue-d); font-style: normal; font-weight: 800; }
.rank:nth-child(1) i { background: var(--blue); color: #fff; }
.rank:nth-child(2) i { background: var(--red); color: #fff; }
.rank:nth-child(3) i { background: var(--cyan); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.person-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); font-weight: 800; }
.kv dd { margin: 0; font-weight: 700; }
.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tree li { background: var(--wash); border-radius: 14px; padding: 10px 12px; }
.tree li.now { outline: 2px solid var(--blue); background: #fff; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.progress-line { height: 12px; }
.station { display: grid; gap: 12px; }
.msg-preview { white-space: pre-wrap; background: var(--wash); border-radius: 16px; padding: 12px 14px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.choice label { display: flex; gap: 6px; align-items: center; font-weight: 800; color: var(--blue-d); }
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(700px 320px at 0 0, #e7ecff, transparent 60%), radial-gradient(600px 280px at 100% 100%, #ffe4e0, transparent 55%), var(--bg); padding: 18px; }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 24px 60px rgba(10, 47, 173, .12); }
.login-photo { position: relative; background: linear-gradient(160deg, #e7ecff, #ffe4e0); min-height: 560px; }
.login-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; position: absolute; inset: 0; }
.login-photo div { position: absolute; left: 18px; right: 18px; bottom: 18px; color: #fff; z-index: 1; }
.login-photo div strong { color: #fff; }
.login-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(8, 48, 176, .88)); }
.login-card { padding: 32px 28px; display: grid; align-content: center; gap: 12px; }
.login-card h1 { font-size: 32px; }
.login-card img { width: 230px; }
.live-note { display: none; margin-bottom: 12px; }
.live-note.show { display: block; }
.scrim { display: none; }
.toast {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
    background: var(--blue-d); color: #fff; padding: 10px 14px; border-radius: 999px; z-index: 20; font-weight: 800;
}

@media (max-width: 980px) {
    .hero, .steps, .login-shell, .layout-2, .stats, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; z-index: 30; transform: translateX(-105%); transition: transform .2s ease; width: min(300px, 88vw); height: 100vh; }
    .side.open { transform: none; }
    .scrim.show { display: block; position: fixed; inset: 0; background: rgba(12, 24, 68, .45); z-index: 20; }
    .menu-btn { display: inline-flex; }
    .top-search { display: none; }
    .hero-photo, .hero-photo img, .login-photo { min-height: 320px; height: 380px; }
    .pub-foot { flex-direction: column; }
    .kv { grid-template-columns: 1fr; }
    .bar-row { grid-template-columns: 1fr; }
    .wrap, .topbar { padding-left: 16px; padding-right: 16px; }
}
