/* Panel de Booky con QR (#85): el diseño del rediseño de noviembre de 2026 (PR-31; lenguaje compartido de DISENO.md). Solo en claro, como la app y el resto del sitio. Se basta solo: no carga /booky/panel/panel.css.
   Sin atributos style="" en el HTML (la CSP de esta página no los deja): lo dinámico (anchos, colores) lo pone w-vista.js con CSSOM. Fuente del sistema, sin recursos externos. */
:root {
  --bg: #FBFBFC; --card: #FFFFFF; --ink: #111113; --ink2: #63636A; --line: rgba(60, 60, 67, .12); --track: rgba(17, 17, 19, .08); --pill: rgba(17, 17, 19, .06); --chip: #F2F2F7;
  --brand: #056E51; --brand-soft: #DDF2EA; --bar: #3FA383; --warn: #A84E00; --warn-soft: #FDEBDD; --blue: #1F62D0; --blue-soft: #E3ECFB;
  --glass: rgba(255, 255, 255, .82); --shadow: 0 6px 20px rgba(17, 17, 19, .08); --shadow-glass: 0 8px 28px rgba(17, 17, 19, .12), inset 0 0 0 1px rgba(17, 17, 19, .06);
  /* La marca de Pro (la etiqueta «Pro» de la cabecera y el enlace «Ver Booky Pro»): un solo sitio para cambiar el color. Hoy, negro y oro con corona, como .bk-pro en site/assets/booky.css; el enlace usa el verde de marca (el oro no se lee sobre blanco). */
  --pro: #1C1C1E; --pro-soft: #1C1C1E; --pro-ink: #FFCB57;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-soft) 0, rgba(221, 242, 234, 0) 340px) top / 100% 340px no-repeat, var(--bg);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--brand); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* Cabecera: una píldora de vidrio que flota */
.top { position: sticky; top: 0; z-index: 5; padding: 20px 40px 0; pointer-events: none; }
.top-in { pointer-events: auto; max-width: 1200px; margin: 0 auto; min-height: 64px; padding: 8px 14px 8px 12px; border-radius: 32px; background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--shadow-glass); display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; }
.marca-p { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 40px; height: 40px; border-radius: 10px; display: block; }
.titles { line-height: 1.3; min-width: 0; }
.nombre { font-family: var(--round); font-size: 19px; line-height: 23px; font-weight: 800; letter-spacing: -.02em; }
.nombre .pro { display: inline-flex; align-items: center; gap: 4px; vertical-align: 2px; margin-left: 4px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--pro-soft); color: var(--pro-ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif; font-size: 11px; line-height: 1; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.nombre .pro svg { width: 11px; height: 11px; flex: none; }
.sub { font-size: 13px; line-height: 17px; color: var(--ink2); }
.acciones { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--pill); }
.lang a { border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--ink2); text-decoration: none; }
.lang a[aria-current] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(17, 17, 19, .10); }
.lang a:not([aria-current]):hover { color: var(--ink); }

