/* Flow Labs Caja · estilos. Fuente de verdad: DESIGN.md ("Editorial claro", el mismo sistema de flowlabs.lat).
   Papel cálido, tinta casi negra, UN azul para acciones. Verde, rojo y ámbar solo para la plata.
   Geist en todo; Geist Mono solo para cifras sueltas que se leen como dato. Tema bloqueado en claro. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  /* Superficies y tinta (iguales a flowlabs.lat) */
  --paper: #faf9f7; --paper2: #f3f1ec; --card: #ffffff;
  --ink: #1a1917; --ink2: #56534c; --ink3: #6f6a63;
  --line: #e5e2db; --line2: #d3cfc6;
  /* Acento único: acciones, foco, pestaña activa, enlaces */
  --blue: #1b45cc; --blue-d: #1435a4; --blue-w: #eef1fd;
  /* Plata (funcionales, nunca decoración) */
  --in: #12764a; --in-w: #e8f5ee; --in-d: #0d5c39;
  --out: #c0283d; --out-w: #fcecee; --out-d: #9c1f31;
  --owed: #9a5b00; --owed-w: #fdf3e1; --owed-line: #f1dcb4;
  /* Radios, sombras, curvas */
  --r-s: 8px; --r-m: 14px; --r-l: 20px;
  --sh-s: 0 1px 2px rgba(38,33,22,.05); --sh-m: 0 4px 16px rgba(38,33,22,.06); --sh-l: 0 18px 48px rgba(38,33,22,.10);
  --ease: cubic-bezier(.23,1,.32,1);
  --font: "Geist", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
  --dim: rgba(26,25,23,.45);
  /* Alias que usan admin.html y las páginas legales */
  --display: var(--font); --body: var(--font); --bg: var(--paper); --surface: var(--card); --surface-2: var(--paper2);
  --muted: var(--ink3); --shadow-1: var(--sh-s); --primary: var(--blue); --primary-press: var(--blue-d); --primary-tint: var(--blue-w);
  --on-primary: #fff; --in-text: var(--in); --out-text: var(--out); --in-tint: var(--in-w); --out-tint: var(--out-w);
  --owed-text: var(--owed); --owed-tint: var(--owed-w);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
