/* =====================================================================
   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); }
.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-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 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: 900px) { .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: grayscale(1) contrast(.9) brightness(1.06); }

/* ---------------- 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; }
.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 .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; }
