/* ===== TEMA =====
   Colores y tipografía de marca: se cambian SOLO aquí.
   (Valores provisionales hasta tener los de la plantilla Efitec.) */
:root {
  --brand: #12355b;        /* color principal: cabecera, botones */
  --brand-contrast: #ffffff;
  --accent: #e0a526;       /* detalle: filetes, código de sala */
  --bg: #f3f5f8;
  --surface: #ffffff;
  --text: #16202c;
  --muted: #5d6b7a;
  --line: #d9dfe6;
  --si: #1d7a4c;
  --no: #b3322b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.4; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
[hidden] { display: none !important; }

.top { background: var(--brand); color: var(--brand-contrast); border-bottom: 4px solid var(--accent); }
.top-in { max-width: 1400px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 16px; }
.logo { height: 34px; display: block; }
.wordmark { font-weight: 800; letter-spacing: .14em; font-size: 1.15rem; }
.top .title { font-size: .95rem; opacity: .9; margin-left: auto; text-align: right; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px;
  border-radius: 12px; border: 2px solid var(--brand); background: var(--brand); color: var(--brand-contrast);
  font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 9px; }
.btn.danger { background: var(--no); border-color: var(--no); }
.btn.ok { background: var(--si); border-color: var(--si); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .pick:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.field { width: 100%; min-height: 54px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 1.1rem; }
.label { display: block; font-weight: 700; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: .92rem; }
.error { background: #fbe9e7; color: #7c1d17; border: 1px solid #efc1bc; border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.notice { background: #e8f3ec; color: #14522f; border: 1px solid #bcdcc8; border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.warn { background: #fdf3d8; color: #6b4a00; border: 1px solid #ecd491; border-radius: 10px; padding: 12px 14px; font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; background: #e6eaef; color: var(--muted); }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.open { background: #dff1e6; color: var(--si); }

.chip { display: inline-block; min-width: 3.2em; text-align: center; padding: 3px 10px; border-radius: 8px; font-weight: 800; color: #fff; }
.chip.SI { background: var(--si); }
.chip.NO { background: var(--no); }

/* ===== Votante (móvil) ===== */
.voter { max-width: 520px; margin: 0 auto; padding: 22px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; }
.step h1 { font-size: 1.45rem; line-height: 1.2; margin-bottom: 6px; }
.step .hint { margin-bottom: 18px; }
.stack { display: grid; gap: 12px; }
.code-input { text-align: center; font-size: 2rem; letter-spacing: .5em; font-weight: 800; font-variant-numeric: tabular-nums; padding-left: .5em; }
.choice { min-height: 76px; font-size: 1.15rem; justify-content: flex-start; text-align: left; background: var(--surface); color: var(--text); border-color: var(--line); }
.choice small { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; }
.results { display: grid; gap: 6px; margin-top: 8px; }
.pick { width: 100%; text-align: left; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 1.05rem; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.pick[disabled] { color: var(--muted); background: var(--bg); cursor: not-allowed; }
.pick .tag { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-radius: 10px; background: #eaf0f7; border: 1px solid #c9d6e6; font-weight: 700; }
.chosen button { background: none; border: 0; color: var(--brand); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 6px; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yn button { min-height: 110px; border-radius: 14px; border: 3px solid var(--line); background: var(--surface); font-size: 2rem; font-weight: 800; cursor: pointer; }
.yn .si { color: var(--si); }
.yn .no { color: var(--no); }
.yn .si[aria-pressed="true"] { background: var(--si); border-color: var(--si); color: #fff; }
.yn .no[aria-pressed="true"] { background: var(--no); border-color: var(--no); color: #fff; }
.summary { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.summary b { font-size: 1.05rem; }
.receipt { text-align: center; }
.receipt .big { font-size: 3rem; line-height: 1; margin-bottom: 10px; color: var(--si); }
.back { background: none; border: 0; color: var(--muted); padding: 10px 0; cursor: pointer; text-decoration: underline; }

/* ===== Monitor (proyección) ===== */
.monitor { max-width: 1400px; margin: 0 auto; padding: 24px 20px 40px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; }
.monitor .q { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.monitor .q h1 { font-size: clamp(1.6rem, 3.2vw, 2.8rem); line-height: 1.1; }
.bars { display: grid; gap: 18px; }
.bar-row { display: grid; grid-template-columns: 4.2rem 1fr auto; align-items: center; gap: 16px; }
.bar-row .lab { font-size: 2.4rem; font-weight: 800; }
.bar-row.si .lab { color: var(--si); }
.bar-row.no .lab { color: var(--no); }
.track { height: 56px; background: #e6eaef; border-radius: 10px; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 10px; transition: width .5s ease; }
.si .fill { background: var(--si); }
.no .fill { background: var(--no); }
.num { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 7.5rem; text-align: right; }
.num small { font-size: 1.1rem; font-weight: 600; color: var(--muted); margin-left: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .9rem; }
.join { text-align: center; }
.join .qr { width: 100%; max-width: 260px; margin: 0 auto 12px; }
.join .qr svg { width: 100%; height: auto; display: block; }
.join .code { font-size: 3.2rem; font-weight: 800; letter-spacing: .18em; font-variant-numeric: tabular-nums; color: var(--brand); border-bottom: 4px solid var(--accent); display: inline-block; padding: 0 0 2px .18em; }
.join .url { font-size: .85rem; color: var(--muted); word-break: break-all; margin-top: 10px; }
.list { grid-column: 1 / -1; }
.list h2 { font-size: 1.1rem; margin-bottom: 12px; }
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.row .who { flex: 1; min-width: 0; font-weight: 600; }
.row .who small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.row time { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 18px 0; }
@media (max-width: 900px) { .monitor { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 3rem 1fr auto; } .bar-row .lab, .num { font-size: 1.6rem; } .num { min-width: 5.5rem; } .track { height: 40px; } }

/* ===== Administración ===== */
.admin { max-width: 980px; margin: 0 auto; padding: 22px 16px 60px; display: grid; gap: 18px; }
.admin h2 { font-size: 1.15rem; margin-bottom: 12px; }
.admin .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin .inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin .field { min-height: 44px; font-size: 1rem; }
.admin textarea.field { min-height: 120px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
td.r { text-align: right; }
code.url { display: block; background: var(--bg); padding: 10px 12px; border-radius: 8px; word-break: break-all; font-size: .9rem; }
@media (max-width: 700px) { .admin .row2 { grid-template-columns: 1fr; } }
