/* =========================================================
   Elecciones CUL — hoja de estilos (tema claro institucional)
   Azul CUL #042358 · Naranja CUL #FF6A00 · Verde #1AB394
   Letra: Lexend (diseñada para legibilidad, de la familia de Verdana)
   ========================================================= */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --navy: #042358;
  --navy-2: #0b3a82;
  --ink: #14223d;
  --text: #2a3650;
  --muted: #5e6b82;
  --line: #e2e7ef;
  --line-strong: #cdd5e2;
  --signal: #f26300;
  --signal-hi: #d95700;
  --signal-soft: #fff1e6;
  --ok: #128a71;
  --ok-bright: #1ab394;
  --ok-soft: #e6f6f2;
  --warn: #9a6a00;
  --warn-soft: #fff6dc;
  --err: #c22f2f;
  --err-soft: #fdecec;
  --info-soft: #eaf0fb;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(4, 35, 88, .06), 0 4px 14px rgba(4, 35, 88, .06);
  --shadow-lg: 0 10px 40px rgba(4, 35, 88, .16);
  --font: "Montserrat", Verdana, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); font-size: 16px; line-height: 1.6; font-weight: 400;
  color: var(--text); background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--navy-2); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(1.8rem, 4.4vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: .9rem; font-weight: 600; color: var(--muted); }
