:root {
  --verde: #1F3D2B;
  --verde-2: #2F5A40;
  --verde-claro: #E2F1E6;
  --verde-texto: #1A5C32;
  --menta: #B9D7A8;
  --naranja: #C2611A;
  --naranja-claro: #FCEBDD;
  --azul: #2C4E7A;
  --azul-claro: #EAF0F8;
  --rojo: #9B2A16;
  --rojo-claro: #FDE4DE;
  --fondo: #F3F5F0;
  --tarjeta: #FFFFFF;
  --texto: #17251C;
  --suave: #4A5A4F;
  --linea: #D5DDD2;
  --sombra: 0 1px 3px rgba(23, 37, 28, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fondo);
  color: var(--texto);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 16px; color: var(--texto); }
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.cargando { padding: 80px 20px; text-align: center; color: var(--suave); }

/* Encabezado */
.encabezado {
  background: var(--verde);
  color: #fff;
  padding: calc(18px + env(safe-area-inset-top)) 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.fila { display: flex; align-items: center; gap: 10px; }
.entre { justify-content: space-between; }
.titulo { font-size: 18px; font-weight: 800; }
.subtitulo { font-size: 12px; color: #C9DCC0; }
.boton-circulo {
  width: 44px; height: 44px; border-radius: 22px; border: none;
  background: var(--verde-2); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.selector {
  width: 100%; height: 44px; border: none; border-radius: 12px;
  background: #fff; color: var(--verde); font-weight: 700; padding: 0 12px;
}

/* Contenido */
.contenido { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.tarjeta {
  background: var(--tarjeta); border-radius: 20px; padding: 16px;
  box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 12px;
}
.etiqueta { font-size: 12px; font-weight: 800; color: var(--suave); letter-spacing: 0.4px; text-transform: uppercase; }
.numero-grande { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.rejilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cuadro { border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.cuadro .mini { font-size: 12px; font-weight: 700; }
.cuadro .valor { font-size: 20px; font-weight: 800; }
.entro { background: var(--verde-claro); } .entro .mini { color: var(--verde-texto); }
.salio { background: var(--naranja-claro); } .salio .mini { color: #9A4A0E; }
.usd { background: var(--azul-claro); } .usd .mini { color: var(--azul); }

/* Botones de acción */
.accion {
  border: none; border-radius: 18px; padding: 16px; min-height: 100px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  font-size: 16px; font-weight: 700; text-align: left; cursor: pointer; box-shadow: var(--sombra);
  background: #fff;
}
.accion.verde { background: var(--verde); color: #fff; }
.accion.naranja { background: var(--naranja); color: #fff; }
.accion svg { width: 28px; height: 28px; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.campo input, .campo select, .campo textarea {
  height: 48px; border: 1px solid var(--linea); border-radius: 12px; padding: 0 12px;
  background: #fff; font-weight: 600; width: 100%;
}
.campo textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.campo-fila {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 56px; border-bottom: 1px solid #EBEFE8; font-size: 15px; font-weight: 600;
}
.campo-fila:last-child { border-bottom: none; }
.campo-fila input {
  width: 140px; height: 42px; border: 1px solid var(--linea); border-radius: 10px;
  text-align: right; padding: 0 10px; font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linea);
  background: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.chip.activo { border: 2px solid var(--naranja); background: var(--naranja-claro); color: #7A3A0B; font-weight: 700; }

.boton {
  height: 54px; border-radius: 16px; border: none; width: 100%;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.boton.principal { background: var(--verde); color: #fff; }
.boton.gasto { background: var(--naranja); color: #fff; }
.boton.secundario { background: #fff; border: 1px solid var(--linea); color: var(--texto); }
.boton:disabled { opacity: 0.55; cursor: default; }

.resumen-usd { background: var(--azul-claro); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.resumen-total { background: var(--verde-claro); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.linea-total { display: flex; justify-content: space-between; font-size: 14px; color: #3F5546; }
.total-grande { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.total-grande span:last-child { font-size: 26px; }

/* Lista de movimientos */
.mov { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EBEFE8; }
.mov:last-child { border-bottom: none; }
.mov .desc { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mov .desc b { font-size: 14px; }
.mov .desc small { font-size: 12px; color: var(--suave); }
.mov .monto { font-weight: 800; white-space: nowrap; }
.mov .monto.mas { color: var(--verde-texto); }
.mov .monto.menos { color: #9A4A0E; }
.vacio { color: var(--suave); font-size: 14px; text-align: center; padding: 8px 0; }

/* Login */
.login { min-height: 100vh; background: var(--verde); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; gap: 22px; }
.login .marca { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; }
.login .lema { color: #C9DCC0; font-size: 14px; margin-top: -10px; }
.login form { background: #fff; color: var(--texto); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.error { background: var(--rojo-claro); color: var(--rojo); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }

/* Aviso flotante */
.aviso {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--texto); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); z-index: 10;
}
.aviso.bien { background: var(--verde-texto); }
.aviso.mal { background: var(--rojo); }

@media (min-width: 900px) {
  #app { max-width: 720px; }
}
