/* =====================================================================
   IDAI · Interfaz
   Paleta guinda institucional, tipografía Inter, componentes propios.
   ===================================================================== */
:root {
  --brand-950: #0b1215;
  --brand-900: #141c21;
  --brand-800: #22313a;
  --brand-700: #1f3a44;
  --brand-600: #2c4f5b;
  --brand-500: #3d6875;
  --brand-100: #e3ecef;
  --brand-50:  #f2f6f7;
  --accent:     #8fb0b8;

  --bg:       #f4f5f6;
  --surface:  #ffffff;
  --ink:      #161b1e;
  --ink-2:    #434b50;
  --muted:    #737b80;
  --line:     #e3e6e8;
  --line-2:   #d2d7da;

  --green: #1f8a5b; --green-bg: #e6f4ec;
  --amber: #a86400; --amber-bg: #fdf1dc;
  --red:   #c0263e; --red-bg:   #fde8eb;
  --violet:#5a3fb5; --violet-bg:#eeeafb;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(22,27,30, .06);
  --shadow: 0 1px 2px rgba(22,27,30, .05), 0 8px 24px -8px rgba(22,27,30, .12);
  --shadow-lg: 0 24px 60px -18px rgba(20,28,33, .35);
  --sidebar-w: 264px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 800; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: .25rem 0 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.strong { font-weight: 700; }
.right { text-align: right; }
[hidden] { display: none !important; }
fieldset { border: 0; margin: 0; min-width: 0; }

/* ---------------- Layout ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 0% 0%, #1b2a31 0%, var(--brand-950) 60%);
  color: #e9eef0; padding: 20px 14px 14px; gap: 14px; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 4px 8px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: #b4bfc4; font-size: .74rem; font-weight: 500; }
.brand strong { font-size: 1.05rem; letter-spacing: -.01em; }
.brand-mark {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700) 55%, var(--brand-900));
  color: #fff; font-weight: 800; font-size: 1.25rem; letter-spacing: -.04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 24px -10px rgba(31,58,68,.8);
}
.brand-mark.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
/* El menú se desplaza por dentro si no cabe; la marca arriba y el usuario abajo quedan fijos */
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; flex-shrink: 0;
  color: #cfd6d9; font-weight: 500; font-size: .92rem; transition: background .15s, color .15s;
}
.sidebar nav a svg { flex-shrink: 0; opacity: .85; }
.nav-sec { display: block; margin: 12px 12px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #80878b; flex-shrink: 0; }
.sidebar .brand, .sidebar-user, .sidebar .install-app { flex-shrink: 0; }
@media (max-height: 760px) {
  .sidebar { padding-top: 14px; gap: 10px; }
  .sidebar nav a { padding: 7px 12px; font-size: .88rem; }
  .nav-sec { margin-top: 8px; }
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); }
.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .who strong { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who small { color: #a6b0b5; font-size: .74rem; }
.sidebar-user .icon-btn { color: #cfd6d9; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent); color: var(--brand-950); font-weight: 800; font-size: .85rem;
}
.avatar.soft { background: var(--brand-100); color: var(--brand-700); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 36px 32px 80px; }
.scrim { display: none; }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 16px;
  font: 600 .92rem/1.2 var(--font); cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s, border-color .15s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-700); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -8px rgba(31,58,68,.7); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-700); }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 10px; }
.btn-xs { padding: 5px 9px; font-size: .78rem; border-radius: 8px; gap: 5px; }
.btn.is-busy { cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--brand-700); font: 600 .92rem var(--font); cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 0; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: rgba(127,127,127,.12); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-bg); }