::selection { background: var(--blue); color: #fff; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { letter-spacing: -.02em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-weight: 600; }
.in { color: var(--in); } .out { color: var(--out); } .owed { color: var(--owed); } .muted { color: var(--ink3); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }
[hidden] { display: none !important; }
.solo-compu { display: none; }

/* ---------- Botones ---------- */
.btn { font: 600 15px var(--font); border: 1px solid transparent; border-radius: var(--r-s); min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
  transition: transform 120ms var(--ease), background-color 160ms ease, border-color 160ms ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-in { background: var(--in); color: #fff; }
.btn-out { background: var(--out); color: #fff; }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line2); }
.btn-ghost { background: none; color: var(--blue); }
.btn-wa { background: #25d366; color: #0b3d1f; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: default; }
a.btn-primary, a.btn-primary:visited, a.btn-in, a.btn-out { color: #fff; }
a.btn-secondary, a.btn-secondary:visited { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--blue-d); }
  .btn-in:hover { background: var(--in-d); }
  .btn-out:hover { background: var(--out-d); }
  .btn-secondary:hover { border-color: var(--ink3); }
  .btn-ghost:hover { background: var(--blue-w); }
}
.enlace-btn { background: none; border: 0; padding: 6px 0; color: var(--blue); font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; min-height: 40px; }
.enlace-btn:disabled { color: var(--ink3); text-decoration: none; cursor: default; }
.icono-btn { width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; border-radius: var(--r-s); padding: 0; color: var(--ink2); }
.icono-btn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .icono-btn:not(:disabled):hover { background: var(--paper2); color: var(--ink); } }

/* ---------- Marca ---------- */
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.marca:visited { color: var(--ink); }
.marca img { flex-shrink: 0; object-fit: contain; }
.marca span { color: var(--blue); font-weight: 500; border-left: 1px solid var(--line); padding-left: 10px; font-size: 14px; }
.marca-movil { display: flex; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface, #fff); font-size: 15px; }
@media (min-width: 960px) { .marca-movil { display: none; } }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--blue-w); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }

/* ---------- Estructura de la app ---------- */
#app { min-height: 100dvh; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.side { display: none; }
.marco-app { flex: 1; display: flex; flex-direction: column; min-width: 0; padding-top: env(safe-area-inset-top); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.topbar .tit { min-width: 0; margin-right: auto; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-size: 22px; font-weight: 600; margin: 0; line-height: 1.15; }
.topbar .sub { font-size: 13.5px; color: var(--ink3); line-height: 1.3; overflow-wrap: anywhere; }
.topbar .acciones { display: none; }
main#principal { flex: 1; min-width: 0; }
.contenido { padding: 0 14px 176px; display: flex; flex-direction: column; gap: 14px; }

/* Zona del pulgar + pestañas (fijas abajo en el celular) */
.abajo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
.thumb { padding: 12px 14px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: linear-gradient(to top, var(--paper) 72%, rgba(250,249,247,0)); position: relative; }
.thumb.uno { grid-template-columns: 1fr; }
.thumb .btn { min-height: 52px; font-size: 16.5px; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--ink3); min-height: 50px; text-decoration: none; border: 0; background: none; }
.tab:visited { color: var(--ink3); }
.tab svg.i { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--blue); font-weight: 600; }

/* ---------- Tarjetas y resumen ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-s); }
.card.pad { padding: 16px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; box-shadow: var(--sh-s); text-align: left; color: var(--ink); min-width: 0; }
button.kpi { font: inherit; cursor: pointer; }
.kpi-t { display: flex; align-items: center; gap: 10px; color: var(--ink2); font-size: 14px; font-weight: 500; }
.ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ic.b { background: var(--blue-w); color: var(--blue); } .ic.g { background: var(--in-w); color: var(--in); }
.ic.r { background: var(--out-w); color: var(--out); } .ic.y { background: var(--owed-w); color: var(--owed); }
.kpi-v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 10px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { font-size: 13px; color: var(--ink3); margin-top: 4px; }
/* La tarjeta que responde "¿gano o pierdo?" */
.kpi.hero { grid-column: 1 / -1; background: var(--ink); color: #fff; border-color: var(--ink); padding: 16px; }
.kpi.hero .kpi-t { color: #cfcbc2; }
.kpi.hero .ic { background: #2c2a26; color: #fff; }
.kpi.hero .kpi-v { font-size: clamp(32px, 9vw, 40px); margin-top: 8px; }
.kpi.hero .kpi-s { color: #b9b4aa; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag.gana { background: rgba(111,224,166,.16); color: #7fe3b0; }
.tag.pierde { background: rgba(255,125,142,.16); color: #ff9aa7; }
.tag.vacio { background: rgba(255,255,255,.12); color: #e9e6df; }
.tag.y { background: var(--owed-w); color: var(--owed); }
.tag.n { background: var(--paper2); color: var(--ink2); }
.kpi.hero .kpi-v.out { color: #fff; }
/* En el celular, la cuarta tarjeta ocupa toda la fila: título y detalle a la izquierda, monto a la derecha */
@media (max-width: 959px) {
  .cards > .kpi.ancha { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .kpi.ancha .kpi-v { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .kpi.ancha .kpi-s { grid-column: 1; padding-left: 44px; margin-top: 0; }
}

.grid2, .grid2 > div { display: grid; gap: 14px; min-width: 0; }
.grid2 > div:empty { display: none; }

/* Encabezado de una tarjeta con lista */
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px 6px; }
.panel-h h2, .panel-h h3 { font-size: 15.5px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.panel-h .n, .panel-h a, .panel-h button { font-size: 13.5px; color: var(--ink3); }
.panel-h a, .panel-h button.enlace-btn { color: var(--blue); font-weight: 500; text-decoration: none; min-height: 0; padding: 0; }

/* Filas de movimiento / lista */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-s); overflow: hidden; }
.card > .list, .card .list { border: 0; box-shadow: none; border-radius: 0; }
.day-h { font-size: 12.5px; font-weight: 600; color: var(--ink3); padding: 10px 16px 6px; background: var(--paper); border-top: 1px solid var(--line); }
.list > .day-h:first-child { border-top: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 60px; width: 100%; background: none; border: 0; text-align: left; color: var(--ink); }
.item + .item { border-top: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { button.item:hover { background: var(--paper); } }
.item .cuerpo { flex: 1; min-width: 0; }
.item .t { font-weight: 600; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.item .n { color: var(--ink3); font-size: 13px; line-height: 1.35; }
.item .meta { display: none; }
.item .monto { font-weight: 600; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .pend { color: var(--owed); font-size: 12.5px; font-weight: 600; }
.chip-medio { display: inline-block; font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--paper2); color: var(--ink2); font-weight: 500; }

/* Gráficos */
.barras { padding: 4px 16px 14px; }
.barras svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink3); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cats { padding: 4px 16px 16px; display: grid; gap: 12px; }
.cat { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 14px; }
.cat > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat .track { grid-column: 1 / -1; height: 8px; background: var(--paper2); border-radius: 99px; overflow: hidden; }
.cat .fill { display: block; height: 100%; background: var(--out); border-radius: 99px; opacity: .85; }

/* Filtros */
.filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sel { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-s); font-weight: 500; font-size: 14.5px; white-space: nowrap; }
.sel > span { padding: 0 4px; }
.sel .icono-btn { width: 32px; height: 32px; }
.buscar { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-s); color: var(--ink3); }
.buscar:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-w); }
.buscar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 13px 0 11px; font-weight: 500; color: var(--ink3); font-size: 14.5px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); font-weight: 600; }

/* ---------- Me deben ---------- */
.owe { background: var(--owed-w); border: 1px solid var(--owed-line); border-radius: var(--r-m); padding: 14px; display: grid; gap: 10px; }
.owe p { margin: 0; font-size: 14.5px; color: var(--ink2); line-height: 1.45; }
.owe p b { color: var(--ink); }
.owe .msg { background: var(--card); border-radius: var(--r-s); padding: 10px 12px; font-size: 13.5px; color: var(--ink2); }
.owe .fila { display: flex; gap: 8px; flex-wrap: wrap; }
.owe .fila > * { flex: 1; min-height: 40px; font-size: 14px; }
.vence-vencida { color: var(--out); font-weight: 600; } .vence-hoy { color: var(--owed); font-weight: 600; }

/* ---------- Hojas (abajo en el celular, al centro en la computadora) ---------- */
.velo { position: fixed; inset: 0; background: var(--dim); z-index: 40; opacity: 0; transition: opacity 200ms ease; }
.velo.on { opacity: 1; }
.hoja { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 94dvh; overflow-y: auto; background: var(--card); border-radius: var(--r-l) var(--r-l) 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 260ms var(--ease); max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--sh-l); }
.hoja.on { transform: translateY(0); }
.handle { width: 40px; height: 4px; border-radius: 3px; background: var(--line2); margin: 0 auto; flex: none; }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hoja-cab .title { font-weight: 600; font-size: 20px; line-height: 1.2; display: flex; align-items: center; gap: 10px; margin: 0; letter-spacing: -.02em; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--in); }
.dot.out { background: var(--out); } .dot.owed { background: var(--owed); }
.monto-grande { font-weight: 600; font-size: 46px; letter-spacing: -.03em; line-height: 1.05; min-height: 48px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.monto-grande.in { color: var(--in); } .monto-grande.out { color: var(--out); } .monto-grande.owed { color: var(--owed); }
.cursor { display: inline-block; width: 2px; height: .8em; background: currentColor; margin-left: 4px; vertical-align: -2px; animation: parpadeo 1s steps(1) infinite; }
@keyframes parpadeo { 50% { opacity: 0; } }
.label { font-size: 13.5px; font-weight: 600; color: var(--ink2); margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 14.5px var(--font); background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-s); padding: 7px 12px; min-height: 40px; color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--blue-w); border-color: var(--blue); color: var(--blue); font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.key { font: 500 22px var(--font); background: var(--paper2); border: 0; border-radius: 10px; height: 52px; display: grid; place-items: center; color: var(--ink); font-variant-numeric: tabular-nums; }
.key:active { background: var(--line); }
.fila-acciones { display: flex; gap: 8px; }
.fila-acciones > * { flex: 1; }
/* El botón de guardar siempre a la vista, aunque la hoja tenga que desplazarse en celulares bajos. */
.hoja > .fila-acciones, .hoja > .btn-block:last-child { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--card); padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); margin-bottom: calc(-16px - env(safe-area-inset-bottom)); box-shadow: 0 -10px 12px -10px rgba(38,33,22,.18); }
@media (max-height: 780px) {
  .key { height: 46px; font-size: 20px; }
  .monto-grande { font-size: 40px; min-height: 42px; }
  .hoja { gap: 10px; }
}
.legal-cuerpo h2 { font-size: 16px; margin: 18px 0 4px; }
.legal-cuerpo p, .legal-cuerpo li { font-size: 14.5px; color: var(--ink2); }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .field .label-txt { font-weight: 600; font-size: 14px; }
.field .ayuda { font-size: 13px; color: var(--ink3); }
.field .error { font-size: 13.5px; font-weight: 500; color: var(--out); }
.field .error:empty { display: none; }
.field .sugerencia { font-size: 13.5px; color: var(--ink2); }
.campo { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-s); min-height: 48px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.campo:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-w); }
.campo.malo { border-color: var(--out); }
.campo.malo:focus-within { box-shadow: 0 0 0 3px var(--out-w); }
.campo input, .campo textarea { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 12px; font-size: 16px; outline: none; }
.campo .prefijo { display: grid; place-items: center; padding: 0 10px 0 12px; color: var(--ink2); border-right: 1px solid var(--line); margin: 10px 0; }
.campo .ojito { width: 48px; border: 0; background: none; display: grid; place-items: center; color: var(--ink3); }
textarea.area { width: 100%; padding: 11px 12px; border: 1px solid var(--line2); border-radius: var(--r-s); background: var(--card); font-size: 16px; resize: vertical; }
textarea.area:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-w); }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; font-size: 14px; line-height: 1.45; color: var(--ink2); }
.check input { appearance: none; width: 20px; height: 20px; flex: none; border: 1.5px solid var(--line2); border-radius: 5px; background: var(--card); margin: 1px 0 0; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.check.malo input { border-color: var(--out); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { width: 100%; min-height: 54px; text-align: center; font: 500 24px var(--mono); background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-s); }
.otp input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-w); outline: none; }
.otp.malo input { border-color: var(--out); }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-m); padding: 12px 14px; min-height: 64px; width: 100%; text-align: left; color: var(--ink); }
.choice .t { font-weight: 600; font-size: 15px; line-height: 1.25; }
.choice .n { color: var(--ink3); font-size: 13px; }
.choice[aria-checked="true"] { border-color: var(--blue); background: var(--blue-w); box-shadow: 0 0 0 1px var(--blue); }
.choice .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; flex: none; background: var(--card); }
.choice[aria-checked="true"] .tick { background: var(--blue); border-color: var(--blue); color: #fff; }
.separador { display: flex; align-items: center; gap: 12px; color: var(--ink3); font-size: 13px; }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.google-btn { min-height: 44px; display: flex; justify-content: center; }

/* ---------- Avisos ---------- */
.franja { border-radius: var(--r-m); padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid transparent; }
.franja.info { background: var(--blue-w); border-color: #d6defa; }
.franja.aviso { background: var(--owed-w); border-color: var(--owed-line); }
.franja.malo { background: var(--out-w); border-color: #f4cfd5; }
.franja .btn { min-height: 36px; font-size: 14px; padding: 0 12px; }
#avisos { display: grid; gap: 8px; padding: 0 14px; }
#avisos:not(:empty) { margin-bottom: 12px; }
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-s); padding: 12px 14px; font-size: 14.5px; line-height: 1.45; }
.alert.bad { background: var(--out-w); } .alert.ok { background: var(--in-w); } .alert.info { background: var(--blue-w); } .alert.warn { background: var(--owed-w); }
.toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translate(-50%, 180%); background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 10px 10px 16px; display: flex; gap: 12px; align-items: center; font-weight: 500; font-size: 14.5px;
  transition: transform 260ms var(--ease), visibility 0s linear 260ms; z-index: 60; width: max-content; max-width: calc(100% - 24px); visibility: hidden; pointer-events: none; box-shadow: var(--sh-l); }
