@font-face { font-family: "Geist"; src: url("/bot/fonts/GeistVF.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --bg-page: #F0F3F8; --bg-surface: #FFFFFF; --header-bg: #0B6B43; --header-text: #FFFFFF;
  --text-primary: #14181C; --text-secondary: #5B6472; --border: #E2E8F0;
  --verde: #0E7F4B; --verde-btn: #0E7F4B; --verde-tint: #E4F7EC;
  --rojo: #C2362B; --rojo-tint: #FCEBEB; --rojo-fg: #8A1E1E;
  --dorado: #B07A12; --dorado-tint: #FDF3E3; --dorado-fg: #7A5210;
  --violeta: #7E22CE; --violeta-tint: #F3E8FF; --hold: #8B7CF6;
  --gris-tint: #E5E9EF; --gris-fg: #5B6472;
  --azul: #2563EB;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06);
  --nav-alto: 64px;
}
:root[data-theme="dark"] {
  --bg-page: #0B1418; --bg-surface: #141C22; --header-bg: #0A4A2F;
  --text-primary: #E8EEF2; --text-secondary: #9AA3B2; --border: #1E2A32;
  --verde: #17B26A; --verde-tint: #132018;
  --rojo: #FF7A6E; --rojo-tint: #2E1414; --rojo-fg: #F87171;
  --dorado: #F2B84B; --dorado-tint: #2E260E; --dorado-fg: #F0C674;
  --violeta: #C084FC; --violeta-tint: #261638; --hold: #A99CFF;
  --gris-tint: #1A2228; --gris-fg: #9AA3B2;
  --azul: #60A5FA;
  --shadow-card: 0 1px 3px rgba(0,0,0,.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg-page); color: var(--text-primary); font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.oculto { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Estructura */
#app { min-height: 100%; display: flex; flex-direction: column; }
.cabecera { background: var(--header-bg); color: var(--header-text); display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; position: sticky; top: 0; z-index: 20; }
.cabecera img { width: 32px; height: 32px; border-radius: 9px; }
.cabecera h1 { font-size: 17px; font-weight: 700; margin: 0; flex: 1; }
.cabecera .icono-btn { color: #fff; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; margin-right: -8px; }
.cabecera .volver { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; font-size: 14px; color: #fff; margin-left: -8px; padding: 0 8px; }
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 14px 16px calc(var(--nav-alto) + 28px + env(safe-area-inset-bottom)); }
.refresco { text-align: center; color: var(--text-secondary); font-size: 12px; height: 0; overflow: hidden; transition: height .15s; }
.refresco.visible { height: 28px; }

/* Barra inferior */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--bg-surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.nav button { flex: 1; max-width: 160px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--text-secondary); border-radius: 10px; }
.nav button[aria-current="page"] { color: var(--verde); }
.nav svg { width: 22px; height: 22px; }

/* Tarjetas */
.tarjeta { background: var(--bg-surface); border-radius: 18px; box-shadow: var(--shadow-card); padding: 16px; margin-bottom: 12px; }
.tarjeta h2 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.grande { font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.medio { font-size: 22px; font-weight: 800; }
.chico { font-size: 12px; color: var(--text-secondary); }
.fila { display: flex; align-items: center; gap: 10px; }
.entre { justify-content: space-between; }
.grilla2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grilla2 .tarjeta { margin: 0; }
.sube { color: var(--verde); } .baja { color: var(--rojo); }
.nota { font-size: 12px; color: var(--text-secondary); margin: 8px 0 0; }
h3.titulo { font-size: 15px; margin: 18px 4px 8px; }

/* Pastillas */
.pastilla { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pastilla::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-verde { background: var(--verde-tint); color: var(--verde); }
.p-rojo { background: var(--rojo-tint); color: var(--rojo-fg); }
.p-dorado { background: var(--dorado-tint); color: var(--dorado-fg); }
.p-gris { background: var(--gris-tint); color: var(--gris-fg); }
.p-violeta { background: var(--violeta-tint); color: var(--violeta); }
.etiqueta { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--gris-tint); color: var(--gris-fg); }
.etiqueta.real { background: var(--rojo-tint); color: var(--rojo-fg); }

/* Listas */
.lista { background: var(--bg-surface); border-radius: 18px; box-shadow: var(--shadow-card); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-bottom: 1px solid var(--border); width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
.item .cuerpo { flex: 1; min-width: 0; display: block; }
.item .cuerpo > .chico { display: block; }
.item .nombre { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.25; }
.item .derecha { text-align: right; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--header-bg); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar.pausada { background: var(--gris-tint); color: var(--gris-fg); }
.filtros { display: flex; gap: 8px; margin-bottom: 12px; }
.filtros button { min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--gris-tint); color: var(--gris-fg); font-weight: 600; font-size: 14px; }
.filtros button[aria-pressed="true"] { background: var(--verde-btn); color: #fff; }

/* Interruptor */
.interruptor { position: relative; width: 52px; height: 32px; flex-shrink: 0; border-radius: 999px; background: var(--gris-tint); border: 1px solid var(--border); transition: background .15s; }
.interruptor::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.interruptor[aria-checked="true"] { background: var(--verde-btn); border-color: var(--verde-btn); }
.interruptor[aria-checked="true"]::after { transform: translateX(20px); }
.zona-toque { min-width: 44px; min-height: 44px; display: grid; place-items: center; margin: -6px -6px -6px 0; }

/* Botones y formularios */
.btn { min-height: 48px; width: 100%; border-radius: 12px; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.btn.primario { background: var(--verde-btn); color: #fff; }
.btn.peligro { background: var(--rojo-tint); color: var(--rojo-fg); border: 1px solid var(--rojo); }
.btn.secundario { background: var(--bg-page); color: var(--text-primary); border: 1px solid var(--border); }
.btn[disabled] { opacity: .55; cursor: default; }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-alto) + 16px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--verde-btn); color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); display: grid; place-items: center; z-index: 25; }
.fab svg { width: 26px; height: 26px; }
label.campo { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], select { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-surface); font-size: 16px; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }
.error-campo { color: var(--rojo-fg); font-size: 12px; font-weight: 600; margin-top: 4px; min-height: 16px; }
.mensaje-error { background: var(--rojo-tint); color: var(--rojo-fg); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; margin: 12px 0; }
.recordar { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.recordar input { width: 22px; height: 22px; }

/* Ingreso */
.ingreso { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ingreso .caja { width: 100%; max-width: 380px; }
.ingreso .logo { display: block; width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ingreso h1 { text-align: center; margin: 0 0 4px; font-size: 24px; }
.ingreso .sub { text-align: center; color: var(--text-secondary); margin: 0 0 20px; font-size: 14px; }

/* Hoja inferior */
.fondo-hoja { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; animation: aparece .15s ease-out; }
.hoja { background: var(--bg-surface); width: 100%; max-width: 640px; border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; animation: sube .2s ease-out; }
.hoja .agarradera { width: 42px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 14px; }
.hoja h2 { margin: 0 0 6px; font-size: 19px; }
.hoja p { margin: 0 0 14px; color: var(--text-secondary); }
.hoja .botones { display: grid; gap: 10px; margin-top: 8px; }
.roja { color: var(--rojo-fg); font-weight: 700; }
@keyframes aparece { from { opacity: 0 } to { opacity: 1 } }
@keyframes sube { from { transform: translateY(40px) } to { transform: none } }

/* Aviso */
#aviso { position: fixed; left: 16px; right: 16px; top: calc(64px + env(safe-area-inset-top)); z-index: 60; display: flex; justify-content: center; pointer-events: none; }
#aviso div { background: #14181C; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; max-width: 420px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
:root[data-theme="dark"] #aviso div { background: #E8EEF2; color: #14181C; }

/* Esqueletos */
.esqueleto { background: linear-gradient(90deg, var(--gris-tint) 25%, var(--border) 50%, var(--gris-tint) 75%); background-size: 200% 100%; animation: brillo 1.3s infinite linear; border-radius: 10px; }
@keyframes brillo { from { background-position: 200% 0 } to { background-position: -200% 0 } }
.esq-linea { height: 14px; margin: 8px 0; } .esq-grande { height: 40px; width: 60%; } .esq-curva { height: 90px; }

/* Gráficos */
.grafico { width: 100%; height: 130px; display: block; }
.grafico .linea { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.grafico .area { opacity: .14; }
.grafico .eje { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.leyenda i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.barra3 { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--gris-tint); margin: 10px 0; }
.barra3 span { display: block; height: 100%; }
.c-btc { background: #F7931A; } .c-eth { background: #627EEA; } .c-usdt { background: var(--verde); }
.pos-fila { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.pos-fila b { display: inline-flex; align-items: center; gap: 8px; }
.pos-fila b::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.pos-fila .btc { color: #F7931A; } .pos-fila .eth { color: #627EEA; } .pos-fila .usdt { color: var(--verde); }
.pos-fila .btc span, .pos-fila .eth span, .pos-fila .usdt span { color: var(--text-primary); }
.periodos { display: flex; gap: 8px; margin: 8px 0; }
.periodos button { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--gris-tint); color: var(--gris-fg); font-weight: 600; font-size: 13px; }
.periodos button[aria-pressed="true"] { background: var(--header-bg); color: #fff; }

/* Versiones */
.ver-fila { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ver-fila:last-child { border-bottom: 0; }
.ver-barra { height: 10px; border-radius: 5px; background: var(--gris-tint); margin: 8px 0 4px; overflow: hidden; }
.ver-barra span { display: block; height: 100%; background: var(--dorado); border-radius: 5px; }
.aclaracion { background: var(--dorado-tint); color: var(--dorado-fg); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 10px; }

@media (min-width: 720px) { main { padding-top: 22px; } .fab { right: calc(50% - 320px + 16px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* v1.1: ingreso con la cuenta de Tapy Go y PIN */
.enlace { background: none; border: 0; color: var(--text-secondary); font: inherit; font-size: 14px; text-decoration: underline; min-height: 44px; margin-top: 6px; cursor: pointer; width: 100%; }
.enlace:hover { color: var(--text-primary); }
input.pin { width: 9.5ch; margin: 0 auto; display: block; text-align: center; letter-spacing: .4em; font-size: 20px; font-variant-numeric: tabular-nums; }
label.campo[for="pin"], #e-pin { text-align: center; }
.btn-instalar { width: 100%; margin-top: 10px; }
.hoja ol { margin: 8px 0 14px 20px; padding: 0; line-height: 1.6; }
.enlace-bot { font-weight: 700; word-break: break-all; text-align: center; background: var(--bg-page); border-radius: 10px; padding: 10px; }