p { margin: 0; }
code { font-family: inherit; background: var(--info-soft); color: var(--navy); padding: .05em .45em; border-radius: 5px; }
.muted { color: var(--muted); }
.i { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 99; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--surface); --fg: var(--ink); --bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 1.15em; border-radius: var(--r-sm);
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-sm { min-height: 36px; padding: 0 .85em; font-size: .88rem; }
.btn-lg { min-height: 54px; padding: 0 1.5em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-ghost { --bg: var(--surface); }
.btn-ghost:hover { --bg: var(--surface-2); --bd: var(--navy-2); }
.btn-votar { --bg: var(--signal); --fg: #fff; --bd: var(--signal); }
.btn-votar:hover { --bg: var(--signal-hi); --bd: var(--signal-hi); }
.btn-primary { --bg: var(--navy); --fg: #fff; --bd: var(--navy); }
.btn-primary:hover { --bg: var(--navy-2); --bd: var(--navy-2); }
.btn-danger { --fg: var(--err); --bd: #f0b9b9; }
.btn-ms { --bg: #fff; --fg: #1f1f1f; --bd: #8c8c8c; font-weight: 500; }
.btn-ms:hover { --bg: #f3f3f3; }
.ms-logo { width: 20px; height: 20px; }
.btn-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn-icon:hover { background: var(--surface-2); border-color: var(--navy-2); }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: .7em; align-items: flex-start; padding: .85em 1em; border-radius: var(--r); border: 1px solid var(--line); background: var(--info-soft); color: var(--ink); margin: 16px 0; }
.alert .i { margin-top: .2em; color: var(--navy-2); }
.alert-ok { border-color: #b5e6da; background: var(--ok-soft); }
.alert-ok .i { color: var(--ok); }
.alert-error { border-color: #f3c2c2; background: var(--err-soft); }
.alert-error .i { color: var(--err); }
.alert-warn { border-color: #f1dc9c; background: var(--warn-soft); }
.alert-warn .i { color: var(--warn); }

/* ---------- Cabecera pública ---------- */
.pub-top { background: var(--surface); border-bottom: 1px solid var(--line); border-top: 4px solid var(--signal); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(4,35,88,.03); }
.pub-top-in { display: flex; align-items: center; gap: 24px; min-height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand img { width: auto; height: 42px; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-size: 1.08rem; font-weight: 700; color: var(--navy); }
.brand small { color: var(--muted); font-size: .76rem; }
.pub-nav { display: flex; gap: 4px; margin-left: auto; }
.pub-nav a { white-space: nowrap; text-decoration: none; padding: 8px 14px; border-radius: var(--r-sm); color: var(--muted); font-weight: 500; }
.pub-nav a:hover { color: var(--navy); background: var(--surface-2); }
.pub-nav a.on { color: var(--navy); background: var(--info-soft); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 600; font-size: .82rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: .88rem; color: var(--ink); font-weight: 600; }
.user-meta small { color: var(--muted); font-size: .74rem; }
.pub-foot { background: var(--navy); color: #c9d4ea; margin-top: 72px; padding: 26px 0 34px; font-size: .84rem; }
.pub-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 48px 0 36px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hero h1 { color: var(--navy); max-width: 16ch; }
.hero-sub { margin-top: 14px; color: var(--muted); font-size: 1.05rem; max-width: 54ch; }
.hero-cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-side { display: grid; gap: 14px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.hero-fechas { color: var(--muted); display: flex; gap: .5em; align-items: center; font-size: .92rem; }
.reloj { display: grid; gap: 10px; }
.reloj-label { color: var(--muted); font-size: .9rem; font-weight: 500; }
.reloj-num { display: flex; gap: 10px; }
.reloj-num > span { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 12px 8px 10px; border-radius: var(--r); background: var(--navy); color: #fff; }
.reloj-num b { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.reloj-num small { color: #b9c7e4; font-size: .76rem; margin-top: 6px; }
.avance { padding-top: 4px; }
.avance-top { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.avance-top strong { color: var(--ink); }
.barra { height: 8px; border-radius: 99px; background: #e7ecf4; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--ok-bright); border-radius: inherit; transition: width .6s ease; }

.indice { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 0 4px; }
.indice a { text-decoration: none; font-size: .85rem; padding: 6px 13px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; color: var(--navy); }
.indice a:hover { border-color: var(--signal); color: var(--signal-hi); }

/* ---------- Campañas y afiches ---------- */
.campana { padding: 36px 0 8px; scroll-margin-top: 90px; }
.campana + .campana { border-top: 1px solid var(--line); }
.campana-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.campana-head h2 { color: var(--navy); max-width: 42ch; }
.campana-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: .78rem; padding: 3px 10px; border-radius: 99px; background: var(--info-soft); color: var(--navy-2); white-space: nowrap; font-weight: 500; }
.tag-num { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-variant-numeric: tabular-nums; }
.estado { display: inline-flex; align-items: center; gap: .4em; padding: 6px 13px; border-radius: 99px; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.estado-pend { background: var(--signal-soft); color: #b44a00; }
.estado-ok { background: var(--ok-soft); color: var(--ok); }
.empty-line { color: var(--muted); }

.afiches { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.afiche { display: flex; flex-direction: column; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.afiche-img {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r);
  background: #edf1f7; overflow: hidden; cursor: zoom-in; aspect-ratio: 16 / 13;
}
.afiche-img img { width: 100%; height: 100%; object-fit: contain; }
.afiche .btn-votar { width: 100%; min-height: 50px; font-size: 1.02rem; }
.afiche-nota { display: flex; align-items: center; justify-content: center; gap: .4em; min-height: 50px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); font-size: .9rem; }
.afiche-nota.ok { border: 1px solid #b5e6da; color: var(--ok); background: var(--ok-soft); font-weight: 600; }
.afiche.is-otro { opacity: .55; }
.afiche.is-otro .afiche-img { filter: grayscale(1); }
.afiche.is-elegido { border-color: var(--ok-bright); box-shadow: 0 0 0 3px rgba(26,179,148,.25), var(--shadow); }

/* Sello de voto */
.sello {
  position: absolute; right: 6%; bottom: 8%; width: 34%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; transform: rotate(-14deg);
  border: 4px solid var(--ok); outline: 2px solid var(--ok); outline-offset: 4px;
  background: rgba(255, 255, 255, .88);
}
.sello span { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); font-size: clamp(.85rem, 2.1vw, 1.2rem); text-align: center; line-height: 1; }
.sello.anim { animation: estampar .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes estampar { from { transform: rotate(-30deg) scale(1.9); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }

/* ---------- Diálogos ---------- */
.dlg { border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(880px, 100% - 24px); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(4, 20, 50, .55); }
.dlg[open] { animation: aparecer .18s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } }
.dlg-x { position: absolute; top: 10px; right: 10px; margin: 0; z-index: 2; }
.pf { display: grid; grid-template-columns: 1.1fr 1fr; }
.pf img { width: 100%; height: 100%; object-fit: contain; min-height: 280px; background: #edf1f7; }
.pf-body { padding: 28px; display: grid; gap: 8px; align-content: start; overflow: auto; max-height: calc(100vh - 40px); }
.pf-body h3 { color: var(--navy); }
.pf-camp { color: var(--signal-hi); font-size: .82rem; font-weight: 600; }
.pf-body h4 { margin-top: 14px; }
.pf-text { white-space: pre-line; }
.dlg-confirm { width: min(560px, 100% - 24px); }
.cf { display: grid; grid-template-columns: 150px 1fr; gap: 22px; padding: 24px; }
.cf img { width: 150px; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--r); background: #edf1f7; }
.cf h3 { color: var(--navy); }
.cf-cand { margin-top: 12px; }
.cf-cand strong { color: var(--ink); }
.cf-warn { margin-top: 14px; display: flex; gap: .5em; align-items: center; color: #b44a00; font-size: .9rem; }
.cf-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login { display: grid; place-items: center; padding: 56px 0; }
.login-card { width: min(460px, 100%); padding: 34px 30px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 16px; border-top: 4px solid var(--navy); }
.login-logo { width: 210px; height: auto; }
.login-card h1 { font-size: 1.6rem; color: var(--navy); }
.login-card .btn-ms { min-height: 52px; font-size: 1rem; }
.fine { font-size: .8rem; color: var(--muted); text-align: center; }
.local { border-top: 1px solid var(--line); padding-top: 14px; }
.local summary { cursor: pointer; color: var(--navy-2); font-size: .92rem; font-weight: 500; }
.local .form { margin-top: 14px; }
.local[open] .btn-ghost { --bg: var(--navy); --fg: #fff; --bd: var(--navy); }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: .9rem; }
.field > span, .field > label { color: var(--ink); font-weight: 500; }
.field small { font-size: .8rem; }
.field input, .field select, .field textarea, .input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(11,58,130,.15); }
.check { display: flex; align-items: center; gap: 10px; font-size: .92rem; cursor: pointer; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--signal); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Vacíos ---------- */
.empty { text-align: center; padding: 72px 16px; display: grid; justify-items: center; gap: 12px; }
.empty > .i { width: 44px; height: 44px; color: var(--navy-2); }
.empty h1, .empty h2 { color: var(--navy); }
.empty p { color: var(--muted); max-width: 52ch; }

/* ---------- Toasts ---------- */
.toast-zone { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, 100% - 32px); }
.toast { display: flex; gap: .6em; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--navy); color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); animation: aparecer .2s ease-out; }
.toast.err { background: var(--err); }

/* =========================================================
   Administración
   ========================================================= */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow: auto; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; padding: 16px 12px; border-top: 4px solid var(--signal); }
.side .brand { padding: 4px 8px 16px; }
.side-title { font-size: .74rem; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); font-size: .9rem; }
.side-nav a:hover { background: var(--surface-2); color: var(--navy); }
.side-nav a.on { background: var(--navy); color: #fff; font-weight: 500; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--line); }
.side-foot a { display: flex; gap: 8px; align-items: center; color: var(--signal-hi); text-decoration: none; font-weight: 600; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.topbar-title { font-size: 1.2rem; color: var(--navy); margin-right: auto; }
.content { padding: 26px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; }
.content > * { min-width: 0; }
.only-mobile { display: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .spacer { flex: 1; }
.toolbar .input { width: auto; min-width: 220px; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 1.02rem; color: var(--navy); }
.panel-head p { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.panel-body { padding: 20px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 4px; border-left: 4px solid var(--navy); }
.kpi span { color: var(--muted); font-size: .84rem; }
.kpi strong { font-size: 1.95rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi small { color: var(--muted); font-size: .78rem; }
.kpi.k-signal { border-left-color: var(--signal); }
.kpi.k-signal strong { color: var(--signal-hi); }
.kpi.k-ok { border-left-color: var(--ok-bright); }
.kpi.k-ok strong { color: var(--ok); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ok); font-weight: 600; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-bright); box-shadow: 0 0 0 0 rgba(26,179,148,.6); animation: latido 2s infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 8px rgba(26,179,148,0); } 100% { box-shadow: 0 0 0 0 rgba(26,179,148,0); } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 500; padding: 12px 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--signal); }
.tab-panel[hidden] { display: none; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 380px; }

/* Barras de resultado */
.res-camp { padding: 18px 20px; border-top: 1px solid var(--line); }
.res-camp:first-child { border-top: 0; }
.res-camp h3 { font-size: 1rem; color: var(--navy); }
.res-camp .meta { color: var(--muted); font-size: .82rem; margin: 4px 0 12px; }
.res-row { display: grid; grid-template-columns: minmax(140px, 260px) 1fr 110px; gap: 14px; align-items: center; padding: 6px 0; }
.res-name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-bar { height: 12px; border-radius: 99px; background: #e7ecf4; overflow: hidden; }
.res-bar i { display: block; height: 100%; border-radius: inherit; background: #7f9cd1; }
.res-row.lead .res-bar i { background: var(--signal); }
.res-row.lead .res-name { font-weight: 600; color: var(--ink); }
.res-num { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--ink); }
.res-num small { color: var(--muted); }

/* Tablas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
.t th, .t td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { color: var(--muted); font-weight: 600; font-size: .8rem; position: sticky; top: 0; background: var(--surface-2); cursor: pointer; user-select: none; white-space: nowrap; }
.t th[data-sort]::after { content: " ↕"; opacity: .35; }
.t th.asc::after { content: " ↑"; opacity: 1; }
.t th.desc::after { content: " ↓"; opacity: 1; }
.t tbody tr:hover { background: #f9fbfe; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t .thumb { width: 56px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.pill { white-space: nowrap; display: inline-block; font-size: .76rem; padding: 2px 9px; border-radius: 99px; background: #eef1f6; color: var(--muted); font-weight: 500; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.no { background: var(--err-soft); color: var(--err); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; color: var(--muted); font-size: .84rem; flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }

.prog { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.prog .barra { flex: 1; }

.drop { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px; text-align: center; color: var(--muted); background: var(--surface-2); }
.drop input { margin-top: 12px; }

.form-dlg { width: min(720px, 100% - 24px); }
.form-dlg .dlg-body { padding: 24px; }
.form-dlg h3 { margin-bottom: 18px; color: var(--navy); }
.form-dlg .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.img-prev { width: 100%; max-height: 220px; object-fit: contain; border-radius: var(--r); background: #edf1f7; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; gap: 24px; }
  .pf { grid-template-columns: 1fr; }
  .pf img { max-height: 46vh; min-height: 0; }
  .pub-top-in { flex-wrap: wrap; gap: 6px 12px; padding: 10px 0 0; min-height: 0; }
  .pub-nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 4px 12px; overflow-x: auto; border-top: 1px solid var(--line); }
  .pub-nav a { padding: 10px 12px; }
  .brand small { display: none; }
  .user-meta { display: none; }
  .user-chip, .pub-top-in > .btn { margin-left: auto; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(4,20,50,.45); }
  .only-mobile { display: inline-grid; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .topbar .user-chip { margin-left: 0; }
  .res-row { grid-template-columns: 1fr 90px; }
  .res-row .res-bar { grid-column: 1 / -1; grid-row: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .input, .toolbar select.input { min-width: 0; width: 100%; flex: 1 1 100%; }
  .toolbar .spacer { display: none; }
  .toolbar .btn-sm { flex: 1; }
}
@media (max-width: 520px) {
  body { font-size: 15px; }
  .brand img { height: 36px; }
  .brand strong { font-size: 1rem; }
  .hero-side { padding: 16px; }
  .cf { grid-template-columns: 1fr; padding: 20px; }
  .cf img { width: 110px; }
  .cf-actions .btn { flex: 1; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 1.45rem; }
  .campana-head { flex-direction: column; gap: 10px; }
  .reloj-num > span { padding: 10px 6px; }
  .afiches { gap: 16px; }
  .topbar-title { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* =========================================================
   TEMA CUL: azul rey + blanco + relleno naranja
   (inspirado en las piezas de campaña "Votaciones abiertas")
   ========================================================= */
:root {
  --royal: #0d3a8a;
  --royal-2: #082a66;
  --royal-deep: #051a45;
  --signal: #ff6a00;
  --signal-hi: #e85d00;
  --amber: #f6b334;
  --bg: #eef2f9;
  --grad: radial-gradient(120% 140% at 30% 20%, #10388a 0%, #0a2b6b 40%, #051a45 100%);
}
body { background: var(--bg); overflow-x: clip; }
.btn { border-radius: 999px; font-weight: 700; }
.btn-votar { box-shadow: 0 6px 16px rgba(255, 106, 0, .28); }
.btn-icon { border-radius: 12px; }

/* Puntos decorativos (motivo de las piezas CUL) */
.puntos { position: absolute; width: 74px; height: 46px; pointer-events: none;
  background-image: radial-gradient(circle, var(--amber) 2.2px, transparent 2.6px); background-size: 14px 14px; opacity: .9; }

/* Cabecera azul rey */
.pub-top { background: var(--royal-deep); border-top: 0; border-bottom: 4px solid var(--signal); box-shadow: 0 2px 10px rgba(4,20,60,.25); }
.pub-top .brand strong { color: #fff; }
.pub-top .brand small { color: #b8c8ea; }
.pub-nav a { color: #c9d6f2; }
.pub-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.pub-nav a.on { color: #fff; background: rgba(255,255,255,.14); }
.pub-top .user-meta strong { color: #fff; }
.pub-top .user-meta small { color: #b8c8ea; }
.pub-top .avatar { background: var(--signal); }
.pub-top .btn-icon { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.pub-top .btn-icon:hover { background: rgba(255,255,255,.1); }
.pub-top-in > .btn-ghost { --bg: var(--signal); --fg: #fff; --bd: var(--signal); }
.pub-top-in > .btn-ghost:hover { --bg: var(--signal-hi); --bd: var(--signal-hi); }

/* Hero a todo lo ancho con degradado azul rey */
.hero {
  position: relative; overflow: hidden;
  margin-inline: calc(50% - 50vw); padding: 56px calc(50vw - 50%) 64px;
  background: var(--grad); border-bottom: 0; color: #fff;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), 0 100%);
}
.hero::before, .hero::after { content: ""; position: absolute; width: 88px; height: 60px;
  background-image: radial-gradient(circle, var(--amber) 2.4px, transparent 2.8px); background-size: 15px 15px; }
.hero::before { left: max(16px, calc(50vw - 50% - 110px)); bottom: 46px; }
.hero::after { right: max(16px, calc(50vw - 50% - 110px)); top: 26px; }
.hero h1 { color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; font-size: clamp(2rem, 5vw, 3.4rem); }
.hero-sub { color: #d6e1f7; }
.hero-sub strong, .hero-fechas { color: var(--amber); }
.hero-fechas .i { color: var(--amber); }
.hero-side { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); box-shadow: none; backdrop-filter: blur(4px); }
.reloj-label { color: #d6e1f7; }
.reloj-num > span { background: #fff; color: var(--royal-2); box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.reloj-num small { color: var(--muted); }
.avance-top { color: #d6e1f7; }
.avance-top strong { color: #fff; }
.hero .barra { background: rgba(255,255,255,.18); }
.hero .barra i { background: var(--signal); }
.hero-cta .btn-votar { min-height: 56px; padding: 0 1.8em; font-size: 1.08rem; }

/* Índice y campañas */
.indice { padding-top: 26px; }
.indice a { background: #fff; border-color: #d3dcee; color: var(--royal-2); font-weight: 600; }
.indice a:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.campana-head h2 { color: var(--royal-2); padding-left: 14px; border-left: 5px solid var(--signal); font-weight: 800; }
.campana-meta { padding-left: 19px; }
.tag { background: #e3eafa; color: var(--royal); font-weight: 600; }
.estado-pend { background: var(--signal); color: #fff; }
.estado-ok { background: var(--ok-bright); color: #fff; }
.afiche { border-radius: 18px; border-color: #dbe3f2; }
.afiche-img { border-radius: 12px; background: linear-gradient(160deg, #e9effb, #dfe7f7); }

/* Pie */
.pub-foot { background: var(--royal-deep); border-top: 4px solid var(--signal); }

/* Login dividido (estilo portal institucional) */
.login { padding: 48px 0 24px; }
.login-split { display: grid; grid-template-columns: 1fr 1fr; width: min(940px, 100%); border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(8, 34, 87, .22); }
.login-brand { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 48px 42px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.login-brand img { width: 64px; height: auto; margin-bottom: 8px; }
.login-brand h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; }
.login-brand p { color: #d6e1f7; max-width: 34ch; }
.login-kicker { color: var(--amber) !important; font-weight: 700; font-size: .78rem; letter-spacing: .02em; }
.login-eleccion { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff !important; font-weight: 600; font-size: .9rem; border-left: 4px solid var(--signal); }
.puntos-a { right: 22px; top: 22px; }
.puntos-b { left: 24px; bottom: 22px; }
.login-card { width: auto; border: 0; border-top: 0; border-radius: 0; box-shadow: none; padding: 48px 42px; align-content: center; }
.login-card h1 { color: var(--royal-2); font-size: 1.6rem; font-weight: 800; }
.login-card .field input { min-height: 50px; border-radius: 12px; background: #f4f7fd; border-color: #d3dcee; }
.login-card .field input:focus { background: #fff; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(20,70,168,.15); }
.login-card .local { border-top: 1px solid var(--line); }

/* Administración: barra lateral azul rey, activo naranja */
.side { background: var(--grad); border-right: 0; border-top: 0; color: #fff; }
.side .brand strong { color: #fff; }
.side .brand small { color: #b8c8ea; }
.side-title { color: var(--amber); }
.side-nav a { color: #dbe5fa; }
.side-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.side-nav a.on { background: var(--signal); color: #fff; font-weight: 700; box-shadow: 0 6px 14px rgba(255,106,0,.3); }
.side-foot { border-top-color: rgba(255,255,255,.2); }
.side-foot a { color: #fff; }
.topbar { border-bottom: 3px solid var(--signal); }
.topbar-title { color: var(--royal-2); font-weight: 800; }
.topbar .avatar { background: var(--signal); }
.kpi { border-left: 0; border-top: 5px solid var(--royal); border-radius: 16px; }
.kpi.k-signal { background: var(--signal); border-top-color: var(--signal-hi); }
.kpi.k-signal span, .kpi.k-signal small, .kpi.k-signal strong { color: #fff; }
.kpi.k-ok { border-top-color: var(--ok-bright); }
.kpi strong { color: var(--royal-2); font-weight: 800; }
.tabs button[aria-selected="true"] { color: var(--royal-2); font-weight: 700; }
.panel-head h2, .res-camp h3 { color: var(--royal-2); font-weight: 700; }
.t th { background: #eef3fc; color: var(--royal-2); }
.side-nav a.on .i, .side-foot a .i { color: #fff; }

@media (max-width: 860px) {
  .hero { padding-top: 34px; padding-bottom: 50px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), 0 100%); }
  .hero::before, .hero::after { display: none; }
  .pub-nav { border-top-color: rgba(255,255,255,.12); }
  .login-split { grid-template-columns: 1fr; border-radius: 18px; }
  .login-brand { padding: 30px 24px; }
  .login-brand h2 { font-size: 1.7rem; }
  .login-card { padding: 28px 22px; }
  .side { background: var(--royal-2); }
}
@media print {
  .hero { clip-path: none; background: #fff !important; color: #000; }
  .kpi.k-signal { background: #fff; }
  .kpi.k-signal span, .kpi.k-signal small, .kpi.k-signal strong { color: #042358; }
}


/* Logo oficial CUL (versión letra blanca) */
.logo-cul { width: auto; height: 52px; }
.pub-top .brand img.logo-cul { height: 50px; }
.brand-sep { width: 1px; height: 34px; background: rgba(255,255,255,.35); margin: 0 4px; }
.brand-app { color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; }
.side .brand { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 10px 18px; }
.side .brand img.logo-cul { height: 62px; }
.brand-sub { color: var(--amber); font-size: .74rem; font-weight: 700; }
.login-brand img.login-logo-cul { width: 170px; height: auto; margin-bottom: 10px; }
.logo-foot { height: 44px; width: auto; }
.pub-foot .wrap { align-items: center; }
@media (max-width: 520px) {
  .pub-top .brand img.logo-cul { height: 40px; }
  .pub-top .brand-sep, .pub-top .brand-app { display: none; }
  .pub-top-in > .btn-ghost { min-height: 38px; padding: 0 1em; font-size: .88rem; }
  .pub-foot .wrap { flex-direction: column; align-items: flex-start; }
  .login-brand img.login-logo-cul { width: 140px; }
}


/* Candidato sin afiche: se muestra el nombre sobre la silueta */
.sin-afiche { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: linear-gradient(transparent, rgba(5,26,69,.92) 45%); color: #fff; }
.sin-afiche strong { font-size: 1.08rem; font-weight: 800; line-height: 1.25; }
.sin-afiche small { color: #d6e1f7; font-size: .82rem; }

/* ---------- Impresión / PDF ---------- */
@media print {
  body { background: #fff !important; font-size: 11pt; }
  .side, .topbar, .toolbar, .tabs, .pub-top, .pub-foot, .toast-zone, .no-print, .btn, .btn-icon { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .panel, .kpi { box-shadow: none; break-inside: avoid; }
  .tab-panel[hidden] { display: block !important; }
  .res-bar i, .barra i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { display: block !important; }
}
.print-head { display: none; margin-bottom: 16px; }
