/* ═══════════════════════════════════════════════════════════════════════════
   Elección AERI 2026 — Manual de Estilos (Tableros de Gestión) + Glass
   Tokens del manual: navy institucional, acento teal, semáforos, neutros fríos.
   Capa glass: fondo con luces navy/teal, superficies translúcidas con blur.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Familia 1 — Marca navy */
  --navy-950: #07213a; --navy-900: #0d3356; --navy-800: #134264; --navy-700: #1a5278;
  /* Familia 2 — Acento teal / cyan */
  --cyan-glow: #00c8f0; --accent-dark: #2d6178; --accent: #5b9db5; --accent-text: #245e76;
  --accent-soft: #e6f4f8; --accent-border: #bbd8e4; --sky: #66a5b9;
  /* Familia 3 — Categorías */
  --cat-violet: #5b4fcf; --cat-teal: #0e8a7d; --cat-teal-md: #1aa899; --cat-sky: #2980b9; --cat-slate: #4a6482;
  /* Familia 4 — Semáforos */
  --green: #0fa876; --green-dark: #0a9668; --green-soft: #eafaf4;
  --amber: #c97a00; --amber-soft: #fef9ee; --red: #e03535; --red-dark: #cc2222; --red-soft: #fef1f1;
  /* Familia 5–6 — Neutros y fondos */
  --ink: #0c1629; --ink-soft: #2d3f55; --ink-faint: #5e738a; --line: #d4dfe6;
  --bg: #edf2f6; --paper: #f3f7fa; --card: #ffffff;
  --shadow-rgb: 7, 33, 58; --radius: 12px;

  /* Capa glass */
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(13, 51, 86, 0.09);
  --glass-blur: blur(18px) saturate(165%);
  --glass-shadow: 0 10px 32px rgba(var(--shadow-rgb), .10), 0 1px 2px rgba(var(--shadow-rgb), .06),
                  inset 0 1px 0 rgba(255, 255, 255, .85);
  --glass-dark: linear-gradient(160deg, rgba(13, 51, 86, .92), rgba(7, 33, 58, .88));
  --sidebar-w: 236px;

  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-size: 14.5px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(91, 157, 181, .38), transparent 60%),
    radial-gradient(800px 560px at 100% 0%, rgba(13, 51, 86, .22), transparent 60%),
    radial-gradient(700px 520px at 60% 110%, rgba(14, 138, 125, .20), transparent 60%),
    radial-gradient(500px 400px at 0% 100%, rgba(0, 200, 240, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent-dark); font-weight: 600; }