/* Botones: uno lleno por pantalla (56 pt); los demás, suaves (36) o de texto (44) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; min-height: 36px; padding: 0 16px; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; background: var(--brand-soft); color: var(--brand); text-decoration: none; text-align: center; }
.btn.primary { min-height: 56px; padding: 0 44px; font-size: 17px; background: var(--brand); color: var(--card); box-shadow: 0 8px 24px rgba(5, 110, 81, .28); }
.btn.corto { min-height: 36px; padding: 0 16px; }
.btn .ic { display: none; }
.btn.texto { min-height: 44px; padding: 0 20px; background: transparent; color: var(--brand); font-size: 17px; font-weight: 600; }
.btn:hover { color: var(--ink); }
.btn.primary:hover { color: var(--card); filter: brightness(1.08); }
.btn:active, .mes:active, .chip:active, button.fila:active { transform: scale(.97); transition: transform 100ms ease-out; }

/* Estructura */
.wrap { flex: 1 1 auto; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 40px 0; display: flex; flex-direction: column; }
main { flex: 1 1 auto; display: block; }
body:not([data-vista="datos"]) main { display: flex; align-items: center; justify-content: center; padding-bottom: 24px; }
body:not([data-vista="datos"]) main > section { width: 100%; }
body[data-vista="espera"] main > section, body[data-vista="mensaje"] main > section { max-width: 640px; }
.card { background: var(--card); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.notice { background: var(--brand-soft); color: var(--brand); border-radius: 14px; padding: 10px 16px; font-weight: 600; margin: 0 0 14px; }
.error { color: var(--warn); font-weight: 600; }
.muted { color: var(--ink2); }
.small { font-size: 14px; }
footer { text-wrap: pretty; padding: 28px 0 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--ink2); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer nav a { color: var(--brand); font-weight: 600; text-decoration: none; }
footer nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.solo-datos { display: none; }
body[data-vista="datos"] .solo-datos { display: inline; }

/* QR */
.qrcard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 40px 56px; padding: 48px 56px; }
.qrtext { flex: 1 1 380px; min-width: 0; }
.qrtext h1 { font-family: var(--round); font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 48px; text-wrap: balance; }
.pasos { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.pasos li { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.pasos .ico, .telefono .ico { flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.pasos .ico { width: 44px; height: 44px; background: var(--blue-soft); color: var(--blue); }
.paso { font-size: 19px; line-height: 24px; font-weight: 600; }
.paso .n { font-weight: 800; color: var(--blue); }
.pro-nota { margin-top: 24px; font-size: 15px; line-height: 22px; color: var(--ink2); }
.pro-nota a { color: var(--brand); font-weight: 650; text-underline-offset: 3px; }
.pro-nota a:hover { color: var(--ink); }
.pro-nota a:focus-visible { outline-color: var(--brand); }
.cifrado { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 22px; color: var(--ink2); text-wrap: pretty; }
.cifrado svg { flex: none; }
.qrcol { flex: 0 0 320px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; max-width: 100%; }
.qr { background: #fff; color: #000; border-radius: 22px; padding: 18px; box-shadow: inset 0 0 0 1px rgba(17, 17, 19, .10); width: 280px; max-width: 100%; aspect-ratio: 1; }
.qr svg { display: block; width: 100%; height: 100%; }
.pildora { display: flex; align-items: center; height: 32px; font-size: 14px; font-weight: 700; padding: 0 14px; border-radius: 16px; background: var(--chip); color: var(--ink); }
.pildora:empty { display: none; }
.qrcol .small { text-align: center; max-width: 280px; line-height: 20px; }

/* Espera y mensajes */
.centro { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 40px; }
.centro h1 { font-family: var(--round); font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 42px; text-wrap: balance; }
.centro h1:focus { outline: none; }
.centro p { color: var(--ink2); line-height: 24px; }
.centro h1 + p { margin-top: 10px; }
.centro .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.telefono { position: relative; width: 96px; height: 150px; border-radius: 24px; border: 3px solid var(--ink); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; }
.telefono .ranura { position: absolute; top: 7px; width: 28px; height: 7px; border-radius: 4px; background: var(--ink); }
.telefono .ico { width: 44px; height: 44px; background: var(--brand-soft); color: var(--brand); }
.puntos { display: flex; gap: 5px; }
.dot { width: 6px; height: 6px; border-radius: 3px; background: var(--brand); animation: pulso 1.4s ease-in-out infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulso { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.chip-eq { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 12px; border-radius: 18px; background: var(--chip); font-size: 15px; font-weight: 600; color: var(--ink) !important; }
.centro .chip-eq + p { margin-top: 12px; font-size: 17px; }
.espera .btn.texto { margin-top: 18px; }

/* Con datos */
#datos { display: flex; flex-direction: column; gap: 24px; padding-bottom: 8px; }
#datos > .centro { margin: 0 auto; width: 100%; max-width: 640px; }
.meses { position: relative; display: flex; align-items: center; gap: 2px; width: fit-content; max-width: 100%; margin: 0 auto; padding: 4px; border-radius: 28px; background: rgba(17, 17, 19, .05); overflow-x: auto; scrollbar-width: none; }
.meses::-webkit-scrollbar { display: none; }
.mes { flex: none; border: 0; border-radius: 24px; min-height: 48px; padding: 0 24px; background: transparent; color: var(--ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; }
.mes .n { font-size: 15px; line-height: 19px; font-weight: 600; }
.mes .t { font-size: 13px; line-height: 17px; }
.mes[aria-current] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 19, .10); }
.mes[aria-current] .n { font-weight: 700; }
.mes[aria-current] .t { color: var(--ink2); }
.mes:not([aria-current]):hover { color: var(--ink); }
.otros { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; font-size: 14px; color: var(--ink2); }
.otros select { font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--card); border: 0; border-radius: 18px; height: 36px; padding: 0 12px; max-width: 220px; box-shadow: inset 0 0 0 1px rgba(17, 17, 19, .08); }
.chips:empty { display: none; }
.chips { display: flex; justify-content: center; }
.chip .x { margin-left: 6px; }
.chip { border: 0; border-radius: 999px; min-height: 36px; padding: 0 16px; font-size: 14px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }

.arriba { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.hero { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.kpis { flex: 0 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hero-t { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 8px; border-radius: 16px; background: var(--card); }
.hero-t.bien { color: var(--brand); }
.hero-t.rapido, .hero-t.pasado { color: var(--warn); }
.hero-t .hero-h { font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.2; color: inherit; }
.hero-t svg { flex: none; width: 18px; height: 18px; }
.hero > .hero-h { font-family: var(--round); font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 40px; color: var(--ink); text-wrap: balance; }
.hero-monto { margin-top: 8px; font-family: var(--round); font-size: 72px; font-weight: 800; letter-spacing: -.02em; line-height: 80px; overflow-wrap: anywhere; }
.hero-monto .de { margin-left: 6px; font-size: 24px; font-weight: 700; letter-spacing: 0; color: var(--ink2); white-space: nowrap; }
.barra { position: relative; margin-top: 34px; width: min(100%, 560px); height: 8px; border-radius: 4px; background: var(--track); }
.relleno { height: 8px; border-radius: 4px; background: var(--brand); max-width: 100%; }
.relleno.rapido, .relleno.pasado { background: var(--warn); }
.marca { position: absolute; top: -6px; width: 2px; height: 20px; border-radius: 1px; background: var(--ink); }
.marca-t { position: absolute; bottom: 18px; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: var(--ink); }
.hero-resto { margin-top: 14px; font-size: 15px; line-height: 22px; color: var(--ink2); }
.hero > .hero-h + .hero-resto { margin-top: 10px; }
.kpi { background: var(--card); border-radius: 22px; padding: 16px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.kpi .ico { width: 32px; height: 32px; background: var(--brand-soft); color: var(--brand); }
.kpi.k-ingresos .ico { background: #DFF3E4; color: #2A7F3A; }
.kpi.k-balance .ico { background: var(--blue-soft); color: var(--blue); }
.kpi.k-deben .ico { background: #F5E3F7; color: #A23BB0; }
.kpi.k-compras .ico { background: var(--warn-soft); color: #C2530F; }
.kpi .valor { font-family: var(--round); font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 34px; overflow-wrap: anywhere; }
.kpi.neg .valor { color: var(--warn); }
.kpi .etq { font-size: 14px; line-height: 18px; color: var(--ink2); }

.card h2 { font-family: var(--round); font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 28px; }
.cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.cab-r { font-size: 15px; font-weight: 600; }
.nw { white-space: nowrap; }
.filtro { font-family: var(--round); font-weight: 600; color: var(--ink2); }
.cab-r.suave, .suave { font-weight: 400; color: var(--ink2); }

.pd-cuerpo { display: flex; gap: 14px; margin-top: 24px; }
.pd-izq { flex: 1 1 auto; min-width: 0; }
.pd-plot { position: relative; height: 200px; }
.pd-linea { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.pd-barras { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 6px; }
.pd-barra { flex: 1 1 0; min-width: 0; border-radius: 3px 3px 0 0; background: var(--bar); }
.pd-barra.hoy:not(.cero) { background: var(--brand); }
.pd-prom { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--ink2); }
.pd-x { position: relative; height: 18px; margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--ink2); }
.pd-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pd-x .hoy { font-weight: 800; color: var(--brand); }
.pd-y { position: relative; height: 200px; font-size: 13px; color: var(--ink2); flex: none; }
.pd-y span { position: absolute; left: 0; transform: translateY(-50%); white-space: nowrap; }

.dos { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }
.abajo { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.abajo > .card { flex: 2 1 560px; }
.abajo > .col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.card > h2 { margin-bottom: 8px; }
.card > .cab { margin-bottom: 0; }
.card > .cab h2 { margin: 0; }
.card > .btn { margin-top: 12px; }
.abajo .card > .btn { margin-top: 16px; }
.vacio { color: var(--ink2); padding: 12px 0; }

.filas { display: flex; flex-direction: column; }
.fila { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 10px; margin: 0 -10px; border: 0; background: transparent; text-align: left; color: inherit; border-radius: 16px; width: calc(100% + 20px); }
button.fila:hover { background: var(--chip); }
button.fila[aria-pressed="true"] { background: var(--brand-soft); }
button.fila:focus-visible { outline-offset: -3px; }
.ico .pto { width: 12px; height: 12px; border-radius: 50%; display: block; }
.ico .pto.hueco { border: 2px solid; background: transparent; }
.cuerpo { flex: 1 1 auto; min-width: 0; }
.fila .cuerpo { display: flex; flex-direction: column; gap: 7px; }
.l1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 16px; line-height: 20px; }
.nom { font-weight: 600; overflow-wrap: anywhere; }
.cnt { font-size: 14px; font-weight: 400; color: var(--ink2); }
.monto { font-weight: 600; white-space: nowrap; text-align: right; }
.pct { display: inline-block; min-width: 44px; text-align: right; font-size: 14px; font-weight: 400; color: var(--ink2); }
.track { display: block; height: 4px; border-radius: 2px; background: var(--pill); }
.fill { display: block; height: 4px; border-radius: 2px; }
.fila .sub { display: block; font-size: 14px; line-height: 18px; color: var(--ink2); }

.dia { margin-top: 18px; }
.dia h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; line-height: 24px; font-weight: 700; }
.dia h3 .dia-t { font-weight: 600; color: var(--ink2); }
.compras { list-style: none; margin: 0; padding: 0; }
.compra { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.compra .l1 { justify-content: flex-start; flex-wrap: wrap; gap: 4px 8px; }
.compra .meta { font-size: 13px; line-height: 17px; color: var(--ink2); overflow-wrap: anywhere; text-wrap: pretty; }
.compra .monto { font-size: 16px; }
.compra .monto.nosuma { color: var(--ink2); text-decoration: line-through; }
.compra .monto.nosuma .meta { text-decoration: none; }
.compra .monto .meta { font-weight: 400; }
.etiqueta.nota { font-weight: 600; white-space: normal; overflow-wrap: anywhere; text-wrap: pretty; }
.etiqueta { font-size: 13px; font-weight: 600; padding: 1px 10px; border-radius: 999px; background: var(--pill); color: var(--ink); }
.etiqueta.dup { background: var(--warn-soft); color: var(--warn); }

/* Teléfono */
@media (max-width: 640px) {
  .top { padding: 12px 16px 0; }
  .top-in { min-height: 56px; padding: 8px 10px; border-radius: 28px; }
  .wrap { padding: 12px 16px 0; }
  .card { padding: 20px; }
  .qrcard { padding: 20px; gap: 20px; }
  .qrtext h1 { font-size: 28px; line-height: 32px; }
  .pasos { margin-top: 20px; gap: 14px; }
  .paso { font-size: 16px; line-height: 21px; }
  .cifrado { margin-top: 20px; padding-top: 16px; font-size: 14px; line-height: 20px; align-items: flex-start; }
  .cifrado svg { margin-top: 1px; }
  .qrcol { flex: 0 0 auto; width: 100%; }
  .qr { width: 200px; padding: 14px; border-radius: 20px; }
  .qrcol .small { font-size: 13px; line-height: 18px; }
  .centro { padding: 32px 20px; }
  .centro h1 { font-size: 28px; line-height: 34px; }
  .hero > .hero-h { font-size: 28px; line-height: 34px; }
  .hero-monto { font-size: 56px; line-height: 64px; }
  .hero-monto .de { font-size: 20px; }
  .meses { margin: 0; }
  .mes { padding: 0 18px; }
  .kpis { gap: 12px; }
  .kpi { padding: 14px 16px; }
  .kpi .valor { font-size: 24px; line-height: 30px; }
  .pd-cuerpo { gap: 8px; }
  .pd-barras { gap: 3px; }
  .abajo > .card, .hero, .kpis, .qrtext { flex-basis: 100%; }
  #datos { gap: 16px; }
  .dos, .abajo { gap: 16px; }
  .abajo > .col { gap: 16px; }
  .dos { grid-template-columns: minmax(0, 1fr); }
  footer { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 20px; font-size: 13px; line-height: 20px; }
  footer nav { gap: 8px 16px; }
}

@media (max-width: 600px) {
  .top { position: static; }
  /* Encabezado compacto: logo, título, ES/EN y el cierre como ícono en una fila; el subtítulo, debajo. */
  .top-in { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; }
  .marca-p, .titles { display: contents; }
  .mark { grid-column: 1; grid-row: 1; }
  .nombre { grid-column: 2; grid-row: 1; font-size: 18px; min-width: 0; }
  .acciones { grid-column: 3; grid-row: 1; gap: 8px; }
  .sub { grid-column: 1 / -1; grid-row: 2; font-size: 12px; line-height: 16px; text-wrap: pretty; padding: 0 4px 2px; }
  #cerrar { padding: 0; width: 40px; height: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  #cerrar .ic { display: block; }
  #cerrar .tx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  .dot:nth-child(1) { opacity: .35; }
  .dot:nth-child(2) { opacity: .65; }
  .btn:active, .mes:active, .chip:active, button.fila:active { transform: none; transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .top-in { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
