:root {
  color-scheme: light;
  --bg: #f4f4f2; --surface: #fcfcfb; --surface-2: #f0efec; --line: #e2e1dc;
  --text: #0b0b0b; --text-2: #52514e; --text-3: #7a7974;
  --accent: #2a78d6; --accent-ink: #fff;
  --good: #0a7d0a; --warn: #9a6700; --warn-bg: #fff4d6; --bad: #c62828; --bad-bg: #fde8e8; --info-bg: #e7f0fb;
  --male: #0891c9; --female: #e64c9b;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #232321; --line: #33332f;
    --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
    --accent: #3987e5; --male: #5cc8f5; --female: #f28cc0; --good: #3fbf3f; --warn: #f0b43c; --warn-bg: #3a2f12; --bad: #ff6b6b; --bad-bg: #3d1a1a; --info-bg: #182638;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #232321; --line: #33332f;
  --text: #f0efec; --text-2: #c3c2b7; --text-3: #8f8e86;
  --accent: #3987e5; --male: #5cc8f5; --female: #f28cc0; --good: #3fbf3f; --warn: #f0b43c; --warn-bg: #3a2f12; --bad: #ff6b6b; --bad-bg: #3d1a1a; --info-bg: #182638;
  --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* barra superior */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px 6px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; background: var(--accent); }