.toast.on { transform: translate(-50%, 0); visibility: visible; pointer-events: auto; transition: transform 260ms var(--ease), visibility 0s; }
.toast button { font: 600 14px var(--font); color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 8px; padding: 6px 12px; min-height: 36px; }

/* Vacío, cargando, error */
.vacio { margin: 0; padding: 16px; color: var(--ink3); font-size: 14.5px; line-height: 1.5; }
.vacio-grande { text-align: center; padding: 36px 20px; display: grid; gap: 8px; justify-items: center; }
.vacio-grande .ic { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 4px; }
.vacio-grande .ic svg.i { width: 24px; height: 24px; }
.vacio-grande h2 { font-weight: 600; font-size: 18px; margin: 0; color: var(--ink); }
.vacio-grande p { margin: 0; color: var(--ink2); max-width: 34em; font-size: 14.5px; }
.vacio-grande .btn { margin-top: 8px; }
.esqueleto { background: linear-gradient(90deg, var(--paper2) 25%, #ebe8e1 50%, var(--paper2) 75%); background-size: 200% 100%; animation: brillo 1.2s ease-in-out infinite; border-radius: var(--r-m); }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pista { position: absolute; left: 14px; bottom: calc(100% + 4px); width: 230px; background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1.4; padding: 10px 12px; border-radius: 10px; font-weight: 500; box-shadow: var(--sh-m); }
.pista::after { content: ""; position: absolute; left: 34px; top: 100%; border: 8px solid transparent; border-top-color: var(--ink); }
.anillo { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--in); }

/* Más */
.menu { display: grid; gap: 14px; }
.menu .item .t { font-weight: 600; }
.menu .item svg.i { color: var(--ink3); }
.ajuste { background: var(--paper2); border-radius: var(--r-m); padding: 16px; display: grid; gap: 12px; }
.ajuste h2 { margin: 0; font-size: 16px; font-weight: 600; }
.codigo-ayudante { font: 500 34px var(--mono); letter-spacing: .12em; }
.ayudante-hola { font-size: 15px; color: var(--ink2); }

/* ---------- Pantallas de cuenta ---------- */
.cuenta-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; max-width: 1180px; margin: 0 auto; width: 100%; }
.cuenta-top .acc { display: flex; align-items: center; gap: 16px; }
.volver-flowlabs { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 500; }
@media (max-width: 600px) { .cuenta-top { flex-wrap: wrap; } .cuenta-top .acc { flex-wrap: wrap; } }
.cuenta-split { min-height: 100dvh; display: flex; flex-direction: column; }
.cuenta { width: 100%; max-width: 460px; margin: 0 auto; padding: 4px 20px 32px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.cuenta h1 { font-size: clamp(28px, 7vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -.03em; margin: 0; }
.cuenta .lead-txt { margin: -4px 0 0; color: var(--ink2); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps i { height: 4px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--blue); }
.step-n { font-size: 13px; font-weight: 500; color: var(--ink3); margin: -8px 0 0; }
.pie-cuenta { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink3); }
.pie-cuenta a { color: var(--ink3); }
.lado-muestra { display: none; }

/* Muestra del panel (portada y lado de las pantallas de cuenta) */
.muestra { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-l); padding: 16px; display: grid; gap: 10px; }
.muestra-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; }
.muestra-h small { font-weight: 500; color: var(--ink3); font-size: 13px; }
.muestra .kpi { box-shadow: none; }
.muestra .cards { grid-template-columns: 1fr 1fr; }
.muestra .cards .kpi-v { font-size: 20px; }

