.bajada { color: var(--tinta-2); font-size: 15px; margin: 6px 0 20px; max-width: 65ch; }
.ayuda code, .mono, .clave-temporal code { font-family: var(--mono); font-size: 13px; }
.centro { text-align: center; }
.boton.corto { min-height: 44px; width: auto; padding: 0 14px; font-size: 15px; }
.boton.secundario.corto { min-height: 44px; }
.boton.texto.peligro { color: var(--rojo); text-decoration-color: currentColor; }
.boton .icono { width: 17px; height: 17px; }
.entrada.corta { height: 44px; width: auto; padding: 0 34px 0 12px; }
.campo label:has(> .entrada) { display: grid; gap: 6px; }

/* Entrada */
.entrar { min-height: 100dvh; display: grid; place-content: center; gap: 16px; padding: 24px 16px; grid-template-columns: minmax(0, 400px); }
.hoja-entrar { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 28px 24px 24px; }
.hoja-entrar h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-top: 28px; }
.hoja-entrar .boton[type=submit] { margin-top: 20px; }
.hoja-entrar .ayuda.centro { margin-top: 14px; }
.sufijo-boton { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--tinta-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.con-sufijo .entrada[type=password], .con-sufijo #clave { padding-right: 80px; }

.demo-cuentas { border: 1px dashed var(--linea-fuerte); border-radius: var(--radio-sm); padding: 4px 16px; }
.demo-cuentas summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--tinta-2); }
.demo-cuentas ul { list-style: none; margin: 0 0 8px; padding: 0; }
.demo-cuentas li + li { border-top: 1px solid var(--linea); }
.demo-cuentas button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; min-height: 52px; border: 0; background: none; text-align: left; cursor: pointer; }
.demo-cuentas b { display: block; font-weight: 500; font-size: 15px; }
.demo-cuentas small { color: var(--tinta-3); font-size: 13px; }
.demo-cuentas .icono { color: var(--tinta-3); width: 16px; height: 16px; }
.demo-cuentas .ayuda { padding-bottom: 12px; }

