/* ==========================================================================
   Elecciones 2026 · Cooperativa Uniotavalo — hoja de estilos única
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-ext-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
  unicode-range: U+0100-02AF, U+1E00-1E9F, U+1EF2-1EFF, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #0e1d3b;
  --ink-2: #1b2d55;
  --ink-3: #2c4072;
  --brand: #86181a;
  --brand-2: #a52325;
  --brand-soft: #f6e9e8;
  --paper: #f9f9f9;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e5e1d8;
  --line-2: #d6d1c5;
  --text: #1c2333;
  --muted: #5d6578;
  --faint: #8a90a0;
  --ok: #1f7a4d;
  --ok-soft: #e6f3ec;
  --warn: #9a6400;
  --warn-soft: #fbf1dc;
  --info: #24539c;
  --info-soft: #e7eef9;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(14, 29, 59, .06);
  --shadow: 0 1px 2px rgba(14, 29, 59, .05), 0 8px 24px -12px rgba(14, 29, 59, .18);
  --shadow-lg: 0 24px 60px -20px rgba(14, 29, 59, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /*--serif: "Fraunces", Georgia, "Times New Roman", serif;*/
  --focus: 0 0 0 3px rgba(36, 83, 156, .28);
}

*, *::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.55;
  color: var(--text); background: var(--paper);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--ink); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1 var(--font); padding: 11px 18px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: rgba(14, 29, 59, .06); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #efc4bf; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #f1efe9; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink); margin-bottom: 6px; }