/* Portada */
.portada { min-height: 100dvh; display: flex; flex-direction: column; }
.portada-hero { max-width: 1180px; margin: 0 auto; width: 100%; padding: 20px 20px 40px; display: grid; gap: 32px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; color: var(--ink2); width: max-content; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--in); }
.portada-hero h1 { font-size: clamp(36px, 9.5vw, 58px); line-height: 1.04; letter-spacing: -.035em; font-weight: 600; margin: 18px 0 14px; }
.portada-hero h1 em { font-style: normal; color: var(--blue); }
.portada-hero .lead { font-size: clamp(16px, 4vw, 18px); color: var(--ink2); max-width: 32em; margin: 0; }
.ctas { display: flex; gap: 10px; margin: 24px 0 16px; flex-wrap: wrap; }
.ctas .btn { min-height: 48px; flex: 1 1 200px; }
@media (min-width: 960px) { .ctas .btn { flex: 0 0 auto; } }
.chk { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--ink2); font-size: 14px; margin: 0; padding: 0; list-style: none; }
.chk li { display: inline-flex; align-items: center; gap: 6px; }
.chk svg { color: var(--in); }
.beneficios { display: grid; gap: 1px; background: var(--line); border-top: 1px solid var(--line); margin-top: auto; }
.beneficios div { background: var(--paper2); padding: 22px 20px; }
.beneficios b { display: block; font-weight: 600; margin-bottom: 4px; font-size: 15.5px; }
.beneficios p { color: var(--ink2); font-size: 14px; margin: 0; }
.beneficios .pie-cuenta { padding: 16px 20px; background: var(--paper2); margin: 0; }

