:root {
  --mo: #5b3fd6;
  --mo2: #3f27b5;
  --moc: #f1edff;
  --tx: #14202b;
  --gr: #6f7b8b;
  --fo: #f6f7fb;
  --bl: #ffffff;
  --li: #eceff4;
  --ve: #17784a;
  --vec: #e7f7ee;
  --am: #9a5b00;
  --amc: #fff3e0;
  --ro: #c0392b;
  --roc: #ffe9e6;
  --sombra: 0 2px 10px rgba(20, 32, 43, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --tx: #eef1f6;
    --gr: #9aa6b6;
    --fo: #0f141b;
    --bl: #1a222d;
    --li: #273140;
    --moc: #2a2350;
    --vec: #10301f;
    --amc: #3a2a0c;
    --roc: #3d1814;
    --ve: #4fd18b;
    --am: #f0b45a;
    --ro: #ff7b6b;
    --sombra: none;
  }
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  background: var(--fo);
  color: var(--tx);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
}
body {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
input,
select {
  width: 100%;
  border: 1.5px solid var(--li);
  background: var(--bl);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--mo);
}
label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gr);
  margin: 12px 0 6px;
}
.oculto {
  display: none !important;
}
.pad {
  padding: 0 16px;
}
.pista {
  color: var(--gr);
  font-size: 12.5px;
  line-height: 1.45;
}
.error {
  color: var(--ro);
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}
.btn {
  display: block;
  width: 100%;
  border-radius: 16px;
  padding: 14px;
  font-weight: 800;
  font-size: 15.5px;
  background: linear-gradient(135deg, #6d4cf0, #4a2fc9);
  color: #fff;
  margin-top: 14px;
}
.btn:disabled {
  opacity: 0.6;
}
.btn.sec {
  background: var(--bl);
  color: var(--tx);
  border: 1.5px solid var(--li);
}
.btn.peligro {
  background: var(--roc);
  color: var(--ro);
}
.enlace {
  color: var(--mo);
  font-weight: 700;
  font-size: 13.5px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 99px;
  background: var(--bl);
  border: 1.5px solid var(--li);
  font-size: 13px;
  white-space: nowrap;
}
.chip.on {
  background: var(--tx);
  color: var(--fo);
  border-color: var(--tx);
}
.fila-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- pantalla de bloqueo / inicio de la app ---------- */
.bloqueo {
  min-height: 100dvh;
  background: linear-gradient(170deg, #5b3fd6, #3a24a8);
  color: #fff;
  padding: 48px 26px 26px;
  text-align: center;
  margin-bottom: calc(-84px - env(safe-area-inset-bottom));
}
.bloqueo .logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.bloqueo h1 {
  font-size: 25px;
}
.bloqueo p {
  opacity: 0.88;
  font-size: 14px;
  margin-top: 6px;
}
.bloqueo .error {
  color: #ffd4cf;
}
.bloqueo input {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  text-align: center;
  margin-top: 22px;
}
.bloqueo input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.bloqueo .btn {
  background: #fff;
  color: var(--mo2);
}
.bloqueo .enlace {
  color: #fff;
  text-decoration: underline;
  display: inline-block;
  margin-top: 18px;
  font-weight: 600;
}
.puntos {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 30px 0 22px;
}
.puntos i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.puntos i.f {
  background: #fff;
}
.teclado {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 22px;
  max-width: 300px;
  margin: 0 auto;
}
.teclado button {
  height: 62px;
  border-radius: 50%;
  font-size: 26px;
  color: #fff;
}
.teclado button:active {
  background: rgba(255, 255, 255, 0.15);
}
.config {
  text-align: left;
  background: var(--bl);
  color: var(--tx);
  border-radius: 22px;
  padding: 6px 18px 18px;
  margin-top: 22px;
}
.config input {
  background: var(--bl);
  color: var(--tx);
  text-align: left;
  border-color: var(--li);
  margin-top: 0;
}
.config input::placeholder {
  color: var(--gr);
}
.config .btn {
  background: linear-gradient(135deg, #6d4cf0, #4a2fc9);
  color: #fff;
}
.config .error {
  color: var(--ro);
}
.dos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------- inicio ---------- */
.cab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px 10px;
}
.cab small {
  display: block;
  color: var(--gr);
  font-size: 12.5px;
}
.cab b {
  font-size: 19px;
}
.icono {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--bl);
  box-shadow: var(--sombra);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.tarjeta-saldo {
  margin: 0 16px;
  border-radius: 24px;
  background: linear-gradient(140deg, #6d4cf0, #3f27b5);
  color: #fff;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(80, 50, 200, 0.3);
}
.tarjeta-saldo small {
  opacity: 0.88;
  font-size: 12.5px;
}
.tarjeta-saldo .grande {
  font-size: 34px;
  font-weight: 800;
  margin: 2px 0;
}
.barra {
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  margin: 10px 0 6px;
  overflow: hidden;
}
.barra i {
  display: block;
  height: 100%;
  background: #fff;
  border-radius: 9px;
}
.fila {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.tarjeta-saldo .fila {
  opacity: 0.92;
}
.caja {
  margin: 12px 16px 0;
  background: var(--bl);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--sombra);
}
.caja h4 {
  font-size: 13px;
  color: var(--gr);
  font-weight: 600;
}
.dia {
  font-size: 27px;
  font-weight: 800;
}
.dia small {
  font-size: 13px;
  color: var(--gr);
  font-weight: 500;
}
.aviso {
  margin-top: 9px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--amc);
  color: var(--am);
}
.aviso.ok {
  background: var(--vec);
  color: var(--ve);
}
.aviso.mal {
  background: var(--roc);
  color: var(--ro);
}
.sep {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 6px;
  font-size: 15px;
  font-weight: 800;
}
.lista {
  margin: 0 16px;
  background: var(--bl);
  border-radius: 18px;
  padding: 2px 12px;
  box-shadow: var(--sombra);
}
.mov {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--li);
  width: 100%;
  text-align: left;
}
.mov:last-child {
  border: 0;
}
.mov .ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: var(--moc);
  flex: none;
}
.mov .tx {
  flex: 1;
  min-width: 0;
}
.mov .tx b {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mov small {
  color: var(--gr);
  font-size: 11.5px;
}
.mov .m {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.mov .m.in {
  color: var(--ve);
}
.vacio {
  text-align: center;
  color: var(--gr);
  padding: 18px 8px;
  font-size: 13.5px;
}
.etq {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 99px;
  font-weight: 700;
  white-space: nowrap;
}
.etq.ok {
  background: var(--vec);
  color: var(--ve);
}
.etq.pend {
  background: var(--amc);
  color: var(--am);
}
.etq.tarde {
  background: var(--roc);
  color: var(--ro);
}

/* ---------- barra de abajo ---------- */
nav.abajo {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bl);
  border-top: 1px solid var(--li);
  display: grid;
  grid-template-columns: 1fr 1fr 76px 1fr 1fr;
  align-items: center;
  z-index: 10;
}
nav.abajo button {
  font-size: 11px;
  color: var(--gr);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
nav.abajo button b {
  font-size: 20px;
  font-weight: 400;
}
nav.abajo button.on {
  color: var(--mo);
  font-weight: 700;
}
.mas {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d4cf0, #4a2fc9);
  color: #fff !important;
  font-size: 32px !important;
  justify-self: center;
  margin-top: -30px;
  box-shadow: 0 8px 20px rgba(90, 60, 220, 0.45);
  border: 5px solid var(--fo) !important;
  justify-content: center;
}

/* ---------- hoja (ventana desde abajo) ---------- */
.fondo {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.5);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hoja {
  background: var(--fo);
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
}
.hoja .asa {
  width: 44px;
  height: 5px;
  border-radius: 9px;
  background: var(--li);
  margin: 0 auto 8px;
}
.hoja .titulo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.hoja .titulo b {
  font-size: 18px;
}
.monto-grande {
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  border: 0;
  background: transparent;
  padding: 6px 0;
}
.cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cats button {
  background: var(--bl);
  border-radius: 16px;
  padding: 10px 2px;
  font-size: 11px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}
.cats button b {
  font-size: 22px;
  font-weight: 400;
}
.cats button.on {
  border-color: var(--mo);
  background: var(--moc);
  font-weight: 700;
}
.seg {
  display: flex;
  background: var(--li);
  border-radius: 14px;
  padding: 3px;
  gap: 3px;
}
.seg button {
  flex: 1;
  padding: 9px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--gr);
}
.seg button.on {
  background: var(--bl);
  color: var(--tx);
  box-shadow: var(--sombra);
}

/* ---------- calendario ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 12px;
}
.cal b {
  color: var(--gr);
  font-weight: 600;
  font-size: 10.5px;
  padding-bottom: 2px;
}
.cal span {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.cal .fuera {
  opacity: 0.3;
}
.cal .hoy {
  background: var(--tx);
  color: var(--fo);
  font-weight: 700;
}
.cal .pago {
  background: var(--roc);
  color: var(--ro);
  font-weight: 700;
}
.cal .pagado {
  background: var(--vec);
  color: var(--ve);
}
.cal .cobro {
  outline: 2px solid var(--ve);
  font-weight: 800;
}
.leyenda {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--gr);
  margin-top: 10px;
}
.leyenda i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}

/* ---------- metas ---------- */
.lim {
  padding: 10px 0;
  border-bottom: 1px solid var(--li);
}
.lim:last-child {
  border: 0;
}
.lb {
  height: 8px;
  border-radius: 9px;
  background: var(--li);
  margin-top: 6px;
  overflow: hidden;
}
.lb i {
  display: block;
  height: 100%;
  border-radius: 9px;
}
.meta {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--li);
  width: 100%;
  text-align: left;
}
.meta:last-child {
  border: 0;
}
.anillo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.anillo span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}
.barras {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  margin-top: 10px;
}
.barras div {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  font-size: 10px;
  color: var(--gr);
  height: 100%;
  min-width: 0;
}
.barras .par {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  justify-content: center;
}
.barras i {
  display: block;
  width: 42%;
  border-radius: 6px 6px 2px 2px;
}
.barras em {
  font-style: normal;
  font-size: 18px;
}

/* ---------- ajustes ---------- */
.opcion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--li);
  width: 100%;
  text-align: left;
  font-size: 14.5px;
}
.opcion:last-child {
  border: 0;
}
.opcion small {
  display: block;
  color: var(--gr);
  font-size: 12px;
}
.opcion span:last-child {
  color: var(--gr);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--tx);
  color: var(--fo);
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  z-index: 40;
  max-width: 90%;
  text-align: center;
}
.espera {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: g 0.8s linear infinite;
  vertical-align: -3px;
}
@keyframes g {
  to {
    transform: rotate(360deg);
  }
}
