/* Formulario QR · Educación Continua — v3, celular primero.
   Marca: azul institucional Tec #0033A0 con el logo blanco de EC encima. Magenta EC solo en el botón que
   envía el formulario del alumno. Letra: Plus Jakarta Sans + IBM Plex Mono para códigos.
   Elemento distintivo: el «pase» (tarjeta con perforación de boleto) en el QR y en el formulario del alumno,
   que al enviarse recibe un sello. */

:root {
  --tec: #0033A0; --tec-700: #002A85; --tec-800: #001E63; --tec-50: #EEF3FF; --tec-100: #DCE6FF;
  --chart: #2E5CCF;
  --ink: #0B1F4D; --ink-2: #46526D; --ink-3: #6B7590;
  --bg: #F2F4F9; --card: #FFFFFF; --line: #DFE4EE; --line-2: #ECEFF5; --gray-50: #EEF0F4;
  --magenta: #D1146A; --magenta-700: #AE0F57;
  --ok: #0E8A5E; --ok-50: #E4F5EE;
  --warn: #9A5E00; --warn-50: #FFF3DB;
  --bad: #BF3329; --bad-50: #FDEBE9;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r-lg: 20px; --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 31, 77, .05), 0 6px 20px -10px rgba(11, 31, 77, .18);
  --shadow-up: 0 -6px 24px -12px rgba(11, 31, 77, .25);
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--tec); text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(0, 51, 160, .4); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ── Texto ── */
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.lede { font-size: 16px; color: var(--ink-2); margin-top: 6px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: .9em; }
.label-cap { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn:hover { border-color: #C3CCDD; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--tec); border-color: var(--tec); color: #fff; }
.btn-primary:hover { background: var(--tec-700); border-color: var(--tec-700); color: #fff; }
.btn-cta { background: var(--magenta); border-color: var(--magenta); color: #fff; box-shadow: 0 8px 18px -10px rgba(209, 20, 106, .8); }
.btn-cta:hover { background: var(--magenta-700); border-color: var(--magenta-700); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0B744F; border-color: #0B744F; color: #fff; }
.btn-soft { background: var(--tec-50); border-color: var(--tec-50); color: var(--tec); }
.btn-soft:hover { background: var(--tec-100); border-color: var(--tec-100); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--gray-50); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 56px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Campos ── */
.field { display: grid; gap: 6px; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: 18px; }
.field-row { display: grid; gap: 18px 14px; grid-template-columns: 1fr 1fr; }
.field-row > .field { margin-top: 0; }
.label { font-weight: 700; font-size: 15px; }
.label .muted { font-weight: 500; }
.hint { font-size: 13.5px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 17px; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; padding-right: 40px; background: var(--card) 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' fill='none' stroke='%236B7590' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--tec); box-shadow: 0 0 0 4px rgba(0, 51, 160, .12); }
.input::placeholder, .textarea::placeholder { color: #9AA3B8; }
.has-error .input, .has-error .select, .has-error .combo__input, .has-error .phone { border-color: var(--bad); }
.is-valid .input { border-color: #9FD3BF; }
.error-msg { display: flex; gap: 6px; align-items: flex-start; color: var(--bad); font-size: 14px; font-weight: 600; }
.error-msg .icon { width: 16px; height: 16px; margin-top: 2px; }
.suggest { font-size: 14px; color: var(--tec-800); background: var(--tec-50); border-radius: 10px; padding: 8px 12px; }
.suggest button { border: 0; background: none; color: var(--tec); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.phone { display: grid; grid-template-columns: 112px 1fr; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.phone:focus-within { border-color: var(--tec); box-shadow: 0 0 0 4px rgba(0, 51, 160, .12); }
.phone .select, .phone .input { border: 0; border-radius: 0; box-shadow: none !important; min-height: 50px; }
.phone .select { border-right: 1.5px solid var(--line-2); background-color: #F8F9FC; font-size: 15.5px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink-2); text-align: center; padding: 6px; transition: all .15s; }
.segmented input:checked + label { border-color: var(--tec); background: var(--tec-50); color: var(--tec); }
.segmented input:focus-visible + label { outline: 3px solid rgba(0, 51, 160, .4); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 1.45; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--tec); flex: none; }
fieldset.field { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.form-section + .form-section { margin-top: 26px; }
.form-section > .label-cap { display: block; margin-bottom: 12px; }

/* Buscador de programas */
.combo { position: relative; }
.combo__input { padding-right: 44px; }
.combo__clear { position: absolute; right: 6px; top: 7px; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 8px; border-radius: 8px; }
.combo__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.combo__opt { padding: 11px 12px; border-radius: 10px; cursor: pointer; line-height: 1.3; }
.combo__opt small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.combo__opt[aria-selected="true"], .combo__opt:hover { background: var(--tec-50); }
.combo__opt mark { background: none; color: var(--tec); font-weight: 700; }
.combo__empty { padding: 12px; color: var(--ink-3); font-size: 14px; }

/* Tarjetas de programa (2 a 8 opciones) */
.choices { display: grid; gap: 8px; }
.choice { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: center; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--tec); }
.choice b { display: block; line-height: 1.3; font-size: 15.5px; }
.choice small { display: block; color: var(--ink-3); font-size: 13px; }
.choice:has(input:checked) { border-color: var(--tec); background: var(--tec-50); }
.choice:has(input:focus-visible) { outline: 3px solid rgba(0, 51, 160, .4); outline-offset: 2px; }

/* Selector de varios programas (editor de QR) */
.picker__selected { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tagchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--tec-50); color: var(--tec-800); font-size: 13.5px; font-weight: 600; max-width: 100%; }
.tagchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagchip button { border: 0; background: none; color: var(--tec); cursor: pointer; padding: 2px; border-radius: 50%; display: grid; place-items: center; }
.picker__list { max-height: 300px; overflow: auto; border: 1.5px solid var(--line); border-radius: 12px; margin-top: 8px; background: var(--card); }
.picker__list label { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 14.5px; }
.picker__list label:last-child { border-bottom: 0; }
.picker__list label:hover { background: var(--tec-50); }
.picker__list input { width: 18px; height: 18px; margin: 0; accent-color: var(--tec); }
.picker__list small { display: block; color: var(--ink-3); font-size: 12.5px; }

/* ── Tarjetas, avisos ── */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card + .card { margin-top: 14px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.flash-ok { background: var(--ok-50); color: #0A6646; }
.flash-error { background: var(--bad-50); color: var(--bad); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--tec-50); color: var(--tec-800); font-size: 14.5px; }
.notice-warn { background: var(--warn-50); color: #6B4200; }
.notice-bad { background: var(--bad-50); color: var(--bad); }

/* Estados: color por tono, siempre con ícono y texto */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--gray-50); color: var(--ink-2); }
.pill .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.tone-ok { background: var(--ok-50); color: var(--ok); }
.tone-wait { background: var(--warn-50); color: var(--warn); }
.tone-info { background: var(--tec-50); color: var(--tec); }
.tone-bad { background: var(--bad-50); color: var(--bad); }
.tone-off { background: var(--gray-50); color: var(--ink-3); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; background: var(--tec-50); color: var(--tec); }
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: #E0A11B; } .dot-fail { background: var(--bad); } .dot-none { background: var(--line); }

/* ═══════════ Estructura de la app ═══════════ */
.appbar { position: sticky; top: 0; z-index: 40; background: var(--tec); color: #fff; padding-top: env(safe-area-inset-top); }
.appbar__in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; min-height: 60px; display: flex; align-items: center; gap: 16px; }
.appbar__logo img { height: 30px; width: auto; }
.appbar__nav { display: none; gap: 4px; margin-left: 12px; }
.appbar__nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: 15px; }
.appbar__nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.appbar__nav a[aria-current="page"] { background: #fff; color: var(--tec); }
.appbar__nav .count { font-size: 12px; background: var(--magenta); color: #fff; border-radius: 999px; padding: 1px 7px; }
.menu { margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: 999px; padding: 3px; }
.menu summary::-webkit-details-marker { display: none; }
.menu .avatar { background: #fff; color: var(--tec); width: 38px; height: 38px; font-size: 14px; }
.menu__name { display: none; text-align: right; font-size: 14px; line-height: 1.2; font-weight: 600; }
.menu__name small { display: block; font-weight: 500; opacity: .75; font-size: 12px; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 16px 40px -12px rgba(11, 31, 77, .35); padding: 8px; z-index: 60; }
.menu__panel .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.menu__panel a, .menu__panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 10px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; }
.menu__panel a:hover, .menu__panel button:hover { background: var(--gray-50); }

.page { max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.page-narrow { max-width: 680px; }
.page-head { margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 12px; padding: 6px 0; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.bottomnav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); box-shadow: var(--shadow-up); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; }
.bottomnav a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-decoration: none; border-radius: 12px; }
.bottomnav a[aria-current="page"] { color: var(--tec); }
.bottomnav .icon { width: 24px; height: 24px; }
.bottomnav .fab { margin-top: -26px; color: var(--tec); }
.bottomnav .fab span:first-child { width: 58px; height: 58px; border-radius: 50%; background: var(--tec); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 22px -8px rgba(0, 51, 160, .7); border: 4px solid #fff; }
.bottomnav .fab .icon { width: 26px; height: 26px; stroke-width: 2.5; }
.bottomnav button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-3); background: none; border: 0; border-radius: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bottomnav button:focus-visible, .bottomnav a:focus-visible { outline: 2px solid var(--tec); outline-offset: 2px; }
/* Perfil: iniciales sobre degradado azul Tec con un aro fino */
.me-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--tec) 0%, #2E5CCF 100%); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--tec-50); transition: box-shadow .15s; }
body:has(#perfil[open]) .bottomnav__me { color: var(--tec); }
body:has(#perfil[open]) .bottomnav__me .me-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--tec); }
.me-avatar--lg { width: 64px; height: 64px; font-size: 22px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--tec-50); flex: none; }
.profile-sheet__who { display: flex; align-items: center; gap: 16px; }
.profile-sheet__who .h2 { line-height: 1.2; }
.profile-sheet__who .pill { margin-top: 6px; }
.profile-sheet__elite { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--tec-50); color: var(--ink); font-size: 14px; line-height: 1.4; }
.profile-sheet__elite .icon { color: var(--tec); margin-top: 2px; flex: none; }
.profile-sheet__actions { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.profile-sheet__actions a, .profile-sheet__actions button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 6px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; border-radius: 10px; }
.profile-sheet__actions a:hover, .profile-sheet__actions button:hover { background: var(--gray-50); }
.profile-sheet__actions .icon { color: var(--ink-3); }
.bottomnav .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.actionbar { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); backdrop-filter: blur(12px); box-shadow: var(--shadow-up); }
.actionbar__in { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.actionbar__hint { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); text-align: center; }
.has-actionbar .bottomnav { display: none; }
.has-actionbar .page { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }

/* ═══════════ Inicio ═══════════ */
.hello { background: var(--tec); color: #fff; margin: -18px -16px 0; padding: 6px 16px 56px; }
.hello__in { max-width: 1120px; margin: 0 auto; }
.hello .h1 { font-size: 24px; }
.hello__note { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 12px 7px 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 14px; font-weight: 600; line-height: 1.3; }
.hello__note .icon { width: 18px; height: 18px; color: #FFD166; stroke: #FFD166; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: -40px; position: relative; }
.stat { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 12px; text-decoration: none; color: var(--ink); display: grid; gap: 2px; }
.stat b { font-size: 28px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--ink-2); font-weight: 600; line-height: 1.25; }
.stat-wait b { color: var(--warn); } .stat-info b { color: var(--tec); } .stat-ok b { color: var(--ok); } .stat-bad b { color: var(--bad); }

.qr-list { display: grid; gap: 10px; }
.qr-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: var(--ink); }
.qr-item__thumb { width: 64px; height: 64px; padding: 6px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line-2); }
.qr-item__thumb svg { width: 100%; height: 100%; }
.qr-item__title { font-weight: 700; font-size: 16px; line-height: 1.25; display: block; }
.qr-item__meta { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; display: block; }
.qr-item__count { text-align: center; min-width: 52px; }
.qr-item__count b { display: block; font-size: 22px; font-weight: 800; line-height: 1; color: var(--tec); }
.qr-item__count span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.qr-item.is-paused { opacity: .62; }
.badge-paused { display: inline-block; font-size: 11.5px; font-weight: 700; background: var(--gray-50); color: var(--ink-3); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.add-tile { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border: 2px dashed #C6CFE0; border-radius: 16px; color: var(--tec); font-weight: 700; text-decoration: none; }
.add-tile:hover { background: var(--tec-50); border-color: var(--tec); }

/* Personas (registros) */
.people { display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; color: var(--ink); position: relative; }
.person__name { font-weight: 700; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; display: block; }
.person__name::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.person__sub { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.person__meta { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.person__meta .pill { font-size: 12px; padding: 3px 9px 3px 7px; margin-right: 2px; }
.person__where { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.person__where .icon { width: 14px; height: 14px; }
.person__chev { color: #B5BDCD; align-self: center; }
.person__actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); position: relative; z-index: 1; }
.person__check { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.person__check.fail { color: var(--bad); font-weight: 600; }
.person__check.warn { color: var(--warn); font-weight: 600; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.chips a[aria-current="page"] { background: var(--ink); color: #fff; box-shadow: none; }
.chips .n { font-size: 12.5px; opacity: .75; }
.searchbar { position: relative; margin-bottom: 12px; }
.searchbar .icon { position: absolute; left: 14px; top: 16px; color: var(--ink-3); }
.searchbar .input { padding-left: 44px; min-height: 50px; font-size: 16px; }
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
.filters .input, .filters .select { min-height: 46px; font-size: 15px; }
.empty { text-align: center; padding: 40px 20px; }
.empty > .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: #A9B3C7; stroke-width: 1.6; }
.empty .h2 { margin-bottom: 4px; }

/* ═══════════ El pase del QR ═══════════ */
.qrcard { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; max-width: 460px; margin: 0 auto; }
.qrcard__top { background: var(--tec); color: #fff; padding: 18px 20px 20px; }
.qrcard__top img { height: 26px; width: auto; }
.qrcard__title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-top: 14px; line-height: 1.2; }
.qrcard__sub { font-size: 14.5px; opacity: .85; margin-top: 4px; }
.perf { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 16px; }
.perf::before, .perf::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); }
.perf::before { left: -27px; } .perf::after { right: -27px; }
.qrcard__body { padding: 22px 20px 20px; text-align: center; }
.qrcard__qr { width: min(100%, 270px); margin: 0 auto; }
.qrcard__qr svg { width: 100%; height: auto; }
.qrcard__code { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--ink-3); margin-top: 12px; }
.qrcard__stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.qrcard__stats div { padding: 12px 6px; text-align: center; }
.qrcard__stats div + div { border-left: 1px solid var(--line-2); }
.qrcard__stats b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.qrcard__stats span { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.qrcard.is-paused .qrcard__qr { opacity: .35; filter: grayscale(1); }
.qr-actions { max-width: 460px; margin: 14px auto 0; display: grid; gap: 10px; }
.share-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.share-row .btn, .contact-row .btn { flex-direction: column; gap: 4px; min-height: 66px; font-size: 13px; padding: 8px 4px; }
.share-row .btn .icon, .contact-row .btn .icon { width: 22px; height: 22px; }
.linkline { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.linkline span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
details.more > summary { cursor: pointer; list-style: none; color: var(--tec); font-weight: 700; font-size: 14.5px; padding: 8px 0; display: inline-flex; gap: 6px; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; }
details.card > summary, .disclosure { list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker, .disclosure::-webkit-details-marker { display: none; }
details.card > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .5; transition: transform .15s; }
details.card[open] > summary::after { transform: rotate(-135deg); }

.present { min-height: 100vh; min-height: 100dvh; background: #fff; display: flex; flex-direction: column; }
.present__top { background: var(--tec); padding: 18px 20px; display: flex; justify-content: center; }
.present__top img { height: 34px; width: auto; }
.present__body { flex: 1; display: grid; place-items: center; text-align: center; padding: 20px; cursor: pointer; }
.present__qr { width: min(80vw, 60vh, 520px); margin: 18px auto; }
.present__qr svg { width: 100%; height: auto; }
.present__title { font-size: clamp(22px, 4.5vw, 38px); font-weight: 800; color: var(--tec-800); line-height: 1.15; letter-spacing: -.01em; }
.present__hint { font-size: clamp(15px, 2.4vw, 20px); color: var(--ink-2); }
.present__exit { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; }

/* ═══════════ Ficha del registro ═══════════ */
.lead-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.lead-head .avatar { width: 56px; height: 56px; font-size: 19px; }
.lead-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.contact-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.where { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; margin-top: 16px; }
.where > .icon { width: 24px; height: 24px; }
.where b { display: block; line-height: 1.3; }
.where span { font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 20px 0 0; padding: 0; list-style: none; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; line-height: 1.25; font-weight: 600; color: var(--ink-3); position: relative; min-width: 0; }
.step__label { display: block; width: 100%; padding: 0 2px; }
.step::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: var(--line); border-radius: 2px; }
.step:first-child::before { display: none; }
.step__dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2.5px solid var(--line); position: relative; z-index: 1; color: transparent; }
.step__dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.step.is-done { color: var(--ink); }
.step.is-done::before { background: var(--tec); }
.step.is-done .step__dot { background: var(--tec); border-color: var(--tec); color: #fff; }
.step.final.is-done .step__dot { background: var(--ok); border-color: var(--ok); }
.step.final.is-done::before { background: var(--ok); }
.step.is-now { color: var(--tec); }
.step.is-now .step__dot { border-color: var(--tec); box-shadow: 0 0 0 5px var(--tec-50); }
.step.is-stop { color: var(--bad); }
.step.is-stop .step__dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.pop { animation: pop .5s var(--ease) both; }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-3); font-weight: 600; font-size: 14px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.checks .ci { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.checks .ci .icon { width: 14px; height: 14px; stroke-width: 3; }
.checks .ok .ci { background: var(--ok-50); color: var(--ok); }
.checks .warn .ci { background: var(--warn-50); color: var(--warn); }
.checks .fail .ci { background: var(--bad-50); color: var(--bad); }
.checks .fail { font-weight: 600; }
.checks .recs { grid-column: 2; font-size: 13px; color: var(--ink-3); }
.problem { border-left: 4px solid var(--bad); }
.problem .h2 { color: var(--bad); display: flex; gap: 8px; align-items: center; }
.raw { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); background: var(--gray-50); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; margin-top: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.timeline li { position: relative; padding: 0 0 16px 28px; font-size: 14.5px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--line); }
.timeline li.k-validado::before, .timeline li.k-en_salesforce::before, .timeline li.k-detectado::before, .timeline li.k-en_carrusel::before { border-color: var(--tec); }
.timeline li.k-oportunidad::before, .timeline li.k-asignado::before, .timeline li.k-convertido_en_sf::before { border-color: var(--ok); background: var(--ok); }
.timeline li.k-rechazado::before, .timeline li.k-error_sf::before, .timeline li.k-error_conversion::before, .timeline li.k-sin_cargar::before { border-color: var(--bad); }
.timeline time { display: block; font-size: 12.5px; color: var(--ink-3); }

dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(11, 31, 77, .25); }
dialog.sheet::backdrop { background: rgba(11, 31, 77, .45); }
.sheet__in { padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet__grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.reasons { display: grid; gap: 8px; margin: 12px 0; }
.reasons label { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 15px; }
.reasons label:has(input:checked) { border-color: var(--bad); background: var(--bad-50); color: var(--bad); }
.reasons input { accent-color: var(--bad); width: 18px; height: 18px; margin: 0; }

/* ═══════════ Formulario del alumno ═══════════ */
.pub { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pub__hero { background: var(--tec); color: #fff; padding: calc(18px + env(safe-area-inset-top)) 20px 64px; text-align: center; }
.pub__hero img { height: 34px; width: auto; margin: 0 auto; }
.pub__main { flex: 1; width: 100%; max-width: 560px; margin: -44px auto 0; padding: 0 14px 28px; }
.pub__card { background: var(--card); border-radius: 22px; box-shadow: 0 10px 40px -16px rgba(11, 31, 77, .35); }
.pub__intro { padding: 22px 18px 18px; }
.pub__card .perf::before, .pub__card .perf::after { background: var(--bg); }
.pub__form { padding: 20px 18px 24px; }
.inviter { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--tec-50); color: var(--tec-800); font-size: 14px; font-weight: 600; }
.inviter .avatar { width: 32px; height: 32px; font-size: 12.5px; background: var(--tec); color: #fff; }
.pub__title { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: 16px; }
.pub__lede { color: var(--ink-2); margin-top: 6px; font-size: 15.5px; }
.pub__time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-top: 10px; font-weight: 600; }
.pub__time .icon { width: 15px; height: 15px; }
.program-tag { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.program-tag .icon { color: var(--tec); }
.program-tag b { display: block; line-height: 1.3; }
.program-tag small { display: block; color: var(--ink-3); font-size: 13px; }
.pub__privacy { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 12px; }
.pub__legal { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 18px 20px 28px; max-width: 560px; margin: 0 auto; }
.pub__legal a { color: var(--ink-3); }
.done { text-align: center; padding: 30px 20px 26px; }
.stamp { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; color: var(--ok); border: 3px solid var(--ok); box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 7px var(--ok); transform: rotate(-8deg); animation: stamp .55s var(--ease) both; }
.stamp .icon { width: 42px; height: 42px; stroke-width: 2.6; }
@keyframes stamp { 0% { transform: scale(1.7) rotate(-20deg); opacity: 0; } 60% { transform: scale(.94) rotate(-6deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }
.next { text-align: left; display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.next li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; font-size: 15px; }
.next .avatar { width: 34px; height: 34px; }
.share-box { margin-top: 22px; padding: 16px; border-radius: 16px; background: var(--bg); text-align: left; }

/* Entrar */
.login { min-height: 100vh; min-height: 100dvh; background: var(--tec); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 18px; gap: 28px; }
.login > img { height: 40px; width: auto; }
.login__card { background: #fff; border-radius: 22px; padding: 26px 22px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .45); }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 16px; }
.gbtn:hover { border-color: var(--tec); }
.gbtn svg { width: 22px; height: 22px; }

/* ═══════════ Admin ═══════════ */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: var(--ink); display: grid; gap: 2px; }
.kpi b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi-bad b { color: var(--bad); } .kpi-wait b { color: var(--warn); } .kpi-ok b { color: var(--ok); }
.chart { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); align-items: end; gap: 2px; height: 170px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.chart__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.chart__bar { width: min(100%, 24px); background: var(--chart); border-radius: 4px 4px 0 0; }
.chart__col:hover .chart__bar, .chart__col:focus .chart__bar { background: var(--tec-800); }
.chart__tip { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.chart__col:hover .chart__tip, .chart__col:focus .chart__tip { opacity: 1; }
.chart__col:nth-child(-n+3) .chart__tip { left: 0; transform: none; }
.chart__col:nth-last-child(-n+3) .chart__tip { left: auto; right: 0; transform: none; }
.chart__val { font-size: 11.5px; font-weight: 700; color: var(--ink-2); position: absolute; left: 50%; transform: translateX(-50%); }
.chart__axis { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 6px; }
.toplist { list-style: none; margin: 0; padding: 0; }
.toplist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.toplist li:last-child { border-bottom: 0; }
.toplist b { font-variant-numeric: tabular-nums; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed time { display: block; color: var(--ink-3); font-size: 12.5px; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.dtable td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: 14.5px; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable a { color: var(--ink); font-weight: 700; text-decoration: none; }
.dtable a:hover { color: var(--tec); }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; font-size: 14px; }
.admin-list { display: grid; gap: 10px; }
.admin-item { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; }
.admin-item__top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.admin-item form.edit { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.admin-item .input, .admin-item .select { min-height: 44px; font-size: 15px; padding: 8px 12px; }
.admin-item .select { padding-right: 36px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
.switch input { accent-color: var(--ok); width: 20px; height: 20px; }
.pair { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.pair .icon { color: var(--tec); width: 16px; height: 16px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kv > div { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; }
.kv b { display: block; font-size: 20px; font-weight: 800; margin-top: 2px; overflow-wrap: anywhere; }

.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.desk-only { display: none; }

@media (min-width: 900px) {
  .appbar__nav { display: flex; }
  .menu__name { display: block; }
  .bottomnav { display: none; }
  .actionbar { position: sticky; bottom: 16px; margin: 16px auto 0; border-radius: 18px; padding: 12px; max-width: 680px; }
  .has-actionbar .page { padding-bottom: 60px; }
  .page { padding: 28px 24px 60px; }
  .h1 { font-size: 30px; }
  .hello { margin: -28px -24px 0; padding: 18px 24px 64px; }
  .hello .h1 { font-size: 30px; }
  .stat { padding: 18px; }
  .stat b { font-size: 34px; }
  .qr-list { grid-template-columns: repeat(2, 1fr); }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
  .split > aside { position: sticky; top: 84px; }
  .desk-only { display: block; }
  .mobile-only { display: none !important; }
  .filters { grid-template-columns: 2fr repeat(3, 1fr); }
  .chips { margin: 0 0 14px; padding: 2px 0 4px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kv { grid-template-columns: repeat(4, 1fr); }
  .admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
  .pub__intro { padding: 28px 30px 20px; }
  .pub__form { padding: 24px 30px 30px; }
  dialog.sheet { margin: auto; border-radius: 22px; }
}
@media (max-width: 899px) {
  .appbar--perfil-abajo .menu { display: none; }
  .split > aside { margin-top: 14px; }
  .admin-grid > * + * { margin-top: 14px; }
  .dtable thead { display: none; }
  .dtable, .dtable tbody, .dtable tr, .dtable td { display: block; width: 100%; }
  .dtable tr { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .dtable td { border: 0; padding: 2px 0; }
  .dtable td[data-k]::before { content: attr(data-k) ": "; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
}
@media (max-width: 420px) {
  .field-row { grid-template-columns: 1fr; }
  .stats .stat span { font-size: 12px; }
}
@media print {
  .appbar, .bottomnav, .actionbar, .no-print, .flash, .back { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .qrcard { box-shadow: none; border: 1px solid var(--line); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