a:hover { color: var(--navy-900); }
h1 { font-size: clamp(1.45rem, 2.3vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .4rem; color: var(--ink); }
h2 { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 .9rem; display: flex; align-items: center; gap: 10px; }
h2::before { content: ""; width: 3px; height: 16px; background: var(--accent-dark); border-radius: 2px; flex-shrink: 0; }
.tenue { color: var(--ink-faint); font-weight: 500; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
code { font-family: ui-monospace, monospace; background: var(--accent-soft); color: var(--accent-text); padding: 2px 6px; border-radius: 4px; font-size: .85em; }
:focus-visible { outline: 3px solid rgba(0, 200, 240, .55); outline-offset: 2px; }

/* ═══ Superficie glass reutilizable ═════════════════════════════════════════ */
.tarjeta, .kpi, .persona, .recientes, .mesa-tarjeta, .login-tarjeta, .aviso, .menu-lista, .barra-movil {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tarjeta, .kpi, .persona, .recientes, .mesa-tarjeta, .login-tarjeta, .menu-lista, .barra-movil { background: var(--glass-strong); }
}

/* ═══ Shell: sidebar navy glass + contenido ═════════════════════════════════ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 20px 14px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  border-right: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 8px 0 32px rgba(var(--shadow-rgb), .18);
  color: #a9c4d4;
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 18px; padding: 0 6px; }
.marca-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-dark), var(--cyan-glow)); color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 4px 14px rgba(0, 200, 240, .3);
}
.marca-txt { display: flex; flex-direction: column; line-height: 1.15; }
.marca-txt b { color: #fff; font-size: 13px; font-weight: 800; }
.marca-txt small { color: #94a3b8; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.nav-grupo { font-size: 9.5px; font-weight: 800; color: #4a7088; text-transform: uppercase; letter-spacing: .07em; padding: 12px 10px 5px; }
.nav-link {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 100px;
  color: #a9c4d4; font-size: 12.5px; font-weight: 600; text-decoration: none; transition: all .15s ease;
}
.nav-link::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3d6070; flex-shrink: 0; transition: all .15s; }
.nav-link:hover { background: rgba(255, 255, 255, .09); color: #e2f0f7; }
.nav-link[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; }
.nav-link[aria-current="page"]::before { background: var(--cyan-glow); box-shadow: 0 0 8px var(--cyan-glow); }
.sidebar-pie { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.usuario { display: flex; align-items: center; gap: 9px; padding: 6px 8px 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 800; font-size: 12px; text-transform: uppercase; }
.usuario b { color: #fff; font-size: 12.5px; display: block; }
.usuario small { color: #94a3b8; font-size: 10.5px; }
.sidebar .btn-salir { width: 100%; background: rgba(255, 255, 255, .06); color: #cbd5e1; border: 1px solid rgba(255, 255, 255, .12); box-shadow: none; }
.sidebar .btn-salir:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.principal { min-width: 0; }
.contenedor { max-width: 1320px; margin: 0 auto; padding: 28px 32px 64px; }

/* Barra superior compacta (fiscal y celular) */
.barra-movil {
  position: sticky; top: 0; z-index: 20; display: none; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 0; border-width: 0 0 1px;
  background: var(--glass-dark); color: #fff;
}
.barra-movil .marca { margin: 0; padding: 0; }
.barra-movil .nav-scroll { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.barra-movil .nav-link { padding: 6px 10px; white-space: nowrap; }
.barra-movil .nav-link::before { display: none; }
.barra-movil form { margin: 0 0 0 auto; }
.barra-movil .btn-salir { background: rgba(255, 255, 255, .08); color: #e2f0f7; border: 1px solid rgba(255, 255, 255, .16); box-shadow: none; }

.sin-sidebar .shell { display: block; }
.sin-sidebar .sidebar { display: none; }
.sin-sidebar .barra-movil { display: flex; }

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .barra-movil { display: flex; }
  .contenedor { padding: 18px 14px 48px; }
}

/* ═══ Botones (pill) ════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--navy-900); color: #fff; border: 1px solid rgba(255, 255, 255, .1);
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 10px 22px; border-radius: 100px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: 0 4px 14px rgba(7, 33, 58, .22); transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.btn:hover { transform: translateY(-1px); background: var(--navy-800); color: #fff; box-shadow: 0 8px 20px rgba(7, 33, 58, .28); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-chico { padding: 6px 14px; font-size: 12px; }
.btn-grande { padding: 14px 24px; font-size: 15px; width: 100%; }
.btn-fantasma {
  background: rgba(255, 255, 255, .55); color: var(--ink-soft); border: 1.5px solid var(--line); box-shadow: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn-fantasma:hover { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); box-shadow: none; }
.btn-voto {
  background: linear-gradient(135deg, var(--green), var(--cat-teal)); border-color: rgba(255, 255, 255, .2);
  font-size: 18px; letter-spacing: .06em; box-shadow: 0 8px 22px rgba(15, 168, 118, .35);
}
.btn-voto:hover { background: linear-gradient(135deg, var(--green-dark), var(--cat-teal)); box-shadow: 0 10px 26px rgba(15, 168, 118, .42); }

/* ═══ Formularios ═══════════════════════════════════════════════════════════ */
label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; margin: .9rem 0 .35rem; }
input, select {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 14px; color: var(--ink);
  background: rgba(255, 255, 255, .7); border: 1.5px solid var(--line); border-radius: 10px;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus { outline: none; border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(45, 97, 120, .15); background: #fff; }
.campo small { display: block; margin-top: .25rem; font-size: 12px; }
.campo .error { color: var(--red); font-weight: 600; }
.con-error input, .con-error select { border-color: var(--red); }
label.check { display: flex; align-items: center; gap: .5rem; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
label.check input { width: auto; }
form .btn-grande { margin-top: 1.3rem; }
.fila-form { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.fila-form label { margin: 0; }
.fila-form select { width: auto; min-width: 280px; flex: 1; border-radius: 100px; }
.filtro select { width: auto; min-width: 250px; border-radius: 100px; padding: 8px 16px; }
.form-angosto { max-width: 560px; }

/* ═══ Avisos (rule-callout) ═════════════════════════════════════════════════ */
.mensajes { margin-bottom: 1rem; }
.aviso { padding: 12px 16px; border-radius: var(--radius); margin-bottom: .6rem; border-left: 4px solid var(--accent-dark); font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
.aviso-success { border-left-color: var(--green); background: rgba(234, 250, 244, .8); color: var(--green-dark); }
.aviso-error { border-left-color: var(--red); background: rgba(254, 241, 241, .85); color: var(--red-dark); }
.aviso-warning, .aviso-info { border-left-color: var(--amber); background: rgba(254, 249, 238, .85); color: #8a5300; }

/* ═══ Contenedores / secciones ══════════════════════════════════════════════ */
.tarjeta { border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.titulo-fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.titulo-fila h1, .titulo-fila h2 { margin: 0; }
.pagina-sub { color: var(--ink-faint); font-size: 13px; font-weight: 500; margin: -.2rem 0 1.2rem; max-width: 820px; }
.grilla-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.columna > .tarjeta:last-child { margin-bottom: 0; }
@media (max-width: 1100px) { .grilla-2 { grid-template-columns: 1fr; } }
.vivo { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--accent-text);
  padding: 6px 12px; border-radius: 100px; background: rgba(230, 244, 248, .7); border: 1px solid var(--accent-border); }
.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(15, 168, 118, .6); animation: pulso 2s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(15, 168, 118, .55); } 70% { box-shadow: 0 0 0 8px rgba(15, 168, 118, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 168, 118, 0); } }
@media (prefers-reduced-motion: reduce) { .vivo::before { animation: none; } * { transition: none !important; } }

/* ═══ KPI cards (Nivel 1, borde superior) ═══════════════════════════════════ */
.kpis { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .6rem; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 20px 22px;
  border-top: 3px solid var(--accent-dark); display: flex; flex-direction: column; gap: 4px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(var(--shadow-rgb), .14), inset 0 1px 0 rgba(255, 255, 255, .85); }
.kpi strong { font-size: 38px; font-weight: 800; color: var(--navy-900); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi span:not(.etiqueta) { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); margin-top: 6px; }
.kpi.k-green { border-top-color: var(--green); } .kpi.k-green strong { color: var(--green); }
.kpi.k-amber { border-top-color: var(--amber); } .kpi.k-amber strong { color: var(--amber); }
.kpi.k-teal { border-top-color: var(--cat-teal); } .kpi.k-teal strong { color: var(--cat-teal); }
.kpi-principal { background: var(--glass-dark); border-color: rgba(255, 255, 255, .12); border-top-color: var(--cyan-glow); }
.kpi-principal::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 240, .35), transparent 70%); pointer-events: none; }
.kpi-principal strong { color: #fff; }
.kpi-principal span:not(.etiqueta) { color: #a9c4d4; }
.kpi-principal .etiqueta { color: var(--cyan-glow); }
.kpi-principal .barra-pct { background: rgba(255, 255, 255, .15); }
.kpi-principal .barra-pct span { background: linear-gradient(90deg, var(--sky), var(--cyan-glow)); box-shadow: 0 0 12px rgba(0, 200, 240, .5); }
.etiqueta { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.nota-pie { color: var(--ink-faint); font-size: 12.5px; font-weight: 500; margin: .6rem 0 1.2rem; }

/* ═══ Progreso ══════════════════════════════════════════════════════════════ */
.barra-pct { height: 7px; background: rgba(13, 51, 86, .08); border-radius: 100px; overflow: hidden; margin: 8px 0 2px; }
.barra-pct span { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--navy-700), var(--accent-dark)); transition: width .4s cubic-bezier(.16, 1, .3, 1); }
.barra-acento span { background: linear-gradient(90deg, var(--cat-teal), var(--cat-teal-md)); }
.barra-fina { margin: 0; flex: 1; height: 6px; }
.celda-barra { display: flex; align-items: center; gap: 8px; }
.celda-barra small { width: 3.4em; text-align: right; font-size: 12.5px; font-weight: 800; color: var(--navy-900); font-variant-numeric: tabular-nums; }

/* ═══ Tablas (spec-table) ═══════════════════════════════════════════════════ */
.tabla-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla th {
  text-align: left; padding: 9px 10px; color: var(--ink-faint); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--glass-line); white-space: nowrap;
}
.tabla td { padding: 9px 10px; border-bottom: 1px solid var(--glass-line); color: var(--ink-soft); vertical-align: middle; }
.tabla tbody tr { transition: background-color .15s ease; }
.tabla tbody tr:hover { background: rgba(45, 97, 120, .06); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--ink); }
.tabla .col-barra { width: 130px; min-width: 110px; }
.tabla td:first-child { white-space: nowrap; }
.tabla a { text-decoration: none; }
.tabla b { color: var(--navy-900); }
.fila-propia { background: rgba(0, 200, 240, .08); box-shadow: inset 3px 0 0 var(--cyan-glow); }
.inactivo { opacity: .5; }
.descargas { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ═══ Chips / status pills ══════════════════════════════════════════════════ */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 11.5px; font-weight: 700; margin-right: 4px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-super { color: #fff; background: var(--navy-900); }
.chip-admin { color: var(--accent-text); background: rgba(45, 97, 120, .12); border: 1px solid rgba(45, 97, 120, .2); }
.chip-coordinador { color: var(--cat-teal); background: rgba(14, 138, 125, .12); border: 1px solid rgba(14, 138, 125, .2); }
.chip-fiscal { color: #b47509; background: rgba(217, 164, 65, .14); border: 1px solid rgba(217, 164, 65, .25); }

/* Menú desplegable */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-lista { position: absolute; right: 0; z-index: 30; margin-top: 6px; border-radius: var(--radius); padding: 6px; min-width: 280px; max-height: 340px; overflow: auto; background: var(--glass-strong); }
.menu-lista a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-soft); font-size: 12.5px; }
.menu-lista a:hover { background: var(--accent-soft); color: var(--accent-text); }

/* Votos por hora */
.horas { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.hora { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; gap: 3px; }
.hora span { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; min-height: 3px; background: linear-gradient(180deg, var(--accent), var(--navy-900)); }
.hora b { order: -1; color: var(--navy-900); font-weight: 800; }
.hora small { color: var(--ink-faint); font-weight: 600; }

/* ═══ Login ═════════════════════════════════════════════════════════════════ */
.pantalla-login {
  background:
    radial-gradient(700px 500px at 15% 10%, rgba(0, 200, 240, .28), transparent 60%),
    radial-gradient(800px 600px at 90% 90%, rgba(14, 138, 125, .30), transparent 60%),
    linear-gradient(160deg, #0a2844, var(--navy-950));
}
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-tarjeta {
  width: min(410px, 100%); padding: 32px 30px; border-radius: 18px;
  background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.login-tarjeta h1 { color: #fff; }
.login-tarjeta .tenue { color: #a9c4d4; }
.login-tarjeta label { color: #a9c4d4; }
.login-tarjeta input { background: rgba(255, 255, 255, .9); border-color: transparent; }
.login-tarjeta .btn { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: rgba(255, 255, 255, .25); box-shadow: 0 8px 22px rgba(0, 200, 240, .22); }
.login-tarjeta .btn:hover { background: linear-gradient(135deg, var(--sky), var(--accent-dark)); }
.login-tarjeta .marca { margin-bottom: 22px; padding: 0; }
.acento { color: var(--cyan-glow); }

/* ═══ Mesas (vista superuser) ═══════════════════════════════════════════════ */
.grilla-mesas { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.mesa-tarjeta { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 3px; border-radius: var(--radius);
  padding: 16px 18px; border-top: 3px solid var(--accent-dark); transition: transform .18s ease, box-shadow .18s ease; }
.mesa-tarjeta strong { color: var(--ink); font-size: 15px; }
.mesa-tarjeta:hover { transform: translateY(-2px); color: inherit; box-shadow: 0 16px 36px rgba(var(--shadow-rgb), .14); }

/* ═══ Fondo vivo: orbes de luz detrás del vidrio ════════════════════════════ */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none;
}
body::before { width: 520px; height: 520px; left: -120px; top: 30%; background: radial-gradient(circle, rgba(91, 157, 181, .7), transparent 70%); }
body::after { width: 600px; height: 600px; right: -160px; top: -120px; background: radial-gradient(circle, rgba(13, 51, 86, .45), transparent 70%); }
.pantalla-login::before, .pantalla-login::after { display: none; }

/* ═══ Anillos SVG ═══════════════════════════════════════════════════════════ */
.anillo-wrap { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.anillo { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 11; }
.anillo-fondo { stroke: rgba(255, 255, 255, .12); }
.anillo-valor { stroke: var(--cyan-glow); stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.16, 1, .3, 1);
  filter: drop-shadow(0 0 6px rgba(0, 200, 240, .55)); }
.anillo-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.anillo-pct small { font-size: .55em; margin-left: 1px; opacity: .8; }

/* ═══ Hero del dashboard: vidrio oscuro ═════════════════════════════════════ */
.hero {
  position: relative; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.55fr);
  padding: 18px; border-radius: 20px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(500px 300px at 10% 0%, rgba(0, 200, 240, .25), transparent 60%),
    radial-gradient(600px 380px at 95% 100%, rgba(14, 138, 125, .35), transparent 60%),
    linear-gradient(150deg, #0d3356 0%, #07213a 70%);
  box-shadow: 0 24px 60px rgba(var(--shadow-rgb), .30);
}
.hero::after { content: ""; position: absolute; z-index: -1; width: 340px; height: 340px; left: 38%; top: -170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 157, 181, .35), transparent 70%); filter: blur(10px); }
.hero-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 16px; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 30px rgba(0, 0, 0, .18);
}
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero .etiqueta { color: #9fd9ea; }
.hero-cuerpo { display: flex; align-items: center; gap: 18px; }
.hero-datos { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-num { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #fff; }
.hero-num small { font-size: .5em; opacity: .8; margin-left: 2px; }
.hero-sub { font-size: 13px; font-weight: 600; color: #a9c4d4; }
.hero-pill { align-self: flex-start; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 100px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #e2f0f7; }
.hero-pill-ambar { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .35); color: #fcd57a; }
.hero-teal .anillo-valor { stroke: #34d399; filter: drop-shadow(0 0 6px rgba(52, 211, 153, .55)); }

.hero-proy { gap: 12px; }
.proy-principal { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.proy-principal .hero-num { font-size: 54px; color: #fff; text-shadow: 0 0 24px rgba(0, 200, 240, .35); }
.proy-barra { position: relative; display: flex; height: 16px; border-radius: 100px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.proy-barra span { height: 100%; transition: width .6s cubic-bezier(.16, 1, .3, 1); }
.proy-propio { background: linear-gradient(90deg, #34d399, var(--cyan-glow)); box-shadow: 0 0 14px rgba(0, 200, 240, .5); }
.proy-ajeno { background: rgba(255, 255, 255, .28); }
.proy-mitad { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: #fff; opacity: .8; border-radius: 2px; }
.proy-leyenda { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: #a9c4d4; font-weight: 600; }
.proy-leyenda b { color: #fff; }
.punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.punto-propio { background: linear-gradient(135deg, #34d399, var(--cyan-glow)); }
.punto-ajeno { background: rgba(255, 255, 255, .45); }
.punto-navy { background: var(--navy-700); }
.proy-escenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 2px; }
.proy-escenarios > div { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }
.proy-escenarios small { font-size: 11px; font-weight: 600; color: #a9c4d4; line-height: 1.3; }
.proy-escenarios b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.proy-escenarios b.ok { color: #34d399; }
.estado { font-size: 11.5px; font-weight: 800; padding: 4px 11px; border-radius: 100px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.estado-gana { color: #34d399; background: rgba(52, 211, 153, .14); border: 1px solid rgba(52, 211, 153, .35); }
.estado-alcance { color: #fbbf24; background: rgba(251, 191, 36, .14); border: 1px solid rgba(251, 191, 36, .35); }
.estado-abajo { color: #f87171; background: rgba(248, 113, 113, .14); border: 1px solid rgba(248, 113, 113, .35); }
.estado-sin-datos { color: #cbd5e1; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); }
@media (max-width: 1200px) { .hero { grid-template-columns: 1fr 1fr; } .hero-proy { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; padding: 12px; gap: 12px; border-radius: 18px; }
  .hero-num { font-size: 40px; }
  .proy-principal .hero-num { font-size: 46px; }
  .anillo-wrap { width: 96px; height: 96px; }
  .anillo-pct { font-size: 20px; }
  .proy-escenarios { grid-template-columns: 1fr; }
  .proy-escenarios > div { flex-direction: row; align-items: center; }
}

/* ═══ Mosaico de mesas ══════════════════════════════════════════════════════ */
.leyenda-mini { font-size: 12px; font-weight: 600; color: var(--ink-faint); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.leyenda-mini .punto { margin-left: 8px; }
.mosaico { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.mesa-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 13px 14px; border-radius: 14px; text-decoration: none; color: inherit; font-weight: 500;
  background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 4px 16px rgba(var(--shadow-rgb), .06);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
a.mesa-tile:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .78); color: inherit; box-shadow: 0 12px 28px rgba(var(--shadow-rgb), .12); }
.mesa-tile-cab { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mesa-tile-num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-950)); }
.mesa-tile-nombre { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mesa-tile-fila { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.mesa-tile-fila b { font-size: 20px; font-weight: 800; color: var(--navy-900); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mesa-tile-fila b small { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.mesa-tile-fila > span { font-size: 13px; font-weight: 800; color: var(--navy-700); }
.mesa-tile-sub { font-size: 11.5px; font-weight: 600; color: var(--ink-faint); white-space: nowrap; }
.mesa-tile-sub .propio { font-weight: 800; color: var(--cat-teal); }
.mesa-tile-hora { font-size: 10.5px; color: var(--ink-faint); font-weight: 600; }
.vacio-panel { color: var(--ink-faint); font-weight: 500; font-size: 13px; padding: 20px 4px; text-align: center; }

/* ═══ Fiscal (mobile-first) ═════════════════════════════════════════════════ */
.pantalla-fiscal { padding-bottom: env(safe-area-inset-bottom); }
.fiscal { max-width: 640px; margin: 0 auto; padding: 14px 12px 120px; }
.mesa-cabecera {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(260px 180px at 100% 0%, rgba(0, 200, 240, .32), transparent 70%),
    radial-gradient(280px 200px at 0% 100%, rgba(14, 138, 125, .35), transparent 70%),
    linear-gradient(150deg, #0d3356, #07213a);
  box-shadow: 0 16px 40px rgba(var(--shadow-rgb), .28), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.mesa-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mesa-id .etiqueta { color: var(--cyan-glow); }
.mesa-id h1 { color: #fff; font-size: 1.45rem; margin: 0; line-height: 1.15; }
.mesa-conteo { font-size: 13px; font-weight: 600; color: #a9c4d4; margin-top: 4px; }
.mesa-conteo b { color: #fff; font-size: 17px; font-weight: 800; }
.anillo-chico { width: 86px; height: 86px; }
.anillo-chico .anillo-pct { font-size: 19px; }

.buscador-zona {
  position: sticky; top: 56px; z-index: 15; margin: 12px -4px 0; padding: 8px 4px 10px;
  background: linear-gradient(180deg, rgba(237, 242, 246, .92) 70%, rgba(237, 242, 246, 0));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.buscador { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 100px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.buscador:focus-within { border-color: var(--accent-dark); box-shadow: 0 0 0 4px rgba(45, 97, 120, .16), var(--glass-shadow); }
.buscador input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 22px; font-weight: 700; padding: 10px 14px; letter-spacing: .01em; box-shadow: none; }
.buscador input::placeholder { font-size: 17px; font-weight: 600; color: var(--ink-faint); opacity: .7; }
.buscador input:focus { box-shadow: none; background: transparent; }
.buscador input::-webkit-search-cancel-button { display: none; }
.buscador .btn { padding: 14px 20px; }
.modo { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; padding: 4px; border-radius: 100px;
  background: rgba(255, 255, 255, .5); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modo button { font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); background: none; border: 0; padding: 9px 10px; border-radius: 100px; cursor: pointer; min-height: 40px; }
.modo button[aria-pressed="true"] { background: var(--navy-900); color: #fff; box-shadow: 0 2px 10px rgba(7, 33, 58, .25); }
.offline { margin: 6px 0 4px; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--red-dark);
  background: rgba(254, 241, 241, .9); border: 1px solid rgba(224, 53, 53, .25); }
.offline[hidden] { display: none; }

.resultados { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; min-height: 8px; }
.multiples { margin: 0; padding: 12px 16px; border-radius: 14px; font-weight: 800; font-size: 14px; color: #8a5300;
  background: rgba(254, 249, 238, .88); border: 1px solid rgba(201, 122, 0, .25); border-left: 4px solid var(--amber); }
.vacio { color: var(--ink-faint); text-align: center; padding: 20px; font-weight: 600; }
.persona { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; border-radius: 18px; padding: 16px; border-left: 5px solid var(--accent-dark);
  animation: entrar .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.persona-orden { font-size: 34px; font-weight: 800; color: var(--navy-900); line-height: 1; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.persona-orden small { font-size: 10.5px; font-weight: 800; color: var(--ink-faint); margin-top: 6px; letter-spacing: .03em; text-transform: uppercase; }
.persona-datos { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--ink-soft); font-weight: 500; min-width: 0; }
.persona-nombre { font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.persona .padron { align-self: flex-start; margin-top: 3px; font-size: 10.5px; font-weight: 800; color: var(--accent-text); text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 100px; background: rgba(45, 97, 120, .1); border: 1px solid rgba(45, 97, 120, .18); }
.persona .acciones, .persona .nota { grid-column: 1 / -1; margin: 8px 0 0; display: flex; gap: 10px; align-items: center; }
.persona .btn-voto { min-height: 60px; font-size: 20px; }
.persona-voto { border-left-color: var(--green); background: rgba(234, 250, 244, .78); }
.persona-alerta { border-left-color: var(--amber); background: rgba(254, 249, 238, .8); }
.persona .nota { color: #8a5300; font-weight: 800; font-size: 14px; }
.sello { flex: 1; color: var(--green-dark); font-weight: 800; font-size: 16px; }

.subtitulo { margin: 26px 4px 8px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); }
.subtitulo::before { display: none; }
.recientes { list-style: none; margin: 0; padding: 2px 0; border-radius: 16px; }
.recientes li { padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--glass-line); display: flex; gap: 10px; align-items: center; font-weight: 600; color: var(--ink-soft); font-size: 14px; min-height: 52px; }
.recientes li:last-child { border-bottom: 0; }
.recientes .orden { font-weight: 800; color: var(--navy-900); min-width: 3.2em; font-variant-numeric: tabular-nums; }
.rec-nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recientes small { color: var(--green-dark); font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-deshacer { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .6);
  color: var(--ink-faint); font-size: 18px; font-weight: 800; cursor: pointer; }
.rec-deshacer:hover { color: var(--red); border-color: rgba(224, 53, 53, .3); background: var(--red-soft); }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; min-height: 52px; width: max-content; max-width: calc(100% - 24px);
  border-radius: 100px; font-weight: 700; font-size: 14.5px; color: #fff;
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 16px 40px rgba(var(--shadow-rgb), .35); animation: subir .25s cubic-bezier(.16, 1, .3, 1); }
@keyframes subir { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast #toast-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-ok { background: rgba(10, 150, 104, .9); }
.toast-info { background: rgba(13, 51, 86, .9); padding-right: 20px; }
.toast-error { background: rgba(204, 34, 34, .92); padding-right: 20px; }
.toast-accion { font: inherit; font-size: 13px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35);
  padding: 9px 16px; border-radius: 100px; cursor: pointer; flex-shrink: 0; }
.toast-accion[hidden], .toast[hidden] { display: none; }

@media (max-width: 560px) {
  .fiscal { padding: 10px 10px 120px; }
  .mesa-cabecera { padding: 14px 16px; border-radius: 18px; }
  .mesa-id h1 { font-size: 1.25rem; }
  .anillo-chico { width: 74px; height: 74px; }
  .anillo-chico .anillo-pct { font-size: 17px; }
  .buscador-zona { top: 52px; }
  .buscador input { font-size: 21px; padding: 9px 10px; }
  .buscador .btn { padding: 13px 16px; }
  .persona { padding: 14px; gap: 6px 12px; }
  .persona-orden { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { .persona, .toast { animation: none; } }