/* ---------- Computadora ---------- */
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px 16px; }
  .side .marca { padding: 2px 8px 18px; }
  .side .negocio { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 10px; }
  .side .negocio b { display: block; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
  .side .negocio small { color: var(--ink3); font-size: 12.5px; }
  .side .grp { font-size: 11.5px; font-weight: 600; color: var(--ink3); letter-spacing: .04em; text-transform: uppercase; padding: 14px 10px 6px; }
  .side .nav { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 10px; border-radius: var(--r-s); color: var(--ink2); font-weight: 500; font-size: 14.5px; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; }
  .side .nav:visited { color: var(--ink2); }
  .side .nav[aria-current="page"] { background: var(--blue-w); color: var(--blue); font-weight: 600; }
  .side .nav .badge { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--owed-w); color: var(--owed); padding: 1px 8px; border-radius: 999px; }
  .side .esp { flex: 1; min-height: 16px; }
  .side .prueba { background: var(--paper2); border-radius: var(--r-m); padding: 14px; font-size: 13.5px; color: var(--ink2); display: grid; gap: 10px; margin-bottom: 6px; }
  .side .prueba b { color: var(--ink); display: block; font-size: 14px; margin-bottom: 2px; }
  .side .barra { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
  .side .barra i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
  @media (hover: hover) and (pointer: fine) { .side .nav:not([aria-current="page"]):hover { background: var(--paper2); color: var(--ink); } }

  .solo-movil { display: none !important; }
  .solo-compu { display: inline; }
  .marco-app { padding-top: 0; }
  .topbar { padding: 26px 32px 18px; }
  .topbar .av { display: none; }
  .topbar h1 { font-size: 26px; }
  .topbar .acciones { display: flex; gap: 10px; }
  .topbar .acciones .btn { min-height: 40px; font-size: 14.5px; }
  .contenido { padding: 0 32px 48px; gap: 16px; }
  #avisos { padding: 0 32px; }
  .abajo { display: none; }

  .cards { grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; }
  .cards.dos { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 18px; }
  .kpi-v { font-size: 26px; margin-top: 12px; }
  .kpi.hero { grid-column: auto; }
  .kpi.hero .kpi-v { font-size: 32px; }
  .grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
  .grid2 > div { display: grid; gap: 16px; min-width: 0; }
  .grid2.inv > div:first-child { order: 2; }
  .ancho { max-width: 760px; }

  /* En la computadora la lista se lee como tabla: medio y quién anotó en columnas */
  .item .meta { display: flex; gap: 10px; align-items: center; width: 210px; flex: none; }
  .item .meta .quien { color: var(--ink3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .item .n .solo-cel { display: none; }
  .item .monto { width: 130px; text-align: right; }

  .toast { bottom: 28px; }
  .hoja { border-radius: var(--r-l); top: 50%; bottom: auto; max-height: 90dvh; transform: translateY(-46%) scale(.98); opacity: 0; transition: transform 220ms var(--ease), opacity 180ms ease; }
  .hoja.on { transform: translateY(-50%); opacity: 1; }
  .handle { display: none; }

  /* Cuenta: formulario a la izquierda, muestra del panel a la derecha */
  .cuenta-split { display: grid; grid-template-columns: minmax(440px, 1fr) minmax(0, 1.1fr); }
  .cuenta-split > .col { display: flex; flex-direction: column; min-height: 100dvh; }
  .cuenta-split .cuenta-top { padding: 22px 40px; }
  .cuenta-split .cuenta { padding: 24px 40px 32px; justify-content: center; }
  .lado-muestra { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 48px 56px; background: var(--paper2); border-left: 1px solid var(--line); }
  .lado-muestra h2 { font-size: 26px; font-weight: 600; letter-spacing: -.03em; margin: 0; line-height: 1.15; max-width: 18em; }
  .lado-muestra .muestra { max-width: 520px; }

  .portada-hero { grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 48px 40px 72px; }
  .cuenta-top { padding: 22px 40px; }
  .beneficios { grid-template-columns: repeat(3, 1fr); }
  .beneficios div { padding: 26px 40px; }
  .beneficios .pie-cuenta { grid-column: 1 / -1; padding: 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .hoja, .velo, .btn, .campo { transition: none !important; }
  .esqueleto, .cursor { animation: none !important; }
}
