@font-face { font-family: 'Sora'; src: url('fuentes/sora.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --acento: #5B2A86; --acento-osc: #45206A; --acento-suave: #EFE8F7;
  --fondo: #F6F4FB; --blanco: #FFFFFF; --tinta: #1E1B2E; --gris: #6B6680;
  --borde: #E2DEEE; --vacio: #D9D5E6; --ok: #0F7A4A; --ok-suave: #E4F4EC;
  --mal: #B42318; --mal-suave: #FDECEA; --ambar: #8A5A00; --ambar-suave: #FFF4D6;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fondo); color: var(--tinta);
  font-family: 'Sora', system-ui, sans-serif; font-size: 15px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

#app {
  max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto;
  background: var(--blanco); display: flex; flex-direction: column;
}
@media (min-width: 520px) { #app { border-left: 1px solid var(--borde); border-right: 1px solid var(--borde); } }

.pantalla { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.pie { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.pie-fijo { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--blanco) 22%); padding-bottom: 4px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; padding-top: 18px; }

/* cabecera */
.cab { display: flex; align-items: center; gap: 12px; }
.cab .txt { flex: 1; min-width: 0; }
.cab .pre { font-size: 12px; color: var(--gris); }
.cab h1 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.2; }
.redondo { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid var(--borde); background: var(--blanco); display: grid; place-items: center; }
.chip { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: var(--fondo); color: var(--gris); white-space: nowrap; }
.chip.ok { background: var(--ok-suave); color: var(--ok); }
.chip.amb { background: var(--ambar-suave); color: var(--ambar); }

/* tarjetas y botones */
.caja { background: var(--fondo); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.caja.centro { align-items: center; text-align: center; }
.caja h2 { margin: 0; font-size: 15px; font-weight: 700; }
.nota { font-size: 12px; color: var(--gris); }
.nota.centro { text-align: center; }
.btn { height: 56px; border-radius: 18px; border: 0; background: var(--acento); color: #fff; font-size: 16px; font-weight: 700; padding: 0 18px; }
.btn:active { background: var(--acento-osc); }
.btn[disabled] { background: var(--vacio); color: #fff; cursor: not-allowed; }
.btn.sec { background: var(--blanco); color: var(--tinta); border: 1.5px solid var(--borde); }
.btn.peq { height: 44px; font-size: 14px; border-radius: 14px; }
.enlace { background: none; border: 0; color: var(--acento); font-weight: 600; padding: 10px; text-decoration: underline; text-underline-offset: 3px; }
.fila-btn { display: flex; gap: 10px; }
.fila-btn > * { flex: 1; }

/* aviso de modo prueba y cola */
.banda { margin: 0; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.banda.prueba { background: var(--ambar-suave); color: var(--ambar); }
.banda.cola { background: var(--acento-suave); color: var(--acento); }
.banda.info { background: var(--fondo); color: var(--gris); font-weight: 500; }
.banda .enlace { padding: 0; margin-left: auto; color: inherit; }

/* login */
.login { justify-content: center; gap: 20px; }
.login h1 { margin: 0; font-size: 26px; font-weight: 800; text-align: center; line-height: 1.15; }
.login .sub { margin: -10px 0 4px; text-align: center; color: var(--gris); }
.logo { display: flex; justify-content: center; }
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--gris); }
.campo-pw { position: relative; }
.campo input, .num input, select {
  width: 100%; height: 54px; border-radius: 14px; border: 1.5px solid var(--borde); background: var(--blanco);
  padding: 0 14px; font-size: 17px; font-weight: 600; color: var(--tinta);
}
.campo-pw input { padding-right: 56px; }
.campo-pw button { position: absolute; right: 6px; top: 6px; height: 42px; width: 44px; border: 0; background: none; color: var(--gris); border-radius: 10px; }
input:focus, select:focus { border-color: var(--acento); outline: none; box-shadow: 0 0 0 3px var(--acento-suave); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--tinta); font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--acento); }
.error { color: var(--mal); background: var(--mal-suave); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin: 0; }

/* lista de sucursales */
.lista { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 16px; border-radius: 18px; border: 1.5px solid var(--borde); background: var(--blanco);
}
.item .txt { flex: 1; min-width: 0; }
.item strong { display: block; font-size: 16px; }
.item span.nota { display: block; margin-top: 2px; }
.item .flecha { color: var(--gris); }
.item.hecho { background: var(--fondo); }

/* sindicatos (1 puesto) */
.ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.op {
  height: 64px; border-radius: 18px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--blanco); border: 1.5px solid var(--borde); font-size: 16px; font-weight: 700; text-align: left;
}
.op[aria-checked="true"] { background: var(--fondo); border: 2px solid var(--acento); padding: 0 15.5px; }
.op .punto { width: 14px; height: 14px; }
.punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.op .marca { margin-left: auto; color: var(--acento); }