/* ---------------- Tarjetas ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--brand-500); margin: 0 0 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.stack-lg > .card + .card { margin-top: 0; }

/* ---------------- Panel ---------------- */
.hero { margin-bottom: 26px; }
.hero h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 22px; }
.action-card {
  position: relative; display: flex; align-items: center; gap: 18px; padding: 24px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden;
}
.action-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-100); }
.action-card.featured { background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); color: #fff; border-color: transparent; }
.action-card.featured::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(143,176,184,.35), transparent 70%);
}
.action-icon { width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.featured .action-icon { background: rgba(255,255,255,.12); color: #fff; }
.action-body { flex: 1; min-width: 0; }
.action-body strong { display: block; font-size: 1.12rem; letter-spacing: -.01em; }
.action-body small { color: var(--muted); font-size: .88rem; }
.featured .action-body small { color: #d5dee1; }
.action-arrow { font-size: 1.4rem; opacity: .5; transition: transform .18s, opacity .18s; }
.action-card:hover .action-arrow { transform: translateX(4px); opacity: 1; }
.badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 4px 8px; border-radius: 999px; }
.badge-new { background: var(--accent); color: var(--brand-950); position: absolute; top: 14px; right: 14px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: .78rem; color: var(--muted); }
.kpi.accent { background: var(--brand-50); border-color: var(--brand-100); }
.kpi.accent strong { color: var(--brand-700); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow strong { display: block; font-size: .94rem; }
.list .grow small { color: var(--muted); font-size: .8rem; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------------- Stepper ---------------- */
.stepper { list-style: none; margin: 0 0 22px; padding: 6px; display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.stepper li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: .8rem; font-weight: 800; flex-shrink: 0; }
.stepper li.active { background: var(--brand-50); color: var(--brand-700); }
.stepper li.active span { background: var(--brand-700); color: #fff; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done span { background: var(--green); color: #fff; font-size: 0; }
.stepper li.done span::after { content: '✓'; font-size: .8rem; }

/* ---------------- Captura INE ---------------- */
.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dropzone {
  position: relative; border: 2px dashed var(--line-2); border-radius: 18px; background: #f8f9fa;
  aspect-ratio: 1.586; display: grid; place-items: center; overflow: hidden; outline: none;
  transition: border-color .15s, background .15s;
}
.dropzone:focus-visible, .dropzone.drag { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone.has-image { border-style: solid; border-color: var(--line); background: #111; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px; }
.dz-empty strong { font-size: .98rem; }
.dz-empty em { font-style: normal; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-left: 4px; }
.dz-empty em.req { color: var(--brand-500); }
.dz-empty small { color: var(--muted); }
.dz-buttons { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.ine-outline { width: 120px; height: 76px; border-radius: 10px; border: 2px solid var(--line-2); display: flex; gap: 8px; padding: 10px; margin-bottom: 8px; background: #fff; }
.ine-photo { width: 30px; border-radius: 6px; background: var(--line); }
.ine-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.ine-lines i { height: 6px; border-radius: 3px; background: var(--line); }
.ine-lines i:nth-child(2) { width: 75%; } .ine-lines i:nth-child(3) { width: 55%; }
.dz-preview { position: absolute; inset: 0; }
.dz-preview img { width: 100%; height: 100%; object-fit: contain; }
.dz-remove { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.dz-tag { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; letter-spacing: .04em; }
.scanline { display: none; position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 18px 4px rgba(143,176,184,.6); }
.dropzone.scanning .scanline { display: block; animation: scan 1.6s ease-in-out infinite; }
.dropzone.scanning .dz-preview img { filter: saturate(.6) brightness(.85); }
@keyframes scan { 0% { top: 4%; } 50% { top: 94%; } 100% { top: 4%; } }
.capture-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; flex-wrap: wrap; }

/* ---------------- Formularios ---------------- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.grid + .grid, .grid + .field, .field + .grid, fieldset > .field + .field { margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; position: relative; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  width: 100%; font: 500 .95rem var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input.mono { font-family: var(--mono); font-weight: 600; letter-spacing: .06em; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(61,104,117,.12); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23807579' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
textarea { resize: vertical; }
.field.invalid input, .field.invalid select { border-color: var(--red); background: #fafcfc; }
.field-error { color: var(--red); font-size: .78rem; font-weight: 600; }
.counter { position: absolute; right: 10px; top: 33px; font: 600 .7rem var(--mono); color: var(--muted); background: #fff; padding: 2px 4px; border-radius: 4px; }
.counter.ok { color: var(--green); }
.counter.bad { position: static; display: block; margin-top: 4px; padding: 0; background: none; color: var(--red); font-family: inherit; }
.hint { margin: 10px 0 0; font-size: .86rem; color: var(--ink-2); }
.output { display: block; min-height: 44px; padding: 11px 13px; border-radius: 11px; background: var(--bg); font-weight: 600; font-size: .84rem; color: var(--ink-2); }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; background: #fff; overflow: hidden; }
.input-prefix:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(61,104,117,.12); }
.input-prefix b { padding: 0 4px 0 13px; color: var(--muted); }
.input-prefix input { border: 0; box-shadow: none !important; padding-left: 4px; font-variant-numeric: tabular-nums; }

.segmented { align-self: flex-start; display: inline-flex; padding: 4px; gap: 4px; background: var(--bg); border-radius: 12px; border: 1px solid var(--line); flex-wrap: wrap; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-2); transition: background .15s, color .15s; }
.segmented input:checked + span { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand-500); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; margin-top: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-700); flex-shrink: 0; padding: 0; }
.casilla-box, .onerosa-box { margin: 16px 0 6px; padding: 18px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.onerosa-box .check { margin-top: 0; margin-bottom: 14px; }
.casilla-box + .grid { margin-top: 18px; }

.collapsible { padding: 0; }
.collapsible summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; cursor: pointer; }
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible[open] summary { border-bottom: 1px solid var(--line); }
.collapsible > .stack { padding: 20px 24px 24px; }
.chev { font-size: 1.3rem; color: var(--muted); transition: transform .2s; }
.collapsible[open] .chev { transform: rotate(180deg); }
.privacy { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: .86rem; color: var(--ink-2); }
.privacy summary { cursor: pointer; font-weight: 600; color: var(--ink); }

.form-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-actions.sticky { position: sticky; bottom: 0; z-index: 5; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(244,245,246,0)); }

.confidence { font-size: .76rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.confidence.hi { background: var(--green-bg); color: var(--green); }
.confidence.mid { background: var(--amber-bg); color: var(--amber); }
.confidence.lo { background: var(--red-bg); color: var(--red); }

/* ---------------- Alertas, pills ---------------- */
.alert { padding: 12px 14px; border-radius: 12px; font-size: .88rem; font-weight: 500; margin-bottom: 16px; }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-warn { background: var(--amber-bg); color: var(--amber); }
.pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill-brand { background: var(--brand-100); color: var(--brand-700); }
.pill-violet { background: var(--violet-bg); color: var(--violet); }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }

/* ---------------- Resultado ---------------- */
.success-card { text-align: center; padding: 40px 28px; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--green-bg); color: var(--green); animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-card h2 { font-size: 1.5rem; }
.folio-chip { display: inline-block; margin-top: 14px; padding: 7px 14px; border-radius: 10px; background: var(--brand-950); color: #fff; font-weight: 700; }
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px auto 26px; max-width: 760px; }
.doc-grid.single { grid-template-columns: minmax(0, 260px); justify-content: center; }
.doc-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.doc-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-500); }
.doc-card.primary { border-color: var(--brand-700); box-shadow: 0 0 0 3px var(--brand-100); }
.doc-card small { color: var(--muted); font-size: .8rem; }
.doc-thumb { width: 64px; height: 82px; border-radius: 6px; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; position: relative; }
.doc-thumb.nom { height: 96px; }
.doc-thumb i { height: 4px; border-radius: 2px; background: var(--line); }
.doc-thumb i:first-child { background: var(--brand-700); width: 60%; }
.doc-thumb i:nth-child(3) { width: 80%; }
.doc-thumb.exp::after { content: ''; position: absolute; inset: 6px -6px -6px 6px; border: 1px solid var(--line-2); border-radius: 6px; z-index: -1; background: #fff; }
.row-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Tablas ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select, .filters input { width: auto; }
.filters .w-sm { width: 110px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 11px; padding: 0 12px; color: var(--muted); background: #fff; }
.search:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(61,104,117,.12); }
.search input { border: 0; box-shadow: none !important; padding-left: 0; width: 100%; }
.table-wrap { overflow-x: auto; margin: 0 -24px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfbfc; white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table tbody tr:hover { background: #fafbfb; }
.actions-cell { white-space: nowrap; }
.actions-cell > * { margin-left: 4px; vertical-align: middle; }
.loading-row { text-align: center; padding: 40px !important; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; flex-wrap: wrap; font-size: .86rem; }
.pager > div { display: flex; align-items: center; gap: 8px; }
.page-num { font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 6px; }

/* ---------------- Spinner, toasts, modal ---------------- */
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--brand-100); border-top-color: var(--brand-700); animation: spin .7s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.btn-ghost .spinner.sm { border-color: var(--line); border-top-color: var(--brand-700); }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; background: var(--brand-950); color: #fff; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg); transform: translateY(12px); opacity: 0; transition: transform .25s, opacity .25s; word-break: break-word; }
.toast.in { transform: none; opacity: 1; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.toast-success .toast-dot { background: #4ade80; }
.toast-error .toast-dot { background: #fb7185; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,18,21,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 90; opacity: 0; transition: opacity .2s; padding: 16px; }
.modal-backdrop.in { opacity: 1; }
.modal { background: #fff; border-radius: 18px; padding: 24px; width: min(420px, 100%); box-shadow: var(--shadow-lg); transform: scale(.96); transition: transform .2s; }
.modal-backdrop.in .modal { transform: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------------- Auth / verificación ---------------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(90% 60% at 50% 0%, #22313a 0%, var(--brand-950) 70%); }
.auth-card { width: min(400px, 100%); background: #fff; border-radius: 24px; padding: 36px 30px 26px; box-shadow: var(--shadow-lg); text-align: center; }
.auth-card .brand-mark { margin: 0 auto 16px; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card form { margin: 26px 0 14px; text-align: left; }
.pin-wrap { position: relative; }
.pin-wrap input { font-size: 1.3rem; letter-spacing: .3em; text-align: center; padding: 14px 44px; }
.pin-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; }
.setup-log { text-align: left; background: var(--bg); border-radius: 12px; padding: 14px 18px 14px 30px; font-size: .86rem; margin: 18px 0; }
.verify { max-width: 440px; }
.verify-badge { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; }
.verify-badge.ok { background: var(--green-bg); color: var(--green); }
.verify-badge.bad { background: var(--red-bg); color: var(--red); }
.verify-data { text-align: left; margin: 22px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.verify-data div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: .9rem; }
.verify-data div:first-child { border-top: 0; }
.verify-data dt { color: var(--muted); }
.verify-data dd { margin: 0; font-weight: 600; text-align: right; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .25s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; padding: 10px 12px; background: rgba(244,245,246,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .topbar-title { font-weight: 700; }
  .content { padding: 20px 16px 60px; }
  .actions { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .doc-grid { grid-template-columns: 1fr; max-width: 320px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .card { padding: 18px; border-radius: 14px; }
  .capture-grid, .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .kpi strong { font-size: 1.6rem; }
  .stepper li { padding: 8px; font-size: 0; gap: 0; justify-content: center; }
  .stepper li span { font-size: .8rem; }
  .stepper li.active { font-size: .82rem; gap: 8px; }
  .capture-actions { flex-direction: column-reverse; align-items: stretch; }
  .capture-actions .btn { width: 100%; }
  .form-actions .btn { flex: 1; }
  .collapsible summary, .collapsible > .stack { padding-left: 18px; padding-right: 18px; }
  .page-head .head-actions { width: 100%; }
  .page-head .head-actions .btn { flex: 1; }
  .filters > * { flex: 1 1 140px; }
  .table-wrap { margin: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
  .table td { border: 0; padding: 5px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; text-align: left; }
  .table td.actions-cell { justify-content: flex-end; flex-wrap: wrap; padding-top: 10px !important; }
  .table td.actions-cell::before { content: none; }
  .table td.loading-row, .table td[colspan] { display: block; text-align: center; }
  .table td[colspan]::before { content: none; }
}
.table .mono.strong { white-space: nowrap; }
@media (max-width: 640px) {
  .table td .cell { min-width: 0; text-align: right; }
  .table td .cell br { display: none; }
  .table td .cell small { display: block; }
}

/* =====================================================================
   Verificación de presencia: casillas, monitoreo, acceso app
   ===================================================================== */
.map { width: 100%; height: 460px; border-radius: 14px; z-index: 0; }
.map.tall { height: 640px; }
.map-wrap { position: relative; }
.map-hint { position: absolute; left: 50%; top: 12px; transform: translate(-50%, -8px); background: var(--brand-950); color: #fff; font-size: .82rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .2s; z-index: 500; }
.map-hint.on { opacity: 1; transform: translate(-50%, 0); }
.geo-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.geo-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.geo-main .card + .card { margin-top: 0; }
.geo-list { padding: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 10px; }
.geo-list .check { margin-top: 0; }
.cas-list { list-style: none; margin: 0 -16px; padding: 0; overflow: auto; flex: 1; border-top: 1px solid var(--line); }
.cas-list li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cas-list li:hover { background: #fafbfb; }
.cas-list li.sel { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-700); }
.cas-list li > div { flex: 1; min-width: 0; }
.cas-list b { display: block; font-size: .92rem; }
.cas-list small { color: var(--muted); font-size: .78rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: var(--green); } .dot.no { background: var(--line-2); border: 2px dashed var(--muted); }
.cas-form .form-actions { margin-top: 16px; }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e11d48; margin-right: 4px; vertical-align: 1px; animation: live 1.4s infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 5px rgba(225,29,72,.18); } }
.kpis.k6 { grid-template-columns: repeat(6, 1fr); }
.kpi.ok strong { color: var(--green); } .kpi.warn strong { color: var(--amber); } .kpi.bad strong { color: var(--red); }
.mon-layout { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.mon-layout .card + .card { margin-top: 0; }
.map-card { padding: 12px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--ink-2); padding: 2px 6px 10px; }
.lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
.lg.ok { background: #1f8a5b; } .lg.warn { background: #d48806; } .lg.bad { background: #c0263e; } .lg.gray { background: #80878b; } .lg.none { background: #fff; }
.side { padding: 0; max-height: 692px; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 6px 6px 0; gap: 4px; }
.tabs button { flex: 1; border: 0; background: none; padding: 11px; font: 600 .88rem var(--font); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button.active { color: var(--brand-700); border-bottom-color: var(--brand-700); }
.tabs b { background: var(--red-bg); color: var(--red); border-radius: 999px; padding: 1px 7px; font-size: .74rem; margin-left: 4px; }
.feed, [data-panel="reps"] { overflow: auto; flex: 1; }
.alert-item { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 4px solid transparent; }
.alert-item:hover { background: #fafbfb; }
.alert-item.rhi { border-left-color: var(--red); } .alert-item.rmid { border-left-color: #d48806; } .alert-item.rlo { border-left-color: var(--line-2); }
.ai-head { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.ai-sub { margin-top: 4px; }
.alert-item ul { margin: 6px 0 0; padding-left: 18px; font-size: .8rem; color: var(--ink-2); }
.filters.compact { padding: 10px 12px; margin: 0; border-bottom: 1px solid var(--line); }
.filters.compact input { flex: 1; }
.rep-list { list-style: none; margin: 0; padding: 0; }
.rep-list li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rep-list li:hover { background: #fafbfb; }
.rep-list b { display: block; font-size: .88rem; }
.rep-list small { display: block; color: var(--muted); font-size: .76rem; }
.rep-list .right { text-align: right; flex-shrink: 0; }
.st { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-ok { background: var(--green-bg); color: var(--green); } .st-warn { background: var(--amber-bg); color: var(--amber); }
.st-bad { background: var(--red-bg); color: var(--red); } .st-gray, .st-empty { background: var(--bg); color: var(--muted); }
.ok-t { color: var(--green); font-weight: 700; } .bad-t { color: var(--red); font-weight: 700; }
.gen-ic { background: var(--violet); color: #fff; border-radius: 50%; display: grid !important; place-items: center; font: 800 10px var(--font); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.pop { min-width: 220px; font-family: var(--font); }
.pop-rep { padding: 6px 0; border-top: 1px solid var(--line); margin-top: 6px; cursor: pointer; font-size: .82rem; }
.pop-rep:hover { color: var(--brand-700); }

.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(11,18,21,.4); opacity: 0; transition: opacity .2s; }
.drawer.in { opacity: 1; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(30px); transition: transform .25s; }
.drawer.in .drawer-panel { transform: none; }
.drawer-panel > header { display: flex; justify-content: space-between; gap: 12px; padding: 22px 22px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.timeline { overflow: auto; padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 14px; }
.ev { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-body { display: grid; grid-template-columns: 130px 1fr; gap: 14px; margin-top: 12px; }
.ev-body img { width: 130px; height: 170px; object-fit: cover; border-radius: 10px; display: block; background: #111; }
.nofoto { width: 130px; height: 170px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--muted); font-size: .8rem; border: 1px dashed var(--line-2); }
.ev dl { margin: 0; font-size: .82rem; }
.ev dl div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ev dt { color: var(--muted); } .ev dd { margin: 0; font-weight: 600; text-align: right; }
.risk { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--line); vertical-align: middle; overflow: hidden; }
.risk i { display: block; height: 100%; width: calc(var(--r) * 1%); background: linear-gradient(90deg, #1f8a5b, #d48806 50%, #c0263e); }
.ev-nota { margin: 10px 0 0; font-size: .86rem; background: var(--amber-bg); padding: 8px 10px; border-radius: 8px; }
.flags { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.flags li { font-size: .78rem; padding: 5px 9px; border-radius: 8px; }
.flags li.hi { background: var(--red-bg); color: var(--red); } .flags li.mid { background: var(--amber-bg); color: var(--amber); } .flags li.lo { background: var(--bg); color: var(--ink-2); }
.ev-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.app-modal { width: min(560px, 100%) !important; }
.app-state { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--bg); }
.app-state.on { background: var(--green-bg); }
.app-state b { display: block; } .app-state small { color: var(--ink-2); font-size: .8rem; }
.app-code { display: flex; gap: 18px; align-items: center; margin-top: 14px; }
.app-code .qr { width: 170px; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.app-code .qr svg { width: 100%; height: auto; display: block; }
.code-big { font-size: 2rem; font-weight: 800; letter-spacing: .08em; color: var(--brand-700); margin: 2px 0; }

@media (max-width: 1180px) {
  .kpis.k6 { grid-template-columns: repeat(3, 1fr); }
  .mon-layout { grid-template-columns: 1fr; }
  .side { max-height: 560px; }
}
@media (max-width: 900px) {
  .geo-layout { grid-template-columns: 1fr; }
  .geo-list { position: static; max-height: 360px; }
  .map.tall { height: 460px; }
}
@media (max-width: 640px) {
  .kpis.k6 { grid-template-columns: repeat(2, 1fr); }
  .ev-body { grid-template-columns: 1fr; }
  .ev-body img, .nofoto { width: 100%; height: 220px; }
  .app-code { flex-direction: column; align-items: flex-start; }
}

/* ---------------- Avisos del menú ---------------- */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }
.nav-badge.hot { background: #e11d48; animation: live 1.4s infinite; }

/* =====================================================================
   Solicitudes y resultados
   ===================================================================== */
.kpis.k5 { grid-template-columns: repeat(4, 1fr); }
.sol-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sol-bar select { width: auto; }
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.seg-tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: 600 .86rem var(--font); color: var(--ink-2); cursor: pointer; }
.seg-tabs button.active { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.sol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.sol { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; border-left: 4px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.sol.late1 { border-left-color: #d48806; }
.sol.late2, .sol.urgent { border-left-color: var(--red); }
.sol.urgent { background: linear-gradient(90deg, #fff6f7, #fff 40%); }
.sol header { display: flex; align-items: flex-start; gap: 12px; }
.sol header .grow { flex: 1; min-width: 0; }
.sol header b { font-size: .98rem; }
.sol header small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.sol-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--brand-50); flex-shrink: 0; }
.sol-msg { margin: 0; font-size: .95rem; background: var(--bg); padding: 10px 12px; border-radius: 10px; }
.sol-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--ink-2); }
.sol-resp { margin: 0; font-size: .86rem; background: var(--green-bg); color: #145c3d; padding: 8px 10px; border-radius: 10px; }
.sol-actions { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 4px 10px; font: 500 .76rem var(--font); cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.sol-reply { display: flex; gap: 6px; align-items: center; }
.sol-reply input { flex: 1; padding: 8px 11px; font-size: .88rem; }

.res-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.res-layout .card + .card { margin-top: 0; }
.res-layout select { width: auto; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 10px; font-size: .84rem; }
.bar-lbl { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bar-track { height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--brand-700); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row:hover .bar-track i { background: var(--brand-500); }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; color: var(--ink); }
.bar-val small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.tot-foot { margin: 16px 0 0; border-top: 1px solid var(--line); padding-top: 10px; font-size: .86rem; }
.tot-foot div { display: flex; justify-content: space-between; padding: 4px 0; }
.tot-foot dt { color: var(--muted); } .tot-foot dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.tot-foot .tot { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 8px; font-size: .95rem; }
.drawer-panel.wide { width: min(980px, 100%); }
.res-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px; overflow: auto; }
.rd-photo { display: flex; flex-direction: column; gap: 6px; }
.rd-photo img { width: 100%; border-radius: 12px; background: #111; max-height: 72vh; object-fit: contain; }
.rd-form { display: flex; flex-direction: column; gap: 12px; }
.vt { width: 100%; border-collapse: collapse; }
.vt th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.vt td { padding: 4px; }
.vt input { padding: 8px 10px; font-size: .9rem; }
.vt td:nth-child(2) { width: 120px; } .vt td:nth-child(3) { width: 36px; }
.vt-extra { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cuadre { padding: 10px 12px; border-radius: 10px; font-size: .88rem; }
.cuadre.ok { background: var(--green-bg); color: var(--green); }
.cuadre.bad { background: var(--red-bg); color: var(--red); }
.cuadre.warn { background: var(--amber-bg); color: var(--amber); }
.json { background: var(--brand-950); color: #e9eef0; padding: 14px; border-radius: 12px; font-size: .76rem; max-height: 320px; overflow: auto; margin: 0; }
@media (max-width: 1100px) { .res-layout { grid-template-columns: 1fr; } .kpis.k5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .res-detail { grid-template-columns: 1fr; } .sol-grid { grid-template-columns: 1fr; } .sol-reply { flex-wrap: wrap; } .vt-extra { grid-template-columns: 1fr; } }
.st-violet { background: var(--violet-bg); color: var(--violet); }
.nofoto.big { width: 100%; height: auto; min-height: 260px; padding: 24px; text-align: center; line-height: 1.5; }
.cmp { border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.cmp.ok { background: #f3fbf7; border-color: #cdebdc; }
.cmp.bad { background: #fff7f8; border-color: #f6cfd6; }
.cmp-head { font-size: .9rem; margin-bottom: 6px; }
.cmp.ok .cmp-head { color: var(--green); } .cmp.bad .cmp-head { color: var(--red); }
.cmp-t td { font-size: .84rem; padding: 4px 6px; }
.cmp-t tr.dif td { background: var(--red-bg); color: var(--red); font-weight: 700; }
.cmp-t tr.res td { border-top: 1px dashed var(--line); }

/* ---------------- Sin permiso / roles ---------------- */
.empty-state { text-align: center; padding: 48px 24px; max-width: 520px; margin: 40px auto; }
.es-icon { font-size: 2.6rem; margin-bottom: 10px; }
.empty-state h2 { font-size: 1.3rem; margin-bottom: 6px; }
.empty-state .btn { margin-top: 18px; }
.rol-pill { display: inline-block; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.rol-ADMIN { background: var(--brand-100); color: var(--brand-700); }
.rol-SUPERADMIN { background: #1a2328; color: #dde6e9; }
.rol-CAPTURISTA, .rol-CAPTURA_CIUDADANA { background: #eef0f1; color: #434b50; }
.rol-CAPTURA_REPRESENTANTES { background: #e3e6e8; color: #2c3439; }
.rol-COORDINADOR { background: #dde6e9; color: #24414b; }
.rol-CANDIDATO { background: #f3e7d3; color: #6b4410; }
.rol-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.rol-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; }
.rol-card h3 { font-size: .95rem; margin: 6px 0 6px; }
.rol-card ul { margin: 0; padding-left: 18px; font-size: .82rem; color: var(--ink-2); }
.u-off td { opacity: .5; }
@media (max-width: 1100px) { .rol-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .rol-cards { grid-template-columns: 1fr; } }

/* ---------------- Inteligencia electoral (SUPERADMIN) ---------------- */
.input { width: auto; }
.input.sm, select.input.sm { padding: 7px 11px; font-size: .85rem; border-radius: 9px; min-width: 180px; }
.segmented.sm span { padding: 6px 12px; font-size: .82rem; }
.check.sm { margin: 0; align-items: center; font-size: .85rem; }
.kpi.skeleton { background: linear-gradient(90deg, #fff 0%, #f2f4f5 50%, #fff 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; min-height: 104px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.kpi .trend { font-weight: 700; }
.kpi .trend.up { color: var(--green); } .kpi .trend.down { color: var(--red); }

.i-search { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 16px; flex-wrap: wrap; color: var(--muted); }
.i-search input { flex: 1; min-width: 220px; border: 0; box-shadow: none !important; padding: 8px 4px; font-size: .95rem; }
.i-hits { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
.i-hits:empty { display: none; }
.i-hit { border: 1px solid var(--line); background: var(--brand-50); color: var(--brand-700); border-radius: 999px; padding: 4px 11px; font: 600 .8rem var(--font); cursor: pointer; }
.i-hit:hover { background: var(--brand-100); }
.i-hits .muted { font-size: .82rem; align-self: center; }

.i-tabs-card { padding: 0; overflow: hidden; }
.i-tabs button { flex: 0 1 auto; padding: 12px 18px; }
.i-pane { padding: 18px 20px 22px; }
.i-map-tools { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.i-map-wrap { display: grid; grid-template-columns: 1fr 340px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: 640px; }
.i-map { height: 100%; background: #eef0f1; }
.i-side { border-left: 1px solid var(--line); overflow: auto; background: #fff; }
.i-side-empty { padding: 40px 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.i-side-empty .es-icon { font-size: 2rem; margin-bottom: 8px; }
.i-sec-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.i-sw { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.15); flex: none; display: inline-block; vertical-align: -3px; }
.i-sec-head h3 { margin: 0; font-size: 1.15rem; }
.i-sec-head small { color: var(--muted); }
.i-sec-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; font-size: .88rem; }
.i-sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.i-sec-grid div { background: var(--bg); border-radius: 10px; padding: 9px 11px; }
.i-sec-grid span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.i-sec-grid b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.i-sec-body h4 { margin: 0 0 6px; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.i-sec-body ul { margin: 0; padding: 0; list-style: none; }
.i-sec-body li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.i-sec-body li:last-child { border-bottom: 0; }
.i-sec-body li small { color: var(--muted); }
.i-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.i-chips span { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font: 600 .78rem var(--mono); }
.i-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.i-bar i { display: block; height: 100%; border-radius: 99px; }
.i-bar-row { display: flex; align-items: center; gap: 10px; }
.i-bar-row .i-bar { flex: 1; }
.i-bar-row b { font-size: .82rem; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.t-ok { background: var(--green); } .t-warn { background: #d48806; } .t-bad { background: var(--red); } .t-none { background: #9aa1a5; }
.c-ok { color: var(--green); } .c-warn { color: var(--amber); } .c-bad { color: var(--red); }

.i-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: .8rem; color: var(--ink-2); }
.i-legend span { display: inline-flex; align-items: center; gap: 6px; }
.i-mk { color: #fff; font: 800 12px var(--font); padding: 3px 9px; border-radius: 99px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); white-space: nowrap; transform: translate(-50%, -50%); display: inline-block; }
.i-divicon { background: none; border: 0; }
.leaflet-tooltip.i-tip { font: 600 12px var(--font); border-radius: 8px; }
.i-pop { font: 13px var(--font); min-width: 190px; }
.i-pop b { display: block; font-size: 14px; margin-bottom: 4px; }

.i-mini { grid-template-columns: repeat(4, 1fr); }
.i-mini .kpi strong { font-size: 1.6rem; }
.i-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.i-chart { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; background: #fff; margin-bottom: 16px; }
.i-grid2 .i-chart { margin-bottom: 0; }
.i-chart.flat { border: 0; padding: 0; }
.i-chart h3, .i-h3, .i-subhead h3 { font-size: .95rem; margin: 0 0 10px; }
.i-h3 { margin-top: 18px; }
.i-cv { position: relative; height: 300px; }
.i-cv.sm { height: 200px; }
.i-subhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.i-subhead .row-actions { margin: 0; display: flex; gap: 8px; align-items: center; }
.i-sub { margin-bottom: 16px; }
.i-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.i-stats div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.i-stats span { display: block; font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.i-stats b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.i-stats small { display: block; font-size: .7rem; color: var(--muted); }
.i-table td, .i-table th { padding-top: 9px; padding-bottom: 9px; }
.i-table .right { text-align: right; font-variant-numeric: tabular-nums; }
.i-table tbody tr.clic { cursor: pointer; }
.i-table tbody tr.sel { background: var(--brand-50); }
.i-scroll { max-height: 460px; overflow: auto; }
.i-scroll.tall { max-height: 620px; }
.i-scroll thead th { position: sticky; top: 0; z-index: 1; }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]::after { content: ' ↕'; opacity: .35; }
.sortable th.asc::after { content: ' ↑'; opacity: 1; } .sortable th.desc::after { content: ' ↓'; opacity: 1; }
.i-rank { list-style: none; margin: 0; padding: 0; counter-reset: r; display: flex; flex-direction: column; gap: 8px; }
.i-rank li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 11px 14px; cursor: pointer; }
.i-rank li::before { content: '#' counter(r); font-weight: 800; color: var(--muted); }
.i-rank li b { font-size: 1.05rem; }
.i-rank li small { color: var(--muted); display: block; }
.i-rank.good li strong { color: var(--green); } .i-rank.bad li strong { color: var(--red); }
.i-rank li strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.i-op-detail { border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: 14px; padding: 14px 16px; margin: 4px 0 14px; }
.i-op-detail .i-stats { margin: 0 0 12px; }
.i-empty { padding: 30px; text-align: center; color: var(--muted); }
.i-drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; color: var(--ink-2); }
.i-drop.over { border-color: var(--brand-500); background: var(--brand-50); }

@media (max-width: 1180px) {
  .i-map-wrap { grid-template-columns: 1fr; height: auto; }
  .i-map { height: 480px; }
  .i-side { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .i-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .i-pane { padding: 14px 12px 18px; }
  .i-mini, .i-stats { grid-template-columns: repeat(2, 1fr); }
  .i-tabs { overflow-x: auto; }
  .i-tabs button { white-space: nowrap; padding: 11px 12px; }
  .i-map { height: 420px; }
  .i-cv { height: 260px; }
}
.i-tiles { filter: saturate(.5) contrast(.97); }

/* ---------------- Día D · ¿Ya votó? ---------------- */
.v-modo { margin-bottom: 16px; }
.v-progreso { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: end; padding: 18px 20px; margin-bottom: 14px; }
.v-prog-txt strong { display: block; font-size: 1.15rem; font-weight: 700; }
.v-prog-txt strong b { font-size: 1.6rem; color: var(--green); font-variant-numeric: tabular-nums; }
.v-prog-pct { font-size: 1.8rem; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.v-bar { grid-column: 1 / -1; height: 10px; }
.v-bar i { transition: width .5s ease; }
.v-lista-card { padding: 0; overflow: hidden; }
.v-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.v-search { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 11px; padding: 0 12px; color: var(--muted); }
.v-search:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(61,104,117,.12); }
.v-search input { border: 0; box-shadow: none !important; padding: 11px 2px; font-size: 1rem; }
.v-list { list-style: none; margin: 0; padding: 0; }
.v-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background .12s; }
.v-item.sel { background: var(--brand-50); }
.v-item.voto { background: #f6fbf8; }
.v-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v-info b { font-size: .98rem; }
.v-info small { color: var(--muted); font-size: .8rem; }
.v-check { position: relative; flex: none; cursor: pointer; }
.v-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.v-box { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; background: #fff; transition: all .12s; }
.v-check input:checked + .v-box { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.v-check input:disabled:checked + .v-box { background: var(--green); border-color: var(--green); }
.v-check input:disabled:not(:checked) + .v-box { opacity: .4; cursor: not-allowed; }
.v-check input:focus-visible + .v-box { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.v-ok { flex: none; text-align: right; color: var(--green); font-weight: 700; font-size: .85rem; display: flex; flex-direction: column; }
.v-ok small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.v-empty { padding: 34px 16px; text-align: center; color: var(--muted); list-style: none; }
.v-bar-sel { position: fixed; left: calc(var(--sidebar-w) + 24px); right: 24px; bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 12px; background: var(--brand-900); color: #fff; padding: 12px 14px 12px 20px; border-radius: 16px; box-shadow: var(--shadow-lg); }
.v-bar-sel span { flex: 1; }
.v-bar-sel .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); background: transparent; }
.v-bar-sel .btn-primary { background: var(--accent); color: var(--brand-950); }
body.v-con-sel .v-lista-card { margin-bottom: 90px; }
.v-conf-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; margin: 14px 0; }
.v-conf-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--bg); }
.v-conf-nombre { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
.v-conf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.v-conf-grid .full { grid-column: 1 / -1; }
.v-conf-grid span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.v-conf-grid b { font-size: .92rem; word-break: break-word; }
.v-conf-warn { margin: 0 0 6px; font-size: .88rem; }
.v-conf-ack { margin: 12px 0 4px; font-weight: 600; }

.v-kpis { grid-template-columns: repeat(4, 1fr); }
.kpi.pulse strong { animation: vpulse 1.2s ease; }
@keyframes vpulse { 0% { transform: scale(1); } 30% { transform: scale(1.12); color: var(--green); } 100% { transform: scale(1); } }
.v-mon-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.v-mon-main { padding: 0; overflow: hidden; }
.v-mon-main .card-head { padding: 16px 20px 6px; }
.v-mon-main .card-head small { font-size: .78rem; }
.v-feed-card { padding: 0; position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.v-feed-card .card-head { padding: 16px 18px 8px; }
.v-feed { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.v-feed li { display: flex; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .86rem; }
.v-feed li div { display: flex; flex-direction: column; min-width: 0; }
.v-feed li small { color: var(--muted); font-size: .75rem; }
.v-feed-h { font: 700 .8rem var(--mono); color: var(--green); padding-top: 2px; }
.v-feed li.nuevo { animation: vnuevo 3s ease; }
@keyframes vnuevo { 0% { background: #d9f2e4; } 100% { background: transparent; } }
.v-audit { border-top: 1px solid var(--line); padding: 10px 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: .8rem; }
.v-pend { list-style: none; margin: 8px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.v-pend li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.v-pend li div { display: flex; flex-direction: column; min-width: 0; }
.v-pend li small { color: var(--muted); font-size: .76rem; }
.v-pend li.voto { opacity: .6; }

@media (max-width: 1180px) { .v-mon-grid { grid-template-columns: 1fr; } .v-feed-card { position: static; max-height: 420px; } }
@media (max-width: 1080px) { .v-bar-sel { left: 16px; right: 16px; } }
@media (max-width: 640px) {
  .v-kpis { grid-template-columns: repeat(2, 1fr); }
  .v-tools { padding: 10px 12px; }
  .v-item { padding: 12px; gap: 12px; }
  .v-conf-grid { grid-template-columns: 1fr; }
  .v-bar-sel { left: 10px; right: 10px; bottom: 10px; flex-wrap: wrap; padding: 12px; }
  .v-bar-sel span { flex-basis: 100%; }
  .v-bar-sel .btn { flex: 1; }
}

.v-mon-main .table-wrap { margin: 0; }
.i-pane .table-wrap { margin: 0 -20px; }
@media (max-width: 1080px) { .v-mon-main .table-wrap, .i-pane .table-wrap { margin: 0; } .v-mon-main .table { padding: 0 12px; } }
@media (max-width: 1080px) { .table td .i-bar-row { flex: 0 1 62%; } }
.v-anular { margin-top: 4px; align-self: flex-end; border: 1px solid var(--line-2); background: #fff; color: var(--red); font: 700 .72rem var(--font); padding: 3px 9px; border-radius: 8px; cursor: pointer; }
.v-anular:hover { background: var(--red-bg); border-color: var(--red); }
.v-feed .v-anular { align-self: flex-start; }
.v-anul { border-top: 1px solid var(--line); padding: 10px 18px; font-size: .82rem; }
.v-anul summary { cursor: pointer; font-weight: 700; color: var(--red); }
.v-anul summary b { background: var(--red-bg); border-radius: 99px; padding: 0 7px; margin-left: 4px; }
.v-anul ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow: auto; }
.v-anul li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.v-anul li small { color: var(--muted); }
.v-anul li em { color: var(--ink-2); }

.app-pin { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.app-pin small { display: block; color: var(--muted); font-size: .8rem; max-width: 360px; }

/* ---------------- Acceso: usuario + contraseña + 2 pasos ---------------- */
.auth-tabs { align-self: stretch; display: flex; margin: 6px 0 14px; }
.auth-tabs label { flex: 1; }
.auth-tabs span { text-align: center; padding: 8px 10px; font-size: .86rem; }
body[data-modo="equipo"] .auth-rep, body[data-modo="rep"] .auth-equipo { display: none; }
.auth-step { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 12px 14px; text-align: left; }
.auth-step b { display: block; color: var(--brand-700); }
.auth-step small { color: var(--ink-2); }
.code-input { font: 700 1.6rem var(--mono); letter-spacing: .35em; text-align: center; }
.auth-resend { justify-content: center; margin: 10px 0 0; }

/* ---------------- Mi cuenta ---------------- */
.cuenta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cuenta-grid .card { padding: 20px 22px; }
.cuenta-grid .card-head { padding: 0; }
.cuenta-metodos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metodo { border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.metodo span { font-size: 1.3rem; }
.metodo small { color: var(--muted); font-size: .76rem; }
.metodo.on, .metodo:hover { border-color: var(--brand-500); background: var(--brand-50); }
#c-2fa[data-bloq] .metodo { opacity: .5; }
.pill { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pill.ok { background: var(--green-bg); color: var(--green); } .pill.warn { background: var(--amber-bg); color: var(--amber); }
.totp-box { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: start; }
.totp-box .qr svg { width: 100%; height: auto; }
.rec-box { border: 1px solid var(--accent); background: #fffaf0; border-radius: 12px; padding: 14px; }
.rec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; font-size: 1rem; font-weight: 700; }
.cuenta-accesos { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.cuenta-accesos li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 640px) { .totp-box { grid-template-columns: 1fr; } .totp-box .qr { max-width: 200px; } }
.sidebar-user a.who { color: inherit; text-decoration: none; } .sidebar-user a.who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-filtros { display: flex; gap: 10px; padding: 14px 20px 6px; flex-wrap: wrap; }
.u-filtros input { flex: 1; min-width: 200px; }
.u-filtros select { width: auto; min-width: 170px; }
.u-cuenta { margin: 0; padding: 0 20px 8px; }
.u-acciones { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }
.danger-t { color: var(--red) !important; }
.acc-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; margin: 16px 0; }
.acc-grid span { color: var(--muted); font-size: .8rem; }
.acc-grid .code-big { font-size: 1.3rem; }
.ambito-sel [hidden] { display: none !important; }

.ftr { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ftr select { width: auto; min-width: 170px; padding: 8px 34px 8px 12px; font-size: .86rem; border-radius: 10px; }
.ftr select[hidden] { display: none; }
.mon-nacional { padding: 0; overflow: hidden; margin-bottom: 18px; } .mon-nacional .card-head { padding: 16px 20px 8px; } .mon-nacional .table-wrap { margin: 0; } .mon-ambito { margin: -6px 0 10px; }

.i-map-box { position: relative; height: 100%; }
.i-sinmapa { position: absolute; inset: 0; background: rgba(244,245,246,.92); display: grid; place-items: center; text-align: center; padding: 24px; z-index: 500; }
.i-sinmapa[hidden] { display: none; }
.i-sinmapa .es-icon { font-size: 2rem; }
@media (max-width: 1180px) { .i-map-box { height: 480px; } }
.aud-det { display: block; max-width: 480px; white-space: pre-wrap; word-break: break-word; }

/* ---------------- PWA ---------------- */
.install-app { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 14px; border-radius: 12px; border: 1px dashed rgba(143,176,184,.55);
  background: rgba(143,176,184,.08); color: #dde6e9; font: 600 .86rem var(--font); cursor: pointer; }
.install-app:hover { background: rgba(143,176,184,.16); }
.install-app[hidden] { display: none; }
@media (display-mode: standalone) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } }

/* ---------------- Captura sin internet ---------------- */
.sr-chip {
  position: fixed; top: 12px; right: 16px; z-index: 40; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 .82rem/1.2 var(--font); box-shadow: var(--shadow); cursor: pointer;
}
.sr-chip[hidden] { display: none; }
.sr-chip .sr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.sr-chip.off { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.sr-chip.off .sr-dot { background: var(--accent); }
.sr-chip.bad .sr-dot { background: var(--red); }
.sr-offline { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--brand-900); color: #e6ecee; font-size: .9rem; }
.sr-offline[hidden] { display: none; }
.sr-offline b { color: #fff; }
.sr-modal h4.sr-h { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sr-modal h4.sr-h.bad { color: var(--red); }
.sr-modal h4.sr-h.ok { color: var(--green); }
.sr-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 260px; overflow: auto; }
.sr-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.sr-list li:first-child { border-top: 0; }
.sr-list li > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sr-list small { color: var(--muted); font-size: .78rem; }
.sr-acc { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.sr-sms { margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--brand-50); border: 1px solid var(--brand-100); }
.sr-sms code { display: block; margin: 8px 0 10px; padding: 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--line-2);
  font-size: .74rem; word-break: break-all; user-select: all; }
.sr-sms .btn-block { display: flex; width: 100%; justify-content: center; margin: 4px 0 6px; padding: 12px; font-size: .95rem; }
.sr-sms .row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sr-guardado { text-align: left; }
.sms-bandeja { list-style: none; margin: 14px 0 0; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sms-bandeja li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: .84rem; }
.sms-bandeja li:first-child { border-top: 0; }
.sms-bandeja .est { grid-row: span 2; align-self: center; font-size: .7rem; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--line); }
.sms-bandeja .est.OK { background: var(--green-bg); color: var(--green); }
.sms-bandeja .est.DUPLICADO { background: var(--violet-bg); color: var(--violet); }
.sms-bandeja .est.ERROR, .sms-bandeja .est.RECHAZADO { background: var(--red-bg); color: var(--red); }
.sms-bandeja .est.PARCIAL { background: var(--amber-bg); color: var(--amber); }
.sms-bandeja small { color: var(--muted); }
@media (max-width: 980px) { .sr-chip { top: 9px; right: 12px; } }
.v-ok.v-local { background: var(--amber-bg); color: var(--amber); }
.v-local-nota { margin-bottom: 14px; }
.kpis.k5n { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .kpis.k5n { grid-template-columns: repeat(2, 1fr); } }

/* Fotos de la credencial */
.modal.ine-modal { max-width: 860px; width: calc(100% - 32px); }
.ine-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.ine-fotos figure { margin: 0; }
.ine-fotos img { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--bg, #f3f4f5); display: block; }
.ine-fotos figcaption { font-size: .8rem; color: var(--ink-2); margin-top: 4px; }
@media (max-width: 700px) { .ine-fotos { grid-template-columns: 1fr; } }

/* Pestañas del Día D */
.diad-tabs { display: inline-flex; margin: 0 0 14px; }
.diad-tabs a { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--ink-2); text-decoration: none; }
.diad-tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Inicio de los mandos: lo que está esperando */
.pend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 18px; }
.pend-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; }
.pend-item strong { font-size: 1.4rem; min-width: 1.6em; color: var(--ink-2); }
.pend-item span { flex: 1; font-size: .9rem; }
.pend-item i { font-style: normal; color: var(--ink-2); }
.pend-item.hay strong { color: #b45309; }
.pend-item:hover { border-color: var(--ink-2); }

/* Usuarios: qué hace cada rol, en una línea */
.roles-leyenda { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 18px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.roles-leyenda div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.roles-leyenda .rol-pill { flex: none; min-width: 92px; text-align: center; }
.roles-leyenda small { color: var(--ink-2); font-size: .82rem; }

/* Galería de credenciales */
.cred-top { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.cred-top .segmented b { font-weight: 700; color: var(--ink-2); margin-left: 4px; }
.cred-q { flex: 1; min-width: 240px; max-width: 420px; }
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 16px 20px 20px; }
.cred-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.cred-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.cred-img { position: relative; border: 0; padding: 0; background: #f3f4f5; aspect-ratio: 1.58; cursor: zoom-in; display: block; }
.cred-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cred-img span { position: absolute; left: 6px; bottom: 6px; font-size: .7rem; font-weight: 700; background: rgba(0,0,0,.55); color: #fff; padding: 2px 7px; border-radius: 6px; }
.cred-img.vacia { display: grid; place-items: center; cursor: default; }
.cred-img.vacia span { position: static; background: none; color: var(--ink-2); font-weight: 600; }
.cred-info { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 2px; }
.cred-info strong { font-size: .9rem; }
.cred-info small { font-size: .78rem; }
.cred-acc { display: flex; gap: 6px; padding: 6px 12px 12px; margin-top: auto; }

/* Nombre de cada municipio sobre el mapa */
.leaflet-tooltip.i-mun-lbl { background: transparent; border: 0; box-shadow: none; color: #1f3a44; font-weight: 800; font-size: 11px; letter-spacing: .02em; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.leaflet-tooltip.i-mun-lbl::before { display: none; }
.i-sin-mun .leaflet-tooltip.i-mun-lbl { display: none; }

/* Día D (Inicio de la Dirección) */
.diad-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 18px; border-left: 4px solid #9aa1a5; }
.diad-card.on { border-left-color: #1f8a5b; }
.diad-info { display: flex; gap: 12px; align-items: flex-start; flex: 1; min-width: 280px; }
.diad-info b { display: block; font-size: 1rem; }
.diad-info small { color: var(--ink-2); font-size: .82rem; }
.diad-dot { width: 12px; height: 12px; border-radius: 50%; background: #9aa1a5; margin-top: 5px; flex: none; }
.diad-card.on .diad-dot { background: #1f8a5b; box-shadow: 0 0 0 4px rgba(31,138,91,.15); }
.diad-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.diad-form .field { margin: 0; }
.diad-form .check { margin-bottom: 10px; }
.alert-info { background: var(--brand-50, #eef3f4); color: var(--ink); border: 1px solid var(--line); }

/* Datos leídos de la credencial (bloqueados) */
.field.bloqueado input, .field.bloqueado select { background: var(--brand-50); border-style: dashed; color: var(--ink); cursor: not-allowed; }
.field.bloqueado select { pointer-events: none; }
.field.bloqueado > span::after { content: ' 🔒'; font-size: .8em; }
.nota-bloqueo { margin: 0 0 12px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--brand-50); border: 1px solid var(--brand-100); }
.verif { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--line); color: var(--muted); white-space: nowrap; }
.verif.EXTRACCION, .verif.VERIFICADO { background: var(--green-bg); color: var(--green); }
.verif.CORREGIDO { background: var(--violet-bg); color: var(--violet); }
.verif.DUPLICADO, .verif.ILEGIBLE { background: var(--red-bg); color: var(--red); }
/* Borrado de datos de prueba (temporal) */
.limpiar-card { border: 1px dashed var(--red); margin-bottom: 16px; }
.limpiar-card summary { cursor: pointer; list-style: none; }
.limpiar-card[open] summary { margin-bottom: 10px; }
.limpiar-card form { align-items: end; margin-top: 8px; }

/* Revisión de límites municipales */
.rep-mun { margin: 6px 0; font-size: .84rem; }
.rep-mun summary { cursor: pointer; font-weight: 600; }
.rep-mun.warn summary { color: var(--amber, #a86b00); }
.rep-mun.bad summary { color: var(--red); }
.rep-mun ul { margin: 6px 0 0 18px; max-height: 180px; overflow: auto; }
.c-warn { color: var(--amber, #a86b00); }
.c-ok { color: var(--green); }

.solo-ver [data-sync], .solo-ver [data-vaciar], .solo-ver [data-nueva], .solo-ver label.btn, .solo-ver a[download] { display: none !important; }

/* Candidaturas */
.cd-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cd-resumen:empty { display: none; }
.cd-resumen .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.cd-resumen .stat small { display: block; color: var(--muted); font-size: .75rem; }
.cd-resumen .stat b { font-size: 1.35rem; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cd-card h3 { margin: 6px 0 2px; font-size: 1.05rem; }
.cd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cd-FEDERAL { background: #dde6f3; color: #1d3c6b; } .cd-LOCAL { background: #e6e0f2; color: #45306b; } .cd-MUNICIPAL { background: #f3e7d3; color: #6b4410; }
.cd-cand { margin: 0; font-weight: 600; }
.cd-mun { margin: 4px 0 10px; }
.cd-cob b { font-size: 1.2rem; }
.cd-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 6px 0 10px; }
.cd-bar span { display: block; height: 100%; border-radius: 6px; background: var(--red); }
.cd-bar span.mid { background: #c98a1b; } .cd-bar span.ok { background: var(--green); }
.cd-num { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 12px; }
.cd-num dt { font-size: .72rem; color: var(--muted); } .cd-num dd { margin: 0; font-weight: 700; }
.cd-equipo, .cd-casillas { list-style: none; margin: 12px 0; padding: 0; max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cd-equipo li, .cd-casillas li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.cd-equipo li:first-child, .cd-casillas li:first-child { border-top: 0; }
.cd-equipo small { display: block; color: var(--muted); }
.ctl { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }

/* Accesos por nivel */
.auth-elige { font-weight: 700; margin: 18px 0 8px; }
.accesos { display: grid; gap: 8px; text-align: left; }
.acceso { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: inherit; text-decoration: none; border-left: 4px solid var(--brand); }
.acceso b { font-size: 1rem; } .acceso small { grid-column: 1; color: var(--muted); font-size: .8rem; } .acceso i { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; color: var(--muted); }
.acceso:hover { border-color: var(--brand); }
.acceso-nacional { border-left-color: #1f3a44; } .acceso-estatal { border-left-color: #2d6a7a; } .acceso-municipal { border-left-color: #c98a1b; }
.acceso-candidaturas { border-left-color: #6b4410; } .acceso-representantes { border-left-color: var(--green); }
.acceso-titulo { margin: 16px 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-50); border-left: 4px solid var(--brand); text-align: left; }
.acceso-titulo b { display: block; } .acceso-titulo small { color: var(--muted); }

.cd-panel { margin-bottom: 16px; }
.head-actions .ctl { width: auto; }


/* Centro de mando nacional: un tema a la vez, cifras grandes con aire y un ranking del territorio */
.cm { max-width: 1080px; }
.cm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin: 4px 0 28px; }
.cm-head h1 { margin: 0 0 10px; font-size: 2.1rem; font-weight: 800; letter-spacing: -.035em; color: var(--brand-900); }
.cm-terr { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-terr select { appearance: none; border: 0; border-bottom: 2px solid var(--brand-500); border-radius: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233d6875' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 4px center;
  padding: 4px 24px 4px 0; font-family: inherit; font-weight: 600; font-size: 1.05rem; line-height: 1.3; color: var(--brand-700); cursor: pointer; max-width: 100%; }
.cm-terr select:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; }
.cm-diad { text-align: right; padding-top: 6px; }
.cm-diad b { display: block; font-size: 1.05rem; color: var(--brand-700); }
.cm-diad b.vivo { color: var(--green); }
.cm-diad b.vivo::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 4px var(--green-bg); }
.cm-diad small { color: var(--muted); }

.cm-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 30px; overflow-x: auto; }
.cm-tabs button { border: 0; background: none; padding: 10px 0 12px; font-family: inherit; font-weight: 600; font-size: .98rem; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.cm-tabs button[aria-selected="true"] { color: var(--brand-900); border-bottom-color: var(--brand-700); }
.cm-tabs button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.cm-cifras { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 0; margin-bottom: 40px; }
.cm-cifras.seis { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
.cm-cifra { padding: 0 28px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.cm-cifra:first-child, .cm-cifras.seis .cm-cifra:nth-child(3n+1) { border-left: 0; padding-left: 0; }
.cm-cifra b { font-size: 2.2rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; color: var(--brand-900); font-variant-numeric: tabular-nums; }
.cm-cifra.grande b { font-size: 3.6rem; }
.cm-cifra.alerta b { color: var(--amber); }
.cm-cifra span { font-size: .92rem; color: var(--ink-2); max-width: 22ch; }
.cm-cifra small { font-size: .8rem; color: var(--muted); }
.cm-barra { height: 8px; border-radius: 4px; background: var(--line); margin-top: 10px; overflow: hidden; max-width: 320px; }
.cm-barra i, .cm-bar i { display: block; height: 100%; border-radius: 4px; background: var(--red); transition: width .4s ease; }
.cm-barra i.mid, .cm-bar i.mid { background: #c98a1b; } .cm-barra i.ok, .cm-bar i.ok { background: var(--green); } .cm-bar i.neutro { background: var(--brand-500); }

.cm-rank { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px 16px; }
.cm-rank-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cm-rank-head h2 { margin: 0; font-size: 1.1rem; }
.cm-rank-head label { font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.cm-rank-head select { border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: .85rem; background: var(--surface); }
.cm-lista { list-style: none; margin: 0; padding: 0; }
.cm-lista li { display: grid; grid-template-columns: minmax(140px, 1.1fr) 2fr 70px; grid-template-rows: auto auto; column-gap: 18px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--line); border-radius: 8px; }
.cm-lista li:first-child { border-top: 0; }
.cm-lista li[data-entra] { cursor: pointer; }
.cm-lista li[data-entra]:hover, .cm-lista li[data-entra]:focus-visible { background: var(--brand-50); outline: none; }
.cm-nom { font-weight: 600; color: var(--brand-900); }
.cm-bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.cm-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.cm-det { grid-column: 2 / 4; color: var(--muted); font-size: .78rem; margin-top: 4px; }
.cm-vacio { color: var(--muted); padding: 24px 8px !important; display: block !important; }
.cm-pie { margin: 10px 8px 0; font-size: .78rem; color: var(--muted); }

.cm-ir { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; margin: 26px 0 34px; font-size: .92rem; }
.cm-ir span { color: var(--muted); }
.cm-ir a { color: var(--brand-700); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.cm-ir a:hover { border-bottom-color: var(--brand-700); }

@media (max-width: 900px) {
  .cm-cifras, .cm-cifras.seis { grid-template-columns: 1fr 1fr; row-gap: 26px; column-gap: 20px; }
  .cm-cifra, .cm-cifras.seis .cm-cifra:nth-child(3n+1) { border-left: 0; padding: 0; }
  .cm-cifra.grande { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .cm-head h1 { font-size: 1.6rem; } .cm-diad { text-align: left; }
  .cm-cifra b { font-size: 1.8rem; } .cm-cifra.grande b { font-size: 2.8rem; }
  .cm-rank { padding: 16px 14px 12px; }
  .cm-lista li { grid-template-columns: 1fr 60px; } .cm-bar { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; } .cm-det { grid-column: 1 / -1; grid-row: 3; }
}
@media (prefers-reduced-motion: reduce) { .cm-barra i, .cm-bar i { transition: none; } }

.cm-ajustes { font-size: 1rem; color: var(--muted); font-weight: 600; margin: 8px 0 12px; max-width: 1080px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------------------------------------
   Dirección nacional: interfaz institucional. Barra superior solo de texto con menús agrupados,
   títulos con serifa, superficies planas con líneas finas (sin sombras ni burbujas).
   --------------------------------------------------------------------------------------------- */
.tema-nacional { --radius: 6px; --radius-sm: 4px; --shadow-sm: none; --nx-tinta: #0f1d27; --nx-linea: #d9dde0; --nx-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif; background: #f2f3f4; }
.tema-nacional .nx-shell { display: block; min-height: 100vh; }
.nx-top { position: sticky; top: 0; z-index: 40; background: var(--nx-tinta); box-shadow: inset 0 -2px 0 #3d6875; }
.nx-bar { max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 62px; display: flex; align-items: center; gap: 28px; }
.nx-marca { display: flex; align-items: baseline; gap: 12px; color: #fff; text-decoration: none; white-space: nowrap; }
.nx-marca b { font-family: var(--nx-serif); font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.nx-marca span { font-size: .82rem; color: rgba(255,255,255,.62); padding-left: 12px; border-left: 1px solid rgba(255,255,255,.22); }
.nx-nav { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.nx-nav > a, .nx-grupo > button { display: flex; align-items: center; height: 100%; padding: 0 12px; border: 0; background: none; color: rgba(255,255,255,.74);
  font-family: inherit; font-weight: 500; font-size: .9rem; line-height: 1; text-decoration: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.nx-nav > a:hover, .nx-grupo > button:hover, .nx-grupo.open > button { color: #fff; }
.nx-nav > a[aria-current="page"], .nx-grupo.activo > button { color: #fff; border-bottom-color: #a9c7cf; }
.nx-grupo { position: relative; display: flex; }
.nx-grupo > button::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 8px; opacity: .7; }
.nx-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: #fff; border: 1px solid var(--nx-linea); border-top: 0; box-shadow: 0 14px 32px rgba(15,29,39,.14); padding: 6px 0; }
.nx-grupo.open .nx-sub { display: block; }
.nx-sub a { display: block; padding: 9px 18px; color: #16202a; text-decoration: none; font-size: .9rem; border-left: 2px solid transparent; }
.nx-sub a:hover { background: #f1f4f5; }
.nx-sub a[aria-current="page"] { font-weight: 600; border-left-color: #1f3a44; }
.nx-usuario { margin-left: auto; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.nx-usuario a { color: rgba(255,255,255,.82); text-decoration: none; font-size: .86rem; }
.nx-usuario a:hover { color: #fff; }
.nx-usuario .nx-salir { border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 5px 12px; }
.nx-menu { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 3px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.nx-nav a:focus-visible, .nx-grupo > button:focus-visible, .nx-menu:focus-visible, .nx-usuario a:focus-visible { outline: 2px solid #a9c7cf; outline-offset: 2px; }

.tema-nacional .content { max-width: 1280px; padding: 40px 32px 90px; }
.tema-nacional .page-head h1, .tema-nacional .cm-head h1, .tema-nacional .hero h1 { font-family: var(--nx-serif); font-weight: 600; letter-spacing: -.01em; font-size: 2.05rem; color: var(--nx-tinta); }
.tema-nacional h2, .tema-nacional .card-head h2 { font-family: var(--nx-serif); font-weight: 600; letter-spacing: 0; }
.tema-nacional .eyebrow { text-transform: none; letter-spacing: 0; font-size: .86rem; font-weight: 500; color: var(--muted); }
.tema-nacional .card, .tema-nacional .kpi, .tema-nacional .cm-rank, .tema-nacional .diad-card, .tema-nacional .m-tile { border-radius: 6px; box-shadow: none; border-color: var(--nx-linea); }
.tema-nacional .btn { border-radius: 4px; box-shadow: none; }
.tema-nacional .btn-primary { background: var(--nx-tinta); }
.tema-nacional .pill, .tema-nacional .rol-pill { border-radius: 3px; }
.tema-nacional .kpi strong, .tema-nacional .cm-cifra b { font-family: var(--nx-serif); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.tema-nacional .cm-cifra.grande b { font-size: 4rem; }
.tema-nacional .cm-tabs button { font-size: .95rem; }
.tema-nacional .cm-tabs button[aria-selected="true"] { border-bottom-width: 2px; color: var(--nx-tinta); }
.tema-nacional .cm-rank-head h2 { font-size: 1.2rem; }
.tema-nacional .cm-ajustes { font-family: var(--nx-serif); }

@media (max-width: 1100px) { .nx-marca span { display: none; } .nx-bar { gap: 16px; } .nx-nav > a, .nx-grupo > button { padding: 0 9px; } }
@media (max-width: 980px) {
  .nx-bar { padding: 0 16px; height: 56px; flex-wrap: wrap; }
  .nx-marca span { display: inline; }
  .nx-menu { display: block; }
  .nx-usuario { display: none; }
  .nx-nav { display: none; }
  body.nx-abierto .nx-nav { display: flex; flex-direction: column; height: auto; width: 100%; order: 3; padding: 6px 0 14px; border-top: 1px solid rgba(255,255,255,.12); }
  body.nx-abierto .nx-usuario { display: flex; order: 4; width: 100%; padding: 0 0 16px; margin: 0; }
  body.nx-abierto .nx-bar { height: auto; padding-top: 10px; }
  .nx-nav > a, .nx-grupo > button { height: auto; padding: 11px 0; border-bottom: 0; margin: 0; font-size: .98rem; }
  .nx-nav > a[aria-current="page"], .nx-grupo.activo > button { color: #fff; font-weight: 600; }
  .nx-grupo { flex-direction: column; }
  .nx-grupo > button::after { display: none; }
  .nx-sub { display: block; position: static; background: none; border: 0; box-shadow: none; padding: 0 0 6px 14px; min-width: 0; }
  .nx-sub a { color: rgba(255,255,255,.72); padding: 8px 0 8px 12px; border-left-color: rgba(255,255,255,.15); }
  .nx-sub a:hover { background: none; color: #fff; }
  .nx-sub a[aria-current="page"] { color: #fff; border-left-color: #a9c7cf; }
  .tema-nacional .content { padding: 24px 16px 70px; }
  .tema-nacional .page-head h1, .tema-nacional .cm-head h1 { font-size: 1.65rem; }
}

.tema-nacional .cm { max-width: none; }

/* Inteligencia: navegación país › estado › municipio */
.i-ruta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 4px; font-size: .86rem; }
.i-ruta a { color: var(--accent, #2c4f5b); text-decoration: none; border-bottom: 1px solid currentColor; }
.i-ruta a:hover { opacity: .8; }
.i-ruta span { color: var(--muted, #737b80); }
.i-terr { list-style: none; margin: 0; padding: 4px 0; max-height: 560px; overflow-y: auto; }
.i-terr li { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line, #e8ebed); cursor: pointer; }
.i-terr li:hover { background: var(--hover, rgba(44, 79, 91, .06)); }
.i-terr li b { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.i-terr li small { color: var(--muted, #737b80); font-size: .76rem; }
.i-terr .i-bar-row { margin: 0; }
.i-volver { margin: 10px 14px 0; }
[data-i-mun] { max-width: 220px; }
@media (max-width: 600px) { .i-terr li { grid-template-columns: minmax(0, 1fr) 100px; } }
.geo-list .search { flex: 0 0 auto; min-height: 42px; }

/* Selector de mapa base (calles / satélite) */
.leaflet-control-layers { border-radius: 6px !important; box-shadow: 0 1px 4px rgba(0,0,0,.25) !important; font: inherit; }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 10px; }
.leaflet-control-layers label { display: flex !important; align-items: center; gap: 8px; margin: 0; padding: 4px 0; font-size: .86rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.leaflet-control-layers label > span, .leaflet-control-layers label > div { display: flex; align-items: center; gap: 8px; }
.leaflet-control-layers input.leaflet-control-layers-selector { appearance: auto; -webkit-appearance: radio; width: 15px !important; height: 15px; min-height: 0; margin: 0 !important; padding: 0; flex: 0 0 auto; box-shadow: none; position: static; }
.leaflet-control-layers-toggle { width: 36px !important; height: 36px !important; }

/* Casillas: precisión de la ubicación y ubicador por dirección */
.dot.aprox { background: var(--amber, #d48806); box-shadow: 0 0 0 2px rgba(212, 136, 6, .25); }
.geo-prec { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--line, #e3e7ea); border-radius: 6px; font-size: .86rem; background: #f7faf8; color: var(--green, #1f8a5b); }
.geo-prec.aprox { background: #fff8eb; border-color: #f0d49b; color: #8a5300; }
.geo-u-lista { max-height: 300px; overflow: auto; margin: 12px 0; padding-left: 18px; }
.geo-u-lista li { margin: 3px 0; }
.geo-u-lista .pill { font-size: .72rem; margin-left: 4px; }
.modal .progress { height: 6px; background: var(--line, #e3e7ea); border-radius: 3px; overflow: hidden; }
.modal .progress i { display: block; height: 100%; background: var(--brand-500, #2c4f5b); transition: width .3s; }

/* Solicitudes de cambio al catálogo de casillas (5.4) */
.cas-sol { margin-bottom: 16px; }
.cas-sol .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cas-sol .card-head p { margin: 4px 0 0; max-width: 760px; }
.sol-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 300px; overflow: auto; border-top: 1px solid var(--line); }
.sol-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sol-list li:hover, .sol-list li.sel { background: var(--bg); }
.sol-list li.empty { display: block; cursor: default; color: var(--ink-2); text-align: center; }
.sol-list li small { display: block; color: var(--ink-2); }
.sol-list .sol-est { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.sol-est.PENDIENTE { background: #fff4dc; color: #8a5a00; } .sol-est.APROBADA { background: #e3f4ea; color: #1d6b3d; }
.sol-est.RECHAZADA { background: #fde8e8; color: #9b1c1c; } .sol-est.CANCELADA { color: var(--ink-2); }
.sol-rev { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; background: var(--bg); font-size: .86rem; }
.sol-rev table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.sol-rev th, .sol-rev td { text-align: left; padding: 4px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.sol-rev td.cambia { background: #fff4dc; font-weight: 600; }
.sol-rev .motivo { margin: 6px 0 0; white-space: pre-wrap; }
@media (max-width: 640px) { .sol-list li { grid-template-columns: 1fr; gap: 4px; } }

/* Distritos y municipios (5.5) */
.dt-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dt-resumen:empty { display: none; }
.dt-resumen .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.dt-resumen .stat small { display: block; color: var(--muted); font-size: .75rem; }
.dt-resumen .stat b { font-size: 1.35rem; }
.dt-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.dt-bar .search { max-width: 360px; min-height: 40px; }
.dt-dist { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.dt-dist > summary { list-style: none; display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 14px; cursor: pointer; }
.dt-dist > summary::-webkit-details-marker { display: none; }
.dt-dist[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg); border-radius: 12px 12px 0 0; }
.dt-dist-t small { display: block; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.dt-num { text-align: right; min-width: 90px; }
.dt-num b { display: block; font-size: 1.05rem; } .dt-num small { color: var(--muted); font-size: .72rem; }
.dt-dist .table-wrap { padding: 4px 10px 10px; overflow-x: auto; }
.dt-tabla { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dt-tabla th, .dt-tabla td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dt-tabla th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.dt-tabla .num { text-align: right; white-space: nowrap; }
.dt-rangos { max-width: 420px; color: var(--ink-2); word-break: break-word; }
.dt-chip { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.dt-chip.ok { background: #e3f4ea; color: #1d6b3d; } .dt-chip.parcial { background: #fff4dc; color: #8a5a00; }
.dt-hit { background: #fff1b8; border-radius: 3px; padding: 0 2px; } .dt-hit-row td { background: #fffbe6; }
.dt-nota { margin: 8px 2px 0; } .dt-vacio { padding: 24px 6px; text-align: center; }
.dt-tabla .pill small { font-weight: 500; opacity: .8; }
@media (max-width: 700px) { .dt-dist > summary { grid-template-columns: auto 1fr; } .dt-num { text-align: left; } }
.dt-dist .table-wrap { margin: 0; } .dt-card .table-wrap { margin: 0; }
.cd-sub { margin: 16px 0 6px; font-size: .9rem; }
.cd-reps { max-height: 320px; overflow: auto; }

/* ===== Inicio de la Dirección nacional (5.8) ===== */
.in-root { max-width: 1180px; }
.in-head { margin: 4px 0 22px; }
.in-head h1 { margin: 2px 0 0; font-size: 2.1rem; font-weight: 800; letter-spacing: -.035em; color: var(--brand-900); }
.in-modulos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.in-mod { text-align: left; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: baseline;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s; }
.in-mod:hover { border-color: var(--brand-500); }
.in-mod[aria-selected="true"] { border-color: var(--brand-800); background: var(--brand-900); color: #fff; box-shadow: var(--shadow-sm); }
.in-mod-n { grid-row: 1 / 3; font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--brand-500); font-variant-numeric: tabular-nums; }
.in-mod[aria-selected="true"] .in-mod-n { color: #9fb9c1; }
.in-mod b { font-size: 1.12rem; letter-spacing: -.01em; }
.in-mod small { grid-column: 2; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.in-mod[aria-selected="true"] small { color: #c6d3d7; }
.in-mod:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.in-filtros { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 22px; }
.in-f { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.in-f > span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.in-f select { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .92rem; background: var(--surface); min-width: 170px; }
.in-f select:disabled { opacity: .5; }
.in-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.in-seg button { border: 0; background: var(--surface); padding: 8px 14px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; border-left: 1px solid var(--line-2); }
.in-seg button:first-child { border-left: 0; }
.in-seg button[aria-pressed="true"] { background: var(--brand-800); color: #fff; }

.in-cifras { display: grid; grid-template-columns: 1fr 1fr 1.3fr; margin-bottom: 24px; }
.in-cifra { padding: 4px 26px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.in-cifra:first-child { border-left: 0; padding-left: 4px; }
.in-cifra b { font-size: 2.4rem; font-weight: 750; letter-spacing: -.03em; line-height: 1; color: var(--brand-900); font-variant-numeric: tabular-nums; }
.in-cifra span { font-size: .95rem; color: var(--ink-2); }
.in-cifra small { font-size: .8rem; color: var(--muted); }
.in-cifra.off { opacity: .38; }

.in-acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.in-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 210px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--brand-800);
  background: var(--brand-800); color: #fff; font: inherit; cursor: pointer; text-align: left; transition: background .15s, transform .1s; }
.in-btn:hover { background: var(--brand-900); }
.in-btn:active { transform: translateY(1px); }
.in-btn b { font-size: 1rem; } .in-btn small { font-size: .78rem; opacity: .8; }
.in-btn-alt, [data-p].in-btn { background: var(--surface); color: var(--brand-900); border-color: var(--line-2); }
.in-btn-alt:hover, [data-p].in-btn:hover { background: var(--brand-50); }
.in-btn-alt[aria-expanded="true"], [data-p].in-btn.on { border-color: var(--brand-800); box-shadow: inset 0 0 0 1px var(--brand-800); background: var(--brand-50); }
.in-bloque { margin: 6px 0 22px; }
.in-bloque:empty { display: none; }
[data-promo-box] { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.in-h3 { font-size: 1.02rem; margin: 6px 0 10px; }
.in-sub-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }
.in-vacio { padding: 18px 4px; }
.in-click { cursor: pointer; } .in-click:hover td { background: var(--brand-50); }

.in-comite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.in-comite > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.in-comite h3 { margin: 2px 0 4px; font-size: 1.15rem; }
.in-tot { font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.in-det > summary { list-style: none; display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; cursor: pointer; }
.in-det > summary::-webkit-details-marker { display: none; }
.in-det[open] > summary { margin-bottom: 10px; }

.in-tabla-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.in-tabla { width: 100%; border-collapse: collapse; font-size: .84rem; }
.in-tabla th { position: sticky; top: 0; background: #f6f8f9; text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.in-tabla td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.in-tabla tr:last-child td { border-bottom: 0; }
.in-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.in-tabla.in-compacta td { vertical-align: middle; }
.in-t-a { color: #1d3c6b; font-weight: 600; } .in-t-s { color: #6b4410; font-weight: 600; }

.in-sabana { margin: 18px 0 30px; padding: 18px 20px; border: 1px solid var(--brand-800); border-radius: var(--radius); background: var(--surface); }
.in-sabana > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.in-sabana h2 { margin: 2px 0; font-size: 1.2rem; }
.in-sabana .in-tabla-wrap { max-height: 560px; overflow: auto; }
.in-sabana .in-tabla td { white-space: nowrap; }
.in-pag { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.in-pag:empty { display: none; }
.in-prox { padding: 26px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; }
.in-prox b { font-size: 1.1rem; }

@media (max-width: 800px) {
  .in-modulos { grid-template-columns: 1fr; }
  .in-cifras { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .in-cifra:nth-child(3) { grid-column: 1 / 3; border-left: 0; padding-left: 4px; }
  .in-btn { min-width: 0; flex: 1 1 100%; }
}

/* Comité: alta de integrantes (5.8.1) */
.cmt-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.cmt-head h3 { margin: 2px 0 4px; font-size: 1.4rem; letter-spacing: -.02em; }
.cmt-head p { margin: 0; max-width: 520px; }
.cmt-tot { display: flex; gap: 22px; text-align: right; }
.cmt-tot b { display: block; font-size: 1.6rem; line-height: 1; color: var(--brand-900); font-variant-numeric: tabular-nums; }
.cmt-tot small { color: var(--muted); font-size: .76rem; }
.cmt-body { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.cmt-col h4, .cmt-acc h4 { margin: 0 0 10px; font-size: .95rem; }
.cmt-lista { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; max-height: 360px; overflow: auto; }
.cmt-lista li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.cmt-lista li:first-child { border-top: 0; }
.cmt-lista li.pres { background: var(--brand-50); }
.cmt-lista li small { display: block; color: var(--muted); margin-top: 2px; }
.cmt-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-100, #e3ebee); color: var(--brand-800); font-weight: 700; font-size: .8rem; }
.cmt-lista li.pres .cmt-av { background: var(--brand-800); color: #fff; }
.cmt-cargo { display: inline-block; font-weight: 600; color: var(--brand-700); margin-right: 6px; }
.cmt-num { white-space: nowrap; color: var(--ink-2) !important; font-variant-numeric: tabular-nums; }
.cmt-vacio { display: block !important; padding: 18px 12px !important; }
.cmt-alta { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.cmt-alta .btn { width: 100%; }
.cmt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cmt-chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: .78rem; cursor: pointer; color: var(--ink-2); }
.cmt-chip:hover { border-color: var(--brand-500); color: var(--brand-800); }
.cmt-chip.on { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.cmt-acc { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.cmt-acc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cmt-acc-head h4 { margin: 0; }
@media (max-width: 760px) { .cmt-body { grid-template-columns: 1fr; } .cmt-head { flex-direction: column; } .cmt-tot { text-align: left; } }

/* Ventanas altas: se desplazan dentro de la pantalla (5.8.3) */
.modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.cmt .modal-actions { position: sticky; bottom: -24px; margin: 18px -24px -24px; padding: 14px 24px; background: #fff; border-top: 1px solid var(--line); z-index: 2; }
.cmt-chips { gap: 5px; }
.cmt-chip { padding: 3px 9px; font-size: .74rem; }
.cmt-alta .field { margin-bottom: 0; }
.cmt-alta .stack { gap: 10px; }
.cmt-lista { max-height: 300px; }
.in-cand-f { margin: 2px 0 6px; }
.in-cand-f .in-seg button small { opacity: .65; font-weight: 500; margin-left: 2px; }
.in-cand-f { margin-bottom: 12px; }
.in-cand-f .in-seg small { opacity: .7; font-weight: 500; margin-left: 2px; }
.in-cand-total { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--brand-800); border-radius: var(--radius); background: var(--surface); margin: 6px 0 12px; }
.in-cand-total > div > b { display: block; font-size: 1.02rem; }
.in-cand-total > div > small { display: block; margin: 2px 0 4px; }
/* Inicio del presidente estatal / municipal: registrar y su comité */
.mi-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:16px;margin:0 0 20px}
.mi-grid .card{margin:0}
.mi-grid h2{font-size:1.05rem;margin:0 0 8px}
.mi-btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
@media (max-width:860px){.mi-grid{grid-template-columns:1fr}}

/* =====================================================================
   Responsivo: celular (≤ 640px) y tableta (≤ 1024px) en todo el sistema
   ===================================================================== */
img, svg, video, canvas { max-width: 100%; }
.geo-layout > *, .res-layout > *, .mon-layout > *, .cuenta-grid > *, .grid > *, .mi-grid > *, .kpis > * { min-width: 0; }
.card-head { flex-wrap: wrap; }
.card-head > :first-child { min-width: 0; }
.table-wrap, .in-tabla-wrap { -webkit-overflow-scrolling: touch; }
/* Monitoreo fija 5 columnas en línea: solo en pantallas anchas */
@media (max-width: 1080px) { .kpis.k6, .kpis.k5n, .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 900px) {
  .geo-layout, .res-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .in-filtros { gap: 12px 14px; }
}
@media (max-width: 640px) {
  .content { padding: 16px 12px 64px; }
  .btn { max-width: 100%; white-space: normal; }
  .in-seg button { flex: 1 1 0; padding: 8px 6px; }
  h1 { font-size: 1.55rem; line-height: 1.15; overflow-wrap: anywhere; }
  .card { padding: 16px; }
  .kpis, .kpis.k6, .kpis.k5n, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .kpi strong { font-size: 1.5rem; }
  .card-head { gap: 8px; margin-bottom: 12px; }
  .card-head > * { flex: 1 1 100%; max-width: 100% !important; }
  .card-head > .link, .card-head > a.btn { flex: 0 0 auto; }
  .g2, .g3, .g4, .row-2, .capture-grid { grid-template-columns: minmax(0, 1fr) !important; }
  /* Fotos de la INE: que los botones Tomar foto / Subir archivo nunca queden cortados */
  .dropzone { aspect-ratio: auto; min-height: 210px; }
  .dropzone.has-image { aspect-ratio: 1.586; min-height: 0; }
  /* Filtros: cada uno a lo ancho */
  .in-filtros { padding: 14px; flex-direction: column; align-items: stretch; }
  .in-f, .in-f select { min-width: 0; width: 100%; }
  .in-seg, .in-f .seg { width: 100%; }
  .toolbar, .filters, .filtros { flex-wrap: wrap; }
  .toolbar > *, .filters > *, .filtros > * { flex: 1 1 100%; min-width: 0; }
  select, input[type=search], input[type=text] { max-width: 100%; }
  /* Tablas del Inicio: se desplazan de lado sin cortarse */
  .in-tabla { font-size: .8rem; }
  .in-tabla th, .in-tabla td { padding: 7px 8px; }
  .in-tabla-wrap { margin: 0 -2px; }
  /* Leyenda de roles en Usuarios: rol arriba, descripción abajo */
  .roles-leyenda { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .roles-leyenda div { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .roles-leyenda div:last-child { border-bottom: 0; }
  .roles-leyenda .rol-pill { min-width: 0; text-align: left; }
  /* Modales a pantalla casi completa */
  .modal-backdrop { padding: 8px; align-items: end; }
  .modal { width: 100% !important; max-width: 100% !important; padding: 18px 16px; border-radius: 16px; }
  .modal.ine-modal { width: 100% !important; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  .cmt .modal-actions { bottom: -18px; margin: 14px -16px -18px; padding: 12px 16px; }
  /* Pestañas largas: se desplazan */
  .tabs, .seg, .in-modulos, .dt-tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  /* Inicio de presidentes y Día D */
  .mi-grid { grid-template-columns: minmax(0, 1fr); }
  .mi-btns .btn { flex: 1 1 100%; justify-content: center; }
  .toasts { left: 12px; right: 12px; }
  .toast { max-width: 100%; }
  .in-seg { flex-wrap: wrap; }
  /* Tablas del Inicio (estructura, candidatos, por estado): en celular, cada fila es una tarjeta */
  .in-tabla-wrap { border: 0; background: transparent; overflow: visible; }
  .in-tabla thead { display: none; }
  .in-tabla, .in-tabla tbody, .in-tabla tr, .in-tabla td { display: block; width: 100%; }
  .in-tabla tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; background: var(--surface); }
  .in-tabla td { border: 0 !important; padding: 4px 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .in-tabla td::before { content: attr(data-label); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; text-align: left; flex: none; }
  .in-tabla td:not([data-label])::before, .in-tabla td[colspan]::before { content: none; }
  .in-tabla td:not([data-label]) { justify-content: flex-end; }
  .in-tabla td[colspan] { display: block; text-align: center; }
  .in-tabla .num { white-space: normal; }
  .dt-dist > summary { gap: 8px 12px; }
}
/* Tableta: las tablas anchas se desplazan de lado dentro de su tarjeta (no se corta la columna de acciones) */
@media (min-width: 641px) and (max-width: 1100px) {
  .table-wrap { overflow-x: auto; }
  .table { min-width: 640px; }
  .content { padding-left: 20px; padding-right: 20px; }
}
.roles-leyenda small { flex: 1 1 auto; min-width: 0; }
.roles-leyenda .rol-pill { max-width: 46%; white-space: normal; }
@media (max-width: 640px) { .roles-leyenda .rol-pill { max-width: 100%; } }
.lec-card { flex-wrap: wrap; }
.lec-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 10px; }
.lec-nums div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.lec-nums b { display: block; font-size: 1.2rem; }
.lec-nums small { color: var(--muted); font-size: .76rem; }
@media (max-width: 640px) { .lec-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Lectura en el teléfono: campos que no cuadran con la CURP o la clave */
.campo-revisar { border-color: #d39a2c !important; background: #fff8eb !important; box-shadow: 0 0 0 3px rgba(211, 154, 44, .18) !important; }
/* Paso "Verificar datos": foto de la credencial junto a los campos */
.ine-cols { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.ine-foto { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #f8f9fa; }
.ine-foto summary { font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--ink-2); margin-bottom: 8px; }
.ine-foto img { width: 100%; border-radius: 10px; display: block; background: #111; aspect-ratio: 1.586; object-fit: contain; }
.ine-foto small { display: block; margin-top: 6px; font-size: .74rem; }
.ine-campos { min-width: 0; }
.ine-sec { margin: 14px 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ine-sec:first-child { margin-top: 0; }
.ine-visor { position: fixed; inset: 0; z-index: 120; background: rgba(8, 12, 14, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.ine-visor img { max-width: 100%; max-height: 82vh; border-radius: 10px; }
.ine-visor .btn { background: #fff; }
@media (max-width: 900px) {
  .ine-cols { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ine-foto { position: static; }
}
@media (max-width: 640px) {
  .ine-par { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .ine-ubic { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .ine-ubic > :first-child { grid-column: 1 / -1; }
}

/* ---------- Cámara guiada de la INE (teléfonos) ---------- */
html.cam-abierta, html.cam-abierta body { overflow: hidden; }
.cam-ine { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; display: flex; flex-direction: column; touch-action: none; }
.cam-ine .cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-mascara { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cam-marco { position: relative; width: min(94vw, calc((100vh - 260px) * 1.586), 720px); aspect-ratio: 85.6 / 54; border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .62); border: 3px solid #ef4444; transition: border-color .2s; }
.cam-marco.casi { border-color: #f59e0b; }
.cam-marco.ok { border-color: #22c55e; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .62), 0 0 0 6px rgba(34, 197, 94, .35); }
.cam-marco > i { position: absolute; width: 28px; height: 28px; border: 5px solid #fff; }
.cam-marco > i:nth-child(1) { top: -6px; left: -6px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.cam-marco > i:nth-child(2) { top: -6px; right: -6px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.cam-marco > i:nth-child(3) { bottom: -6px; left: -6px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.cam-marco > i:nth-child(4) { bottom: -6px; right: -6px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.cam-barra { position: absolute; left: 4%; right: 4%; top: 10%; height: 2px; background: rgba(255, 255, 255, .7); animation: cam-barrido 2.2s ease-in-out infinite; }
.cam-marco.ok .cam-barra { display: none; }
@keyframes cam-barrido { 0%, 100% { top: 10%; } 50% { top: 88%; } }
.cam-arriba { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: linear-gradient(rgba(0,0,0,.6), transparent); }
.cam-arriba strong { font-size: 1rem; }
.cam-btn-x, .cam-btn-luz { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.cam-btn-luz { font-size: 1.1rem; }
.cam-btn-luz.on { background: #fbbf24; color: #000; }
.cam-abajo { position: relative; margin-top: auto; padding: 14px 16px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.75) 30%); text-align: center; }
.cam-estado { margin: 0 0 10px; font-weight: 600; font-size: 1.02rem; min-height: 1.4em; text-shadow: 0 1px 3px #000; }
.cam-nivel { height: 6px; max-width: 260px; margin: 0 auto 16px; background: rgba(255, 255, 255, .2); border-radius: 3px; overflow: hidden; }
.cam-nivel span { display: block; height: 100%; width: 4%; background: #ef4444; transition: width .15s, background .2s; }
.cam-nivel span.casi { background: #f59e0b; }
.cam-nivel span.ok { background: #22c55e; }
.cam-acciones { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.cam-nativa { justify-self: start; background: none; border: 0; color: #e5e7eb; text-decoration: underline; font-size: .82rem; text-align: left; max-width: 120px; cursor: pointer; }
.cam-disparo { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.cam-disparo span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #22c55e; transition: background .2s, transform .1s; }
.cam-disparo:disabled { opacity: .45; cursor: not-allowed; }
.cam-disparo:disabled span { background: #9ca3af; }
.cam-disparo:not(:disabled):active span { transform: scale(.9); }
.cam-ine.flash::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: .7; pointer-events: none; animation: cam-flash .25s ease-out forwards; }
@keyframes cam-flash { to { opacity: 0; } }
.cam-revisar { position: absolute; inset: 0; z-index: 3; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.cam-revisar img { max-width: 100%; max-height: 62vh; border-radius: 10px; box-shadow: 0 0 0 2px #22c55e; }
.cam-revisar p { margin: 0; font-weight: 600; }
.cam-revisar-acc { display: flex; gap: 12px; width: 100%; max-width: 420px; }
.cam-revisar-acc .btn { flex: 1; min-height: 48px; }
.cam-revisar-acc .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .5); background: transparent; }
@media (orientation: landscape) and (max-height: 500px) {
  .cam-marco { width: min(70vw, calc((100vh - 150px) * 1.586)); }
  .cam-abajo { padding-top: 6px; }
  .cam-nivel { margin-bottom: 8px; }
  .cam-disparo { width: 60px; height: 60px; }
}

/* Inicio de tres botones (nacional, estatal y municipal) */
.in-head h1 .in-lugar { display: block; font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-top: 4px; }
.in-volver { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; flex-wrap: wrap; }
.in-volver h2 { margin: 0; font-family: inherit; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand-900); }
.in-panel > .mi-grid { margin-bottom: 18px; }

/* Casilla que cubrirá el representante */
.cas-asig-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.cas-asig-head b { font-size: .95rem; }
.cas-asig .grid { margin-top: 0; }
.cas-asig select option:disabled { color: #9ca3af; }
.cas-asig .grid + .grid { margin-top: 12px; }

/* Día D · cobertura de casillas y ¿Ya votó? */
.dd-barra { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin: 6px 0 6px; }
.dd-barra span { display: block; height: 100%; }
.dd-barra .ok, .dd-leyenda i.ok { background: #16a34a; }
.dd-barra .warn, .dd-leyenda i.warn { background: #f59e0b; }
.dd-barra .bad, .dd-leyenda i.bad { background: #dc2626; }
.dd-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: .8rem; color: var(--muted); margin: 0 0 14px; }
.dd-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; }
.dd-rep { padding: 2px 0; }
.dd-rep.dd-NO_HA_LLEGADO b { color: #b45309; }
.dd-rep.dd-SE_RETIRO b { color: var(--muted); }
.dd-sec { margin: 18px 0 8px; font-size: 1rem; font-weight: 800; color: var(--brand-900); }
.dd-mini { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.dd-mini span { display: block; height: 100%; background: #16a34a; }
.dd-det-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-red { background: #fee2e2; color: #991b1b; }
@media (max-width: 640px) { .dd-mini { display: none; } }
@media (max-width: 640px) {
  .in-tabla .dd-rep { white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .in-tabla td:has(.dd-rep) { flex-direction: column; align-items: flex-start; gap: 4px; }
}
.in-sabana .in-tabla td:has(.dd-rep) { white-space: normal; min-width: 260px; }

/* Marca nacional: un solo botón "IDAI · Dirección Nacional" que lleva al inicio */
.nx-marca { align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; background: rgba(255,255,255,.06); transition: background .15s, border-color .15s; }
.nx-marca:hover, .nx-marca:focus-visible { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); }
.nx-marca b { font-size: 1.15rem; line-height: 1; }
.nx-marca span { border-left: 0; padding-left: 0; color: rgba(255,255,255,.85); font-size: .84rem; line-height: 1; }
.nx-marca span::before { content: '·'; margin-right: 8px; color: rgba(255,255,255,.5); }
@media (max-width: 1100px) { .nx-marca span { display: inline; } }
@media (max-width: 420px) { .nx-marca { padding: 6px 10px; } .nx-marca span { font-size: .76rem; } }
.nx-marca, .nx-marca:hover, .nx-marca:hover b, .nx-marca:hover span { text-decoration: none !important; }
.nx-marca span::before { font-size: 1.1rem; font-weight: 700; vertical-align: -1px; }
.cas-multi .cas-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.cas-op { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.cas-op:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); }
.cas-op input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.cas-op small { display: block; color: var(--muted); font-size: .78rem; }
.cas-elegidas { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.cas-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-700, #1f3a44); color: #fff; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .84rem; font-weight: 600; }
.cas-chip button { background: rgba(255,255,255,.2); color: #fff; border: 0; border-radius: 50%; width: 20px; height: 20px; line-height: 1; cursor: pointer; }

/* Dirección · INE y nombramientos de representantes */
.rd-filtros { margin-bottom: 16px; }
.rd-q input { min-width: 240px; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.rd-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.rd-ine { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rd-ine img, .rd-sin { width: 100%; aspect-ratio: 85.6 / 54; object-fit: cover; border-radius: 8px; background: #eef1f2; display: flex; align-items: center; justify-content: center; font-size: .78rem; color: var(--muted); }
.rd-info { display: flex; flex-direction: column; gap: 3px; }
.rd-info .pill { align-self: flex-start; }
.rd-info small { color: var(--muted); font-size: .8rem; }
.rd-acc { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) { .rd-grid { grid-template-columns: 1fr; } .rd-q input { min-width: 0; } }

/* 5.26 · Inicio con cuatro botones (Inteligencia) y Defensa dentro de Estructura electoral */
.in-modulos.in-4 { grid-template-columns: repeat(4, 1fr); }
a.in-mod, a.in-btn { text-decoration: none; }
a.in-mod { color: var(--ink); }
.in-def-tit { margin-top: 4px; }
@media (max-width: 1000px) { .in-modulos.in-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .in-modulos.in-4 { grid-template-columns: 1fr; } }

/* 5.28 · Navegación por pasos: filtros → botones → lo elegido, con «← Atrás» y ruta */
.in-migas { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 1.05rem; }
.in-migas a { color: var(--brand-700, var(--brand-800)); text-decoration: none; font-weight: 600; }
.in-migas a:hover { text-decoration: underline; }
.in-migas span { color: var(--muted); }
.in-migas b { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand-900); }
.in-f-aplicar { min-width: 0; justify-content: flex-end; }
.in-f-aplicar .btn { padding: 9px 18px; }
[data-promo-box], [data-ee-def] { padding: 0; border: 0; background: none; }
.in-filtros-in { padding: 10px 0 0; border: 0; background: none; margin: 0; }
.in-filtros-in input { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .92rem; background: var(--surface); min-width: 220px; }

/* 5.29 · Ficha de casilla con mapa (Estructura electoral → Casillas) */
.cas-ficha header h2 small { font-size: .95rem; font-weight: 600; margin-left: 6px; }
.cas-ficha-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; margin: 6px 0 22px; align-items: start; }
.cas-mapa { height: 420px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.cas-sin-mapa { height: 220px; border-radius: 12px; border: 1px dashed var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; background: var(--bg); }
.cas-datos { margin: 0; display: grid; gap: 12px; }
.cas-datos dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cas-datos dd { margin: 2px 0 0; font-size: .95rem; color: var(--ink); }
.cas-chip { display: inline-block; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .82rem; font-family: ui-monospace, monospace; background: var(--surface); color: var(--brand-900); cursor: pointer; margin: 0 4px 4px 0; }
.cas-chip.on { background: var(--brand-900); color: #fff; border-color: var(--brand-900); cursor: default; }
[data-ee-cas].in-click td { cursor: pointer; }
@media (max-width: 900px) { .cas-ficha-grid { grid-template-columns: 1fr; } .cas-mapa { height: 320px; } }

/* 5.30 · Comunicación con las bases */
.in-modulos.in-n4 { grid-template-columns: repeat(4, 1fr); }
.in-modulos.in-n5, .in-modulos.in-n6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .in-modulos.in-n4, .in-modulos.in-n5, .in-modulos.in-n6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .in-modulos.in-n4, .in-modulos.in-n5, .in-modulos.in-n6 { grid-template-columns: 1fr; } }
.in-input { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: .92rem; background: var(--surface); min-width: 210px; }
.b-wa { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #e7f6ec; color: #13703a; font-weight: 600; font-size: .86rem;
  text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid #c3e8cf; }
.b-wa:hover { background: #d4f0de; }
.b-wa-i { flex: none; }
.i-volver { margin: 10px 0 8px; }
.k-sencillo { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.in-btn.in-ir { text-decoration: none; background: var(--surface); color: var(--brand-900); border-color: var(--line-2); }
.in-btn.in-ir small { color: var(--muted); }
.in-btn.in-ir:hover { background: var(--brand-50); }

/* PREP */
.prep-avance { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: end; margin: 6px 0 18px; }
.prep-barra { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.prep-barra span { display: block; height: 100%; background: var(--brand-800); }
.prep-ops { display: grid; gap: 8px; margin: 4px 0 22px; }
.prep-op { display: grid; grid-template-columns: 120px minmax(0, 1fr) 150px; gap: 12px; align-items: center; font-variant-numeric: tabular-nums; }
.prep-op b { font-size: .95rem; } .prep-op .num { text-align: right; } .prep-op .num small { color: var(--muted); margin-left: 6px; }
.prep-op .bar { height: 22px; border-radius: 6px; background: var(--brand-50); overflow: hidden; }
.prep-op .bar span { display: block; height: 100%; background: var(--brand-800); border-radius: 6px; }
.prep-op.lider .bar span { background: var(--brand-900); }
.prep-ir { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand-800); cursor: pointer; text-align: left; }
.prep-ir:hover { text-decoration: underline; }
@media (max-width: 640px) { .prep-op { grid-template-columns: 80px minmax(0, 1fr); } .prep-op .num { grid-column: 1 / -1; text-align: left; } }
.k-sencillo.k3 { grid-template-columns: repeat(3, 1fr); max-width: 900px; } @media (max-width: 640px) { .k-sencillo.k3 { grid-template-columns: 1fr; } }
.ee-geo .geo-list { max-height: 520px; } .ee-geo .cas-list li small { display: block; } .ee-geo .cas-list { margin-bottom: 0; } .ee-geo .map { height: 520px; } @media (max-width: 900px) { .ee-geo { grid-template-columns: 1fr; } .ee-geo .geo-list { position: static; max-height: 360px; } .ee-geo .map { height: 380px; } }
.geo-main p .dot { display: inline-block; vertical-align: -1px; width: 9px; height: 9px; }

/* Aviso "Modo sin internet": avance de la descarga, listo, activado sin señal */
.sr-prep { padding: 14px 16px 13px; border-radius: 14px; background: var(--brand-950); color: #e6ecee; box-shadow: var(--shadow-lg); font-size: .88rem; line-height: 1.4;
  transform: translateY(12px); opacity: 0; transition: transform .25s, opacity .25s; }
.sr-prep.in { transform: none; opacity: 1; }
.sr-prep-h { display: flex; align-items: center; gap: 9px; }
.sr-prep-h b { flex: 1; color: #fff; font-size: .93rem; }
.sr-prep-ic { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.sr-prep[data-estado="carga"] .sr-prep-ic { animation: srLatido 1.2s ease-in-out infinite; }
.sr-prep[data-estado="listo"] .sr-prep-ic { background: #4ade80; }
.sr-prep[data-estado="off"] .sr-prep-ic { background: #fbbf24; }
.sr-prep[data-estado="error"] .sr-prep-ic { background: #fb7185; }
.sr-prep-x { margin: -4px -6px -4px 0; padding: 2px 8px; border: 0; background: none; color: #a9b8bd; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.sr-prep-x:hover { color: #fff; }
.sr-prep p { margin: 6px 0 0 19px; }
.sr-prep small { display: block; margin: 6px 0 0 19px; color: #a9b8bd; font-size: .78rem; }
.sr-prep small:empty { display: none; }
.sr-prep-bar { height: 6px; margin: 10px 0 0 19px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.sr-prep-bar[hidden] { display: none; }
.sr-prep-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
@keyframes srLatido { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sr-prep, .sr-prep-bar i { transition: none; } .sr-prep[data-estado="carga"] .sr-prep-ic { animation: none; } }

/* ---------------- Grafo de cuentas (Dirección nacional) ---------------- */
.gr-barra { padding: 16px 18px 12px; margin-bottom: 16px; }
.gr-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin: 0; }
.gr-campo { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.gr-campo select, .gr-campo input { min-width: 190px; }
.gr-buscar { flex: 1 1 220px; }
.gr-buscar input { width: 100%; }
.gr-check { display: flex; align-items: center; gap: 7px; font-size: .86rem; color: var(--ink-2); padding-bottom: 9px; }
.gr-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.gr-seg button { border: 0; background: var(--surface); color: var(--ink-2); font: inherit; font-size: .86rem; padding: 9px 14px; cursor: pointer; }
.gr-seg button + button { border-left: 1px solid var(--line-2); }
.gr-seg button[aria-pressed="true"] { background: var(--brand-700); color: #fff; font-weight: 600; }
.gr-seg button:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.gr-leyenda { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.gr-ley { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 5px 10px; font: inherit; font-size: .8rem; color: var(--ink); cursor: pointer; }
.gr-ley small { color: var(--muted); font-variant-numeric: tabular-nums; }
.gr-ley[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.gr-ley-fija { cursor: default; border-style: dashed; color: var(--ink-2); }
.gr-ico { display: inline-block; width: 12px; height: 12px; background: var(--c, #9aa3a8); flex: none; }
.gr-f-ellipse { border-radius: 50%; }
.gr-f-round-rectangle { border-radius: 3px; }
.gr-f-diamond { transform: rotate(45deg) scale(.82); }
.gr-f-hexagon { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.gr-f-triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.gr-f-star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.gr-terr { background: #fff; border: 1.5px dashed #7d878c; border-radius: 3px; }
.gr-inact { background: #1f3a44; opacity: .38; border-radius: 50%; }
.gr-zona { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.gr-lienzo { position: relative; padding: 0; overflow: hidden; height: min(74vh, 820px); min-height: 460px; background: #fbfcfc; }
.gr-cy { position: absolute; inset: 0; }
.gr-estado { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(251,252,252,.8); z-index: 2; text-align: center; padding: 20px; }
.gr-estado[hidden] { display: none; }
.gr-zoom { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.gr-zoom .btn { background: var(--surface); min-width: 34px; }
.gr-ayuda { position: absolute; left: 14px; bottom: 8px; margin: 0; z-index: 3; background: rgba(251,252,252,.85); padding: 2px 6px; border-radius: 3px; pointer-events: none; }
.gr-ficha { padding: 18px 20px; position: sticky; top: 80px; max-height: min(74vh, 820px); overflow: auto; }
.gr-nombre { font-size: 1.25rem; margin: 2px 0 4px; line-height: 1.25; overflow-wrap: anywhere; }
.gr-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0; font-size: .84rem; }
.gr-dl dt { color: var(--muted); }
.gr-dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.gr-cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.gr-cifras div { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; }
.gr-cifras b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.gr-cifras small { color: var(--muted); font-size: .75rem; }
.gr-ruta { line-height: 1.5; }
.gr-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tema-nacional .gr-nombre { font-family: var(--nx-serif); font-weight: 600; }
@media (max-width: 1000px) {
  .gr-zona { grid-template-columns: 1fr; }
  .gr-ficha { position: static; max-height: none; }
  .gr-lienzo { height: 62vh; min-height: 380px; }
}
@media (max-width: 600px) {
  .gr-campo, .gr-campo select, .gr-campo input { width: 100%; min-width: 0; }
  .gr-seg { width: 100%; } .gr-seg button { flex: 1; padding: 9px 6px; }
  .gr-ayuda { display: none; }
}

/* ---------------- Telemetría de celulares (RC y RG) ---------------- */
.tm-auto { padding-bottom: 0; white-space: nowrap; }
.tm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tm-kpi { text-align: left; font: inherit; cursor: pointer; border-left: 3px solid var(--line-2); }
.tm-kpi:hover { border-color: var(--brand-500); }
.tm-kpi.activo { outline: 2px solid var(--brand-700); outline-offset: -2px; }
.tm-kpi:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.tm-k-ok { border-left-color: var(--green); } .tm-k-warn { border-left-color: var(--amber); } .tm-k-bad { border-left-color: var(--red); }
.tm-filtros { display: flex; flex-wrap: wrap; gap: 10px; }
.tm-filtros input[type=search] { flex: 1 1 240px; }
.tm-fila { cursor: pointer; }
.tm-fila:hover td { background: var(--brand-50); }
.tm-nowrap { white-space: nowrap; }
.tm-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--muted); }
.tm-dot.tm-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); } .tm-dot.tm-warn { background: var(--amber); } .tm-dot.tm-bad { background: var(--red); }
.tm-bat { display: inline-block; width: 34px; height: 12px; border: 1.5px solid var(--ink-2); border-radius: 3px; vertical-align: middle; position: relative; padding: 1px; }
.tm-bat::after { content: ''; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: var(--ink-2); border-radius: 0 1px 1px 0; }
.tm-bat i { display: block; height: 100%; border-radius: 1px; background: var(--green); }
.tm-bat.tm-warn i { background: var(--amber); } .tm-bat.tm-bad i { background: var(--red); }
.tm-nota { margin-top: 12px; max-width: 900px; }
.tm-modal { width: min(620px, 100%) !important; }
.tm-h4 { font-size: .86rem; margin: 14px 0 6px; color: var(--ink-2); }
.tm-graf { width: 100%; height: auto; display: block; }
.tm-g-eje { stroke: var(--line); stroke-width: 1; }
.tm-g-umbral { stroke: var(--red); stroke-width: 1; stroke-dasharray: 4 4; opacity: .6; }
.tm-g-linea { fill: none; stroke: var(--brand-600); stroke-width: 2; stroke-linejoin: round; }
.tm-g-txt { font-size: 10px; fill: var(--muted); }
@media (max-width: 1000px) { .tm-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- Mapa sin internet (5.43) ---------------- */
.mp-barra { padding: 12px 14px; margin-bottom: 12px; }
.mp-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.mp-filtros input[type=search] { flex: 1 1 220px; }
.mp-filtros select { flex: 0 1 260px; }
.mp-barra .muted { margin: 8px 0 0; }
.mp-mapa { height: min(72vh, 760px); min-height: 340px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 600px) { .mp-mapa { height: 66vh; } }

/* ---------------- Sitio de ensayo (5.43) ---------------- */
.banda-ensayo { position: sticky; top: 0; z-index: 60; background: repeating-linear-gradient(-45deg, #a86400 0 14px, #8f5500 14px 28px); color: #fff; text-align: center; font: 700 .82rem/1.3 Inter, system-ui, sans-serif; padding: 6px 12px; letter-spacing: .02em; }
.tema-nacional .banda-ensayo + .nx-shell .nx-top { top: 30px; }

/* ---------------- Simulacro del Día D (5.43) ---------------- */
.sm-aviso { border-left: 4px solid var(--amber); background: var(--amber-bg); padding: 12px 16px; margin-bottom: 14px; font-size: .9rem; }
.sm-aviso code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; }
.sm-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.sm-form h2, .sm-vivo h2 { margin-bottom: 12px; }
.sm-h3 { font-size: .95rem; margin: 16px 0 8px; }
.sm-perfiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sm-perfiles label { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; border: 1px solid var(--line); border-radius: 6px; padding: 10px; cursor: pointer; }
.sm-perfiles label:has(input:checked) { border-color: var(--brand-700); background: var(--brand-50); }
.sm-perfiles input { grid-row: span 2; margin-top: 3px; }
.sm-perfiles small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.sm-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sm-terr { margin-bottom: 10px; }
.sm-reloj { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 14px; }
.sm-reloj b { font-size: 2rem; font-variant-numeric: tabular-nums; font-family: var(--nx-serif, inherit); }
.sm-barra { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.sm-barra i { display: block; height: 100%; background: var(--brand-600); transition: width .6s; }
.sm-reloj span { font-size: .8rem; color: var(--muted); }
.sm-cifras { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.sm-cifras div { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.sm-cifras b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.sm-cifras small { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.sm-errores { margin: 8px 0 0 16px; font-size: .8rem; color: var(--ink-2); }
.sm-informe { margin-bottom: 16px; }
.sm-inf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sm-res { font-size: .9rem; padding: 4px 12px; }
.sm-rev { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.sm-rev li { display: grid; grid-template-columns: 28px 1fr; gap: 6px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); }
.sm-rev li > span { font-weight: 700; }
.sm-rev li p { margin: 2px 0 0; font-size: .85rem; color: var(--ink-2); }
.sm-rev .sm-ok > span { color: var(--green); } .sm-rev .sm-warn { background: var(--amber-bg); } .sm-rev .sm-warn > span { color: var(--amber); }
.sm-rev .sm-bad { background: var(--red-bg); } .sm-rev .sm-bad > span { color: var(--red); }
.sm-pre { white-space: pre-wrap; font-size: .76rem; background: var(--bg); padding: 12px; border-radius: 6px; max-height: 420px; overflow: auto; }
@media (max-width: 1000px) { .sm-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .sm-perfiles { grid-template-columns: 1fr; } .sm-reloj b { font-size: 1.5rem; } }