.brand-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-t b { font-size: 1.02rem; white-space: nowrap; }
.brand-t small { color: var(--text-2); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.net { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .78rem; color: var(--text); padding: 5px 10px 5px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; cursor: default; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.net.off::before { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 25%, transparent); }
.net.pend { background: var(--warn-bg); border-color: transparent; cursor: pointer; }
.net-p { font-weight: 700; color: var(--warn); }
.net-p::before { content: "· "; color: var(--text-3); font-weight: 400; }
.user-menu { position: relative; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem; letter-spacing: .02em; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #6250d6)); display: grid; place-items: center; }
.avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; max-width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; z-index: 30; }
.menu-h { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-h span { color: var(--text-2); font-size: .85rem; }
.menu-it { width: 100%; text-align: left; font: inherit; color: var(--bad); background: none; border: 0; border-radius: 8px; padding: 10px; cursor: pointer; }
.menu-it:hover { background: var(--surface-2); }
.tabs { max-width: 1200px; margin: 0 auto; display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 11px; text-decoration: none; color: var(--text-2); white-space: nowrap; font-size: .92rem; font-weight: 500; border-radius: 8px 8px 0 0; }
.tabs a .ic { opacity: .8; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent); font-weight: 600; }
.tabs a.on .ic { opacity: 1; }
.tabs a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tabs.pocas a { flex: 1; justify-content: center; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 20px; }
/* tarjeta de avance */
.avance { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.avance-n { font-variant-numeric: tabular-nums; line-height: 1; }
.avance-n b { font-size: 1.6rem; }
.avance-n span { color: var(--text-2); font-size: .95rem; }
.avance-t { display: grid; gap: 6px; font-size: .82rem; color: var(--text-2); min-width: 0; }
.avance-t .prog { height: 8px; }
.avance-p { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.avance-p small { font-size: .7em; margin-left: 1px; }

main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi span { color: var(--text-2); font-size: .82rem; }

/* formularios */
label { display: block; font-size: .85rem; color: var(--text-2); margin: 0 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type=checkbox] { width: auto; min-height: 0; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.field { margin-bottom: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 10px 16px; min-height: 44px; cursor: pointer; text-decoration: none; }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.bad { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* registro de actas */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; border-radius: 99px; cursor: pointer; font: inherit; font-size: .88rem; color: var(--text); min-height: 40px; }
.chip.on { background: var(--accent); color: #fff; border-color: transparent; }
.chip .ok { margin-left: 4px; }
/* ---------- registrar acta ---------- */
.ctx { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ctx-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ctx-txt b { font-size: 1.25rem; }
.sel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sel-h h2 { flex: 1; }
.rc-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin-bottom: 16px; }
.rc { text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.rc.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--info-bg); }
.rc-n { font-weight: 600; }
.rc-m { font-size: .8rem; color: var(--text-2); }
.rc-p { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 4px; }
.jt-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.jt-head h3 { flex: 1; min-width: 0; }
.tog { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-2); margin: 0; cursor: pointer; }
.tog input { width: 18px; height: 18px; }
.jt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.jt { position: relative; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px 8px; min-height: 64px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.jt b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.jt span { font-size: .72rem; color: var(--text-2); margin-top: 2px; }
.jt i { position: absolute; top: 4px; right: 5px; font-style: normal; font-size: .7rem; font-weight: 700; }
.jt.vacia { border-style: dashed; }
.jt.parcial { background: var(--warn-bg); border-color: transparent; }
.jt.parcial i { color: var(--warn); }
.jt.ok { background: var(--info-bg); border-color: transparent; }
.jt.ok i { color: var(--good); }
.jt.aviso { background: var(--bad-bg); border-color: transparent; }
.jt.aviso i { color: var(--bad); }
.jt.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.jt:active, .rc:active, .dg:active { transform: scale(.97); }
.jt-ley { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.jt-ley span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.lg.vacia { border-style: dashed; } .lg.parcial { background: var(--warn-bg); } .lg.ok { background: var(--info-bg); } .lg.aviso { background: var(--bad-bg); }
.dg-tabs { display: flex; gap: 6px; margin: 14px 0 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dg-tabs::-webkit-scrollbar { display: none; }
.dg { flex: 1 0 auto; min-width: 120px; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.dg span { font-weight: 600; white-space: nowrap; }
.dg small { font-size: .75rem; color: var(--text-2); white-space: nowrap; }
.dg.on { background: var(--accent); border-color: transparent; color: #fff; }
.dg.on small { color: rgba(255,255,255,.85); }
.dg.e-ok:not(.on) small { color: var(--good); }
.dg.e-nov:not(.on) small, .dg.e-conf:not(.on) small, .dg.e-err:not(.on) small, .dg.e-anul:not(.on) small { color: var(--bad); }
.dg.e-pend:not(.on) small { color: var(--warn); }
.flash { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--info-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; animation: aparece .3s ease; }
.flash > div { flex: 1; min-width: 180px; }
.flash-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
@keyframes aparece { from { opacity: 0; transform: translateY(-4px); } }
.modo { margin-bottom: 12px; border-left: 4px solid var(--warn); }
.modo.verif { border-left-color: var(--accent); }
.modo p { margin: 4px 0 10px; }
.modo.verif p { margin-bottom: 0; }
.req { color: var(--bad); font-size: .75rem; }
.reg-form { display: grid; gap: 12px; }
.reg-datos { padding: 12px 14px 6px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.sec-h h3 { flex: 1; }
.opt { display: grid; grid-template-columns: 5px 42px minmax(0, 1fr) 104px; gap: 10px; align-items: center; padding: 8px 6px; margin: 0 -6px; border-bottom: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: inherit; cursor: text; }
.opt:focus-within { background: var(--info-bg); border-bottom-color: transparent; }
.opt .sw { width: 5px; height: 34px; border-radius: 3px; }
.opt img, .opt .ph { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--text-2); }
.opt .nm { min-width: 0; display: flex; flex-direction: column; }
.opt .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .nm > span { color: var(--text-2); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt.tot { grid-template-columns: minmax(0, 1fr) 104px; }
.opt.suf { background: var(--surface-2); border-bottom: 0; margin-top: 6px; }
.opt.suf:focus-within { background: var(--info-bg); }
input.nv { text-align: right; font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 12px; min-height: 48px; }
input.nv.vacio { border-style: dashed; }
input.nv::placeholder { color: var(--text-3); font-weight: 400; }
.obs { margin: 10px 0 8px; }
.obs summary { cursor: pointer; color: var(--accent); font-size: .9rem; padding: 6px 0; }
.obs textarea { margin-top: 6px; }
.foto-vacia { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; border: 2px dashed var(--line); background: var(--surface); padding: 22px 16px; cursor: pointer; margin: 0; min-height: 150px; }
.foto-vacia.oblig { border-color: var(--warn); }
.foto-vacia .cam { font-size: 2.2rem; line-height: 1; }
.foto-vacia b { color: var(--text); font-size: 1.05rem; }
.foto-vacia:hover { border-color: var(--accent); }
.reg-foto.drop .foto-vacia, .reg-foto.drop .foto-card { outline: 3px dashed var(--accent); }
.solo-pc { display: none; }
.foto-card { padding: 12px; }
.foto-main { position: relative; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.foto-main img { display: block; width: 100%; max-height: 260px; object-fit: contain; cursor: zoom-in; }
.foto-main .x { position: absolute; top: 8px; right: 8px; border: 0; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; padding: 4px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.foto-strip { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.ft { flex: none; width: 52px; height: 64px; border-radius: 6px; border: 2px solid transparent; padding: 0; overflow: hidden; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; font-size: 1.4rem; color: var(--text-2); margin: 0; }
.ft img { width: 100%; height: 100%; object-fit: cover; }
.ft.on { border-color: var(--accent); }
.ft.add { border: 2px dashed var(--line); }
.reg-bar { position: sticky; bottom: 0; z-index: 15; margin: 14px -16px -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.bar-in { display: flex; align-items: center; gap: 10px; max-width: 1200px; margin: 0 auto; }
.bar-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bar-st { font-size: .92rem; }
.bar-st.ok { color: var(--good); }
.bar-st.bad { color: var(--bad); }
.bar-st.warn { color: var(--warn); }
.bar-in .btn { flex: none; min-height: 48px; padding: 10px 18px; }
.bar-avisos { max-width: 1200px; margin: 0 auto 8px; background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
.bar-avisos ul { margin: 4px 0 0; padding-left: 18px; }
.btn.warnb { background: var(--warn); color: var(--bg); border-color: transparent; }
.ficha { display: grid; gap: 10px; }
.ficha-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ficha-num { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 0 18px; font-size: .92rem; }
.ficha-num > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ficha-num b { font-variant-numeric: tabular-nums; }
.ficha-num .tot b { font-size: 1.05rem; }
.ficha-num .ok b { color: var(--good); }
.ficha-num .bad b { color: var(--bad); }
@media (min-width: 960px) {
  .reg-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
  .reg-foto { position: sticky; top: 110px; }
  .foto-main img { max-height: calc(100vh - 330px); min-height: 320px; }
  .foto-vacia { min-height: 420px; }
  .solo-pc { display: block; }
}
@media (max-width: 600px) {
  .reg-bar { margin: 12px -12px -12px; padding-left: 12px; padding-right: 12px; }
  .opt { grid-template-columns: 4px 36px minmax(0, 1fr) 92px; gap: 8px; }
  .opt img, .opt .ph { width: 36px; height: 36px; }
  .opt.tot { grid-template-columns: minmax(0, 1fr) 92px; }
  .bar-in .btn { padding: 10px 14px; }
  .ctx-txt b { font-size: 1.1rem; }
  .foto-main img { max-height: 190px; }
  .foto-vacia { min-height: 120px; padding: 16px; }
}
.check { padding: 10px 12px; border-radius: 8px; margin: 12px 0; font-size: .92rem; }
.check.ok { background: var(--info-bg); }
.check.warn { background: var(--warn-bg); }
.check.bad { background: var(--bad-bg); color: var(--bad); }
.fotos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.fotos .th { position: relative; }
.fotos img { width: 92px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.fotos .x { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; cursor: pointer; font-size: 14px; }
.exist { background: var(--info-bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }

/* tablas */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: .8rem; white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.st { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.st.valida { background: var(--info-bg); color: var(--accent); }
.st.novedad { background: var(--warn-bg); color: var(--warn); }
.st.anulada { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.st.conflicto { background: var(--bad-bg); color: var(--bad); }
.st.pendiente { background: var(--warn-bg); color: var(--warn); }
.st.sin_acta { background: var(--surface-2); color: var(--text-3); }

/* gráficos */
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: end; }
.bar .lb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar .lb img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.bar .lb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .lb small { color: var(--text-2); white-space: nowrap; }
.bar .vl { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bar .vl b { font-size: 1.05rem; }
.bar .tr { grid-column: 1 / -1; height: 12px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.bar .fl { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; transition: width .6s ease; }
.bar.win .lb b::after { content: " ✓"; color: var(--good); }
.seats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 6px 0 12px; }
.seat { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.prog { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.prog > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: .8rem; max-width: 260px; }
svg text { fill: var(--text-2); font-size: 11px; font-family: inherit; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.modal .box { background: var(--surface); border-radius: 12px; width: 100%; max-width: 860px; padding: 18px; margin: auto 0; }
.modal .box.wide { max-width: 1100px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 4px 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline li.op-anular::before, .timeline li.op-conflicto::before { background: var(--bad); }
.timeline li.op-corregir::before { background: var(--warn); }
.foto-full { max-width: 100%; border-radius: 8px; display: block; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.login { max-width: 380px; margin: 8vh auto; }
.tree details { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--surface); }
.tree summary { padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tree .in { padding: 0 12px 12px; }
.off { opacity: .55; }
.checks { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.checks fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.checks legend { font-weight: 600; font-size: .85rem; color: var(--text-2); padding: 0; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.checks label { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .92rem; padding: 6px 0; margin: 0; cursor: pointer; }
.checks input { width: 18px; height: 18px; }
pre.json { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow: auto; font-size: .8rem; max-height: 300px; }

@media (max-width: 600px) {
  main { padding: 12px; }
  .card { padding: 12px; }
  .top-in { padding: 8px 12px 4px; gap: 8px; }
  .brand .logo { width: 32px; height: 32px; }
  .net { padding: 5px 8px; }
  .net.pend .net-t { display: none; }
  .net.pend .net-p::before { content: none; }
  .tabs { padding: 0 8px; }
  .tabs a { padding: 9px 10px 10px; font-size: .88rem; }
  .seat { width: 38px; height: 38px; }
}

/* pictogramas hombre / mujer */
.sx { display: inline-block; vertical-align: -0.2em; flex: none; }
.sx.m { color: var(--male); }
.sx.f { color: var(--female); }
.sx-par { display: inline-flex; gap: 0; vertical-align: -0.2em; }
.jt .jt-sx { margin-top: 2px; line-height: 0; }
.jn { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
td.nw { white-space: nowrap; }
/* fotos de candidatos en el acta */
.av { position: relative; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); cursor: zoom-in; flex: none; }
.av img, .av .ph { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--text-2); }
.av:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.av-n { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.opt[data-fila] { cursor: text; }
.ficha-num .fn { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ficha-num .fn img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; cursor: zoom-in; flex: none; }
/* ventana grande del candidato */
.lb-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lb-h .sw { width: 6px; align-self: stretch; border-radius: 3px; }
.lb-t { flex: 1; min-width: 0; }
.lb-img { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto; border-radius: 12px; object-fit: contain; cursor: zoom-in; background: var(--surface-2); }
.lb-ph { display: grid; place-items: center; height: 200px; border-radius: 12px; background: var(--surface-2); color: var(--text-3); }
.lb-ph.sm { height: auto; aspect-ratio: 1; font-size: 1.6rem; }
.lb-cap { text-align: center; margin-top: 8px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.lb-grid figure { margin: 0; text-align: center; }
.lb-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--surface-2); }
.lb-grid figcaption { font-size: .85rem; margin-top: 4px; }
/* subir fotos en la configuración */
.fc { display: flex; align-items: center; gap: 6px; }
.fc img, .fc-ph { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.fc-ph { display: grid; place-items: center; font-size: .6rem; color: var(--text-3); border: 1px dashed var(--line); }
.cl-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.cl-row { display: grid; grid-template-columns: 28px auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .av, .av img, .av .ph { width: 36px; height: 36px; }
  .cl-row { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
  .cl-row .fc { grid-column: 2 / -1; grid-row: 2; }
}

/* voto en blanco / nulo */
.vi { display: block; flex: none; }
.av-i { width: 42px; height: 42px; display: grid; place-items: center; }
.ficha-num .fn .vi { width: 26px; height: 26px; }
@media (max-width: 600px) { .av-i, .av-i .vi { width: 36px; height: 36px; } }

/* logos de las listas */
.av.logo, .av.logo img { background: #fff; }
.av.logo img { object-fit: contain; padding: 3px; }
.bar .lb img.logo { background: #fff; object-fit: contain; padding: 2px; }
.lb-logo { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; flex: none; }
.lb-img.logo { background: #fff; max-height: 220px; padding: 12px; }
.lb-grid .sup { display: block; color: var(--text-2); font-size: .78rem; margin-top: 2px; }
.lb-ph.sm { font-size: .8rem; }
.mini-logo { width: 22px; height: 22px; object-fit: contain; background: #fff; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.cl-n { display: grid; gap: 4px; min-width: 0; }
.cl-n input.small { min-height: 34px; padding: 6px 10px; font-size: .85rem; }

/* =========================================================
   Pasada de diseño general
   ========================================================= */
body { background: radial-gradient(1200px 400px at 50% -200px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
main { padding-bottom: 32px; }
.card { border-radius: 14px; }
.card-h h2 { font-size: 1.05rem; }
.btn { transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.btn.pri:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .jt:focus-visible, .rc:focus-visible, .dg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn .ic, .btn svg { flex: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* encabezado de página */
.page-h { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin: 4px 0 14px; }
.page-t { flex: 1; min-width: 220px; }
.page-h h1 { font-size: 1.4rem; letter-spacing: -.01em; }
.page-h p { margin: 4px 0 0; color: var(--text-2); font-size: .9rem; }
.page-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.vivo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bad); background: var(--bad-bg); border-radius: 99px; padding: 2px 9px; margin-right: 4px; }
.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulso 1.6s infinite; }
@keyframes pulso { 50% { opacity: .25; } }

/* indicadores */
.kpis { gap: 12px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; }
.kpi-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.kpi-b { min-width: 0; flex: 1; display: grid; gap: 2px; }
.kpi b { font-size: 1.45rem; }
.kpi b small { color: var(--text-3); font-weight: 400; }
.kpi .prog { margin-top: 6px; }
.kpi.pri .kpi-ic { background: var(--info-bg); color: var(--accent); }
.kpi.warn .kpi-ic { background: var(--warn-bg); color: var(--warn); }
.kpi.warn b { color: var(--warn); }
.kpi.bad .kpi-ic { background: var(--bad-bg); color: var(--bad); }
.kpi.bad b { color: var(--bad); }
.kpi-link { text-decoration: none; color: inherit; display: block; }
.kpi-link .kpi { height: 100%; transition: border-color .15s; }
.kpi-link:hover .kpi { border-color: var(--accent); }

/* tablas */
.tbl-wrap { border: 1px solid var(--line); border-radius: 12px; }
table { font-size: .9rem; }
thead th { background: var(--surface-2); position: sticky; top: 0; z-index: 1; text-transform: uppercase; letter-spacing: .03em; font-size: .72rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.filtros { margin-bottom: 4px; }
.lista-n { margin: 12px 0 8px; }
@media (max-width: 700px) {
  table.resp, table.resp tbody { display: block; }
  table.resp thead { display: none; }
  .tbl-wrap:has(table.resp) { border: 0; overflow: visible; }
  table.resp tr { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  table.resp tr.click:active { background: var(--surface-2); }
  table.resp td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 0; border: 0; text-align: right; background: none !important; }
  table.resp td::before { content: attr(data-l); color: var(--text-2); font-size: .78rem; text-align: left; font-weight: 500; }
  table.resp td.t-main { font-size: 1.02rem; font-weight: 600; justify-content: flex-start; text-align: left; padding-bottom: 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
  table.resp td.t-main::before, table.resp td.t-acc::before { content: none; }
  table.resp td.t-acc { justify-content: flex-start; flex-wrap: wrap; padding-top: 6px; }
  table.resp td.det { display: block; text-align: left; word-break: break-word; }
  table.resp td.det::before { display: block; }
}

/* actas por enviar */
.pend-card { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.pend-list { display: grid; gap: 8px; }
.pend-it { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); }
.pend-it.err { background: var(--bad-bg); }
.pend-t { flex: 1; min-width: 200px; display: grid; gap: 2px; }

/* vacío */
.vacio { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 16px; color: var(--text-3); }
.vacio b { color: var(--text); font-size: 1rem; }
.vacio span { font-size: .88rem; }

/* usuarios y auditoría */
.u-cel { display: flex; align-items: center; gap: 10px; }
.u-cel > div { display: grid; text-align: left; }
.u-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; background: var(--text-3); flex: none; }
.u-av.r-admin { background: #6250d6; } .u-av.r-supervisor { background: #1baf7a; } .u-av.r-digitador { background: var(--accent); }
.rol { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); }
.rol.r-admin { color: #6250d6; background: color-mix(in srgb, #6250d6 15%, transparent); }
.rol.r-supervisor { color: #148a60; background: color-mix(in srgb, #1baf7a 16%, transparent); }
.rol.r-digitador { color: var(--accent); background: var(--info-bg); }
.ev { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--surface-2); }
.ev.ok { background: var(--info-bg); color: var(--good); } .ev.warn { background: var(--warn-bg); color: var(--warn); } .ev.bad { background: var(--bad-bg); color: var(--bad); }

/* ventanas */
body.con-modal { overflow: hidden; }
.modal { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fundido .18s ease; }
.modal .box { position: relative; border-radius: 16px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 1px solid var(--line); animation: sube .22s ease; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.modal-x:hover { color: var(--text); background: var(--line); }
.modal-t { font-size: 1.2rem; margin: 0 44px 14px 0; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 0 44px 14px 0; }
.modal-head .modal-t { margin: 0; flex: 1; }
.lb-h { margin-right: 44px; }
@keyframes fundido { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(14px); opacity: 0; } }
@media (max-width: 600px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal .box { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); margin: 0; }
  .modal .box::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -6px auto 12px; }
  .modal-x { top: 10px; right: 10px; }
  .page-h h1 { font-size: 1.22rem; }
}

/* toast */
.toast { border-radius: 12px; padding: 12px 18px; font-size: .92rem; bottom: calc(24px + env(safe-area-inset-bottom)); animation: sube .2s ease; }
body:has(.reg-bar) .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- ingreso ---------- */
.auth { min-height: calc(100vh - 32px); display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px 0; }
.auth-card { width: min(400px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px 26px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.18); text-align: center; }
.auth-logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #6250d6)); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.auth-card h1 { font-size: 1.55rem; letter-spacing: -.01em; }
.auth-sub { color: var(--text-2); font-size: .9rem; margin: 6px 0 22px; }
.auth-card form { text-align: left; display: grid; gap: 14px; }
.fld label { font-weight: 600; color: var(--text); font-size: .88rem; margin-bottom: 6px; }
.inp-ic { position: relative; }
.inp-ic > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.inp-ic input { padding-left: 42px; min-height: 50px; font-size: 1rem; border-radius: 12px; }
.inp-ic input[type=password], .inp-ic input#lp { padding-right: 48px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.eye:hover { color: var(--text); background: var(--surface-2); }
.caps { display: flex; align-items: center; gap: 6px; color: var(--warn); margin-top: 6px; font-size: .8rem; }
.caps .ic { width: 15px; height: 15px; }
.auth-err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.btn-lg { width: 100%; min-height: 52px; font-size: 1.02rem; border-radius: 12px; margin-top: 4px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.shake { animation: tiembla .35s ease; }
@keyframes tiembla { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem; }
.auth-foot a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; }
.auth-foot a .ic { width: 18px; height: 18px; }
.auth-net { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.auth-net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.auth-net.off::before { background: var(--bad); }
.auth-legal { color: var(--text-3); font-size: .78rem; text-align: center; max-width: 360px; margin: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

@media (max-width: 700px) {
  table.resp td.t-min { display: none; }
  .filtros { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .filtros label { font-size: .72rem; margin-bottom: 2px; }
  .filtros select { min-height: 40px; padding: 6px 8px; font-size: .85rem; }
  .page-acc { width: 100%; }
}
@media (max-width: 700px) {
  .card:has(> .tbl-wrap > table.resp) { background: none; border: 0; box-shadow: none; padding: 0; }
}

/* ---------- menú lateral deslizable ---------- */
.hamb { width: 42px; height: 42px; margin-left: -6px; border: 0; border-radius: 10px; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.hamb:hover { background: var(--surface-2); }
.side { position: fixed; z-index: 35; top: 0; bottom: 0; left: 0; width: min(290px, 84vw); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); padding-top: env(safe-area-inset-top); box-shadow: 8px 0 30px rgba(0,0,0,.25); }
body.side-open .side { transform: none; }
.side-bg { position: fixed; inset: 0; z-index: 34; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); animation: fundido .2s ease; }
.side-h { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.side-h .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--accent); flex: none; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px; display: grid; align-content: start; gap: 14px; }
.side-g { display: grid; gap: 2px; }
.side-gt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 4px 12px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 500; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.on { background: var(--info-bg); color: var(--accent); font-weight: 600; }
.side-nav a .badge { margin-left: auto; }
.side-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.side-f { border-top: 1px solid var(--line); padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 6px; }
.side-u { display: flex; align-items: center; gap: 10px; padding: 4px; }
.side-u > div { display: grid; min-width: 0; }
.side-tv { padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: .9rem; }
.side-tv:hover { background: var(--surface-2); }
.top-in { padding-top: 8px; padding-bottom: 8px; }
@media (min-width: 1024px) {
  .hamb { display: none; }
  .side { transform: none; box-shadow: none; z-index: 21; }
  .side-bg { display: none; }
  body:has(#side:not(.hidden)) { padding-left: 260px; }
  .side { width: 260px; }
  .top .brand .logo { display: none; }
}
