@font-face { font-family: 'Inter'; src: url(fonts/inter-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url(fonts/poppins-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --navy: #012169; --orange: #FF8200; --ink: #231F20; --slate: #333F48;
  --gray: #A2AAAD; --light: #D0D3D4; --bg: #F2F3F4;
  --ok: #1f7a3d; --err: #b3261e; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; font-variant-numeric: tabular-nums; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.noscript { padding: 24px; }

/* ---------- Login y cambio de clave ---------- */
.entrada { background: var(--navy); min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.entrada-in { width: 100%; max-width: 420px; margin: 0 auto; }
.wordmark { font-family: Poppins, Inter, sans-serif; font-weight: 600; font-size: 56px; line-height: 1; color: #fff; letter-spacing: .04em; margin: 0; }
.wordmark::after { content: ''; display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--orange); margin-top: 12px; }
.tagline { color: var(--light); margin: 12px 0 28px; font-size: 16px; }
.card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.card h1 { font-size: 20px; margin: 0 0 6px; color: var(--navy); }
.card p { margin: 6px 0; color: var(--slate); font-size: 15px; line-height: 1.45; }
label { display: block; font-weight: 600; font-size: 14px; color: var(--slate); margin: 16px 0 6px; }
input[type=text], input[type=password] { width: 100%; font: inherit; font-size: 17px; padding: 14px; border: 1.5px solid var(--gray); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus { outline: 3px solid rgba(255, 130, 0, .45); border-color: var(--navy); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 14px 0 0; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.btn { font: inherit; font-weight: 600; font-size: 17px; min-height: 50px; border-radius: 12px; border: 0; padding: 0 18px; cursor: pointer; }
.btn-primary { background: var(--navy); color: #fff; width: 100%; margin-top: 20px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-link { background: none; color: var(--navy); text-decoration: underline; border: 0; font: inherit; font-size: 15px; min-height: 44px; cursor: pointer; padding: 0 8px; }
.entrada .btn-link { color: var(--light); }
.msg { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; line-height: 1.4; }
.msg-error { background: #fdecea; color: var(--err); }
.msg-info { background: #e8edf8; color: var(--navy); }
.centro { margin: auto; text-align: center; color: #fff; font-size: 17px; }
.version { color: var(--gray); font-size: 12px; text-align: center; margin-top: 18px; }

/* ---------- Pantalla principal ---------- */
.shell { display: flex; flex-direction: column; min-height: 100dvh; }
.top { background: var(--navy); color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 16px 12px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5; }
.top .wm { font-family: Poppins, Inter, sans-serif; font-weight: 600; font-size: 26px; letter-spacing: .04em; }
.who { flex: 1; min-width: 0; line-height: 1.25; }
.who-name { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-rol { display: block; font-size: 13px; color: var(--light); }
.salir { font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .14); border: 0; border-radius: 10px; min-height: 40px; padding: 0 14px; cursor: pointer; }
.estado { display: flex; gap: 8px; align-items: flex-start; padding: 9px 16px; background: #fff; border-bottom: 1px solid var(--light); font-size: 13.5px; color: var(--slate); line-height: 1.35; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray); flex: none; margin-top: 4px; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--orange); }
.estado.viejo { background: #fff4e5; }
.hilo { flex: 1; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.vacio { margin: auto; text-align: center; color: var(--slate); max-width: 300px; line-height: 1.5; }
.vacio strong { color: var(--navy); }
.b { max-width: 92%; border-radius: 16px; padding: 12px 14px; font-size: 16px; line-height: 1.4; scroll-margin-bottom: 110px; }
.b-user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.b-ava { align-self: flex-start; background: #fff; border: 1px solid var(--light); border-bottom-left-radius: 4px; width: 92%; }
.ans-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); }
.big { font-family: Poppins, Inter, sans-serif; font-weight: 600; font-size: 34px; line-height: 1.15; color: var(--navy); margin: 2px 0; }
.sub { color: var(--slate); font-size: 15px; margin: 2px 0 0; }
.filas { list-style: none; margin: 12px 0 0; padding: 0; }
.fila { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--light); }
.fila-n { min-width: 0; }
.fila-n strong { display: block; font-size: 15px; }
.fila-n span { font-size: 13px; color: var(--slate); }
.fila-m { font-weight: 600; white-space: nowrap; align-self: center; color: var(--navy); }
.foot { font-size: 12.5px; color: var(--slate); margin: 12px 0 0; line-height: 1.4; border-top: 1px dashed var(--light); padding-top: 10px; }
.err { color: var(--err); margin: 0; }
.acciones { position: sticky; bottom: 0; z-index: 4; background: #fff; border-top: 1px solid var(--light); padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px); display: flex; gap: 8px; flex-wrap: wrap; }
.chip { flex: 1 1 140px; min-height: 48px; border-radius: 24px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); font: inherit; font-weight: 600; font-size: 15px; padding: 0 14px; cursor: pointer; }
.chip:active { background: var(--navy); color: #fff; }
.chip:disabled { opacity: .5; cursor: default; }

/* ---------- Aviso de instalación ---------- */
.instalar { background: #e8edf8; color: var(--navy); padding: 10px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.4; display: flex; gap: 10px; align-items: center; margin: 14px 0 0; }
.instalar span { flex: 1; }
.instalar button { font: inherit; font-weight: 600; font-size: 14px; border: 0; border-radius: 8px; min-height: 40px; padding: 0 12px; cursor: pointer; background: var(--navy); color: #fff; }
.instalar button.sec { background: transparent; color: var(--navy); }
.hilo .instalar { margin: 0 0 4px; }