/* 3 puestos */
.delegados { display: flex; flex-direction: column; gap: 12px; }
.del { display: flex; align-items: center; gap: 12px; }
.del .n { width: 36px; height: 36px; border-radius: 50%; background: var(--fondo); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.del select { flex: 1; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B6680' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.resumen { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font-size: 14px; }
.resumen span { display: flex; align-items: center; gap: 6px; }

/* votos */
.votos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.num { background: var(--blanco); border: 1.5px solid var(--borde); border-radius: 18px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.num::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--color, var(--vacio)); }
.num label { font-size: 13px; font-weight: 700; color: var(--gris); display: flex; justify-content: space-between; gap: 6px; }
.num label small { font-weight: 600; }
.num input { height: 48px; font-size: 22px; font-weight: 800; text-align: right; border-radius: 12px; }
.num.ancho { grid-column: 1 / -1; }
.cuadre { display: flex; justify-content: space-between; align-items: center; border-radius: 16px; padding: 14px 16px; background: var(--fondo); }
.cuadre .grande { font-size: 22px; font-weight: 800; }
.cuadre.ok { background: var(--ok-suave); }
.cuadre.ok .estado { color: var(--ok); }
.cuadre.mal { background: var(--mal-suave); }
.cuadre.mal .estado { color: var(--mal); }
.estado { font-weight: 700; font-size: 14px; text-align: right; }
.titulo-sec { margin: 6px 0 -4px; font-size: 13px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .04em; }

/* mesas */
.mesas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mesa { min-height: 76px; border-radius: 18px; border: 1.5px solid var(--borde); background: var(--blanco); padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left; gap: 6px; }
.mesa strong { font-size: 16px; }
.mesa.hecha { background: var(--fondo); }
.mesa .chip { padding: 4px 8px; }

/* barra de progreso */
.barra { height: 10px; border-radius: 5px; background: var(--borde); overflow: hidden; }
.barra > div { height: 100%; background: var(--acento); border-radius: 5px; }

/* hecho */
.hecho-ico { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 8px auto 0; background: var(--ok-suave); color: var(--ok); }
.hecho-ico.amb { background: var(--ambar-suave); color: var(--ambar); }
.hecho h1 { text-align: center; margin: 0; font-size: 24px; font-weight: 800; }
.hecho .sub { text-align: center; color: var(--gris); margin: -8px 0 0; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla td { padding: 7px 0; border-bottom: 1px solid var(--borde); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td:last-child { text-align: right; font-weight: 700; }
.tabla td:first-child { display: flex; align-items: center; gap: 8px; }

/* hoja inferior (confirmar) */
.hoja-fondo { position: fixed; inset: 0; background: rgba(30, 27, 46, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.hoja-fondo[hidden] { display: none; }
.hoja { width: 100%; max-width: 480px; background: var(--blanco); border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow: auto; animation: sube .18s ease-out; }
.hoja h2 { margin: 0; font-size: 20px; font-weight: 800; }
@keyframes sube { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }

.aviso { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); }
.aviso[hidden] { display: none; }

.girando { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: gira .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes gira { to { transform: rotate(360deg); } }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* foto del acta */
.foto-vacia { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed #CFC9DE; border-radius: 18px; background: var(--blanco); color: var(--acento); cursor: pointer; }
.foto-vacia > span { display: flex; flex-direction: column; color: var(--tinta); }
.foto-vacia strong { font-size: 15px; }
.foto-vacia:active { background: var(--fondo); }
.foto-lista { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: var(--ok-suave); }
.foto-lista img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; }
.foto-lista .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.foto-lista .enlace { color: var(--mal); }
.foto-conf { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 600; color: var(--ok); }
.foto-conf img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.foto-ok { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--ok); }
.foto-ok svg { width: 20px; height: 20px; }
.girando.osc { border-color: var(--borde); border-top-color: var(--acento); }
.foto { display: flex; flex-direction: column; gap: 8px; }
.foto-tit { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.foto-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foto-btns .foto-vacia { justify-content: center; gap: 10px; padding: 14px 10px; }
.foto-btns .foto-vacia strong { color: var(--tinta); font-size: 15px; }

/* varias fotos y observaciones */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.mini { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--fondo); }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(30,27,46,.75); color: #fff; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.foto-vacia.cargando { justify-content: center; color: var(--tinta); }
.obs { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--tinta); }
.obs small { font-weight: 500; color: var(--gris); }
.obs textarea { width: 100%; min-height: 84px; border-radius: 14px; border: 1.5px solid var(--borde); padding: 10px 12px; font: 500 15px/1.4 'Sora', sans-serif; color: var(--tinta); resize: vertical; background: var(--blanco); }
.obs textarea:focus { border-color: var(--acento); outline: none; box-shadow: 0 0 0 3px var(--acento-suave); }
.obs-txt { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; background: var(--ambar-suave); color: var(--tinta); border-radius: 12px; padding: 8px 10px; }
.foto-conf img + img { margin-left: -14px; border: 2px solid #fff; }