/* Barra */
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: rgb(8 13 18 / 0.72); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); position: sticky; top: 0; z-index: 5; }
.barra::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 16px; background: linear-gradient(rgb(8 13 18 / 0.72), transparent); pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .barra::after { animation: fundir linear both; animation-timeline: scroll(); animation-range: 0 48px; }
}
@media (prefers-reduced-transparency: reduce) {
  .barra { background: var(--papel); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.barra-derecha { display: flex; align-items: center; gap: 8px; min-width: 0; }
.quien { display: grid; text-align: right; min-width: 0; line-height: 1.3; }
.quien b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quien small { font-size: 12px; color: var(--tinta-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Estructura */
.panel { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.encabezado h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.encabezado p { color: var(--tinta-3); margin-top: 4px; font-size: 15px; }
.pestanas { display: flex; gap: 4px; margin: 20px -16px 24px; padding: 0 16px; border-bottom: 1px solid var(--linea); overflow-x: auto; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas a { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; color: var(--tinta-2); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; transition: color var(--t-rapido); }
.pestanas a[aria-current=page] { color: var(--tinta); }
.pestanas a[aria-current=page]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accion); border-radius: 2px 2px 0 0; }
.cuenta { font-size: 12px; font-weight: 600; color: var(--aviso); font-variant-numeric: tabular-nums; }
.cuenta::before { content: '·'; margin-right: 4px; color: var(--tinta-3); font-weight: 400; }

.hoja, .nuevo { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 24px 20px; }
.hoja h2, .nuevo h2 { font-size: 20px; font-weight: 600; margin-bottom: 18px; }
.hoja .bajada { margin-top: -10px; }
.hoja form .boton[type=submit], .nuevo form .boton[type=submit] { margin-top: 20px; }
.angosta, .angosto { max-width: 720px; }
.hoja.angosta { max-width: 560px; }

.bloque-cabeza { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 0 0 8px; border-bottom: 1px solid var(--linea); }
.bloque-cabeza h2 { font-size: 18px; font-weight: 600; }
.bloque-cabeza .ayuda { max-width: 52ch; }
.bloque-cabeza + .bajada { margin-top: 14px; }
.vacio { color: var(--tinta-3); padding: 28px 2px; font-size: 15px; }
.columnas, .dos-columnas { display: grid; gap: 40px; }

.franja { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 20px; border-radius: var(--radio-sm); background: var(--aviso); color: var(--aviso-tinta); font-size: 14px; }
.franja.mala { background: var(--rojo-suave); color: var(--rojo-tinta); }
.franja .icono { margin-top: 1px; }

/* Resumen: una sola franja de cifras, sin tarjetas */
.resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.resumen div { padding: 14px 0 16px; animation: aparecer var(--t-entrar) var(--ease) both; }
.resumen div:nth-child(2) { animation-delay: 40ms; }
.resumen div:nth-child(3) { animation-delay: 80ms; }
.resumen div + div { padding-left: 16px; border-left: 1px solid var(--linea); }
.resumen dt { font-size: 13px; color: var(--tinta-3); }
.resumen dd { margin: 4px 0 0; font-size: clamp(20px, 5vw, 28px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.resumen .de { font-size: 15px; font-weight: 400; color: var(--tinta-3); letter-spacing: 0; }
.nota-tasa { margin: 8px 2px 32px; }
.resumen + .dos-columnas { margin-top: 32px; }

/* Estado: pastilla del kit. El color nunca va solo: siempre icono + texto. */
.estado { --ico: none; justify-self: end; display: inline-flex; gap: 5px; align-items: center; min-height: 24px; padding: 0 10px 0 7px; border-radius: 999px; background: var(--hundido); color: var(--tinta-2); font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.estado::before { content: ''; width: 12px; height: 12px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
/* Confirmado va en tono suave: lo que pide atencion es lo pendiente, y asi no se confunden los dos azules. */
.estado.aprobado { background: var(--accion-suave); color: var(--accion); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.estado.por_verificar { background: var(--aviso); color: var(--aviso-tinta); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.estado.rechazado { background: var(--rojo-suave); color: var(--rojo-tinta); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E"); }

/* Pagos */
.pagos, .links, .personas { list-style: none; margin: 0; padding: 0; }
.pago { border-bottom: 1px solid var(--linea); }
.pago-fila { width: calc(100% + 20px); margin: 0 -10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 10px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 10px; color: var(--tinta); transition: background-color var(--t-rapido); }
.pago-fila:active, .pago-fila[aria-expanded=true] { background: var(--hover); }
.pago-cliente { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pago-monto { font-weight: 600; text-align: right; white-space: nowrap; }
.pago-meta { font-size: 13px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pago-detalle { padding: 4px 0 18px; animation: aparecer 200ms var(--ease); }
@keyframes aparecer { from { opacity: 0; transform: translateY(-4px); } }
.detalle { margin: 0; }
.detalle div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--linea); font-size: 14px; }
.detalle div:last-child { border-bottom: 0; }
.detalle dt { color: var(--tinta-3); flex: none; }
.detalle dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.comprobante { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px; border: 1px solid var(--linea); border-radius: var(--radio-sm); color: var(--tinta-2); font-size: 14px; text-decoration: none; background: var(--superficie); }
.comprobante img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--papel); }
.comprobante span { display: inline-flex; gap: 6px; align-items: center; }
.revisar-ayuda { margin-top: 14px; font-size: 14px; color: var(--tinta-2); }
.revisar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 10px; }
.rechazar { display: flex; gap: 8px; flex-wrap: wrap; }
.pago-detalle .alerta { margin-top: 12px; }

/* Segmento (moneda, filtros) */
.segmento { display: inline-flex; gap: 2px; padding: 3px; background: var(--hundido); box-shadow: inset 0 0 0 1px var(--linea); border-radius: var(--radio-sm); border: 0; margin: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmento.ancho { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-bottom: 16px; }
.segmento button, .segmento span { display: grid; place-items: center; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font-size: 14px; font-weight: 500; color: var(--tinta-2); cursor: pointer; white-space: nowrap; }
.segmento.ancho span { min-height: 44px; font-size: 15px; }
.segmento label { position: relative; cursor: pointer; }
.segmento input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmento button[aria-pressed=true], .segmento input:checked + span { background: var(--elevado); color: var(--tinta); box-shadow: inset 0 1px 0 rgb(242 245 252 / 0.06), 0 2px 6px -2px rgb(0 0 0 / 0.6); }
.segmento input:focus-visible + span { outline: 2px solid var(--accion); outline-offset: 1px; }

/* Crear link */
.entrada-monto { height: 64px; font-size: 32px; font-weight: 600; letter-spacing: -0.025em; padding-right: 72px; }
.con-sufijo .sufijo { font-size: 15px; }
.mas-opciones { margin-top: 14px; border-top: 1px solid var(--linea); padding-top: 4px; }
.mas-opciones summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--tinta-2); }
.mas-opciones .casilla { margin-top: 6px; }
.mas-opciones .campo { margin-top: 14px; }
.creado { outline: none; animation: aparecer var(--t-entrar) var(--ease); }
.creado-titulo { color: var(--accion); font-weight: 600; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.creado-monto { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; }
.creado-concepto { color: var(--tinta-2); margin-top: 6px; }
.creado-url { margin-top: 14px; padding: 12px 14px; background: var(--hundido); border: 1px dashed var(--linea-fuerte); border-radius: var(--radio-sm); font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.acciones { display: grid; gap: 10px; margin-top: 16px; }
#otro { margin: 12px auto 0; display: flex; text-decoration: none; }

.link { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.link-datos { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; }
.link-concepto { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-monto { font-weight: 600; text-align: right; white-space: nowrap; }
.link-meta { font-size: 13px; color: var(--tinta-3); grid-column: 1 / -1; }
.link-acciones { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.link-acciones .boton { min-height: 44px; width: auto; padding: 0; background: none; box-shadow: none; border: 0; color: var(--tinta-2); font-size: 14px; font-weight: 500; }
.link-acciones .boton .icono { width: 16px; height: 16px; }

/* Metodos de cobro */
.metodos { max-width: 860px; }
.metodo { padding: 16px 0; border-bottom: 1px solid var(--linea); }
.interruptor { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.interruptor input { appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--linea-fuerte); position: relative; cursor: pointer; transition: background-color 200ms var(--ease); }
.interruptor input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--tinta); box-shadow: 0 1px 2px rgb(0 0 0 / 0.4); transition: transform 320ms var(--resorte), background-color 200ms; }
.interruptor input:checked { background: var(--accion); }
.interruptor input:checked::after { background: var(--sobre); }
.interruptor input:checked::after { transform: translateX(18px); }
.interruptor input:focus-visible { outline: 2px solid var(--accion); outline-offset: 2px; }
.interruptor-texto { display: grid; gap: 2px; }
.interruptor-texto b { font-weight: 600; color: var(--tinta); font-size: 16px; }
.interruptor-texto small { font-size: 14px; color: var(--tinta-3); font-weight: 400; }
.metodo-campos { display: grid; gap: 12px; margin: 16px 0 0 58px; animation: aparecer 200ms var(--ease); }
.metodo-campos .campo + .campo { margin-top: 0; }
.metodo-campos .boton { justify-self: start; }
.metodo-campos .alerta { margin-top: 0; }
.metodo:not(:has(input[name=activo]:checked)) .metodo-campos { display: none; }

/* Personas, empresas, facturas */
.personas li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 12px 2px; border-bottom: 1px solid var(--linea); }
.personas li > :last-child:not(:nth-child(2)) { grid-column: 1 / -1; justify-self: start; }
.persona { display: grid; min-width: 0; }
.persona b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.persona small { font-size: 13px; color: var(--tinta-3); }
.rol { font-size: 14px; color: var(--tinta-2); }
.factura-monto { font-weight: 600; }
.personas .boton.texto { min-height: 44px; padding: 0; font-size: 14px; }
.personas + .ayuda { margin-top: 12px; }

.agregar { margin-top: 20px; }
.agregar summary { list-style: none; width: auto; display: inline-flex; }
.agregar summary::-webkit-details-marker { display: none; }
.agregar[open] summary { display: none; }
.agregar form { padding: 20px; border: 1px solid var(--linea); border-radius: var(--radio-sm); background: var(--superficie); animation: aparecer 200ms var(--ease); }

.clave-temporal { margin: 16px 0; padding: 14px 16px; border-radius: var(--radio-sm); background: var(--accion-suave); color: var(--tinta); display: grid; gap: 6px; outline: none; font-size: 15px; }
.clave-temporal .clave-titulo { font-weight: 600; display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.clave-temporal code { font-size: 16px; background: var(--elevado); padding: 2px 8px; border-radius: 6px; color: var(--tinta); letter-spacing: 0.02em; }
.clave-temporal .ayuda { color: var(--tinta-2); }
.clave-temporal .boton.texto { min-height: 44px; padding: 0 6px; color: var(--accion); }
.nuevo .clave-temporal + .boton { margin-top: 4px; }

/* Carga y avisos */
.cargando-seccion { display: grid; gap: 12px; padding-top: 8px; }
.cargando-seccion .esqueleto { display: block; height: 52px; border-radius: var(--radio-sm); }
.cargando-seccion .esqueleto:first-child { height: 76px; }
.vacio-seccion { padding: 40px 0; display: grid; gap: 12px; justify-items: start; color: var(--tinta-2); }
.aviso { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; padding: 12px 18px; border-radius: 12px; background: var(--tinta); color: var(--papel); font-size: 14px; font-weight: 500; box-shadow: var(--sombra-alta); animation: subir var(--t-entrar) var(--ease), bajar var(--t-salir) ease 2650ms forwards; max-width: calc(100vw - 32px); }
/* comun.js retira el aviso a los 2800 ms: la salida cabe justo antes y es mas corta que la entrada */
@keyframes subir { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes bajar { to { opacity: 0; transform: translate(-50%, 8px); } }

@media (hover: hover) and (pointer: fine) {
  .sufijo-boton:hover { background: var(--hover); color: var(--tinta); }
  .demo-cuentas button:hover b { color: var(--accion); }
  .pestanas a:hover { color: var(--tinta); }
  .pago-fila:hover { background: var(--hover); }
  .comprobante:hover { border-color: var(--linea-fuerte); color: var(--tinta); }
  .segmento button:hover, .segmento label:hover span { color: var(--tinta); }
  .link-acciones .boton:hover { background: none; color: var(--accion); }
}

@media (max-width: 520px) {
  .quien small { display: none; }
  .resumen { grid-template-columns: 1fr 1fr; }
  .resumen div:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--linea); }
  .metodo-campos { margin-left: 0; }
  .revisar { flex-direction: column; align-items: stretch; }
  .revisar .boton.corto { width: 100%; min-height: 48px; }
  .rechazar .entrada.corta { flex: 1; }
}

@media (min-width: 900px) {
  .barra { padding: 12px 32px; }
  .panel { padding: 40px 32px 80px; }
  .encabezado h1 { font-size: 32px; }
  .pestanas { margin: 24px 0 32px; padding: 0; }
  .pestanas a:first-child { padding-left: 0; }
  .pestanas a:first-child[aria-current=page]::after { left: 0; }
  .columnas { grid-template-columns: 1fr 1fr; gap: 56px; }
  .dos-columnas { grid-template-columns: 400px minmax(0, 1fr); gap: 56px; align-items: start; }
  .dos-columnas.invertidas { grid-template-columns: minmax(0, 1fr) 380px; }
  .nuevo { position: sticky; top: 88px; padding: 28px; }
  .hoja { padding: 32px; }
  .acciones { grid-template-columns: 1fr 1fr; }
  .acciones .boton.texto { grid-column: 1 / -1; justify-self: center; }
  .personas li { grid-template-columns: minmax(0, 1fr) auto 128px; }
  .personas li > :last-child:not(:nth-child(2)) { grid-column: auto; justify-self: end; }
  .metodo-campos { grid-template-columns: 1fr 1fr; }
  .metodo-campos .alerta, .metodo-campos .boton { grid-column: 1 / -1; }
}

/* Con menos ancho el concepto del link se cortaba a tres letras: las acciones bajan a su propia fila. */
@media (min-width: 1100px) {
  .link { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 32px; }
  .link-acciones { justify-content: flex-end; }
}