.req { color: var(--brand); margin-left: 2px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
  width: 100%; font: 15px/1.4 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 13px; transition: border-color .15s, box-shadow .15s; appearance: none;
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.select {
  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 1.5 6 6.5l5-5' stroke='%235d6578' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--info); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #a3a8b4; }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid { border-color: var(--danger); }
.error-msg { display: block; color: var(--danger); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.counter { float: right; font-weight: 500; color: var(--faint); font-size: 12px; }

.check {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.check:hover { border-color: var(--ink-3); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-2); flex: none;
  display: grid; place-items: center; background: #fff; margin-top: 1px; transition: all .15s;
}
.check .box svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { box-shadow: var(--focus); }
.check:has(input:checked) { border-color: var(--ink); background: #f3f5fa; }
.check-text { font-size: 14px; line-height: 1.5; }
.is-invalid .check { border-color: var(--danger); }

/* Zona de carga */
.drop {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 18px;
  border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--surface-2);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--ink-3); background: #f1f3f8; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-icon { width: 46px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); flex: none; }
.drop-body { min-width: 0; flex: 1; }
.drop-title { font-weight: 600; color: var(--ink); }
.drop-sub { font-size: 12.5px; color: var(--muted); }
.drop-file { font-size: 13px; color: var(--ok); font-weight: 600; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop.has-file { border-style: solid; border-color: #b9d8c7; background: var(--ok-soft); }
.drop-preview { width: 64px; height: 80px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; background: #fff; }
.is-invalid .drop { border-color: var(--danger); }

/* Firma */
.firma-wrap { border: 1px solid var(--line-2); border-radius: 14px; background: #fff; overflow: hidden; }
.firma-canvas { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; background:
  linear-gradient(transparent calc(100% - 52px), var(--line) calc(100% - 52px), var(--line) calc(100% - 51px), transparent calc(100% - 51px)); }
.firma-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.is-invalid .firma-wrap { border-color: var(--danger); }

/* ---------- Alertas ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 18px; border: 1px solid; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--ok-soft); border-color: #bfe0cd; color: #14532d; }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: #f5c6c0; color: #7a1a12; }
.alert-warning { background: var(--warn-soft); border-color: #efd9a6; color: #6b4600; }
.alert-info { background: var(--info-soft); border-color: #c8d7f0; color: #1c3f75; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Insignias de estado ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-recibida { background: var(--info-soft); color: var(--info); }
.badge-en_revision { background: var(--warn-soft); color: var(--warn); }
.badge-habilitada { background: var(--ok-soft); color: var(--ok); }
.badge-no_habilitada { background: var(--danger-soft); color: var(--danger); }
.badge-admin { background: var(--brand-soft); color: var(--brand); }
.badge-operador { background: var(--info-soft); color: var(--info); }
.badge-off { background: #eceae4; color: var(--muted); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; font-family: var(--font); font-weight: 650; }
.card-body { padding: 22px; }

/* ==========================================================================
   SITIO PÚBLICO
   ========================================================================== */
.pub-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.pub-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.pub-logo img { height: 40px; width: auto; }
.pub-nav { display: flex; gap: 6px; align-items: center; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 860px; }

.hero { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; right: -180px; top: -140px; width: 560px; height: 560px; border-radius: 50%;
  border: 70px solid rgba(255, 255, 255, .045); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; right: 60px; bottom: -220px; width: 420px; height: 420px; border-radius: 50%;
  border: 54px solid rgba(165, 35, 37, .32); pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 80px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #f0c9c9; margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brand-2); }
.hero h1 { color: #fff; font-size: clamp(32px, 5vw, 54px); max-width: 760px; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: #d92626; }
.hero p.lead { font-size: 17.5px; color: #c9d1e3; max-width: 660px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 44px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, .12); }
.hero-meta div { font-size: 13px; color: #a9b4cc; }
.hero-meta strong { display: block; color: #fff; font-size: 15px; font-weight: 600; }

.section { padding: 64px 0; }
.section-title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 8px; }
.section-sub { color: var(--muted); max-width: 640px; margin-bottom: 32px; }

.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: paso; }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step-card::before {
  counter-increment: paso; content: "0" counter(paso);
  font-family: var(--serif); font-size: 28px; color: var(--brand); display: block; margin-bottom: 10px;
}
.step-card h3 { font-size: 16px; font-family: var(--font); font-weight: 650; }
.step-card p { font-size: 14px; color: var(--muted); margin: 0; }

.req-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: start; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.req-list li:last-child { border-bottom: 0; }
.req-list .icon { color: var(--ok); margin-top: 2px; }
.impedimentos { counter-reset: none; margin: 0; padding-left: 0; list-style: none; font-size: 14px; color: var(--text); }
.impedimentos li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px dashed var(--line); }
.impedimentos li:last-child { border-bottom: 0; }
.impedimentos li span { position: absolute; left: 0; top: 8px; font-weight: 700; color: var(--brand); }

.pub-footer { background: var(--ink); color: #a9b4cc; font-size: 13px; padding: 28px 0; margin-top: 40px; }
.pub-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pub-footer a { color: #dfe5f2; }

/* ---------- Formulario de postulación (wizard) ---------- */
.form-page { padding-top: 36px; padding-bottom: 60px; }
.form-intro { margin-bottom: 26px; }
.form-intro h1 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 6px; }
.form-layout { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.stepper { position: sticky; top: 94px; list-style: none; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stepper li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); cursor: default; }
.stepper .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--paper); color: var(--muted); border: 1px solid var(--line); flex: none; }
.stepper li.is-active { background: #f1f3f8; color: var(--ink); font-weight: 600; }
.stepper li.is-active .num { background: var(--ink); color: #fff; border-color: var(--ink); }
.stepper li.is-done { color: var(--ink); cursor: pointer; }
.stepper li.is-done .num { background: var(--ok-soft); color: var(--ok); border-color: #bfe0cd; }
.progress-mobile { display: none; }

.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.form-step { padding: 30px 32px 8px; }
.js .form-step { display: none; }
.js .form-step.is-active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.step-head .tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.step-head h2 { font-size: 22px; margin: 2px 0 2px; }
.step-head p { margin: 0; color: var(--muted); font-size: 14px; }
.form-nav { display: flex; justify-content: space-between; gap: 12px; padding: 18px 32px 28px; }
.legal-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; font-size: 13.5px; line-height: 1.6; margin-bottom: 12px; max-height: 300px; overflow: auto; }
.legal-box h3 { font-family: var(--font); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.legal-box ul { margin: 6px 0 0; padding-left: 20px; }
.legal-box li { margin-bottom: 4px; }
.declara-box { border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; font-size: 14px; margin-bottom: 18px; color: #4a1112; }
.resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.resumen dt { color: var(--muted); font-size: 12px; }
.resumen dd { margin: 0 0 4px; font-weight: 600; color: var(--ink); word-break: break-word; }
.fecha-sistema { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Página de confirmación / consulta */
.center-card { max-width: 620px; margin: 48px auto; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; }
.success-mark .icon { width: 32px; height: 32px; stroke-width: 2.2; }
.codigo { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .06em; color: var(--ink); background: var(--paper); border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 18px; display: inline-block; }

/* ==========================================================================
   LOGIN
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-side { background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; left: -120px; bottom: -160px; width: 460px; height: 460px; border-radius: 50%; border: 60px solid rgba(165, 35, 37, .35); }
.auth-side::before { content: ""; position: absolute; left: 140px; bottom: -60px; width: 300px; height: 300px; border-radius: 50%; border: 44px solid rgba(255, 255, 255, .06); }
.auth-side h2 { color: #fff; font-size: 38px; max-width: 420px; position: relative; z-index: 1; }
.auth-side p { color: #b9c3d8; max-width: 420px; position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; position: relative; z-index: 1; }
.auth-brand img { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: cover; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 30px; margin-bottom: 6px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; cursor: pointer; color: var(--muted); border-radius: 8px; }
.pw-toggle:hover { color: var(--ink); background: var(--paper); }
.otp-input { font-size: 26px; letter-spacing: .5em; text-align: center; font-family: ui-monospace, Menlo, monospace; padding-left: .5em; }

/* ==========================================================================
   PANEL
   ========================================================================== */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #c4cce0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sb-brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; object-fit: cover; }
.sb-brand strong { display: block; color: #fff; font-size: 15px; line-height: 1.2; }
.sb-brand span { font-size: 12px; color: #8e9ab6; }
.sb-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #6f7c9a; padding: 14px 12px 6px; font-weight: 600; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c4cce0; font-size: 14px; font-weight: 500; text-decoration: none !important; margin-bottom: 2px; }
.sb-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-link.is-active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--brand-2); }
.sb-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--brand); color: #fff; flex: none; object-fit: cover; }
.sb-user strong { display: block; color: #fff; font-size: 13.5px; line-height: 1.2; }
.sb-user span { font-size: 12px; color: #8e9ab6; }
.sb-user .btn-quiet { color: #c4cce0; margin-left: auto; }
.sb-user .btn-quiet:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.sb-overlay { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 32px; background: var(--paper); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; }
.topbar.is-scrolled { border-bottom-color: var(--line); background: rgba(246, 244, 239, .92); backdrop-filter: blur(8px); }
.topbar h1 { font-size: 24px; margin: 0; }
.topbar .crumbs { font-size: 12.5px; color: var(--muted); }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.menu-btn { display: none; }
.content { padding: 8px 32px 40px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none !important; color: inherit; transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.stat .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .val { font-family: var(--serif); font-size: 34px; color: var(--ink); line-height: 1.1; margin-top: 6px; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-total { background: var(--ink); } .dot-recibida { background: var(--info); } .dot-en_revision { background: var(--warn); } .dot-habilitada { background: var(--ok); } .dot-no_habilitada { background: var(--danger); }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bar { flex: 1; background: #dfe4ef; border-radius: 6px 6px 2px 2px; position: relative; min-height: 3px; }
.bar.has { background: var(--ink-3); }
.bar:hover { background: var(--brand); }
.bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); padding-bottom: 3px; }
.bars-x { display: flex; gap: 6px; margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.recent li:last-child { border-bottom: 0; }
.recent .who { min-width: 0; flex: 1; }
.recent strong { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent small { color: var(--muted); }

/* Filtros */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; }
.filters label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.filters .input, .filters .select { padding: 9px 12px; font-size: 14px; }
.filters .select { padding-right: 32px; }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search-wrap .input { padding-left: 38px; }

.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: #f1f3f8; border-bottom: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.bulkbar strong { color: var(--ink); }

/* Tabla */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfaf7; }
.table .chk { width: 40px; }
.table input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; }
.person { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.person strong { display: block; color: var(--ink); font-weight: 600; }
.person small { color: var(--muted); }
.thumb { width: 44px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--paper); cursor: zoom-in; flex: none; padding: 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--line-2); margin: 0 auto 10px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; padding: 0 8px; background: var(--surface); }
.pager-links a:hover { border-color: var(--ink-3); }
.pager-links .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager-links .is-gap { border: 0; background: none; }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding: 18px; }
.g-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.g-photo { aspect-ratio: 3 / 4; background: var(--paper); border: 0; padding: 0; cursor: zoom-in; display: block; width: 100%; }
.g-photo img { width: 100%; height: 100%; object-fit: cover; }
.g-body { padding: 10px 12px 12px; }
.g-body strong { display: block; font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.g-body small { color: var(--muted); font-size: 12px; }
.g-body .badge { margin-top: 6px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.view-toggle a { padding: 8px 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.view-toggle a.is-active { background: var(--ink); color: #fff; }

/* Detalle */
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.profile-card { text-align: center; padding: 24px; }
.profile-photo { width: 168px; height: 210px; border-radius: 14px; object-fit: cover; margin: 0 auto 16px; border: 1px solid var(--line); background: var(--paper); cursor: zoom-in; padding: 0; overflow: hidden; display: block; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-card h2 { font-family: var(--font); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 0; font-size: 14px; }
.kv dt { color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; word-break: break-word; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.prose-box { white-space: pre-line; font-size: 14px; line-height: 1.65; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.doc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none !important; background: var(--surface); }
.doc:hover { border-color: var(--ink-3); }
.doc .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--ink); flex: none; }
.doc strong { display: block; font-size: 14px; }
.doc small { color: var(--muted); }
.doc.is-missing { opacity: .55; pointer-events: none; }
.checks-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.checks-list li { display: flex; gap: 10px; align-items: center; padding: 7px 0; }
.checks-list .ok { color: var(--ok); } .checks-list .no { color: var(--danger); }
.firma-img { max-height: 90px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--line); position: relative; margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.timeline small { color: var(--muted); display: block; }
.stack > * + * { margin-top: 18px; }

/* Modal / visor */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 16, 33, .62); backdrop-filter: blur(3px); }
.modal-dialog { position: relative; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 820px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal-dialog.sm { max-width: 460px; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; font-family: var(--font); font-weight: 700; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.qv { display: grid; grid-template-columns: 190px 1fr; gap: 22px; }
.qv-photo { width: 190px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); cursor: zoom-in; padding: 0; display: block; }
.qv-photo img { width: 100%; height: 100%; object-fit: cover; }
.qv h4 { font-size: 20px; margin-bottom: 4px; font-family: var(--serif); font-weight: 600; }
.qv .kv { grid-template-columns: 150px 1fr; font-size: 13.5px; }
.qv .kv dt, .qv .kv dd { padding: 7px 0; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6, 11, 24, .92); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 24px; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: min(92vw, 640px); max-height: 78vh; border-radius: 12px; box-shadow: var(--shadow-lg); background: #fff; }
.lightbox .cap { color: #e6eaf3; margin-top: 14px; font-size: 14px; text-align: center; }
.lightbox .cap small { display: block; color: #95a1bb; }
.lb-close { position: absolute; top: 18px; right: 18px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lightbox .btn-quiet { color: #fff; background: rgba(255, 255, 255, .08); border-radius: 50%; width: 44px; height: 44px; padding: 0; }
.lightbox .btn-quiet:hover { background: rgba(255, 255, 255, .18); }
.doc-frame { width: 100%; height: 70vh; border: 0; border-radius: 10px; background: var(--paper); }

.toast-zone { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: pop .2s ease; }
.toast.error { background: var(--danger); }

.qr-box { display: grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; width: max-content; margin: 0 auto 14px; }
.qr-box img, .qr-box svg { width: 190px; height: 190px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Menlo, monospace; letter-spacing: .1em; font-size: 14px; background: var(--paper); padding: 8px 12px; border-radius: 8px; word-break: break-all; text-align: center; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.inline-form { display: inline; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.radio-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pills label { position: relative; }
.radio-pills input { position: absolute; opacity: 0; }
.radio-pills span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--muted); }
.radio-pills input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.radio-pills input:focus-visible + span { box-shadow: var(--focus); }
.chk-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chk-line { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.chk-line input { width: 17px; height: 17px; accent-color: var(--ink); }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters .f-search { grid-column: 1 / -1; }
}
@media (max-width: 1020px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sb-overlay { position: fixed; inset: 0; background: rgba(9, 16, 33, .5); z-index: 35; display: none; }
  .sb-overlay.is-open { display: block; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 14px 18px; }
  .content { padding: 8px 18px 32px; }
  .dash-grid, .detail-grid, .two-col { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .req-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .stepper { display: none; }
  .progress-mobile { display: block; margin-bottom: 14px; }
  .progress-mobile .lbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
  .progress-mobile .lbl strong { color: var(--ink); }
  .progress-track { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
  .progress-fill { height: 100%; background: var(--ink); border-radius: 99px; transition: width .3s; width: 20%; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .grid-2, .grid-3, .resumen, .doc-list, .chk-group { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .f-actions { grid-column: 1 / -1; }
  .form-step { padding: 22px 18px 4px; }
  .form-nav { padding: 14px 18px 22px; }
  .form-nav .btn { flex: 1; }
  .hero .wrap { padding-top: 48px; padding-bottom: 56px; }
  .hero-actions .btn { flex: 1; }
  .steps-grid { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .pub-nav .btn-label { display: none; }
  .pub-logo img { height: 34px; }
  .topbar h1 { font-size: 20px; }
  .topbar .actions .btn-label { display: none; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; font-size: 12.5px; }
  .qv { grid-template-columns: 1fr; }
  .qv-photo { width: 150px; margin: 0 auto; }
  .qv .kv { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-foot { border-radius: 0; }
  .modal-foot .btn { flex: 1 1 45%; }
  /* Tabla -> tarjetas */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { position: relative; padding: 14px 16px 12px 48px; border-bottom: 1px solid var(--line); }
  .table-cards td { padding: 3px 0; border: 0; }
  .table-cards td.chk { position: absolute; left: 16px; top: 18px; width: auto; }
  .table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
  .table-cards td.c-actions { padding-top: 10px; }
  .table-cards .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .table-cards .person { min-width: 0; }
  .card-pad, .card-body { padding: 18px; }
  .card-head { padding: 14px 18px; }
}

@media print {
  .sidebar, .topbar, .pub-header, .pub-footer { display: none !important; }
}

/* Utilidades */
.text-center { text-align: center; }
.justify-center { justify-content: center !important; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.gap-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.w-auto { width: auto; }
.drop-title, .drop-sub, .drop-file { display: block; }
.checks-list li .ok, .checks-list li .no { display: inline-flex; }
.form-intro .eyebrow { color: var(--brand); }
.text-left { text-align: left; }
.text-right { text-align: right; } .ml-auto { margin-left: auto; }
.d-inline { display: inline-block; }

.break { word-break: break-all; }
.pager .select { padding: 7px 32px 7px 10px; font-size: 13px; }
dl.kv, dl.resumen { margin-top: 0; margin-bottom: 0; }
button.doc { font: inherit; text-align: left; cursor: zoom-in; width: 100%; }

.sin-firma { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 10px; color: var(--muted); font-size: 13px; }
.hint.mt-0 { margin-top: 0; }

.firma-espacio { border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); padding: 56px 24px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.firma-linea { display: block; width: min(320px, 90%); border-top: 1.5px solid var(--ink); }
.firma-nota { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; text-align: center; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat .val-sm { font-family: var(--font); font-size: 17px; font-weight: 650; margin-top: 10px; line-height: 1.3; }
.stack-sm > * + * { margin-top: 8px; }
.chk-line input[type=radio] { width: 17px; height: 17px; accent-color: var(--ink); flex: none; margin-top: 2px; }
.chk-line { align-items: flex-start; }
@media (max-width: 720px) { .stats-3 { grid-template-columns: 1fr; } }
.input-readonly, .input[readonly] { background: var(--surface-2); color: var(--ink); font-weight: 600; cursor: default; }
.imprimir-box { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.h-sm { font-family: var(--font); font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.consulta-ok { padding: 18px; border: 1px solid #bfe0cd; background: var(--ok-soft); border-radius: 14px; }
.success-mark.sm { width: 40px; height: 40px; margin: 0; flex: none; }
.success-mark.sm .icon { width: 22px; height: 22px; }
